diff options
Diffstat (limited to 'package')
125 files changed, 1301 insertions, 1301 deletions
diff --git a/package/inc/ByteChucker.hxx b/package/inc/ByteChucker.hxx index 733756e2dd65..ce187774cf25 100644 --- a/package/inc/ByteChucker.hxx +++ b/package/inc/ByteChucker.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,7 +39,7 @@ namespace com { namespace sun { namespace star { namespace io { class XSeekable; class XOutputStream; } } } } -class ByteChucker +class ByteChucker { protected: com::sun::star::uno::Reference < com::sun::star::io::XOutputStream > xStream; @@ -54,7 +54,7 @@ public: void WriteBytes( const ::com::sun::star::uno::Sequence< sal_Int8 >& aData ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - sal_Int64 GetPosition() + sal_Int64 GetPosition() throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); ByteChucker& operator << (sal_Int8 nInt8); diff --git a/package/inc/ByteGrabber.hxx b/package/inc/ByteGrabber.hxx index a9bdfb1e1928..fd65f3dcc6dd 100644 --- a/package/inc/ByteGrabber.hxx +++ b/package/inc/ByteGrabber.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -41,7 +41,7 @@ namespace com { namespace sun { namespace star { namespace io { class XSeekable; class XInputStream; } } } } -class ByteGrabber +class ByteGrabber { protected: ::osl::Mutex m_aMutex; @@ -54,15 +54,15 @@ protected: public: ByteGrabber (com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xIstream); ~ByteGrabber(); - + void setInputStream (com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xNewStream); // XInputStream - sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) + sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); // XSeekable - sal_Int64 SAL_CALL seek( sal_Int64 location ) + sal_Int64 SAL_CALL seek( sal_Int64 location ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - sal_Int64 SAL_CALL getPosition( ) + sal_Int64 SAL_CALL getPosition( ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); sal_Int64 SAL_CALL getLength( ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); diff --git a/package/inc/CRC32.hxx b/package/inc/CRC32.hxx index cb3c75e41685..a7983557a6fd 100644 --- a/package/inc/CRC32.hxx +++ b/package/inc/CRC32.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/package/inc/Deflater.hxx b/package/inc/Deflater.hxx index 6a45978de44b..3f2c1fcb426d 100644 --- a/package/inc/Deflater.hxx +++ b/package/inc/Deflater.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -30,7 +30,7 @@ #include <com/sun/star/uno/Sequence.hxx> -extern "C" +extern "C" { typedef struct z_stream_s z_stream; } @@ -39,16 +39,16 @@ class Deflater { protected: com::sun::star::uno::Sequence< sal_Int8 > sInBuffer; - sal_Bool bFinish; - sal_Bool bFinished; - sal_Bool bSetParams; - sal_Int32 nLevel, nStrategy; - sal_Int32 nOffset, nLength; - z_stream* pStream; + sal_Bool bFinish; + sal_Bool bFinished; + sal_Bool bSetParams; + sal_Int32 nLevel, nStrategy; + sal_Int32 nOffset, nLength; + z_stream* pStream; void init (sal_Int32 nLevel, sal_Int32 nStrategy, sal_Bool bNowrap); sal_Int32 doDeflateBytes (com::sun::star::uno::Sequence < sal_Int8 > &rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength); - + public: ~Deflater(); Deflater(sal_Int32 nSetLevel, sal_Bool bNowrap); diff --git a/package/inc/EncryptedDataHeader.hxx b/package/inc/EncryptedDataHeader.hxx index ed0ffe6628e3..88cdaa57a02d 100644 --- a/package/inc/EncryptedDataHeader.hxx +++ b/package/inc/EncryptedDataHeader.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -31,24 +31,24 @@ #include <sal/types.h> /* The structure of this header is as follows: - + Header signature 4 bytes Version number 2 bytes Iteraction count 4 bytes - Size 4 bytes - Salt length 2 bytes - IV length 2 bytes - Digest length 2 bytes + Size 4 bytes + Salt length 2 bytes + IV length 2 bytes + Digest length 2 bytes MediaType length 2 bytes Salt content X bytes - IV content X bytes + IV content X bytes digest content X bytes - MediaType X bytes + MediaType X bytes */ const sal_uInt32 n_ConstHeader = 0x0502474dL; // "MG\002\005" const sal_Int32 n_ConstHeaderSize = 22; // + salt length + iv length + digest length + mediatype length -const sal_Int16 n_ConstCurrentVersion = 1; +const sal_Int16 n_ConstCurrentVersion = 1; #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/EncryptionData.hxx b/package/inc/EncryptionData.hxx index ab2a658208c9..4dba2e3f701b 100644 --- a/package/inc/EncryptionData.hxx +++ b/package/inc/EncryptionData.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/package/inc/HashMaps.hxx b/package/inc/HashMaps.hxx index bfd48ef000e1..637f56a1350c 100644 --- a/package/inc/HashMaps.hxx +++ b/package/inc/HashMaps.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -46,19 +46,19 @@ namespace com { namespace sun { namespace star { namespace packages { class ContentInfo; } } } } -typedef std::hash_map < rtl::OUString, +typedef std::hash_map < rtl::OUString, ZipPackageFolder *, - ::rtl::OUStringHash, + ::rtl::OUStringHash, eqFunc > FolderHash; -typedef std::hash_map < rtl::OUString, +typedef std::hash_map < rtl::OUString, rtl::Reference < com::sun::star::packages::ContentInfo >, - ::rtl::OUStringHash, + ::rtl::OUStringHash, eqFunc > ContentHash; -typedef std::hash_map < rtl::OUString, - ZipEntry, - rtl::OUStringHash, +typedef std::hash_map < rtl::OUString, + ZipEntry, + rtl::OUStringHash, eqFunc > EntryHash; #endif diff --git a/package/inc/Inflater.hxx b/package/inc/Inflater.hxx index 47fe8d2b4b95..ee7efecbf0f9 100644 --- a/package/inc/Inflater.hxx +++ b/package/inc/Inflater.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,11 +37,11 @@ extern "C" class Inflater { protected: - sal_Bool bFinish, bFinished, bSetParams, bNeedDict; - sal_Int32 nOffset, nLength, nLastInflateError; - z_stream* pStream; - com::sun::star::uno::Sequence < sal_Int8 > sInBuffer; - sal_Int32 doInflateBytes (com::sun::star::uno::Sequence < sal_Int8 > &rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength); + sal_Bool bFinish, bFinished, bSetParams, bNeedDict; + sal_Int32 nOffset, nLength, nLastInflateError; + z_stream* pStream; + com::sun::star::uno::Sequence < sal_Int8 > sInBuffer; + sal_Int32 doInflateBytes (com::sun::star::uno::Sequence < sal_Int8 > &rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength); public: Inflater(sal_Bool bNoWrap = sal_False); diff --git a/package/inc/PackageConstants.hxx b/package/inc/PackageConstants.hxx index 7dd4d78a4e9b..229f739f5a94 100644 --- a/package/inc/PackageConstants.hxx +++ b/package/inc/PackageConstants.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/package/inc/ZipEntry.hxx b/package/inc/ZipEntry.hxx index 915d1ca7bb21..79df26166548 100644 --- a/package/inc/ZipEntry.hxx +++ b/package/inc/ZipEntry.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -44,6 +44,6 @@ struct ZipEntry sal_Int16 nExtraLen; ::rtl::OUString sPath; }; -#endif +#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/ZipEnumeration.hxx b/package/inc/ZipEnumeration.hxx index bd64b31e9373..0cfaa2bceed6 100644 --- a/package/inc/ZipEnumeration.hxx +++ b/package/inc/ZipEnumeration.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -32,8 +32,8 @@ class ZipEnumeration { -protected: - EntryHash &rEntryHash; +protected: + EntryHash &rEntryHash; EntryHash::const_iterator aIterator; public: sal_Bool SAL_CALL hasMoreElements(); diff --git a/package/inc/ZipFile.hxx b/package/inc/ZipFile.hxx index 0e182ae6900c..982ab18267c3 100644 --- a/package/inc/ZipFile.hxx +++ b/package/inc/ZipFile.hxx @@ -63,9 +63,9 @@ class ZipFile protected: ::osl::Mutex m_aMutex; - ::rtl::OUString sComment; /* zip file comment */ - EntryHash aEntries; - ByteGrabber aGrabber; + ::rtl::OUString sComment; /* zip file comment */ + EntryHash aEntries; + ByteGrabber aGrabber; Inflater aInflater; com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xStream; com::sun::star::uno::Reference < com::sun::star::io::XSeekable > xSeek; @@ -183,13 +183,13 @@ public: ZipEnumeration * SAL_CALL entries( ); protected: - sal_Bool readLOC ( ZipEntry &rEntry) + sal_Bool readLOC ( ZipEntry &rEntry) throw(::com::sun::star::io::IOException, com::sun::star::packages::zip::ZipException, com::sun::star::uno::RuntimeException); - sal_Int32 readCEN() + sal_Int32 readCEN() throw(::com::sun::star::io::IOException, com::sun::star::packages::zip::ZipException, com::sun::star::uno::RuntimeException); - sal_Int32 findEND() + sal_Int32 findEND() throw(::com::sun::star::io::IOException, com::sun::star::packages::zip::ZipException, com::sun::star::uno::RuntimeException); - sal_Int32 recover() + sal_Int32 recover() throw(::com::sun::star::io::IOException, com::sun::star::packages::zip::ZipException, com::sun::star::uno::RuntimeException); }; diff --git a/package/inc/ZipOutputStream.hxx b/package/inc/ZipOutputStream.hxx index 3ea34339428b..53a6bd91feef 100644 --- a/package/inc/ZipOutputStream.hxx +++ b/package/inc/ZipOutputStream.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -46,23 +46,23 @@ class ZipOutputStream { protected: com::sun::star::uno::Reference < com::sun::star::io::XOutputStream > xStream; - ::std::vector < ZipEntry * > aZipList; + ::std::vector < ZipEntry * > aZipList; com::sun::star::uno::Sequence < sal_Int8 > aBuffer, aEncryptionBuffer; - ::rtl::OUString sComment; - Deflater aDeflater; - rtlCipher aCipher; - rtlDigest aDigest; - CRC32 aCRC; - ByteChucker aChucker; - ZipEntry *pCurrentEntry; - sal_Int16 nMethod, nLevel, mnDigested; - sal_Bool bFinished, bEncryptCurrentEntry; - EncryptionData *pCurrentEncryptData; + ::rtl::OUString sComment; + Deflater aDeflater; + rtlCipher aCipher; + rtlDigest aDigest; + CRC32 aCRC; + ByteChucker aChucker; + ZipEntry *pCurrentEntry; + sal_Int16 nMethod, nLevel, mnDigested; + sal_Bool bFinished, bEncryptCurrentEntry; + EncryptionData *pCurrentEncryptData; public: ZipOutputStream( com::sun::star::uno::Reference < com::sun::star::io::XOutputStream > &xOStream ); ~ZipOutputStream(); - + // rawWrite to support a direct write to the output stream void SAL_CALL rawWrite( ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); @@ -74,7 +74,7 @@ public: throw(::com::sun::star::uno::RuntimeException); void SAL_CALL setLevel( sal_Int32 nNewLevel ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL putNextEntry( ZipEntry& rEntry, + void SAL_CALL putNextEntry( ZipEntry& rEntry, rtl::Reference < EncryptionData > &rData, sal_Bool bEncrypt = sal_False ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); diff --git a/package/inc/ZipPackage.hxx b/package/inc/ZipPackage.hxx index 4de11cf22779..4430ba111a0a 100644 --- a/package/inc/ZipPackage.hxx +++ b/package/inc/ZipPackage.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -83,18 +83,18 @@ protected: SotMutexHolderRef m_aMutexHolder; ::com::sun::star::uno::Sequence < sal_Int8 > m_aEncryptionKey; - FolderHash m_aRecent; - ::rtl::OUString m_aURL; - sal_Bool m_bHasEncryptedEntries; - sal_Bool m_bHasNonEncryptedEntries; - sal_Bool m_bInconsistent; - sal_Bool m_bUseManifest; - sal_Bool m_bForceRecovery; - - sal_Bool m_bMediaTypeFallbackUsed; - sal_Int32 m_nFormat; - sal_Bool m_bAllowRemoveOnInsert; - + FolderHash m_aRecent; + ::rtl::OUString m_aURL; + sal_Bool m_bHasEncryptedEntries; + sal_Bool m_bHasNonEncryptedEntries; + sal_Bool m_bInconsistent; + sal_Bool m_bUseManifest; + sal_Bool m_bForceRecovery; + + sal_Bool m_bMediaTypeFallbackUsed; + sal_Int32 m_nFormat; + sal_Bool m_bAllowRemoveOnInsert; + InitialisationMode m_eMode; ::com::sun::star::uno::Reference < com::sun::star::container::XNameContainer > m_xRootFolder; @@ -104,7 +104,7 @@ protected: const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > m_xFactory; ZipPackageFolder *m_pRootFolder; - ZipFile *m_pZipFile; + ZipFile *m_pZipFile; void parseManifest(); void parseContentType(); @@ -131,57 +131,57 @@ public: void ConnectTo( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream ); // XInitialization - virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) + virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); // XHierarchicalNameAccess - virtual ::com::sun::star::uno::Any SAL_CALL getByHierarchicalName( const ::rtl::OUString& aName ) + virtual ::com::sun::star::uno::Any SAL_CALL getByHierarchicalName( const ::rtl::OUString& aName ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasByHierarchicalName( const ::rtl::OUString& aName ) + virtual sal_Bool SAL_CALL hasByHierarchicalName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException); // XSingleServiceFactory - virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance( ) + virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance( ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) + virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); // XChangesBatch - virtual void SAL_CALL commitChanges( ) + virtual void SAL_CALL commitChanges( ) throw(::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasPendingChanges( ) + virtual sal_Bool SAL_CALL hasPendingChanges( ) throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::util::ElementChange > SAL_CALL getPendingChanges( ) + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::util::ElementChange > SAL_CALL getPendingChanges( ) throw(::com::sun::star::uno::RuntimeException); // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); - com::sun::star::uno::Sequence < sal_Int8 > getUnoTunnelImplementationId( void ) + com::sun::star::uno::Sequence < sal_Int8 > getUnoTunnelImplementationId( void ) throw(::com::sun::star::uno::RuntimeException); // XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName( ) + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); // Uno componentiseralation - static ::rtl::OUString static_getImplementationName(); - static ::com::sun::star::uno::Sequence < ::rtl::OUString > static_getSupportedServiceNames(); + static ::rtl::OUString static_getImplementationName(); + static ::com::sun::star::uno::Sequence < ::rtl::OUString > static_getSupportedServiceNames(); static ::com::sun::star::uno::Reference < com::sun::star::lang::XSingleServiceFactory > createServiceFactory( com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > const & rServiceFactory ); sal_Bool SAL_CALL static_supportsService(rtl::OUString const & rServiceName); }; diff --git a/package/inc/ZipPackageBuffer.hxx b/package/inc/ZipPackageBuffer.hxx index e8cf9ff87e86..29ba4156e37d 100644 --- a/package/inc/ZipPackageBuffer.hxx +++ b/package/inc/ZipPackageBuffer.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -55,29 +55,29 @@ public: inline const com::sun::star::uno::Sequence < sal_Int8> getSequence () const { return m_aBuffer; } // XInputStream - virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) + virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) + virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) + virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL available( ) + virtual sal_Int32 SAL_CALL available( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL closeInput( ) + virtual void SAL_CALL closeInput( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); // XOutputStream - virtual void SAL_CALL writeBytes( const ::com::sun::star::uno::Sequence< sal_Int8 >& aData ) + virtual void SAL_CALL writeBytes( const ::com::sun::star::uno::Sequence< sal_Int8 >& aData ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL flush( ) + virtual void SAL_CALL flush( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL closeOutput( ) + virtual void SAL_CALL closeOutput( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); // XSeekable - virtual void SAL_CALL seek( sal_Int64 location ) + virtual void SAL_CALL seek( sal_Int64 location ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual sal_Int64 SAL_CALL getPosition( ) + virtual sal_Int64 SAL_CALL getPosition( ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual sal_Int64 SAL_CALL getLength( ) + virtual sal_Int64 SAL_CALL getLength( ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); }; #endif diff --git a/package/inc/ZipPackageFolder.hxx b/package/inc/ZipPackageFolder.hxx index e45cdc057ae8..29ff92430602 100644 --- a/package/inc/ZipPackageFolder.hxx +++ b/package/inc/ZipPackageFolder.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -36,7 +36,7 @@ #include <cppuhelper/implbase2.hxx> namespace com { namespace sun { namespace star { -namespace beans +namespace beans { struct PropertyValue; } @@ -61,7 +61,7 @@ protected: ::rtl::OUString m_sVersion; public: - + ZipPackageFolder( const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& xFactory, sal_Int32 nFormat, sal_Bool bAllowRemoveOnInsert ); @@ -92,49 +92,49 @@ public: void releaseUpwardRef(); // XNameContainer - virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) + virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeByName( const ::rtl::OUString& Name ) + virtual void SAL_CALL removeByName( const ::rtl::OUString& Name ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); // XEnumerationAccess - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration( ) + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration( ) throw(::com::sun::star::uno::RuntimeException); // XElementAccess - virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasElements( ) + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); // XNameAccess - virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) + virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) + virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException); // XNameReplace - virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) + virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); // XPropertySet - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName( ) + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); }; #endif diff --git a/package/inc/mutexholder.hxx b/package/inc/mutexholder.hxx index 3fbbd4c5738a..8f56012e3bce 100644 --- a/package/inc/mutexholder.hxx +++ b/package/inc/mutexholder.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -34,7 +34,7 @@ class SotMutexHolder { ::osl::Mutex m_aMutex; - sal_Int32 m_nRefCount; + sal_Int32 m_nRefCount; public: SotMutexHolder() : m_nRefCount( 0 ) {} @@ -59,7 +59,7 @@ class SotMutexHolderRef public: SotMutexHolderRef() - : m_pHolder( NULL ) + : m_pHolder( NULL ) {} SotMutexHolderRef( SotMutexHolder* pHolder ) @@ -116,7 +116,7 @@ public: { return *m_pHolder; } - + operator SotMutexHolder*() const { return m_pHolder; diff --git a/package/inc/pch/precompiled_package.cxx b/package/inc/pch/precompiled_package.cxx index 49b45ad88d87..762f8ec652d1 100644 --- a/package/inc/pch/precompiled_package.cxx +++ b/package/inc/pch/precompiled_package.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/package/inc/pch/precompiled_package.hxx b/package/inc/pch/precompiled_package.hxx index dfadd0a869a6..ea9e713ff04b 100644 --- a/package/inc/pch/precompiled_package.hxx +++ b/package/inc/pch/precompiled_package.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/package/inc/zipfileaccess.hxx b/package/inc/zipfileaccess.hxx index 1516aa4d7fef..68f48268e080 100644 --- a/package/inc/zipfileaccess.hxx +++ b/package/inc/zipfileaccess.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -61,7 +61,7 @@ class OZipFileAccess : public ::cppu::WeakImplHelper5< ::cppu::OInterfaceContainerHelper* m_pListenersContainer; sal_Bool m_bDisposed; - + public: OZipFileAccess( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory ); @@ -77,7 +77,7 @@ public: static ::rtl::OUString SAL_CALL impl_staticGetImplementationName(); - static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL impl_staticCreateSelfInstance( + static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL impl_staticCreateSelfInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ); diff --git a/package/qa/ofopxmlstorages/StorageUnitTest.java b/package/qa/ofopxmlstorages/StorageUnitTest.java index 65294d46bbb9..228666c2f2e1 100644 --- a/package/qa/ofopxmlstorages/StorageUnitTest.java +++ b/package/qa/ofopxmlstorages/StorageUnitTest.java @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/package/qa/ofopxmlstorages/Test01.java b/package/qa/ofopxmlstorages/Test01.java index abb73c3fc48b..04510ea73e05 100644 --- a/package/qa/ofopxmlstorages/Test01.java +++ b/package/qa/ofopxmlstorages/Test01.java @@ -58,7 +58,7 @@ public class Test01 implements StorageTest { m_aTestHelper.Error( "No valid temporary file was created!" ); return false; } - + // create temporary storage based on arbitrary medium // after such a storage is closed it is lost XStorage xTempStorage = m_aTestHelper.createTempStorage( m_xMSF, m_xStorageFactory ); @@ -77,7 +77,7 @@ public class Test01 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + byte pBytes1[] = { 1, 1, 1, 1, 1 }; // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes @@ -99,7 +99,7 @@ public class Test01 implements StorageTest { pBytes2, aRelations2 ) ) return false; - + // set Relations for storages and check that "IsRoot" and "OpenMode" properties are set correctly if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempStorage, true, @@ -113,7 +113,7 @@ public class Test01 implements StorageTest { ElementModes.WRITE, aRelations1 ) ) return false; - + // create temporary storage based on a previously created temporary file XStorage xTempFileStorage = m_aTestHelper.createStorageFromURL( m_xStorageFactory, sTempFileURL, @@ -162,7 +162,7 @@ public class Test01 implements StorageTest { m_aTestHelper.Error( "Can't open existing substorage!" ); return false; } - + if ( !m_aTestHelper.checkStorageProperties( xResultSubStorage, false, ElementModes.READ, @@ -194,7 +194,7 @@ public class Test01 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/ofopxmlstorages/Test02.java b/package/qa/ofopxmlstorages/Test02.java index 4ba7892b8295..3b85a5b5c9c8 100644 --- a/package/qa/ofopxmlstorages/Test02.java +++ b/package/qa/ofopxmlstorages/Test02.java @@ -48,7 +48,7 @@ public class Test02 implements StorageTest { XStream xTempFileStream = m_aTestHelper.CreateTempFileStream( m_xMSF ); if ( xTempFileStream == null ) return false; - + // create storage based on the temporary stream XStorage xTempStorage = m_aTestHelper.createStorageFromStream( m_xStorageFactory, xTempFileStream, @@ -68,7 +68,7 @@ public class Test02 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + byte pBytes1[] = { 1, 1, 1, 1, 1 }; // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes @@ -93,7 +93,7 @@ public class Test02 implements StorageTest { ElementModes.WRITE, aRelations ) ) return false; - + // commit substorage first if ( !m_aTestHelper.commitStorage( xTempSubStorage ) ) return false; @@ -120,7 +120,7 @@ public class Test02 implements StorageTest { if ( xTempInStream == null ) return false; - + // open input stream XStorage xResultStorage = m_aTestHelper.createStorageFromInputStream( m_xStorageFactory, xTempInStream ); if ( xResultStorage == null ) @@ -141,7 +141,7 @@ public class Test02 implements StorageTest { m_aTestHelper.Error( "Can't open existing substorage!" ); return false; } - + if ( !m_aTestHelper.checkStorageProperties( xResultSubStorage, false, ElementModes.READ, @@ -158,7 +158,7 @@ public class Test02 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/ofopxmlstorages/Test03.java b/package/qa/ofopxmlstorages/Test03.java index e3424c9106f2..ee2a892d2080 100644 --- a/package/qa/ofopxmlstorages/Test03.java +++ b/package/qa/ofopxmlstorages/Test03.java @@ -61,7 +61,7 @@ public class Test03 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + byte pBytes1[] = { 1, 1, 1, 1, 1 }; // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes @@ -96,7 +96,7 @@ public class Test03 implements StorageTest { if ( !m_aTestHelper.disposeStorage( xTempSubStorage ) ) return false; - + // ================================================ // check storage hyerarchy tree // ================================================ @@ -166,14 +166,14 @@ public class Test03 implements StorageTest { return false; } - if ( !( sRootCont[0].equals( "SubStorage1" ) && sRootCont[1].equals( "SubStream1" ) + if ( !( sRootCont[0].equals( "SubStorage1" ) && sRootCont[1].equals( "SubStream1" ) || sRootCont[0].equals( "SubStream1" ) && sRootCont[1].equals( "SubStorage1" ) ) || !( xRootNameAccess.hasByName( "SubStream1" ) && xRootNameAccess.hasByName( "SubStorage1" ) ) ) { m_aTestHelper.Error( "Root storage contains wrong list of children!" ); return false; } - + // get storage through XNameAccess XStorage xResultSubStorage = getStorageFromNameAccess( xRootNameAccess, "SubStorage1" ); if ( xResultSubStorage == null ) @@ -199,7 +199,7 @@ public class Test03 implements StorageTest { m_aTestHelper.Error( "'SubStream2' can not be detected as child stream element of 'SubStorage1'!" ); return false; } - + return true; } catch( Exception e ) @@ -207,7 +207,7 @@ public class Test03 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } public XStorage getStorageFromNameAccess( XNameAccess xAccess, String sName ) { diff --git a/package/qa/ofopxmlstorages/Test04.java b/package/qa/ofopxmlstorages/Test04.java index 8b99c15bd77c..5188b32b040f 100644 --- a/package/qa/ofopxmlstorages/Test04.java +++ b/package/qa/ofopxmlstorages/Test04.java @@ -61,7 +61,7 @@ public class Test04 implements StorageTest { m_aTestHelper.Error( "No valid temporary file was created!" ); return false; } - + // create temporary storage based on arbitrary medium // after such a storage is closed it is lost XStorage xTempStorage = m_aTestHelper.createTempStorage( m_xMSF, m_xStorageFactory ); @@ -82,7 +82,7 @@ public class Test04 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + byte pBytes1[] = { 1, 1, 1, 1, 1 }; // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes @@ -114,7 +114,7 @@ public class Test04 implements StorageTest { pBytes2, aRelations2 ) ) return false; - + // set Relations for storages and check that "IsRoot" and "OpenMode" properties are set correctly if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempStorage, true, @@ -128,14 +128,14 @@ public class Test04 implements StorageTest { ElementModes.WRITE, aRelations2 ) ) return false; - + // set Relations for storages and check that "IsRoot" and "OpenMode" properties are set correctly if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempSubStorage2, false, ElementModes.WRITE, aRelations2 ) ) return false; - + // create temporary storage based on a previously created temporary file XStorage xTempFileStorage = m_aTestHelper.createStorageFromURL( m_xStorageFactory, sTempFileURL, @@ -216,7 +216,7 @@ public class Test04 implements StorageTest { m_aTestHelper.Error( "Can't open existing substorage!" ); return false; } - + if ( !m_aTestHelper.checkStorageProperties( xResSubStorage1, false, ElementModes.READ, @@ -262,7 +262,7 @@ public class Test04 implements StorageTest { // remove element and check that it was removed completelly if ( !m_aTestHelper.removeElement( xResStorage, "SubStorage2" ) ) return false; - + try { XNameAccess xResAccess = (XNameAccess) UnoRuntime.queryInterface( XNameAccess.class, xResStorage ); @@ -302,7 +302,7 @@ public class Test04 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/ofopxmlstorages/Test05.java b/package/qa/ofopxmlstorages/Test05.java index 36439ca6ebcd..971c0338b40b 100644 --- a/package/qa/ofopxmlstorages/Test05.java +++ b/package/qa/ofopxmlstorages/Test05.java @@ -89,7 +89,7 @@ public class Test05 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + byte pBytes1[] = { 1, 1, 1, 1, 1 }; @@ -112,7 +112,7 @@ public class Test05 implements StorageTest { pBytes2, aRelations2 ) ) return false; - + // set Relations for storages and check that "IsRoot" and "OpenMode" properties are set correctly if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempFileStorage, true, @@ -196,7 +196,7 @@ public class Test05 implements StorageTest { m_aTestHelper.Error( "Wrong exception is thrown by disposed storage: " + e ); return false; } - + try { xSubStream1.getInputStream(); @@ -224,7 +224,7 @@ public class Test05 implements StorageTest { m_aTestHelper.Error( "Wrong exception is thrown by disposed stream: " + e ); return false; } - + // dispose root storage if ( !m_aTestHelper.disposeStorage( xTempFileStorage ) ) @@ -259,7 +259,7 @@ public class Test05 implements StorageTest { m_aTestHelper.Error( "Can't open existing substorage 'SubSubStorage'!" ); return false; } - + if ( !m_aTestHelper.checkStorageProperties( xResSubStorage, false, ElementModes.READ, @@ -275,7 +275,7 @@ public class Test05 implements StorageTest { m_aTestHelper.Error( "Can't open existing substorage 'SubSubStorage'!" ); return false; } - + if ( !m_aTestHelper.checkStorageProperties( xResSubSubStorage, false, ElementModes.READ, @@ -308,7 +308,7 @@ public class Test05 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/ofopxmlstorages/Test06.java b/package/qa/ofopxmlstorages/Test06.java index 61969db88e12..4db4a8989f5c 100644 --- a/package/qa/ofopxmlstorages/Test06.java +++ b/package/qa/ofopxmlstorages/Test06.java @@ -72,7 +72,7 @@ public class Test06 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + // in case stream is open for reading it must exist try { @@ -271,7 +271,7 @@ public class Test06 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/ofopxmlstorages/Test07.java b/package/qa/ofopxmlstorages/Test07.java index bcd85d5d01c0..5499281c57e5 100644 --- a/package/qa/ofopxmlstorages/Test07.java +++ b/package/qa/ofopxmlstorages/Test07.java @@ -84,7 +84,7 @@ public class Test07 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + byte pBytes2[] = { 2, 2, 2, 2, 2 }; // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes @@ -140,7 +140,7 @@ public class Test07 implements StorageTest { m_aTestHelper.Error( "The new substorage still was not commited so it must be empty!" ); return false; } - + if ( !m_aTestHelper.disposeStorage( xClonedSubStorage ) ) return false; @@ -206,7 +206,7 @@ public class Test07 implements StorageTest { m_aTestHelper.Error( "The root storage still was not commited so it's clone must be empty!" ); return false; } - + if ( !m_aTestHelper.disposeStorage( xCloneOfRoot ) ) return false; @@ -253,6 +253,6 @@ public class Test07 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/ofopxmlstorages/Test08.java b/package/qa/ofopxmlstorages/Test08.java index eaed60d4d8e3..ab7f9b14bf44 100644 --- a/package/qa/ofopxmlstorages/Test08.java +++ b/package/qa/ofopxmlstorages/Test08.java @@ -47,7 +47,7 @@ public class Test08 implements StorageTest { XStream xTempFileStream = m_aTestHelper.CreateTempFileStream( m_xMSF ); if ( xTempFileStream == null ) return false; - + // create storage based on the temporary stream XStorage xTempStorage = m_aTestHelper.createStorageFromStream( m_xStorageFactory, xTempFileStream, @@ -67,7 +67,7 @@ public class Test08 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + byte pBytes1[] = { 1, 1, 1, 1, 1 }; // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes @@ -92,7 +92,7 @@ public class Test08 implements StorageTest { ElementModes.WRITE, aRelations1 ) ) return false; - + // commit substorage first if ( !m_aTestHelper.commitStorage( xTempSubStorage ) ) return false; @@ -205,7 +205,7 @@ public class Test08 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } private boolean checkSubStorages( XStorage xStorage, byte[] pBytes1, StringPair[][] aRelations ) { diff --git a/package/qa/ofopxmlstorages/TestHelper.java b/package/qa/ofopxmlstorages/TestHelper.java index 6b153fd2b960..abad297dfc00 100644 --- a/package/qa/ofopxmlstorages/TestHelper.java +++ b/package/qa/ofopxmlstorages/TestHelper.java @@ -37,7 +37,7 @@ public class TestHelper { Error( "Can't get XOutputStream implementation from substream '" + sStreamName + "'!" ); return false; } - + // get XTrucate implementation from output stream XTruncate xTruncate = (XTruncate) UnoRuntime.queryInterface( XTruncate.class, xOutput ); if ( xTruncate == null ) @@ -45,7 +45,7 @@ public class TestHelper { Error( "Can't get XTruncate implementation from substream '" + sStreamName + "'!" ); return false; } - + // write requested byte sequence try { @@ -144,7 +144,7 @@ public class TestHelper { Error( "Can't create substream '" + sStreamName + "', exception : " + e + "!" ); return false; } - + return WriteBytesToStream( xSubStream, sStreamName, sMediaType, bCompressed, pBytes, aRelations ); } @@ -171,7 +171,7 @@ public class TestHelper { Error( "'IsRoot' property contains wrong value!" ); bOk = false; } - + if ( ( bIsRoot && ( nPropMode | ElementModes.READ ) != ( nMode | ElementModes.READ ) ) || ( !bIsRoot && ( nPropMode & nMode ) != nMode ) ) @@ -305,7 +305,7 @@ public class TestHelper { return false; } } - + break; } } @@ -313,7 +313,7 @@ public class TestHelper { return true; } - + public boolean checkStorageProperties( XStorage xStorage, boolean bIsRoot, int nMode, @@ -337,7 +337,7 @@ public class TestHelper { Error( "'IsRoot' property contains wrong value!" ); bOk = false; } - + if ( ( bIsRoot && ( nPropMode | ElementModes.READ ) != ( nMode | ElementModes.READ ) ) || ( !bIsRoot && ( nPropMode & nMode ) != nMode ) ) @@ -399,7 +399,7 @@ public class TestHelper { Error( "Can't get XInputStream implementation from substream '" + sName + "'!" ); return false; } - + byte pContents[][] = new byte[1][]; // ??? // read contents @@ -453,11 +453,11 @@ public class TestHelper { bOk = true; if ( !sPropMediaType.equals( sMediaType ) ) { - Error( "'MediaType' property contains wrong value for stream '" + sName + "',\nexpected: '" + Error( "'MediaType' property contains wrong value for stream '" + sName + "',\nexpected: '" + sMediaType + "', set: '" + sPropMediaType + "'!" ); bOk = false; } - + if ( nPropSize != pBytes.length ) { Error( "'Size' property contains wrong value for stream'" + sName + "'!" ); @@ -528,7 +528,7 @@ public class TestHelper { Error( "Can't open substream '" + sName + "', exception : " + e + "!" ); return false; } - + boolean bResult = InternalCheckStream( xSubStream, sName, sMediaType, pBytes, aRelations ); // free the stream resources, garbage collector may remove the object too late @@ -576,7 +576,7 @@ public class TestHelper { return true; } - + public boolean disposeStream( XStream xStream, String sStreamName ) { XComponent xComponent = (XComponent) UnoRuntime.queryInterface( XComponent.class, xStream ); @@ -585,7 +585,7 @@ public class TestHelper { Error( "Can't get XComponent implementation from substream '" + sStreamName + "'!" ); return false; } - + try { xComponent.dispose(); @@ -666,7 +666,7 @@ public class TestHelper { Error( "Can't close output part of a stream, exception :" + e ); return false; } - + return true; } @@ -708,7 +708,7 @@ public class TestHelper { public String CreateTempFile( XMultiServiceFactory xMSF ) { String sResult = null; - + // try to get temporary file representation XPropertySet xTempFileProps = null; try @@ -900,7 +900,7 @@ public class TestHelper { int nMode ) { XStorage xResult = null; - + try { PropertyValue[] aAddArgs = new PropertyValue[1]; @@ -924,7 +924,7 @@ public class TestHelper { if ( xResult == null ) Error( "Can't create storage from URL!" ); - + return xResult; } @@ -934,7 +934,7 @@ public class TestHelper { int nMode ) { XStorage xResult = null; - + try { PropertyValue[] aAddArgs = new PropertyValue[1]; @@ -958,7 +958,7 @@ public class TestHelper { if ( xResult == null ) Error( "Can't create storage from stream!" ); - + return xResult; } @@ -967,7 +967,7 @@ public class TestHelper { XInputStream xInStream ) { XStorage xResult = null; - + try { PropertyValue[] aAddArgs = new PropertyValue[1]; @@ -991,7 +991,7 @@ public class TestHelper { if ( xResult == null ) Error( "Can't create storage from input stream!" ); - + return xResult; } @@ -1005,7 +1005,7 @@ public class TestHelper { Error( "Can't create temp file stream!" ); return null; } - + try { xResult = createStorageFromStream( xFactory, xStream, ElementModes.WRITE ); diff --git a/package/qa/storages/BorderedStream.java b/package/qa/storages/BorderedStream.java index 7972b7a3ef0a..41d5bd9de40f 100644 --- a/package/qa/storages/BorderedStream.java +++ b/package/qa/storages/BorderedStream.java @@ -41,7 +41,7 @@ public class BorderedStream { return (XInputStream)UnoRuntime.queryInterface( XInputStream.class, this ); } - + // ---------------------------------------------------------- public synchronized XOutputStream getOutputStream() throws com.sun.star.uno.RuntimeException @@ -75,7 +75,7 @@ public class BorderedStream { aData[0] = new byte[0]; } - + return nRead; } diff --git a/package/qa/storages/RegressionTest_114358.java b/package/qa/storages/RegressionTest_114358.java index 51d3ecb4a8b4..3062077ea762 100644 --- a/package/qa/storages/RegressionTest_114358.java +++ b/package/qa/storages/RegressionTest_114358.java @@ -36,7 +36,7 @@ public class RegressionTest_114358 implements StorageTest { XStream xTempFileStream = m_aTestHelper.CreateTempFileStream( m_xMSF ); if ( xTempFileStream == null ) return false; - + // create storage based on the temporary stream Object pArgs[] = new Object[2]; pArgs[0] = (Object) xTempFileStream; @@ -59,7 +59,7 @@ public class RegressionTest_114358 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + byte pBytes1[] = { 1, 1, 1, 1, 1 }; // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes @@ -79,7 +79,7 @@ public class RegressionTest_114358 implements StorageTest { false, ElementModes.WRITE ) ) return false; - + // commit substorage first if ( !m_aTestHelper.commitStorage( xTempSubStorage ) ) return false; @@ -120,7 +120,7 @@ public class RegressionTest_114358 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + // open the substream, set new "MediaType" and "Compressed" properties to it, truncate and write new contents if ( !m_aTestHelper.WriteBytesToSubstream( xTempSubStorage, "SubStream1", "MediaType4", true, pBytes2 ) ) return false; @@ -163,7 +163,7 @@ public class RegressionTest_114358 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + if ( !m_aTestHelper.checkStorageProperties( xTempStorage, "MediaType2", true, ElementModes.READ ) ) return false; @@ -185,6 +185,6 @@ public class RegressionTest_114358 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/RegressionTest_125919.java b/package/qa/storages/RegressionTest_125919.java index 0a13fc63758c..9945faf379bf 100644 --- a/package/qa/storages/RegressionTest_125919.java +++ b/package/qa/storages/RegressionTest_125919.java @@ -49,7 +49,7 @@ public class RegressionTest_125919 implements StorageTest { if ( nInitInd < 18000 ) pBytes18[nInitInd] = ( new Integer( 256 - pBytes36[nInitInd] ) ).byteValue(); } - + System.out.println( "This test can take up to some hours. The file size currently is about 50000." ); System.out.println( "Progress: " ); for ( int nAvailableBytes = nMinTestLen; nAvailableBytes < nMaxTestLen; nAvailableBytes++ ) @@ -129,6 +129,6 @@ public class RegressionTest_125919 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/RegressionTest_i26398.java b/package/qa/storages/RegressionTest_i26398.java index 9116a7d9bafa..257bbcd152a9 100644 --- a/package/qa/storages/RegressionTest_i26398.java +++ b/package/qa/storages/RegressionTest_i26398.java @@ -36,7 +36,7 @@ public class RegressionTest_i26398 implements StorageTest { XStream xTempFileStream = m_aTestHelper.CreateTempFileStream( m_xMSF ); if ( xTempFileStream == null ) return false; - + // create storage based on the temporary stream Object pArgs[] = new Object[2]; pArgs[0] = (Object) xTempFileStream; @@ -59,7 +59,7 @@ public class RegressionTest_i26398 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + byte pBytes1[] = { 1, 1, 1, 1, 1 }; // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes @@ -103,11 +103,11 @@ public class RegressionTest_i26398 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + // dispose substorage if ( !m_aTestHelper.disposeStorage( xTempSubStorage ) ) return false; - + // ================================================ // reopen the substorage in readwrite mode and check contents // ================================================ @@ -133,7 +133,7 @@ public class RegressionTest_i26398 implements StorageTest { // the root storage is based on the temporary stream so it can be left undisposed, since it does not lock // any resource, later the garbage collector will release the object and it must die by refcount - + return true; } catch( Exception e ) @@ -141,6 +141,6 @@ public class RegressionTest_i26398 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/RegressionTest_i27773.java b/package/qa/storages/RegressionTest_i27773.java index 4e627a816167..6753541508fd 100644 --- a/package/qa/storages/RegressionTest_i27773.java +++ b/package/qa/storages/RegressionTest_i27773.java @@ -286,7 +286,7 @@ public class RegressionTest_i27773 implements StorageTest { // the root storage is based on the temporary stream so it can be left undisposed, since it does not lock // any resource, later the garbage collector will release the object and it must die by refcount - + return true; } catch( Exception e ) @@ -294,6 +294,6 @@ public class RegressionTest_i27773 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/RegressionTest_i29169.java b/package/qa/storages/RegressionTest_i29169.java index 580ee510caf8..137d84fa21de 100644 --- a/package/qa/storages/RegressionTest_i29169.java +++ b/package/qa/storages/RegressionTest_i29169.java @@ -36,7 +36,7 @@ public class RegressionTest_i29169 implements StorageTest { XStream xTempFileStream = m_aTestHelper.CreateTempFileStream( m_xMSF ); if ( xTempFileStream == null ) return false; - + // create storage based on the temporary stream Object pArgs[] = new Object[2]; pArgs[0] = (Object) xTempFileStream; @@ -59,7 +59,7 @@ public class RegressionTest_i29169 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + byte pBytes1[] = { 1, 1, 1, 1, 1 }; // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes @@ -94,7 +94,7 @@ public class RegressionTest_i29169 implements StorageTest { false, ElementModes.WRITE ) ) return false; - + // set "MediaType" property for storages and check that "IsRoot" and "OpenMode" properties are set correctly if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempStorage, "MediaType5", @@ -226,7 +226,7 @@ public class RegressionTest_i29169 implements StorageTest { if ( !m_aTestHelper.checkStream( xTempSubSubStorage, "SubSubStream1", "MediaType2", true, pBytes1 ) ) return false; - + // ================================================ // rename the reopened storages and streams // ================================================ @@ -353,10 +353,10 @@ public class RegressionTest_i29169 implements StorageTest { if ( !m_aTestHelper.checkStream( xTempSubSubStorage, "SubSubStream1", "MediaType2", true, pBytes1 ) ) return false; - + // the storage is based on the temporary stream so it can be left undisposed, since it does not lock // any resource, later the garbage collector will release the object and it must die by refcount - + return true; } catch( Exception e ) @@ -364,6 +364,6 @@ public class RegressionTest_i29169 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/RegressionTest_i29321.java b/package/qa/storages/RegressionTest_i29321.java index 740f48ce59a3..a56e545bac18 100644 --- a/package/qa/storages/RegressionTest_i29321.java +++ b/package/qa/storages/RegressionTest_i29321.java @@ -36,7 +36,7 @@ public class RegressionTest_i29321 implements StorageTest { XStream xTempFileStream = m_aTestHelper.CreateTempFileStream( m_xMSF ); if ( xTempFileStream == null ) return false; - + // create storage based on the temporary stream Object pArgs[] = new Object[2]; pArgs[0] = (Object) xTempFileStream; @@ -59,7 +59,7 @@ public class RegressionTest_i29321 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + // open a new substorage XStorage xTempSubSubStorage = m_aTestHelper.openSubStorage( xTempSubStorage, "SubSubStorage1", @@ -157,7 +157,7 @@ public class RegressionTest_i29321 implements StorageTest { // the root storage is based on the temporary stream so it can be left undisposed, since it does not lock // any resource, later the garbage collector will release the object and it must die by refcount - + return true; } catch( Exception e ) @@ -165,6 +165,6 @@ public class RegressionTest_i29321 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/RegressionTest_i30400.java b/package/qa/storages/RegressionTest_i30400.java index 5f82a7beb39e..8294b6814b9d 100644 --- a/package/qa/storages/RegressionTest_i30400.java +++ b/package/qa/storages/RegressionTest_i30400.java @@ -41,7 +41,7 @@ public class RegressionTest_i30400 implements StorageTest { XStream xTempFileStream = m_aTestHelper.CreateTempFileStream( m_xMSF ); if ( xTempFileStream == null ) return false; - + // create storage based on the temporary stream Object pArgs[] = new Object[2]; pArgs[0] = (Object) xTempFileStream; @@ -75,7 +75,7 @@ public class RegressionTest_i30400 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes if ( !m_aTestHelper.WriteBytesToSubstream( xTempSubStorage, "SubStream1", "MediaType3", true, pBytes1 ) ) return false; @@ -112,7 +112,7 @@ public class RegressionTest_i30400 implements StorageTest { false, ElementModes.WRITE ) ) return false; - + // set "MediaType" property for storages and check that "IsRoot" and "OpenMode" properties are set correctly if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempStorage, "MediaType8", @@ -131,11 +131,11 @@ public class RegressionTest_i30400 implements StorageTest { // commit the storages // ================================================ - // commit lowlevel substorage + // commit lowlevel substorage if ( !m_aTestHelper.commitStorage( xTempSubSubStorage ) ) return false; - // commit substorage + // commit substorage if ( !m_aTestHelper.commitStorage( xTempSubStorage ) ) return false; @@ -201,7 +201,7 @@ public class RegressionTest_i30400 implements StorageTest { // the storage is based on the temporary stream so it can be left undisposed, since it does not lock // any resource, later the garbage collector will release the object and it must die by refcount - + return true; } catch( Exception e ) @@ -209,7 +209,7 @@ public class RegressionTest_i30400 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } public boolean TestCopyWithRenaming( XStorage xTempStorage, XStorage xTempSubStorage, XStorage xTempSubSubStorage ) diff --git a/package/qa/storages/RegressionTest_i30677.java b/package/qa/storages/RegressionTest_i30677.java index 740c9e319313..87d28939f361 100644 --- a/package/qa/storages/RegressionTest_i30677.java +++ b/package/qa/storages/RegressionTest_i30677.java @@ -36,7 +36,7 @@ public class RegressionTest_i30677 implements StorageTest { XStream xTempFileStream = m_aTestHelper.CreateTempFileStream( m_xMSF ); if ( xTempFileStream == null ) return false; - + // create storage based on the temporary stream Object pArgs[] = new Object[2]; pArgs[0] = (Object) xTempFileStream; @@ -59,7 +59,7 @@ public class RegressionTest_i30677 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + // open a new subsubstorage XStorage xTempSubSubStorage = m_aTestHelper.openSubStorage( xTempSubStorage, "SubSubStorage1", @@ -250,7 +250,7 @@ public class RegressionTest_i30677 implements StorageTest { // the root storage is based on the temporary stream so it can be left undisposed, since it does not lock // any resource, later the garbage collector will release the object and it must die by refcount - + return true; } catch( Exception e ) @@ -258,6 +258,6 @@ public class RegressionTest_i30677 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/RegressionTest_i35095.java b/package/qa/storages/RegressionTest_i35095.java index d98ec800a5a6..dd5779a51752 100644 --- a/package/qa/storages/RegressionTest_i35095.java +++ b/package/qa/storages/RegressionTest_i35095.java @@ -36,7 +36,7 @@ public class RegressionTest_i35095 implements StorageTest { XStream xTempFileStream = m_aTestHelper.CreateTempFileStream( m_xMSF ); if ( xTempFileStream == null ) return false; - + // create storage based on the temporary stream Object pArgs[] = new Object[2]; pArgs[0] = (Object) xTempFileStream; @@ -69,7 +69,7 @@ public class RegressionTest_i35095 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes if ( !m_aTestHelper.WriteBytesToEncrSubstream( xTempSubStorage, "SubStream2", "MediaType2", false, pBytes, sPass ) ) return false; @@ -139,7 +139,7 @@ public class RegressionTest_i35095 implements StorageTest { m_aTestHelper.Error( "Can't open existing substorage!" ); return false; } - + if ( !m_aTestHelper.checkStorageProperties( xResultSubStorage, "MediaType4", false, ElementModes.READ ) ) return false; @@ -160,7 +160,7 @@ public class RegressionTest_i35095 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/RegressionTest_i46848.java b/package/qa/storages/RegressionTest_i46848.java index 438626e9a7ba..339b35f9ed83 100644 --- a/package/qa/storages/RegressionTest_i46848.java +++ b/package/qa/storages/RegressionTest_i46848.java @@ -36,7 +36,7 @@ public class RegressionTest_i46848 implements StorageTest { XStream xTempFileStream = m_aTestHelper.CreateTempFileStream( m_xMSF ); if ( xTempFileStream == null ) return false; - + // create storage based on the temporary stream Object pArgs[] = new Object[2]; pArgs[0] = (Object) xTempFileStream; @@ -59,7 +59,7 @@ public class RegressionTest_i46848 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + byte pBytes1[] = { 1, 1, 1, 1, 1 }; // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes @@ -79,7 +79,7 @@ public class RegressionTest_i46848 implements StorageTest { false, ElementModes.WRITE ) ) return false; - + // commit substorage first if ( !m_aTestHelper.commitStorage( xTempSubStorage ) ) return false; @@ -118,7 +118,7 @@ public class RegressionTest_i46848 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + // set "MediaType" property for storages and check that "IsRoot" and "OpenMode" properties are set correctly if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempSubStorage, "ChangedMediaType3", @@ -164,7 +164,7 @@ public class RegressionTest_i46848 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + if ( !m_aTestHelper.checkStorageProperties( xTempStorage, "MediaType2", true, ElementModes.READ ) ) return false; @@ -186,6 +186,6 @@ public class RegressionTest_i46848 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/RegressionTest_i49755.java b/package/qa/storages/RegressionTest_i49755.java index 7d3ee6c01cac..c1b597828d0d 100644 --- a/package/qa/storages/RegressionTest_i49755.java +++ b/package/qa/storages/RegressionTest_i49755.java @@ -36,7 +36,7 @@ public class RegressionTest_i49755 implements StorageTest { XStream xTempFileStream = m_aTestHelper.CreateTempFileStream( m_xMSF ); if ( xTempFileStream == null ) return false; - + // create storage based on the temporary stream Object pArgs[] = new Object[2]; pArgs[0] = (Object) xTempFileStream; @@ -71,7 +71,7 @@ public class RegressionTest_i49755 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + // set "MediaType" property for storages and check that "IsRoot" and "OpenMode" properties are set correctly if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempSubStorage, "MediaType2", @@ -88,7 +88,7 @@ public class RegressionTest_i49755 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + // set "MediaType" property for storages and check that "IsRoot" and "OpenMode" properties are set correctly if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempSubSubStorage, "MediaType3", @@ -109,7 +109,7 @@ public class RegressionTest_i49755 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + // set "MediaType" property for storages and check that "IsRoot" and "OpenMode" properties are set correctly if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempSubStorage1, "MediaType5", @@ -161,7 +161,7 @@ public class RegressionTest_i49755 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes if ( !m_aTestHelper.WriteBytesToSubstream( xStep2TempSubStorage1, "SubStream2", "MediaType4", false, pBytes ) ) return false; @@ -217,7 +217,7 @@ public class RegressionTest_i49755 implements StorageTest { m_aTestHelper.Error( "Can't open existing substorage!" ); return false; } - + if ( !m_aTestHelper.checkStorageProperties( xResultSubStorage, "MediaType2", false, ElementModes.READ ) ) return false; @@ -230,7 +230,7 @@ public class RegressionTest_i49755 implements StorageTest { m_aTestHelper.Error( "Can't open existing substorage!" ); return false; } - + if ( !m_aTestHelper.checkStorageProperties( xResultSubSubStorage, "MediaType3", false, ElementModes.READ ) ) return false; @@ -247,7 +247,7 @@ public class RegressionTest_i49755 implements StorageTest { m_aTestHelper.Error( "Can't open existing substorage!" ); return false; } - + if ( !m_aTestHelper.checkStorageProperties( xResultSubStorage1, "MediaType5", false, ElementModes.READ ) ) return false; @@ -266,7 +266,7 @@ public class RegressionTest_i49755 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/RegressionTest_i55821.java b/package/qa/storages/RegressionTest_i55821.java index 0803816427d6..5c669423b696 100644 --- a/package/qa/storages/RegressionTest_i55821.java +++ b/package/qa/storages/RegressionTest_i55821.java @@ -40,7 +40,7 @@ public class RegressionTest_i55821 implements StorageTest { XStream xTempFileStream = m_aTestHelper.CreateTempFileStream( m_xMSF ); if ( xTempFileStream == null ) return false; - + // create storage based on the temporary stream Object pArgs[] = new Object[2]; pArgs[0] = (Object) xTempFileStream; @@ -61,7 +61,7 @@ public class RegressionTest_i55821 implements StorageTest { // the stream will not be encrypted if ( !m_aTestHelper.WriteBytesToEncrSubstream( xTempStorage, "SubStream1", "MediaType1", false, pBytes, sPass ) ) return false; - + if ( !m_aTestHelper.commitStorage( xTempStorage ) ) return false; @@ -106,6 +106,6 @@ public class RegressionTest_i55821 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/RegressionTest_i59886.java b/package/qa/storages/RegressionTest_i59886.java index 471149823c33..ce39e39df109 100644 --- a/package/qa/storages/RegressionTest_i59886.java +++ b/package/qa/storages/RegressionTest_i59886.java @@ -36,7 +36,7 @@ public class RegressionTest_i59886 implements StorageTest { XStream xTempFileStream = m_aTestHelper.CreateTempFileStream( m_xMSF ); if ( xTempFileStream == null ) return false; - + // create storage based on the temporary stream Object pArgs[] = new Object[2]; pArgs[0] = (Object) xTempFileStream; @@ -69,7 +69,7 @@ public class RegressionTest_i59886 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes if ( !m_aTestHelper.WriteBytesToEncrSubstream( xTempSubStorage, "SubStream2", "MediaType2", false, pBytes, sPass ) ) return false; @@ -122,7 +122,7 @@ public class RegressionTest_i59886 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + // set the common storage password XEncryptionProtectedSource xEncr = (XEncryptionProtectedSource) UnoRuntime.queryInterface( XEncryptionProtectedSource.class, xStep2TempStorage ); if ( xEncr == null ) @@ -199,7 +199,7 @@ public class RegressionTest_i59886 implements StorageTest { m_aTestHelper.Error( "Can't open existing substorage!" ); return false; } - + if ( !m_aTestHelper.checkStorageProperties( xTargetSubStorage, "MediaType4", false, ElementModes.WRITE ) ) return false; @@ -238,6 +238,6 @@ public class RegressionTest_i59886 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/RegressionTest_i61909.java b/package/qa/storages/RegressionTest_i61909.java index 5f5c1572d79d..95590e319288 100644 --- a/package/qa/storages/RegressionTest_i61909.java +++ b/package/qa/storages/RegressionTest_i61909.java @@ -45,7 +45,7 @@ public class RegressionTest_i61909 implements StorageTest { m_aTestHelper.Error( "No valid temporary file was created!" ); return false; } - + // create storage based on the temporary stream Object pArgs[] = new Object[2]; pArgs[0] = (Object) sTempFileURL; @@ -76,7 +76,7 @@ public class RegressionTest_i61909 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes if ( !m_aTestHelper.WriteBytesToSubstream( xTempSubStorage, "SubStream2", "MediaType2", true, pBytes ) ) return false; @@ -162,6 +162,6 @@ public class RegressionTest_i61909 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/RegressionTest_i84234.java b/package/qa/storages/RegressionTest_i84234.java index 16150690d882..be011000a750 100644 --- a/package/qa/storages/RegressionTest_i84234.java +++ b/package/qa/storages/RegressionTest_i84234.java @@ -36,7 +36,7 @@ public class RegressionTest_i84234 implements StorageTest { XStream xTempFileStream = m_aTestHelper.CreateTempFileStream( m_xMSF ); if ( xTempFileStream == null ) return false; - + // create storage based on the temporary stream Object pArgs[] = new Object[2]; pArgs[0] = (Object) xTempFileStream; @@ -59,7 +59,7 @@ public class RegressionTest_i84234 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + byte pBytes1[] = { 1, 1, 1, 1, 1 }; // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes @@ -90,7 +90,7 @@ public class RegressionTest_i84234 implements StorageTest { // dispose storage if ( !m_aTestHelper.disposeStorage( xTempStorage ) ) return false; - + // ================================================ // reopen the storages in readwrite mode and check Compressed flag // ================================================ @@ -121,7 +121,7 @@ public class RegressionTest_i84234 implements StorageTest { // the root storage is based on the temporary stream so it can be left undisposed, since it does not lock // any resource, later the garbage collector will release the object and it must die by refcount - + return true; } catch( Exception e ) @@ -129,6 +129,6 @@ public class RegressionTest_i84234 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/StorageUnitTest.java b/package/qa/storages/StorageUnitTest.java index e5010d86c735..a56beffd1305 100644 --- a/package/qa/storages/StorageUnitTest.java +++ b/package/qa/storages/StorageUnitTest.java @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/package/qa/storages/Test01.java b/package/qa/storages/Test01.java index a793a2fd5809..b722c3a4ec24 100644 --- a/package/qa/storages/Test01.java +++ b/package/qa/storages/Test01.java @@ -37,7 +37,7 @@ public class Test01 implements StorageTest { m_aTestHelper.Error( "No valid temporary file was created!" ); return false; } - + // create temporary storage based on arbitrary medium // after such a storage is closed it is lost Object oTempStorage = m_xStorageFactory.createInstance(); @@ -57,7 +57,7 @@ public class Test01 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + byte pBigBytes[] = new byte[33000]; for ( int nInd = 0; nInd < 33000; nInd++ ) pBigBytes[nInd] = (byte)( nInd % 128 ); @@ -81,7 +81,7 @@ public class Test01 implements StorageTest { // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes if ( !m_aTestHelper.WriteBytesToSubstream( xTempSubStorage, "SubStream2", "MediaType2", false, pBytes2 ) ) return false; - + // set "MediaType" property for storages and check that "IsRoot" and "OpenMode" properties are set correctly if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempStorage, "MediaType3", @@ -95,7 +95,7 @@ public class Test01 implements StorageTest { false, ElementModes.WRITE ) ) return false; - + // create temporary storage based on a previously created temporary file Object pArgs[] = new Object[2]; pArgs[0] = (Object) sTempFileURL; @@ -144,7 +144,7 @@ public class Test01 implements StorageTest { m_aTestHelper.Error( "Can't open existing substorage!" ); return false; } - + if ( !m_aTestHelper.checkStorageProperties( xResultSubStorage, "MediaType4", false, ElementModes.READ ) ) return false; @@ -171,7 +171,7 @@ public class Test01 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/Test02.java b/package/qa/storages/Test02.java index 668efbe6a509..2da897a850f8 100644 --- a/package/qa/storages/Test02.java +++ b/package/qa/storages/Test02.java @@ -36,7 +36,7 @@ public class Test02 implements StorageTest { XStream xTempFileStream = m_aTestHelper.CreateTempFileStream( m_xMSF ); if ( xTempFileStream == null ) return false; - + // create storage based on the temporary stream Object pArgs[] = new Object[2]; pArgs[0] = (Object) xTempFileStream; @@ -59,7 +59,7 @@ public class Test02 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + byte pBigBytes[] = new byte[33000]; for ( int nInd = 0; nInd < 33000; nInd++ ) pBigBytes[nInd] = (byte)( nInd % 128 ); @@ -87,7 +87,7 @@ public class Test02 implements StorageTest { false, ElementModes.WRITE ) ) return false; - + // commit substorage first if ( !m_aTestHelper.commitStorage( xTempSubStorage ) ) return false; @@ -114,7 +114,7 @@ public class Test02 implements StorageTest { if ( xTempInStream == null ) return false; - + // open input stream // since no mode is provided the result storage must be opened readonly Object pOneArg[] = new Object[1]; @@ -140,7 +140,7 @@ public class Test02 implements StorageTest { m_aTestHelper.Error( "Can't open existing substorage!" ); return false; } - + if ( !m_aTestHelper.checkStorageProperties( xResultSubStorage, "MediaType3", false, ElementModes.READ ) ) return false; @@ -157,7 +157,7 @@ public class Test02 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/Test03.java b/package/qa/storages/Test03.java index 353cd4df8d14..01b9039dd318 100644 --- a/package/qa/storages/Test03.java +++ b/package/qa/storages/Test03.java @@ -51,7 +51,7 @@ public class Test03 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + byte pBigBytes[] = new byte[33000]; for ( int nInd = 0; nInd < 33000; nInd++ ) pBigBytes[nInd] = (byte)( nInd % 128 ); @@ -88,7 +88,7 @@ public class Test03 implements StorageTest { if ( !m_aTestHelper.disposeStorage( xTempSubStorage ) ) return false; - + // ================================================ // check storage hyerarchy tree // ================================================ @@ -174,7 +174,7 @@ public class Test03 implements StorageTest { m_aTestHelper.Error( "Root storage contains wrong list of children!" ); return false; } - + // get storage through XNameAccess XStorage xResultSubStorage = getStorageFromNameAccess( xRootNameAccess, "SubStorage1" ); if ( xResultSubStorage == null ) @@ -197,7 +197,7 @@ public class Test03 implements StorageTest { m_aTestHelper.Error( "'SubStream2' can not be detected as child stream element of 'SubStorage1'!" ); return false; } - + return true; } catch( Exception e ) @@ -205,7 +205,7 @@ public class Test03 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } public XStorage getStorageFromNameAccess( XNameAccess xAccess, String sName ) { diff --git a/package/qa/storages/Test04.java b/package/qa/storages/Test04.java index 81f770f8ff9a..2f8ba736f1b3 100644 --- a/package/qa/storages/Test04.java +++ b/package/qa/storages/Test04.java @@ -40,7 +40,7 @@ public class Test04 implements StorageTest { m_aTestHelper.Error( "No valid temporary file was created!" ); return false; } - + // create temporary storage based on arbitrary medium // after such a storage is closed it is lost Object oTempStorage = m_xStorageFactory.createInstance(); @@ -62,7 +62,7 @@ public class Test04 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + byte pBigBytes[] = new byte[33000]; for ( int nInd = 0; nInd < 33000; nInd++ ) pBigBytes[nInd] = (byte)( nInd % 128 ); @@ -96,7 +96,7 @@ public class Test04 implements StorageTest { // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes if ( !m_aTestHelper.WriteBytesToSubstream( xTempSubStorage2, "SubStream2", "MediaType2", false, pBytes2 ) ) return false; - + // set "MediaType" property for storages and check that "IsRoot" and "OpenMode" properties are set correctly if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempStorage, "MediaType3", @@ -110,14 +110,14 @@ public class Test04 implements StorageTest { false, ElementModes.WRITE ) ) return false; - + // set "MediaType" property for storages and check that "IsRoot" and "OpenMode" properties are set correctly if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempSubStorage2, "MediaType5", false, ElementModes.WRITE ) ) return false; - + // create temporary storage based on a previously created temporary file Object pArgs[] = new Object[2]; pArgs[0] = (Object) sTempFileURL; @@ -209,7 +209,7 @@ public class Test04 implements StorageTest { m_aTestHelper.Error( "Can't open existing substorage!" ); return false; } - + if ( !m_aTestHelper.checkStorageProperties( xResSubStorage1, "MediaType4", false, ElementModes.READ ) ) return false; @@ -261,7 +261,7 @@ public class Test04 implements StorageTest { // remove element and check that it was removed completelly if ( !m_aTestHelper.removeElement( xResStorage, "SubStorage2" ) ) return false; - + try { XNameAccess xResAccess = (XNameAccess) UnoRuntime.queryInterface( XNameAccess.class, xResStorage ); @@ -301,7 +301,7 @@ public class Test04 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/Test05.java b/package/qa/storages/Test05.java index adf943c6ef12..6d90cf9efaa7 100644 --- a/package/qa/storages/Test05.java +++ b/package/qa/storages/Test05.java @@ -71,7 +71,7 @@ public class Test05 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + byte pBigBytes[] = new byte[33000]; for ( int nInd = 0; nInd < 33000; nInd++ ) pBigBytes[nInd] = (byte)( nInd % 128 ); @@ -95,7 +95,7 @@ public class Test05 implements StorageTest { // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes if ( !m_aTestHelper.WriteBytesToSubstream( xSubSubStorage, "SubStream2", "MediaType2", false, pBytes2 ) ) return false; - + // set "MediaType" property for storages and check that "IsRoot" and "OpenMode" properties are set correctly if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempFileStorage, "MediaType3", @@ -192,7 +192,7 @@ public class Test05 implements StorageTest { m_aTestHelper.Error( "Wrong exception is thrown by disposed storage: " + e ); return false; } - + try { xSubStream1.getInputStream(); @@ -220,7 +220,7 @@ public class Test05 implements StorageTest { m_aTestHelper.Error( "Wrong exception is thrown by disposed stream: " + e ); return false; } - + // dispose root storage if ( !m_aTestHelper.disposeStorage( xTempFileStorage ) ) @@ -252,7 +252,7 @@ public class Test05 implements StorageTest { m_aTestHelper.Error( "Can't open existing substorage 'SubSubStorage'!" ); return false; } - + if ( !m_aTestHelper.checkStorageProperties( xResSubStorage, "MediaType4", false, ElementModes.READ ) ) return false; @@ -265,7 +265,7 @@ public class Test05 implements StorageTest { m_aTestHelper.Error( "Can't open existing substorage 'SubSubStorage'!" ); return false; } - + if ( !m_aTestHelper.checkStorageProperties( xResSubSubStorage, "MediaType5", false, ElementModes.READ ) ) return false; @@ -293,7 +293,7 @@ public class Test05 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/Test06.java b/package/qa/storages/Test06.java index ef42c66335a5..0803389a1edf 100644 --- a/package/qa/storages/Test06.java +++ b/package/qa/storages/Test06.java @@ -73,7 +73,7 @@ public class Test06 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + // in case stream is open for reading it must exist try { @@ -273,7 +273,7 @@ public class Test06 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/Test07.java b/package/qa/storages/Test07.java index 970c6f13ec09..b0edaa5db998 100644 --- a/package/qa/storages/Test07.java +++ b/package/qa/storages/Test07.java @@ -37,7 +37,7 @@ public class Test07 implements StorageTest { m_aTestHelper.Error( "No valid temporary file was created!" ); return false; } - + // create temporary storage based on arbitrary medium // after such a storage is closed it is lost Object oTempStorage = m_xStorageFactory.createInstance(); @@ -73,7 +73,7 @@ public class Test07 implements StorageTest { // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes if ( !m_aTestHelper.WriteBytesToEncrSubstream( xTempStorage, "SubStream2", "MediaType2", false, pBytes2, sPass2 ) ) return false; - + // create temporary storage based on a previously created temporary file Object pArgs[] = new Object[2]; pArgs[0] = (Object) sTempFileURL; @@ -156,7 +156,7 @@ public class Test07 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/Test08.java b/package/qa/storages/Test08.java index 5e024db588c8..ecf28c4a86b4 100644 --- a/package/qa/storages/Test08.java +++ b/package/qa/storages/Test08.java @@ -31,7 +31,7 @@ public class Test08 implements StorageTest { { try { - + // create temporary storage based on arbitrary medium // after such a storage is closed it is lost Object oTempStorage = m_xStorageFactory.createInstance(); @@ -51,7 +51,7 @@ public class Test08 implements StorageTest { m_aTestHelper.Message( "Optional interface XEncryptionProtectedSource is not implemented, feature can not be tested!" ); return true; } - + String sPass1 = "123"; String sPass2 = "321"; @@ -63,7 +63,7 @@ public class Test08 implements StorageTest { m_aTestHelper.Error( "Can't set a common encryption key for the storage, exception:" + e ); return false; } - + // open a new substorage XStorage xTempSubStorage = m_aTestHelper.openSubStorage( xTempStorage, "SubStorage1", @@ -73,7 +73,7 @@ public class Test08 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + byte pBigBytes[] = new byte[33000]; for ( int nInd = 0; nInd < 33000; nInd++ ) pBigBytes[nInd] = (byte)( nInd % 128 ); @@ -126,7 +126,7 @@ public class Test08 implements StorageTest { m_aTestHelper.Error( "No valid temporary file was created!" ); return false; } - + // create temporary storage based on a previously created temporary file Object pArgs[] = new Object[2]; pArgs[0] = (Object) sTempFileURL; @@ -175,7 +175,7 @@ public class Test08 implements StorageTest { m_aTestHelper.Error( "Can't open existing substorage!" ); return false; } - + if ( !m_aTestHelper.checkStorageProperties( xResultSubStorage, "MediaType5", false, ElementModes.READ ) ) return false; @@ -188,7 +188,7 @@ public class Test08 implements StorageTest { m_aTestHelper.Error( "XEncryptionProtectedSource was successfully used already, so it must be supported!" ); return false; } - + try { xResultStorageEncryption.setEncryptionPassword( sPass2 ); } @@ -225,6 +225,6 @@ public class Test08 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/Test09.java b/package/qa/storages/Test09.java index 2ce2dfb1e484..8d867a4fecaa 100644 --- a/package/qa/storages/Test09.java +++ b/package/qa/storages/Test09.java @@ -31,7 +31,7 @@ public class Test09 implements StorageTest { { try { - + // create temporary storage based on arbitrary medium // after such a storage is closed it is lost Object oTempStorage = m_xStorageFactory.createInstance(); @@ -63,7 +63,7 @@ public class Test09 implements StorageTest { m_aTestHelper.Error( "No valid temporary file was created!" ); return false; } - + // create temporary storage based on a previously created temporary file Object pArgs[] = new Object[2]; pArgs[0] = (Object) sTempFileURL; @@ -133,6 +133,6 @@ public class Test09 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/Test10.java b/package/qa/storages/Test10.java index 162daa5abe29..35c3e6ecbce6 100644 --- a/package/qa/storages/Test10.java +++ b/package/qa/storages/Test10.java @@ -67,7 +67,7 @@ public class Test10 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + byte pBytes2[] = { 2, 2, 2, 2, 2 }; // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes @@ -119,7 +119,7 @@ public class Test10 implements StorageTest { m_aTestHelper.Error( "The new substorage still was not commited so it must be empty!" ); return false; } - + if ( !m_aTestHelper.disposeStorage( xClonedSubStorage ) ) return false; @@ -184,7 +184,7 @@ public class Test10 implements StorageTest { m_aTestHelper.Error( "The root storage still was not commited so it's clone must be empty!" ); return false; } - + if ( !m_aTestHelper.disposeStorage( xCloneOfRoot ) ) return false; @@ -227,6 +227,6 @@ public class Test10 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/Test11.java b/package/qa/storages/Test11.java index 198fa41fe588..5663c1e57746 100644 --- a/package/qa/storages/Test11.java +++ b/package/qa/storages/Test11.java @@ -68,7 +68,7 @@ public class Test11 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + String sPass2 = "2222222222"; byte pBytes2[] = { 2, 2, 2, 2, 2 }; @@ -121,7 +121,7 @@ public class Test11 implements StorageTest { m_aTestHelper.Error( "The new substorage still was not commited so it must be empty!" ); return false; } - + if ( !m_aTestHelper.disposeStorage( xClonedSubStorage ) ) return false; @@ -170,7 +170,7 @@ public class Test11 implements StorageTest { // ============================== // commit the root storage and check cloning // ============================== - + if ( !m_aTestHelper.commitStorage( xTempStorage ) ) return false; @@ -213,6 +213,6 @@ public class Test11 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/Test12.java b/package/qa/storages/Test12.java index 05928cf76b0d..6db2561bfade 100644 --- a/package/qa/storages/Test12.java +++ b/package/qa/storages/Test12.java @@ -36,7 +36,7 @@ public class Test12 implements StorageTest { XStream xTempFileStream = m_aTestHelper.CreateTempFileStream( m_xMSF ); if ( xTempFileStream == null ) return false; - + // create storage based on the temporary stream Object pArgs[] = new Object[2]; pArgs[0] = (Object) xTempFileStream; @@ -59,7 +59,7 @@ public class Test12 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + byte pBigBytes[] = new byte[33000]; for ( int nInd = 0; nInd < 33000; nInd++ ) pBigBytes[nInd] = (byte)( nInd % 128 ); @@ -87,7 +87,7 @@ public class Test12 implements StorageTest { false, ElementModes.WRITE ) ) return false; - + // commit substorage first if ( !m_aTestHelper.commitStorage( xTempSubStorage ) ) return false; @@ -192,7 +192,7 @@ public class Test12 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } private boolean checkSubStorages( XStorage xStorage, byte[] pBytes1, byte[] pBigBytes ) { diff --git a/package/qa/storages/Test13.java b/package/qa/storages/Test13.java index e8b05264f44d..6e8c8a4e9037 100644 --- a/package/qa/storages/Test13.java +++ b/package/qa/storages/Test13.java @@ -33,7 +33,7 @@ public class Test13 implements StorageTest { for ( int nInd = 0; nInd < 4; ++nInd, aStreamPrefix += "SubStorage" + nInd ) if ( !testForPath( aStreamPrefix ) ) return false; - + return true; } @@ -54,7 +54,7 @@ public class Test13 implements StorageTest { m_aTestHelper.Error( "No valid temporary file was created!" ); return false; } - + // create temporary storage based on a previously created temporary file Object pArgs[] = new Object[2]; pArgs[0] = (Object) sTempFileURL; @@ -209,7 +209,7 @@ public class Test13 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/Test14.java b/package/qa/storages/Test14.java index 1f35758af05a..94e384c6b8f9 100644 --- a/package/qa/storages/Test14.java +++ b/package/qa/storages/Test14.java @@ -33,7 +33,7 @@ public class Test14 implements StorageTest { for ( int nInd = 0; nInd < 4; ++nInd, aStreamPrefix += "SubStorage" + nInd ) if ( !testForPath( aStreamPrefix ) ) return false; - + return true; } @@ -51,7 +51,7 @@ public class Test14 implements StorageTest { m_aTestHelper.Error( "No valid temporary file was created!" ); return false; } - + // create temporary storage based on a previously created temporary file Object pArgs[] = new Object[2]; pArgs[0] = (Object) sTempFileURL; @@ -80,7 +80,7 @@ public class Test14 implements StorageTest { // and commit if ( !m_aTestHelper.WriteBytesToEncrStreamH( xTempFileStorage, aSubStream2Path, "MediaType2", false, pBytes2, sPass2, true ) ) return false; - + // open a new substream hierarchically, set "MediaType" and "Compressed" properties to it, write some bytes // and don't commit if ( !m_aTestHelper.WriteBytesToEncrStreamH( xTempFileStorage, aSubStream3Path, "MediaType2", false, pBytes2, sPass2, false ) ) @@ -182,7 +182,7 @@ public class Test14 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/Test15.java b/package/qa/storages/Test15.java index b58453f9a195..ca89cfa19e95 100644 --- a/package/qa/storages/Test15.java +++ b/package/qa/storages/Test15.java @@ -33,7 +33,7 @@ public class Test15 implements StorageTest { for ( int nInd = 0; nInd < 4; ++nInd, aStreamPrefix += "SubStorage" + nInd ) if ( !testForPath( aStreamPrefix ) ) return false; - + return true; } @@ -52,7 +52,7 @@ public class Test15 implements StorageTest { m_aTestHelper.Error( "No valid temporary file was created!" ); return false; } - + // create temporary storage based on a previously created temporary file Object pArgs[] = new Object[2]; pArgs[0] = (Object) sTempFileURL; @@ -75,7 +75,7 @@ public class Test15 implements StorageTest { m_aTestHelper.Message( "Optional interface XEncryptionProtectedSource is not implemented, feature can not be tested!" ); return true; } - + String sPass1 = "12345"; String sPass2 = "54321"; @@ -112,7 +112,7 @@ public class Test15 implements StorageTest { if ( !m_aTestHelper.WBToSubstrOfEncrH( xTempFileStorage, aSubStream4Path, "MediaType2", true, pBytes1, true, false ) ) return false; - + // set "MediaType" property for storages and check that "IsRoot" and "OpenMode" properties are set correctly if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempFileStorage, "MediaType3", @@ -152,7 +152,7 @@ public class Test15 implements StorageTest { m_aTestHelper.Error( "XEncryptionProtectedSource is supported, but can not be retrieved!" ); return false; } - + try { xTempStorageEncryption.setEncryptionPassword( sPass2 ); } @@ -229,7 +229,7 @@ public class Test15 implements StorageTest { m_aTestHelper.Error( "XEncryptionProtectedSource is supported, but can not be retrieved!" ); return false; } - + try { xTempStorageEncryption.setEncryptionPassword( sPass1 ); } @@ -262,7 +262,7 @@ public class Test15 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/Test16.java b/package/qa/storages/Test16.java index 6f432b0da730..1b573dc126a1 100644 --- a/package/qa/storages/Test16.java +++ b/package/qa/storages/Test16.java @@ -37,7 +37,7 @@ public class Test16 implements StorageTest { m_aTestHelper.Error( "No valid temporary file was created!" ); return false; } - + // create temporary storage based on arbitrary medium // after such a storage is closed it is lost Object oTempStorage = m_xStorageFactory.createInstance(); @@ -57,7 +57,7 @@ public class Test16 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + byte pBytes1[] = { 1, 1, 1, 1, 1 }; // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes @@ -69,7 +69,7 @@ public class Test16 implements StorageTest { // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes if ( !m_aTestHelper.WriteBytesToSubstream( xTempSubStorage, "SubStream\u0442\u0435\u0441\u04422", "MediaType2", false, pBytes2 ) ) return false; - + // set "MediaType" property for storages and check that "IsRoot" and "OpenMode" properties are set correctly if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempStorage, "MediaType3", @@ -83,7 +83,7 @@ public class Test16 implements StorageTest { false, ElementModes.WRITE ) ) return false; - + // create temporary storage based on a previously created temporary file Object pArgs[] = new Object[2]; pArgs[0] = (Object) sTempFileURL; @@ -132,7 +132,7 @@ public class Test16 implements StorageTest { m_aTestHelper.Error( "Can't open existing substorage!" ); return false; } - + if ( !m_aTestHelper.checkStorageProperties( xResultSubStorage, "MediaType4", false, ElementModes.READ ) ) return false; @@ -153,7 +153,7 @@ public class Test16 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/Test17.java b/package/qa/storages/Test17.java index 009344cefbc4..9d25672ba78c 100644 --- a/package/qa/storages/Test17.java +++ b/package/qa/storages/Test17.java @@ -36,7 +36,7 @@ public class Test17 implements StorageTest { XStream xTempFileStream = m_aTestHelper.CreateTempFileStream( m_xMSF ); if ( xTempFileStream == null ) return false; - + // create storage based on the temporary stream Object pArgs[] = new Object[2]; pArgs[0] = (Object) xTempFileStream; @@ -50,7 +50,7 @@ public class Test17 implements StorageTest { return false; } - + byte pBytes1[] = { 1, 1, 1, 1, 1 }; String pNames[] = { "SubStream1", "SubStream2", "SubStream3", "SubStream4", "SubStream5", "SubStream6", "SubStream7" }; @@ -65,7 +65,7 @@ public class Test17 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes if ( !m_aTestHelper.WriteBytesToSubstream( xTempSubStorage, pNames[nInd], "MediaType1", true, pBytes1 ) ) return false; @@ -101,7 +101,7 @@ public class Test17 implements StorageTest { if ( xTempInStream == null ) return false; - + // open input stream // since no mode is provided the result storage must be opened readonly Object pOneArg[] = new Object[1]; @@ -124,7 +124,7 @@ public class Test17 implements StorageTest { m_aTestHelper.Error( "Can't open existing substorage!" ); return false; } - + for ( int nInd = 0; nInd < pNames.length; nInd++ ) if ( !m_aTestHelper.checkStream( xResultSubStorage, pNames[nInd], "MediaType1", true, pBytes1 ) ) return false; @@ -136,7 +136,7 @@ public class Test17 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/Test18.java b/package/qa/storages/Test18.java index 335a230027ce..a79e2d3c2b9c 100644 --- a/package/qa/storages/Test18.java +++ b/package/qa/storages/Test18.java @@ -38,7 +38,7 @@ public class Test18 implements StorageTest { m_aTestHelper.Error( "No valid temporary file was created!" ); return false; } - + // create temporary storage based on arbitrary medium // after such a storage is closed it is lost Object oTempStorage = m_xStorageFactory.createInstance(); @@ -58,7 +58,7 @@ public class Test18 implements StorageTest { m_aTestHelper.Error( "Can't create substorage!" ); return false; } - + byte pBytes1[] = { 1, 1, 1, 1, 1 }; // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes @@ -68,7 +68,7 @@ public class Test18 implements StorageTest { // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes if ( !m_aTestHelper.WriteBytesToSubstreamDefaultCompressed( xTempSubStorage, "SubStream2", "image/png", pBytes1 ) ) return false; - + // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes if ( !m_aTestHelper.WriteBytesToSubstreamDefaultCompressed( xTempSubStorage, "SubStream3", "image/gif", pBytes1 ) ) return false; @@ -90,7 +90,7 @@ public class Test18 implements StorageTest { false, ElementModes.WRITE ) ) return false; - + // create temporary storage based on a previously created temporary file Object pArgs[] = new Object[2]; pArgs[0] = (Object) sTempFileURL; @@ -139,7 +139,7 @@ public class Test18 implements StorageTest { m_aTestHelper.Error( "Can't open existing substorage!" ); return false; } - + if ( !m_aTestHelper.checkStorageProperties( xResultSubStorage, "MediaType4", false, ElementModes.READ ) ) return false; @@ -166,7 +166,7 @@ public class Test18 implements StorageTest { m_aTestHelper.Error( "Exception: " + e ); return false; } - } + } } diff --git a/package/qa/storages/TestHelper.java b/package/qa/storages/TestHelper.java index dc28786513b1..0c1580fc7014 100644 --- a/package/qa/storages/TestHelper.java +++ b/package/qa/storages/TestHelper.java @@ -36,7 +36,7 @@ public class TestHelper { Error( "Can't get XOutputStream implementation from substream '" + sStreamName + "'!" ); return false; } - + // get XTrucate implementation from output stream XTruncate xTruncate = (XTruncate) UnoRuntime.queryInterface( XTruncate.class, xOutput ); if ( xTruncate == null ) @@ -44,7 +44,7 @@ public class TestHelper { Error( "Can't get XTruncate implementation from substream '" + sStreamName + "'!" ); return false; } - + // write requested byte sequence try { @@ -118,7 +118,7 @@ public class TestHelper { Error( "Can't create substream '" + sStreamName + "', exception : " + e + "!" ); return false; } - + // get output stream of substream XOutputStream xOutput = xSubStream.getOutputStream(); if ( xOutput == null ) @@ -126,7 +126,7 @@ public class TestHelper { Error( "Can't get XOutputStream implementation from substream '" + sStreamName + "'!" ); return false; } - + // get XTrucate implementation from output stream XTruncate xTruncate = (XTruncate) UnoRuntime.queryInterface( XTruncate.class, xOutput ); if ( xTruncate == null ) @@ -134,7 +134,7 @@ public class TestHelper { Error( "Can't get XTruncate implementation from substream '" + sStreamName + "'!" ); return false; } - + // write requested byte sequence try { @@ -213,7 +213,7 @@ public class TestHelper { Error( "Can't create substream '" + sStreamName + "', exception : " + e + "!" ); return false; } - + if ( !WriteBytesToStream( xSubStream, sStreamName, sMediaType, bCompressed, pBytes ) ) return false; @@ -345,7 +345,7 @@ public class TestHelper { Error( "Can't create substream '" + sStreamPath + "', exception : " + e + "!" ); return false; } - + if ( !WriteBytesToStream( xSubStream, sStreamPath, sMediaType, bCompressed, pBytes ) ) return false; @@ -410,7 +410,7 @@ public class TestHelper { Error( "Can't create substream '" + sStreamPath + "', exception : " + e + "!" ); return false; } - + if ( !WriteBytesToStream( xSubStream, sStreamPath, sMediaType, bCompressed, pBytes ) ) return false; @@ -555,7 +555,7 @@ public class TestHelper { Message( "Optional interface XEncryptionProtectedSource is not implemented, feature can not be tested!" ); return -1; } - + try { xStreamEncryption.setEncryptionPassword( sNewPass ); } @@ -613,7 +613,7 @@ public class TestHelper { Message( "Optional interface XEncryptionProtectedSource is not implemented, feature can not be tested!" ); return -1; } - + try { xStreamEncryption.setEncryptionPassword( sNewPass ); } @@ -672,7 +672,7 @@ public class TestHelper { Error( "'IsRoot' property contains wrong value!" ); bOk = false; } - + if ( ( bIsRoot && ( nPropMode | ElementModes.READ ) != ( nMode | ElementModes.READ ) ) || ( !bIsRoot && ( nPropMode & nMode ) != nMode ) ) @@ -716,13 +716,13 @@ public class TestHelper { + sMediaType + "', set '" + sPropMediaType + "' !" ); bOk = false; } - + if ( bPropIsRoot != bIsRoot ) { Error( "'IsRoot' property contains wrong value!" ); bOk = false; } - + if ( ( bIsRoot && ( nPropMode | ElementModes.READ ) != ( nMode | ElementModes.READ ) ) || ( !bIsRoot && ( nPropMode & nMode ) != nMode ) ) @@ -758,7 +758,7 @@ public class TestHelper { Error( "Can't get XInputStream implementation from substream '" + sName + "'!" ); return false; } - + byte pContents[][] = new byte[1][]; // ??? // read contents @@ -813,11 +813,11 @@ public class TestHelper { bOk = true; if ( !sPropMediaType.equals( sMediaType ) ) { - Error( "'MediaType' property contains wrong value for stream '" + sName + "',\nexpected: '" + Error( "'MediaType' property contains wrong value for stream '" + sName + "',\nexpected: '" + sMediaType + "', set: '" + sPropMediaType + "'!" ); bOk = false; } - + if ( nPropSize != pBytes.length ) { Error( "'Size' property contains wrong value for stream'" + sName + "'!" ); @@ -866,7 +866,7 @@ public class TestHelper { Error( "Can't open substream '" + sName + "', exception : " + e + "!" ); return false; } - + boolean bResult = InternalCheckStream( xSubStream, sName, sMediaType, bCompressed, pBytes, true ); // free the stream resources, garbage collector may remove the object too late @@ -883,7 +883,7 @@ public class TestHelper { String sPass ) { // Important: a common password for any of parent storage should not be set or - // should be different from sPass + // should be different from sPass try { @@ -898,7 +898,7 @@ public class TestHelper { Error( "Unexpected exception in case of opening of encrypted stream '" + sName + "' without password: " + e + "!" ); return false; } - + String sWrongPass = "11"; sWrongPass += sPass; try @@ -914,7 +914,7 @@ public class TestHelper { Error( "Unexpected exception in case of opening of encrypted stream '" + sName + "' with wrong password: " + e + "!" ); return false; } - + XStream xSubStream = null; try { @@ -931,7 +931,7 @@ public class TestHelper { Error( "Can't open encrypted substream '" + sName + "', exception : " + e + "!" ); return false; } - + // encrypted streams will be compressed always, so after the storing this property is always true, // although before the storing it can be set to false ( it is not always clear whether a stream is encrypted // before the storing ) @@ -975,7 +975,7 @@ public class TestHelper { Error( "Can't open substream '" + sPath + "', exception : " + e + "!" ); return false; } - + boolean bResult = InternalCheckStream( xSubStream, sPath, sMediaType, bCompressed, pBytes, true ); // free the stream resources, garbage collector may remove the object too late @@ -992,7 +992,7 @@ public class TestHelper { String sPass ) { // Important: a common password for any of parent storage should not be set or - // should be different from sPass + // should be different from sPass XHierarchicalStorageAccess xHStorage = (XHierarchicalStorageAccess) UnoRuntime.queryInterface( XHierarchicalStorageAccess.class, xParentStorage ); if ( xHStorage == null ) @@ -1015,7 +1015,7 @@ public class TestHelper { Error( "Unexpected exception in case of opening of encrypted stream '" + sPath + "' without password: " + e + "!" ); return false; } - + String sWrongPass = "11"; sWrongPass += sPass; try @@ -1032,7 +1032,7 @@ public class TestHelper { Error( "Unexpected exception in case of opening of encrypted stream '" + sPath + "' with wrong password: " + e + "!" ); return false; } - + XStream xSubStream = null; try { @@ -1049,7 +1049,7 @@ public class TestHelper { Error( "Can't open encrypted substream '" + sPath + "', exception : " + e + "!" ); return false; } - + // encrypted streams will be compressed always, so after the storing this property is always true, // although before the storing it can be set to false ( it is not always clear whether a stream is encrypted // before the storing ) @@ -1100,7 +1100,7 @@ public class TestHelper { return true; } - + public boolean disposeStream( XStream xStream, String sStreamName ) { XComponent xComponent = (XComponent) UnoRuntime.queryInterface( XComponent.class, xStream ); @@ -1109,7 +1109,7 @@ public class TestHelper { Error( "Can't get XComponent implementation from substream '" + sStreamName + "'!" ); return false; } - + try { xComponent.dispose(); @@ -1190,7 +1190,7 @@ public class TestHelper { Error( "Can't close output part of a stream, exception :" + e ); return false; } - + return true; } @@ -1232,7 +1232,7 @@ public class TestHelper { public String CreateTempFile( XMultiServiceFactory xMSF ) { String sResult = null; - + // try to get temporary file representation XPropertySet xTempFileProps = null; try diff --git a/package/source/manifest/Base64Codec.cxx b/package/source/manifest/Base64Codec.cxx index f3c8152a3fad..9c2d4d34288a 100644 --- a/package/source/manifest/Base64Codec.cxx +++ b/package/source/manifest/Base64Codec.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/package/source/manifest/Base64Codec.hxx b/package/source/manifest/Base64Codec.hxx index 8cae2a7037fd..941c115a8437 100644 --- a/package/source/manifest/Base64Codec.hxx +++ b/package/source/manifest/Base64Codec.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/package/source/manifest/ManifestDefines.hxx b/package/source/manifest/ManifestDefines.hxx index 65b9c6181727..67159ee8edb5 100644 --- a/package/source/manifest/ManifestDefines.hxx +++ b/package/source/manifest/ManifestDefines.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/package/source/manifest/ManifestExport.cxx b/package/source/manifest/ManifestExport.cxx index 04316e784c77..6283e5ff84fc 100644 --- a/package/source/manifest/ManifestExport.cxx +++ b/package/source/manifest/ManifestExport.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -47,44 +47,44 @@ using namespace com::sun::star::xml::sax; ManifestExport::ManifestExport(Reference < XDocumentHandler > xHandler, const Sequence < Sequence < PropertyValue > > &rManList ) { - const OUString sFileEntryElement ( RTL_CONSTASCII_USTRINGPARAM ( ELEMENT_FILE_ENTRY ) ); - const OUString sManifestElement ( RTL_CONSTASCII_USTRINGPARAM ( ELEMENT_MANIFEST ) ); + const OUString sFileEntryElement ( RTL_CONSTASCII_USTRINGPARAM ( ELEMENT_FILE_ENTRY ) ); + const OUString sManifestElement ( RTL_CONSTASCII_USTRINGPARAM ( ELEMENT_MANIFEST ) ); const OUString sEncryptionDataElement( RTL_CONSTASCII_USTRINGPARAM ( ELEMENT_ENCRYPTION_DATA ) ); - const OUString sAlgorithmElement ( RTL_CONSTASCII_USTRINGPARAM ( ELEMENT_ALGORITHM ) ); + const OUString sAlgorithmElement ( RTL_CONSTASCII_USTRINGPARAM ( ELEMENT_ALGORITHM ) ); const OUString sStartKeyGenerationElement ( RTL_CONSTASCII_USTRINGPARAM ( ELEMENT_START_KEY_GENERATION ) ); const OUString sKeyDerivationElement( RTL_CONSTASCII_USTRINGPARAM ( ELEMENT_KEY_DERIVATION ) ); - const OUString sCdataAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_CDATA ) ); - const OUString sMediaTypeAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_MEDIA_TYPE ) ); - const OUString sVersionAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_VERSION ) ); - const OUString sFullPathAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_FULL_PATH ) ); - const OUString sSizeAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_SIZE ) ); - const OUString sKeySizeAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_KEY_SIZE ) ); - const OUString sSaltAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_SALT ) ); + const OUString sCdataAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_CDATA ) ); + const OUString sMediaTypeAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_MEDIA_TYPE ) ); + const OUString sVersionAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_VERSION ) ); + const OUString sFullPathAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_FULL_PATH ) ); + const OUString sSizeAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_SIZE ) ); + const OUString sKeySizeAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_KEY_SIZE ) ); + const OUString sSaltAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_SALT ) ); const OUString sInitialisationVectorAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_INITIALISATION_VECTOR ) ); const OUString sIterationCountAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_ITERATION_COUNT ) ); - const OUString sAlgorithmNameAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_ALGORITHM_NAME ) ); + const OUString sAlgorithmNameAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_ALGORITHM_NAME ) ); const OUString sStartKeyGenerationNameAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_START_KEY_GENERATION_NAME ) ); - const OUString sKeyDerivationNameAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_KEY_DERIVATION_NAME ) ); - const OUString sChecksumTypeAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_CHECKSUM_TYPE ) ); - const OUString sChecksumAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_CHECKSUM) ); - - const OUString sFullPathProperty ( RTL_CONSTASCII_USTRINGPARAM ( "FullPath" ) ); - const OUString sVersionProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Version" ) ); - const OUString sMediaTypeProperty ( RTL_CONSTASCII_USTRINGPARAM ( "MediaType" ) ); - const OUString sIterationCountProperty ( RTL_CONSTASCII_USTRINGPARAM ( "IterationCount" ) ); - const OUString sSaltProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Salt" ) ); + const OUString sKeyDerivationNameAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_KEY_DERIVATION_NAME ) ); + const OUString sChecksumTypeAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_CHECKSUM_TYPE ) ); + const OUString sChecksumAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_CHECKSUM) ); + + const OUString sFullPathProperty ( RTL_CONSTASCII_USTRINGPARAM ( "FullPath" ) ); + const OUString sVersionProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Version" ) ); + const OUString sMediaTypeProperty ( RTL_CONSTASCII_USTRINGPARAM ( "MediaType" ) ); + const OUString sIterationCountProperty ( RTL_CONSTASCII_USTRINGPARAM ( "IterationCount" ) ); + const OUString sSaltProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Salt" ) ); const OUString sInitialisationVectorProperty( RTL_CONSTASCII_USTRINGPARAM ( "InitialisationVector" ) ); - const OUString sSizeProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Size" ) ); - const OUString sDigestProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Digest" ) ); + const OUString sSizeProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Size" ) ); + const OUString sDigestProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Digest" ) ); - const OUString sWhiteSpace ( RTL_CONSTASCII_USTRINGPARAM ( " " ) ); - const OUString sBlowfish ( RTL_CONSTASCII_USTRINGPARAM ( "Blowfish CFB" ) ); - const OUString sPBKDF2 ( RTL_CONSTASCII_USTRINGPARAM ( "PBKDF2" ) ); - const OUString sChecksumType ( RTL_CONSTASCII_USTRINGPARAM ( CHECKSUM_TYPE ) ); - const OUString sStartKeySize ( RTL_CONSTASCII_USTRINGPARAM ( START_KEY_SIZE ) ); - const OUString sDerivedKeySize ( RTL_CONSTASCII_USTRINGPARAM ( DERIVED_KEY_SIZE ) ); - const OUString sSHA1 ( RTL_CONSTASCII_USTRINGPARAM ( ALGORITHM_SHA1 ) ); + const OUString sWhiteSpace ( RTL_CONSTASCII_USTRINGPARAM ( " " ) ); + const OUString sBlowfish ( RTL_CONSTASCII_USTRINGPARAM ( "Blowfish CFB" ) ); + const OUString sPBKDF2 ( RTL_CONSTASCII_USTRINGPARAM ( "PBKDF2" ) ); + const OUString sChecksumType ( RTL_CONSTASCII_USTRINGPARAM ( CHECKSUM_TYPE ) ); + const OUString sStartKeySize ( RTL_CONSTASCII_USTRINGPARAM ( START_KEY_SIZE ) ); + const OUString sDerivedKeySize ( RTL_CONSTASCII_USTRINGPARAM ( DERIVED_KEY_SIZE ) ); + const OUString sSHA1 ( RTL_CONSTASCII_USTRINGPARAM ( ALGORITHM_SHA1 ) ); ::comphelper::AttributeList * pRootAttrList = new ::comphelper::AttributeList; const Sequence < PropertyValue > *pSequence = rManList.getConstArray(); @@ -139,7 +139,7 @@ ManifestExport::ManifestExport(Reference < XDocumentHandler > xHandler, const S || aDocMediaType.equals( OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_ASCII ) ) ) || aDocMediaType.equals( OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_ASCII ) ) ) || aDocMediaType.equals( OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_OASIS_OPENDOCUMENT_CHART_ASCII ) ) ) - || aDocMediaType.equals( OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_OASIS_OPENDOCUMENT_DATABASE_ASCII ) ) ) + || aDocMediaType.equals( OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_OASIS_OPENDOCUMENT_DATABASE_ASCII ) ) ) || aDocMediaType.equals( OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_ASCII ) ) ) || aDocMediaType.equals( OUString( RTL_CONSTASCII_USTRINGPARAM( MIMETYPE_OASIS_OPENDOCUMENT_TEXT_TEMPLATE_ASCII ) ) ) diff --git a/package/source/manifest/ManifestExport.hxx b/package/source/manifest/ManifestExport.hxx index 73b8cce89725..860c8e60d44f 100644 --- a/package/source/manifest/ManifestExport.hxx +++ b/package/source/manifest/ManifestExport.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/package/source/manifest/ManifestImport.cxx b/package/source/manifest/ManifestImport.cxx index be0e540a11da..33b63877795f 100644 --- a/package/source/manifest/ManifestImport.cxx +++ b/package/source/manifest/ManifestImport.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -43,41 +43,41 @@ using namespace std; // --------------------------------------------------- ManifestImport::ManifestImport( vector < Sequence < PropertyValue > > & rNewManVector ) : nNumProperty ( 0 ) -, bIgnoreEncryptData ( sal_False ) +, bIgnoreEncryptData ( sal_False ) , rManVector ( rNewManVector ) -, sFileEntryElement ( RTL_CONSTASCII_USTRINGPARAM ( ELEMENT_FILE_ENTRY ) ) -, sManifestElement ( RTL_CONSTASCII_USTRINGPARAM ( ELEMENT_MANIFEST ) ) +, sFileEntryElement ( RTL_CONSTASCII_USTRINGPARAM ( ELEMENT_FILE_ENTRY ) ) +, sManifestElement ( RTL_CONSTASCII_USTRINGPARAM ( ELEMENT_MANIFEST ) ) , sEncryptionDataElement( RTL_CONSTASCII_USTRINGPARAM ( ELEMENT_ENCRYPTION_DATA ) ) -, sAlgorithmElement ( RTL_CONSTASCII_USTRINGPARAM ( ELEMENT_ALGORITHM ) ) +, sAlgorithmElement ( RTL_CONSTASCII_USTRINGPARAM ( ELEMENT_ALGORITHM ) ) , sKeyDerivationElement( RTL_CONSTASCII_USTRINGPARAM ( ELEMENT_KEY_DERIVATION ) ) -, sCdataAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_CDATA ) ) -, sMediaTypeAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_MEDIA_TYPE ) ) -, sVersionAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_VERSION ) ) -, sFullPathAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_FULL_PATH ) ) -, sSizeAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_SIZE ) ) -, sSaltAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_SALT ) ) +, sCdataAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_CDATA ) ) +, sMediaTypeAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_MEDIA_TYPE ) ) +, sVersionAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_VERSION ) ) +, sFullPathAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_FULL_PATH ) ) +, sSizeAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_SIZE ) ) +, sSaltAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_SALT ) ) , sInitialisationVectorAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_INITIALISATION_VECTOR ) ) -, sIterationCountAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_ITERATION_COUNT ) ) -, sAlgorithmNameAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_ALGORITHM_NAME ) ) -, sKeyDerivationNameAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_KEY_DERIVATION_NAME ) ) -, sChecksumAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_CHECKSUM ) ) -, sChecksumTypeAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_CHECKSUM_TYPE ) ) - -, sFullPathProperty ( RTL_CONSTASCII_USTRINGPARAM ( "FullPath" ) ) -, sMediaTypeProperty ( RTL_CONSTASCII_USTRINGPARAM ( "MediaType" ) ) -, sVersionProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Version" ) ) -, sIterationCountProperty ( RTL_CONSTASCII_USTRINGPARAM ( "IterationCount" ) ) -, sSaltProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Salt" ) ) -, sInitialisationVectorProperty ( RTL_CONSTASCII_USTRINGPARAM ( "InitialisationVector" ) ) -, sSizeProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Size" ) ) -, sDigestProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Digest" ) ) - -, sWhiteSpace ( RTL_CONSTASCII_USTRINGPARAM ( " " ) ) -, sBlowfish ( RTL_CONSTASCII_USTRINGPARAM ( "Blowfish CFB" ) ) -, sPBKDF2 ( RTL_CONSTASCII_USTRINGPARAM ( "PBKDF2" ) ) -, sChecksumType ( RTL_CONSTASCII_USTRINGPARAM ( CHECKSUM_TYPE ) ) +, sIterationCountAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_ITERATION_COUNT ) ) +, sAlgorithmNameAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_ALGORITHM_NAME ) ) +, sKeyDerivationNameAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_KEY_DERIVATION_NAME ) ) +, sChecksumAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_CHECKSUM ) ) +, sChecksumTypeAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_CHECKSUM_TYPE ) ) + +, sFullPathProperty ( RTL_CONSTASCII_USTRINGPARAM ( "FullPath" ) ) +, sMediaTypeProperty ( RTL_CONSTASCII_USTRINGPARAM ( "MediaType" ) ) +, sVersionProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Version" ) ) +, sIterationCountProperty ( RTL_CONSTASCII_USTRINGPARAM ( "IterationCount" ) ) +, sSaltProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Salt" ) ) +, sInitialisationVectorProperty ( RTL_CONSTASCII_USTRINGPARAM ( "InitialisationVector" ) ) +, sSizeProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Size" ) ) +, sDigestProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Digest" ) ) + +, sWhiteSpace ( RTL_CONSTASCII_USTRINGPARAM ( " " ) ) +, sBlowfish ( RTL_CONSTASCII_USTRINGPARAM ( "Blowfish CFB" ) ) +, sPBKDF2 ( RTL_CONSTASCII_USTRINGPARAM ( "PBKDF2" ) ) +, sChecksumType ( RTL_CONSTASCII_USTRINGPARAM ( CHECKSUM_TYPE ) ) { aStack.reserve( 10 ); } @@ -88,19 +88,19 @@ ManifestImport::~ManifestImport ( void ) } // --------------------------------------------------- -void SAL_CALL ManifestImport::startDocument( ) +void SAL_CALL ManifestImport::startDocument( ) throw( xml::sax::SAXException, uno::RuntimeException ) { } // --------------------------------------------------- -void SAL_CALL ManifestImport::endDocument( ) +void SAL_CALL ManifestImport::endDocument( ) throw( xml::sax::SAXException, uno::RuntimeException ) { } // --------------------------------------------------- -void SAL_CALL ManifestImport::startElement( const OUString& aName, const uno::Reference< xml::sax::XAttributeList >& xAttribs ) +void SAL_CALL ManifestImport::startElement( const OUString& aName, const uno::Reference< xml::sax::XAttributeList >& xAttribs ) throw( xml::sax::SAXException, uno::RuntimeException ) { StringHashMap aConvertedAttribs; @@ -197,12 +197,12 @@ void SAL_CALL ManifestImport::startElement( const OUString& aName, const uno::Re } // --------------------------------------------------- -void SAL_CALL ManifestImport::endElement( const OUString& aName ) +void SAL_CALL ManifestImport::endElement( const OUString& aName ) throw( xml::sax::SAXException, uno::RuntimeException ) { ::rtl::OUString aConvertedName = ConvertName( aName ); if ( !aStack.empty() && aStack.rbegin()->m_aConvertedName.equals( aConvertedName ) ) - { + { if ( aConvertedName.equals( sFileEntryElement ) ) { aSequence.realloc ( nNumProperty ); @@ -216,31 +216,31 @@ void SAL_CALL ManifestImport::endElement( const OUString& aName ) } // --------------------------------------------------- -void SAL_CALL ManifestImport::characters( const OUString& /*aChars*/ ) +void SAL_CALL ManifestImport::characters( const OUString& /*aChars*/ ) throw( xml::sax::SAXException, uno::RuntimeException ) { } // --------------------------------------------------- -void SAL_CALL ManifestImport::ignorableWhitespace( const OUString& /*aWhitespaces*/ ) +void SAL_CALL ManifestImport::ignorableWhitespace( const OUString& /*aWhitespaces*/ ) throw( xml::sax::SAXException, uno::RuntimeException ) { } // --------------------------------------------------- -void SAL_CALL ManifestImport::processingInstruction( const OUString& /*aTarget*/, const OUString& /*aData*/ ) +void SAL_CALL ManifestImport::processingInstruction( const OUString& /*aTarget*/, const OUString& /*aData*/ ) throw( xml::sax::SAXException, uno::RuntimeException ) { } // --------------------------------------------------- -void SAL_CALL ManifestImport::setDocumentLocator( const uno::Reference< xml::sax::XLocator >& /*xLocator*/ ) +void SAL_CALL ManifestImport::setDocumentLocator( const uno::Reference< xml::sax::XLocator >& /*xLocator*/ ) throw( xml::sax::SAXException, uno::RuntimeException ) { } // --------------------------------------------------- -::rtl::OUString ManifestImport::PushNameAndNamespaces( const ::rtl::OUString& aName, const uno::Reference< xml::sax::XAttributeList >& xAttribs, StringHashMap& o_aConvertedAttribs ) +::rtl::OUString ManifestImport::PushNameAndNamespaces( const ::rtl::OUString& aName, const uno::Reference< xml::sax::XAttributeList >& xAttribs, StringHashMap& o_aConvertedAttribs ) { StringHashMap aNamespaces; ::std::vector< ::std::pair< ::rtl::OUString, ::rtl::OUString > > aAttribsStrs; @@ -275,12 +275,12 @@ void SAL_CALL ManifestImport::setDocumentLocator( const uno::Reference< xml::sax aConvertedName = ConvertName( aName ); aStack.push_back( ManifestScopeEntry( aConvertedName, aNamespaces ) ); - + for ( sal_uInt16 nInd = 0; nInd < aAttribsStrs.size(); nInd++ ) { // convert the attribute names on filling o_aConvertedAttribs[ConvertName( aAttribsStrs[nInd].first )] = aAttribsStrs[nInd].second; - } + } return aConvertedName; } @@ -307,7 +307,7 @@ void SAL_CALL ManifestImport::setDocumentLocator( const uno::Reference< xml::sax { // no check for manifest.xml consistency currently since the old versions have supported inconsistent documents as well aResult = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( MANIFEST_NSPREFIX ) ); - aResult += aPureName; + aResult += aPureName; } return aResult; diff --git a/package/source/manifest/ManifestImport.hxx b/package/source/manifest/ManifestImport.hxx index e875c46b8b9c..6a48672bc16f 100644 --- a/package/source/manifest/ManifestImport.hxx +++ b/package/source/manifest/ManifestImport.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,7 +35,7 @@ #include <HashMaps.hxx> -namespace com { namespace sun { namespace star { +namespace com { namespace sun { namespace star { namespace xml { namespace sax { class XAttributeList; } } namespace beans { struct PropertyValue; } } } } @@ -62,7 +62,7 @@ class ManifestImport : public cppu::WeakImplHelper1 < com::sun::star::xml::sax:: { protected: com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > aSequence; - sal_Int16 nNumProperty; + sal_Int16 nNumProperty; ManifestStack aStack; sal_Bool bIgnoreEncryptData; ::std::vector < ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue > > & rManVector; @@ -110,21 +110,21 @@ protected: public: ManifestImport( std::vector < ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue > > & rNewVector ); ~ManifestImport( void ); - virtual void SAL_CALL startDocument( ) + virtual void SAL_CALL startDocument( ) throw(::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL endDocument( ) + virtual void SAL_CALL endDocument( ) throw(::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL startElement( const ::rtl::OUString& aName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttribs ) + virtual void SAL_CALL startElement( const ::rtl::OUString& aName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttribs ) throw(::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL endElement( const ::rtl::OUString& aName ) + virtual void SAL_CALL endElement( const ::rtl::OUString& aName ) throw(::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL characters( const ::rtl::OUString& aChars ) + virtual void SAL_CALL characters( const ::rtl::OUString& aChars ) throw(::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL ignorableWhitespace( const ::rtl::OUString& aWhitespaces ) + virtual void SAL_CALL ignorableWhitespace( const ::rtl::OUString& aWhitespaces ) throw(::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL processingInstruction( const ::rtl::OUString& aTarget, const ::rtl::OUString& aData ) + virtual void SAL_CALL processingInstruction( const ::rtl::OUString& aTarget, const ::rtl::OUString& aData ) throw(::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setDocumentLocator( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator >& xLocator ) + virtual void SAL_CALL setDocumentLocator( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator >& xLocator ) throw(::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); }; #endif diff --git a/package/source/manifest/ManifestReader.cxx b/package/source/manifest/ManifestReader.cxx index 9e973a65d31e..34fe9e262d75 100644 --- a/package/source/manifest/ManifestReader.cxx +++ b/package/source/manifest/ManifestReader.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -50,13 +50,13 @@ using namespace ::com::sun::star::packages::manifest; using ::rtl::OUString; ManifestReader::ManifestReader( const Reference < XMultiServiceFactory > & xNewFactory ) -: xFactory ( xNewFactory ) +: xFactory ( xNewFactory ) { } ManifestReader::~ManifestReader() { } -Sequence< Sequence< PropertyValue > > SAL_CALL ManifestReader::readManifestSequence( const Reference< XInputStream >& rStream ) +Sequence< Sequence< PropertyValue > > SAL_CALL ManifestReader::readManifestSequence( const Reference< XInputStream >& rStream ) throw (::com::sun::star::uno::RuntimeException) { Sequence < Sequence < PropertyValue > > aManifestSequence; @@ -74,8 +74,8 @@ Sequence< Sequence< PropertyValue > > SAL_CALL ManifestReader::readManifestSeque xParser->parseStream( aParserInput ); aManifestSequence.realloc ( aManVector.size() ); Sequence < PropertyValue > * pSequence = aManifestSequence.getArray(); - ::std::vector < Sequence < PropertyValue > >::const_iterator aIter = aManVector.begin(); - ::std::vector < Sequence < PropertyValue > >::const_iterator aEnd = aManVector.end(); + ::std::vector < Sequence < PropertyValue > >::const_iterator aIter = aManVector.begin(); + ::std::vector < Sequence < PropertyValue > >::const_iterator aEnd = aManVector.end(); while( aIter != aEnd ) *pSequence++ = (*aIter++); } @@ -124,7 +124,7 @@ OUString ManifestReader::getImplementationName() sal_Bool SAL_CALL ManifestReader::supportsService(OUString const & rServiceName) throw (RuntimeException) { - return static_supportsService ( rServiceName ); + return static_supportsService ( rServiceName ); } Sequence < OUString > ManifestReader::getSupportedServiceNames() diff --git a/package/source/manifest/ManifestReader.hxx b/package/source/manifest/ManifestReader.hxx index 7454e26b0e98..b200f6efbbf8 100644 --- a/package/source/manifest/ManifestReader.hxx +++ b/package/source/manifest/ManifestReader.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -33,7 +33,7 @@ #include <com/sun/star/packages/manifest/XManifestReader.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> -namespace com { namespace sun { namespace star { +namespace com { namespace sun { namespace star { namespace lang { class XMultiServiceFactory; class XSingleServiceFactory; } } } } @@ -50,20 +50,20 @@ public: virtual ~ManifestReader(); // XManifestReader - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > > SAL_CALL readManifestSequence( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rStream ) + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > > SAL_CALL readManifestSequence( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rStream ) throw (::com::sun::star::uno::RuntimeException); // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName( ) + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); // Component constructor - static ::rtl::OUString static_getImplementationName(); - static ::com::sun::star::uno::Sequence < ::rtl::OUString > static_getSupportedServiceNames(); + static ::rtl::OUString static_getImplementationName(); + static ::com::sun::star::uno::Sequence < ::rtl::OUString > static_getSupportedServiceNames(); sal_Bool SAL_CALL static_supportsService(rtl::OUString const & rServiceName); static ::com::sun::star::uno::Reference < com::sun::star::lang::XSingleServiceFactory > createServiceFactory( com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > const & rServiceFactory ); }; diff --git a/package/source/manifest/ManifestWriter.cxx b/package/source/manifest/ManifestWriter.cxx index ef829ff5ac03..6d7c848016b6 100644 --- a/package/source/manifest/ManifestWriter.cxx +++ b/package/source/manifest/ManifestWriter.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -51,7 +51,7 @@ using namespace ::com::sun::star::xml::sax; using namespace ::com::sun::star::packages::manifest; ManifestWriter::ManifestWriter( const Reference < XMultiServiceFactory > & xNewFactory ) -: xFactory ( xNewFactory ) +: xFactory ( xNewFactory ) { } ManifestWriter::~ManifestWriter() @@ -59,7 +59,7 @@ ManifestWriter::~ManifestWriter() } // XManifestWriter methods -void SAL_CALL ManifestWriter::writeManifestSequence( const Reference< XOutputStream >& rStream, const Sequence< Sequence< PropertyValue > >& rSequence ) +void SAL_CALL ManifestWriter::writeManifestSequence( const Reference< XOutputStream >& rStream, const Sequence< Sequence< PropertyValue > >& rSequence ) throw (RuntimeException) { OUString sSaxWriter ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.xml.sax.Writer" ) ); diff --git a/package/source/manifest/ManifestWriter.hxx b/package/source/manifest/ManifestWriter.hxx index eac775b08ad2..34c4e45d3be5 100644 --- a/package/source/manifest/ManifestWriter.hxx +++ b/package/source/manifest/ManifestWriter.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -33,7 +33,7 @@ #include <com/sun/star/packages/manifest/XManifestWriter.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> -namespace com { namespace sun { namespace star { +namespace com { namespace sun { namespace star { namespace lang { class XMultiServiceFactory; class XSingleServiceFactory; } } } } @@ -50,20 +50,20 @@ public: virtual ~ManifestWriter(); // XManifestWriter - virtual void SAL_CALL writeManifestSequence( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& rStream, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >& rSequence ) + virtual void SAL_CALL writeManifestSequence( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& rStream, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >& rSequence ) throw (::com::sun::star::uno::RuntimeException); // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName( ) + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); // Component constructor - static ::rtl::OUString static_getImplementationName(); - static ::com::sun::star::uno::Sequence < ::rtl::OUString > static_getSupportedServiceNames(); + static ::rtl::OUString static_getImplementationName(); + static ::com::sun::star::uno::Sequence < ::rtl::OUString > static_getSupportedServiceNames(); static ::com::sun::star::uno::Reference < com::sun::star::lang::XSingleServiceFactory > createServiceFactory( com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > const & rServiceFactory ); sal_Bool SAL_CALL static_supportsService(rtl::OUString const & rServiceName); }; diff --git a/package/source/xstor/disposelistener.cxx b/package/source/xstor/disposelistener.cxx index 97b06e790051..312c77d040f9 100644 --- a/package/source/xstor/disposelistener.cxx +++ b/package/source/xstor/disposelistener.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/package/source/xstor/disposelistener.hxx b/package/source/xstor/disposelistener.hxx index 8c8e02096027..54b336688ec1 100644 --- a/package/source/xstor/disposelistener.hxx +++ b/package/source/xstor/disposelistener.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/package/source/xstor/ocompinstream.cxx b/package/source/xstor/ocompinstream.cxx index 50333b0d4982..446e33996c53 100644 --- a/package/source/xstor/ocompinstream.cxx +++ b/package/source/xstor/ocompinstream.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -55,7 +55,7 @@ OInputCompStream::OInputCompStream( OWriteStream_Impl& aImpl, OSL_ENSURE( m_pImpl->m_rMutexRef.Is(), "No mutex is provided!\n" ); if ( !m_pImpl->m_rMutexRef.Is() ) throw uno::RuntimeException(); // just a disaster - + OSL_ENSURE( xStream.is(), "No stream is provided!\n" ); } @@ -99,12 +99,12 @@ uno::Any SAL_CALL OInputCompStream::queryInterface( const uno::Type& rType ) // common interfaces aReturn <<= ::cppu::queryInterface - ( rType - , static_cast<io::XInputStream*> ( this ) - , static_cast<io::XStream*> ( this ) - , static_cast<lang::XComponent*> ( this ) - , static_cast<beans::XPropertySet*> ( this ) - , static_cast<embed::XExtendedStorageStream*> ( this ) ); + ( rType + , static_cast<io::XInputStream*> ( this ) + , static_cast<io::XStream*> ( this ) + , static_cast<lang::XComponent*> ( this ) + , static_cast<beans::XPropertySet*> ( this ) + , static_cast<embed::XExtendedStorageStream*> ( this ) ); if ( aReturn.hasValue() == sal_True ) return aReturn ; @@ -112,9 +112,9 @@ uno::Any SAL_CALL OInputCompStream::queryInterface( const uno::Type& rType ) if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { aReturn <<= ::cppu::queryInterface - ( rType - , static_cast<embed::XRelationshipAccess*> ( this ) ); - + ( rType + , static_cast<embed::XRelationshipAccess*> ( this ) ); + if ( aReturn.hasValue() == sal_True ) return aReturn ; } @@ -123,7 +123,7 @@ uno::Any SAL_CALL OInputCompStream::queryInterface( const uno::Type& rType ) } //----------------------------------------------- -sal_Int32 SAL_CALL OInputCompStream::readBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) +sal_Int32 SAL_CALL OInputCompStream::readBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw ( io::NotConnectedException, io::BufferSizeExceededException, io::IOException, @@ -146,7 +146,7 @@ sal_Int32 SAL_CALL OInputCompStream::readBytes( uno::Sequence< sal_Int8 >& aData } //----------------------------------------------- -sal_Int32 SAL_CALL OInputCompStream::readSomeBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) +sal_Int32 SAL_CALL OInputCompStream::readSomeBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) throw ( io::NotConnectedException, io::BufferSizeExceededException, io::IOException, @@ -170,7 +170,7 @@ sal_Int32 SAL_CALL OInputCompStream::readSomeBytes( uno::Sequence< sal_Int8 >& a } //----------------------------------------------- -void SAL_CALL OInputCompStream::skipBytes( sal_Int32 nBytesToSkip ) +void SAL_CALL OInputCompStream::skipBytes( sal_Int32 nBytesToSkip ) throw ( io::NotConnectedException, io::BufferSizeExceededException, io::IOException, @@ -194,7 +194,7 @@ void SAL_CALL OInputCompStream::skipBytes( sal_Int32 nBytesToSkip ) } //----------------------------------------------- -sal_Int32 SAL_CALL OInputCompStream::available( ) +sal_Int32 SAL_CALL OInputCompStream::available( ) throw ( io::NotConnectedException, io::IOException, uno::RuntimeException ) @@ -217,7 +217,7 @@ sal_Int32 SAL_CALL OInputCompStream::available( ) } //----------------------------------------------- -void SAL_CALL OInputCompStream::closeInput( ) +void SAL_CALL OInputCompStream::closeInput( ) throw ( io::NotConnectedException, io::IOException, uno::RuntimeException ) @@ -449,7 +449,7 @@ uno::Sequence< beans::StringPair > SAL_CALL OInputCompStream::getRelationshipByI return aSeq[nInd1]; break; } - + throw container::NoSuchElementException(); } @@ -679,7 +679,7 @@ uno::Any SAL_CALL OInputCompStream::getPropertyValue( const ::rtl::OUString& aPr //----------------------------------------------- -void SAL_CALL OInputCompStream::addPropertyChangeListener( +void SAL_CALL OInputCompStream::addPropertyChangeListener( const ::rtl::OUString& /*aPropertyName*/, const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/ ) throw ( beans::UnknownPropertyException, diff --git a/package/source/xstor/ocompinstream.hxx b/package/source/xstor/ocompinstream.hxx index 98bafe333efb..c585f18fc4bb 100644 --- a/package/source/xstor/ocompinstream.hxx +++ b/package/source/xstor/ocompinstream.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -78,19 +78,19 @@ public: void InternalDispose(); // XInterface - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType ) + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType ) throw( ::com::sun::star::uno::RuntimeException ); // XInputStream - virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) + virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) + virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) + virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL available( ) + virtual sal_Int32 SAL_CALL available( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL closeInput( ) + virtual void SAL_CALL closeInput( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); //XStream diff --git a/package/source/xstor/ohierarchyholder.cxx b/package/source/xstor/ohierarchyholder.cxx index d36fd2d23895..6f0b3c5ec883 100644 --- a/package/source/xstor/ohierarchyholder.cxx +++ b/package/source/xstor/ohierarchyholder.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -276,7 +276,7 @@ void SAL_CALL OHierarchyElement_Impl::disposing( const lang::EventObject& Source throw ( uno::RuntimeException ) { uno::Sequence< embed::XStorage > aStoragesToCommit; - + try { ::osl::ClearableMutexGuard aGuard( m_aMutex ); diff --git a/package/source/xstor/ohierarchyholder.hxx b/package/source/xstor/ohierarchyholder.hxx index cc6fb1e211d9..6fff34c17f75 100644 --- a/package/source/xstor/ohierarchyholder.hxx +++ b/package/source/xstor/ohierarchyholder.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/package/source/xstor/oseekinstream.cxx b/package/source/xstor/oseekinstream.cxx index 0c8ee1527b0d..229bba9ebb7f 100644 --- a/package/source/xstor/oseekinstream.cxx +++ b/package/source/xstor/oseekinstream.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -92,7 +92,7 @@ uno::Any SAL_CALL OInputSeekStream::queryInterface( const uno::Type& rType ) throw( uno::RuntimeException ) { // Attention: - // Don't use mutex or guard in this method!!! Is a method of XInterface. + // Don't use mutex or guard in this method!!! Is a method of XInterface. uno::Any aReturn( ::cppu::queryInterface( rType, static_cast< io::XSeekable* >( this ) ) ); @@ -140,7 +140,7 @@ void SAL_CALL OInputSeekStream::seek( sal_Int64 location ) } sal_Int64 SAL_CALL OInputSeekStream::getPosition() - throw ( io::IOException, + throw ( io::IOException, uno::RuntimeException) { ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); diff --git a/package/source/xstor/oseekinstream.hxx b/package/source/xstor/oseekinstream.hxx index 8203be6ec8b9..b605d25e8a8d 100644 --- a/package/source/xstor/oseekinstream.hxx +++ b/package/source/xstor/oseekinstream.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx index 7e45f6574355..b68162eeec73 100644 --- a/package/source/xstor/owriteablestream.cxx +++ b/package/source/xstor/owriteablestream.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -178,8 +178,8 @@ sal_Bool KillFile( const ::rtl::OUString& aURL, const uno::Reference< lang::XMul try { - uno::Reference < ucb::XSimpleFileAccess > xAccess( - xFactory->createInstance ( + uno::Reference < ucb::XSimpleFileAccess > xAccess( + xFactory->createInstance ( ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY ); @@ -205,7 +205,7 @@ const sal_Int32 n_ConstBufferSize = 32000; { ::rtl::OUString aTempURL; - uno::Reference < beans::XPropertySet > xTempFile( + uno::Reference < beans::XPropertySet > xTempFile( xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.io.TempFile" ) ), uno::UNO_QUERY ); @@ -222,7 +222,7 @@ const sal_Int32 n_ConstBufferSize = 32000; ::package::StaticAddLog( aException.Message ); ::package::StaticAddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Quiet exception" ) ) ); } - + if ( !aTempURL.getLength() ) throw uno::RuntimeException(); // TODO: can not create tempfile @@ -352,9 +352,9 @@ void OWriteStream_Impl::InsertIntoPackageFolder( const ::rtl::OUString& aName, uno::Reference< lang::XUnoTunnel > xTunnel( m_xPackageStream, uno::UNO_QUERY ); if ( !xTunnel.is() ) throw uno::RuntimeException(); // TODO - + xParentPackageFolder->insertByName( aName, uno::makeAny( xTunnel ) ); - + m_bFlushed = sal_False; m_bHasInsertedStreamOptimization = sal_False; } @@ -478,17 +478,17 @@ void OWriteStream_Impl::DisposeWrappers() { try { m_pAntiImpl->dispose(); - } + } catch ( uno::RuntimeException& aRuntimeException ) { AddLog( aRuntimeException.Message ); AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Quiet exception" ) ) ); } - + m_pAntiImpl = NULL; } m_pParent = NULL; - + if ( !m_aInputStreamsList.empty() ) { for ( InputStreamsList_Impl::iterator pStreamIter = m_aInputStreamsList.begin(); @@ -510,7 +510,7 @@ uno::Reference< lang::XMultiServiceFactory > OWriteStream_Impl::GetServiceFactor { if ( m_xFactory.is() ) return m_xFactory; - + return ::comphelper::getProcessServiceFactory(); } @@ -524,11 +524,11 @@ uno::Reference< lang::XMultiServiceFactory > OWriteStream_Impl::GetServiceFactor try { if ( aTempURL && xStream.is() ) { - uno::Reference < ucb::XSimpleFileAccess > xTempAccess( - GetServiceFactory()->createInstance ( + uno::Reference < ucb::XSimpleFileAccess > xTempAccess( + GetServiceFactory()->createInstance ( ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY ); - + if ( !xTempAccess.is() ) throw uno::RuntimeException(); // TODO: @@ -538,7 +538,7 @@ uno::Reference< lang::XMultiServiceFactory > OWriteStream_Impl::GetServiceFactor // the current position of the original stream should be still OK, copy further ::comphelper::OStorageHelper::CopyInputToOutput( xStream, xTempOutStream ); xTempOutStream->closeOutput(); - xTempOutStream = uno::Reference< io::XOutputStream >(); + xTempOutStream = uno::Reference< io::XOutputStream >(); } else throw io::IOException(); // TODO: @@ -577,7 +577,7 @@ uno::Reference< lang::XMultiServiceFactory > OWriteStream_Impl::GetServiceFactor if ( !m_xCacheStream.is() && !m_aTempURL.getLength() ) { uno::Reference< io::XInputStream > xOrigStream = m_xPackageStream->getDataStream(); - if ( !xOrigStream.is() ) + if ( !xOrigStream.is() ) { // in case of new inserted package stream it is possible that input stream still was not set uno::Reference< io::XStream > xCacheStream = CreateMemoryStream( GetServiceFactory() ); @@ -599,7 +599,7 @@ uno::Reference< lang::XMultiServiceFactory > OWriteStream_Impl::GetServiceFactor OSL_ENSURE( xCacheStream.is(), "If the stream can not be created an exception must be thrown!\n" ); if ( nRead ) - { + { uno::Reference< io::XOutputStream > xOutStream( xCacheStream->getOutputStream(), uno::UNO_SET_THROW ); xOutStream->writeBytes( aData ); } @@ -614,11 +614,11 @@ uno::Reference< lang::XMultiServiceFactory > OWriteStream_Impl::GetServiceFactor try { if ( m_aTempURL.getLength() ) { - uno::Reference < ucb::XSimpleFileAccess > xTempAccess( - GetServiceFactory()->createInstance ( + uno::Reference < ucb::XSimpleFileAccess > xTempAccess( + GetServiceFactory()->createInstance ( ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY ); - + if ( !xTempAccess.is() ) throw uno::RuntimeException(); // TODO: @@ -632,7 +632,7 @@ uno::Reference< lang::XMultiServiceFactory > OWriteStream_Impl::GetServiceFactor // the current position of the original stream should be still OK, copy further ::comphelper::OStorageHelper::CopyInputToOutput( xOrigStream, xTempOutStream ); xTempOutStream->closeOutput(); - xTempOutStream = uno::Reference< io::XOutputStream >(); + xTempOutStream = uno::Reference< io::XOutputStream >(); } else throw io::IOException(); // TODO: @@ -670,8 +670,8 @@ uno::Reference< io::XStream > OWriteStream_Impl::GetTempFileAsStream() if ( m_aTempURL.getLength() ) { // the temporary file is not used if the cache is used - uno::Reference < ucb::XSimpleFileAccess > xTempAccess( - GetServiceFactory()->createInstance ( + uno::Reference < ucb::XSimpleFileAccess > xTempAccess( + GetServiceFactory()->createInstance ( ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY ); @@ -715,8 +715,8 @@ uno::Reference< io::XInputStream > OWriteStream_Impl::GetTempFileAsInputStream() if ( m_aTempURL.getLength() ) { // the temporary file is not used if the cache is used - uno::Reference < ucb::XSimpleFileAccess > xTempAccess( - GetServiceFactory()->createInstance ( + uno::Reference < ucb::XSimpleFileAccess > xTempAccess( + GetServiceFactory()->createInstance ( ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY ); @@ -755,7 +755,7 @@ void OWriteStream_Impl::InsertStreamDirectly( const uno::Reference< io::XInputSt { ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ; - // this call can be made only during parent storage commit + // this call can be made only during parent storage commit // the parent storage is responsible for the correct handling // of deleted and renamed contents @@ -847,7 +847,7 @@ void OWriteStream_Impl::Commit() uno::Reference< packages::XDataSinkEncrSupport > xNewPackageStream; uno::Sequence< uno::Any > aSeq( 1 ); - aSeq[0] <<= sal_False; + aSeq[0] <<= sal_False; if ( m_xCacheStream.is() ) { @@ -960,7 +960,7 @@ void OWriteStream_Impl::Revert() m_xCacheStream = uno::Reference< io::XStream >(); m_xCacheSeek = uno::Reference< io::XSeekable >(); } - + if ( m_aTempURL.getLength() ) { KillFile( m_aTempURL, GetServiceFactory() ); @@ -1054,10 +1054,10 @@ uno::Sequence< beans::PropertyValue > OWriteStream_Impl::InsertOwnProps( return aResult; } - + //----------------------------------------------- sal_Bool OWriteStream_Impl::IsTransacted() -{ +{ ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ; return ( m_pAntiImpl && m_pAntiImpl->m_bTransacted ); } @@ -1077,7 +1077,7 @@ void OWriteStream_Impl::ReadRelInfoIfNecessary() m_xOrigRelInfoStream, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels/*.rels" ) ), m_xFactory ); - + // in case of success the stream must be thrown away, that means that the OrigRelInfo is initialized // the reason for this is that the original stream might not be seekable ( at the same time the new // provided stream must be seekable ), so it must be read only once @@ -1112,7 +1112,7 @@ void OWriteStream_Impl::ReadRelInfoIfNecessary() } } } - + //----------------------------------------------- uno::Sequence< beans::PropertyValue > OWriteStream_Impl::ReadPackageStreamProperties() { @@ -1135,7 +1135,7 @@ uno::Sequence< beans::PropertyValue > OWriteStream_Impl::ReadPackageStreamProper aResult[2].Name = ::rtl::OUString::createFromAscii("Size"); if ( m_nStorageType == embed::StorageFormats::PACKAGE ) - aResult[3].Name = ::rtl::OUString::createFromAscii("Encrypted"); + aResult[3].Name = ::rtl::OUString::createFromAscii("Encrypted"); } else { @@ -1208,7 +1208,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > OWriteStream_Impl::GetAllRel return uno::Sequence< uno::Sequence< beans::StringPair > >(); ReadRelInfoIfNecessary(); - + if ( m_nRelInfoStatus == RELINFO_READ ) return m_aOrigRelInfo; else if ( m_nRelInfoStatus == RELINFO_CHANGED_STREAM_READ || m_nRelInfoStatus == RELINFO_CHANGED ) @@ -1391,7 +1391,7 @@ uno::Reference< io::XStream > OWriteStream_Impl::GetStream_Impl( sal_Int32 nStre uno::Reference< io::XStream > xCompStream( static_cast< ::cppu::OWeakObject* >( pStream ), uno::UNO_QUERY ); - OSL_ENSURE( xCompStream.is(), + OSL_ENSURE( xCompStream.is(), "OInputCompStream MUST provide XStream interfaces!\n" ); m_aInputStreamsList.push_back( pStream ); @@ -1416,7 +1416,7 @@ uno::Reference< io::XStream > OWriteStream_Impl::GetStream_Impl( sal_Int32 nStre uno::Reference< io::XStream > xSeekStream( static_cast< ::cppu::OWeakObject* >( pStream ), uno::UNO_QUERY ); - OSL_ENSURE( xSeekStream.is(), + OSL_ENSURE( xSeekStream.is(), "OInputSeekStream MUST provide XStream interfaces!\n" ); m_aInputStreamsList.push_back( pStream ); @@ -1491,7 +1491,7 @@ uno::Reference< io::XInputStream > OWriteStream_Impl::GetPlainRawInStream() // this method is used only internally, this stream object should not go outside of this implementation // if ( m_pAntiImpl ) - // throw io::IOException(); // TODO: + // throw io::IOException(); // TODO: return m_xPackageStream->getPlainRawStream(); } @@ -1537,7 +1537,7 @@ void OWriteStream_Impl::CreateReadonlyCopyBasedOnData( const uno::Reference< io: { uno::Reference < io::XStream > xTempFile; if ( !xTargetStream.is() ) - xTempFile = uno::Reference < io::XStream >( + xTempFile = uno::Reference < io::XStream >( m_xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.io.TempFile" ) ), uno::UNO_QUERY ); else @@ -1546,7 +1546,7 @@ void OWriteStream_Impl::CreateReadonlyCopyBasedOnData( const uno::Reference< io: uno::Reference < io::XSeekable > xTempSeek( xTempFile, uno::UNO_QUERY ); if ( !xTempSeek.is() ) throw uno::RuntimeException(); // TODO - + uno::Reference < io::XOutputStream > xTempOut = xTempFile->getOutputStream(); if ( !xTempOut.is() ) throw uno::RuntimeException(); @@ -1577,7 +1577,7 @@ void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTar OSL_ENSURE( m_xPackageStream.is(), "The source stream for copying is incomplete!\n" ); if ( !m_xPackageStream.is() ) throw uno::RuntimeException(); - + uno::Reference< io::XInputStream > xDataToCopy; if ( IsEncrypted() ) { @@ -1725,7 +1725,7 @@ void OWriteStream_Impl::CommitStreamRelInfo( const uno::Reference< embed::XStora aNewRelStreamName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".rels" ) ); sal_Bool bRenamed = !aOrigRelStreamName.equals( aNewRelStreamName ); - if ( m_nRelInfoStatus == RELINFO_CHANGED + if ( m_nRelInfoStatus == RELINFO_CHANGED || m_nRelInfoStatus == RELINFO_CHANGED_STREAM_READ || m_nRelInfoStatus == RELINFO_CHANGED_STREAM ) { @@ -1771,7 +1771,7 @@ void OWriteStream_Impl::CommitStreamRelInfo( const uno::Reference< embed::XStora xSeek->seek( 0 ); ::comphelper::OStorageHelper::CopyInputToOutput( m_xNewRelInfoStream, xOutputStream ); xSeek->seek( 0 ); - + // set the mediatype uno::Reference< beans::XPropertySet > xPropSet( xRelsStream, uno::UNO_QUERY_THROW ); xPropSet->setPropertyValue( @@ -1822,7 +1822,7 @@ OWriteStream::OWriteStream( OWriteStream_Impl* pImpl, sal_Bool bTransacted ) if ( !m_pImpl || !m_pImpl->m_rMutexRef.Is() ) throw uno::RuntimeException(); // just a disaster - + m_pData = new WSInternalData_Impl( pImpl->m_rMutexRef, m_pImpl->m_nStorageType ); } @@ -1839,7 +1839,7 @@ OWriteStream::OWriteStream( OWriteStream_Impl* pImpl, uno::Reference< io::XStrea if ( !m_pImpl || !m_pImpl->m_rMutexRef.Is() ) throw uno::RuntimeException(); // just a disaster - + m_pData = new WSInternalData_Impl( pImpl->m_rMutexRef, m_pImpl->m_nStorageType ); if ( xStream.is() ) @@ -1957,7 +1957,7 @@ void OWriteStream::CopyToStreamInternally_Impl( const uno::Reference< io::XStrea // if it fails the stream will become invalid try { m_xSeekable->seek( nCurPos ); - } + } catch ( uno::Exception& aException ) { m_pImpl->AddLog( aException.Message ); @@ -1967,7 +1967,7 @@ void OWriteStream::CopyToStreamInternally_Impl( const uno::Reference< io::XStrea OSL_ENSURE( sal_False, "The stream become invalid during copiing!\n" ); throw uno::RuntimeException(); } - + if ( bThrown ) throw eThrown; @@ -2012,31 +2012,31 @@ uno::Any SAL_CALL OWriteStream::queryInterface( const uno::Type& rType ) // common interfaces aReturn <<= ::cppu::queryInterface - ( rType - , static_cast<lang::XTypeProvider*> ( this ) - , static_cast<io::XInputStream*> ( this ) - , static_cast<io::XOutputStream*> ( this ) - , static_cast<io::XStream*> ( this ) - , static_cast<embed::XExtendedStorageStream*> ( this ) - , static_cast<io::XSeekable*> ( this ) - , static_cast<io::XTruncate*> ( this ) - , static_cast<lang::XComponent*> ( this ) - , static_cast<beans::XPropertySet*> ( this ) ); - + ( rType + , static_cast<lang::XTypeProvider*> ( this ) + , static_cast<io::XInputStream*> ( this ) + , static_cast<io::XOutputStream*> ( this ) + , static_cast<io::XStream*> ( this ) + , static_cast<embed::XExtendedStorageStream*> ( this ) + , static_cast<io::XSeekable*> ( this ) + , static_cast<io::XTruncate*> ( this ) + , static_cast<lang::XComponent*> ( this ) + , static_cast<beans::XPropertySet*> ( this ) ); + if ( aReturn.hasValue() == sal_True ) return aReturn ; if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE ) { aReturn <<= ::cppu::queryInterface - ( rType - , static_cast<embed::XEncryptionProtectedSource*> ( this ) ); + ( rType + , static_cast<embed::XEncryptionProtectedSource*> ( this ) ); } else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { aReturn <<= ::cppu::queryInterface - ( rType - , static_cast<embed::XRelationshipAccess*> ( this ) ); + ( rType + , static_cast<embed::XRelationshipAccess*> ( this ) ); } if ( aReturn.hasValue() == sal_True ) @@ -2045,9 +2045,9 @@ uno::Any SAL_CALL OWriteStream::queryInterface( const uno::Type& rType ) if ( m_bTransacted ) { aReturn <<= ::cppu::queryInterface - ( rType - , static_cast<embed::XTransactedObject*> ( this ) - , static_cast<embed::XTransactionBroadcaster*> ( this ) ); + ( rType + , static_cast<embed::XTransactedObject*> ( this ) + , static_cast<embed::XTransactionBroadcaster*> ( this ) ); if ( aReturn.hasValue() == sal_True ) return aReturn ; @@ -2083,49 +2083,49 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes() if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE ) { m_pData->m_pTypeCollection = new ::cppu::OTypeCollection - ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XInputStream >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XOutputStream >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XStream >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XSeekable >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XTruncate >* )NULL ) - , ::getCppuType( ( const uno::Reference< lang::XComponent >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XEncryptionProtectedSource >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XExtendedStorageStream >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XTransactedObject >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XTransactionBroadcaster >* )NULL ) - , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); + ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XInputStream >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XOutputStream >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XStream >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XSeekable >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XTruncate >* )NULL ) + , ::getCppuType( ( const uno::Reference< lang::XComponent >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XEncryptionProtectedSource >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XExtendedStorageStream >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XTransactedObject >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XTransactionBroadcaster >* )NULL ) + , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); } else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { m_pData->m_pTypeCollection = new ::cppu::OTypeCollection - ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XInputStream >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XOutputStream >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XStream >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XSeekable >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XTruncate >* )NULL ) - , ::getCppuType( ( const uno::Reference< lang::XComponent >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XRelationshipAccess >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XExtendedStorageStream >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XTransactedObject >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XTransactionBroadcaster >* )NULL ) - , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); + ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XInputStream >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XOutputStream >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XStream >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XSeekable >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XTruncate >* )NULL ) + , ::getCppuType( ( const uno::Reference< lang::XComponent >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XRelationshipAccess >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XExtendedStorageStream >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XTransactedObject >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XTransactionBroadcaster >* )NULL ) + , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); } else // if ( m_pData->m_nStorageType == embed::StorageFormats::ZIP ) { m_pData->m_pTypeCollection = new ::cppu::OTypeCollection - ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XInputStream >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XOutputStream >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XStream >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XSeekable >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XTruncate >* )NULL ) - , ::getCppuType( ( const uno::Reference< lang::XComponent >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XExtendedStorageStream >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XTransactedObject >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XTransactionBroadcaster >* )NULL ) - , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); + ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XInputStream >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XOutputStream >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XStream >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XSeekable >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XTruncate >* )NULL ) + , ::getCppuType( ( const uno::Reference< lang::XComponent >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XExtendedStorageStream >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XTransactedObject >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XTransactionBroadcaster >* )NULL ) + , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); } } else @@ -2133,40 +2133,40 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes() if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE ) { m_pData->m_pTypeCollection = new ::cppu::OTypeCollection - ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XInputStream >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XOutputStream >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XStream >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XSeekable >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XTruncate >* )NULL ) - , ::getCppuType( ( const uno::Reference< lang::XComponent >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XEncryptionProtectedSource >* )NULL ) - , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); + ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XInputStream >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XOutputStream >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XStream >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XSeekable >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XTruncate >* )NULL ) + , ::getCppuType( ( const uno::Reference< lang::XComponent >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XEncryptionProtectedSource >* )NULL ) + , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); } else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { m_pData->m_pTypeCollection = new ::cppu::OTypeCollection - ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XInputStream >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XOutputStream >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XStream >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XSeekable >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XTruncate >* )NULL ) - , ::getCppuType( ( const uno::Reference< lang::XComponent >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XRelationshipAccess >* )NULL ) - , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); + ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XInputStream >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XOutputStream >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XStream >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XSeekable >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XTruncate >* )NULL ) + , ::getCppuType( ( const uno::Reference< lang::XComponent >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XRelationshipAccess >* )NULL ) + , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); } else // if ( m_pData->m_nStorageType == embed::StorageFormats::ZIP ) { m_pData->m_pTypeCollection = new ::cppu::OTypeCollection - ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XInputStream >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XOutputStream >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XStream >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XSeekable >* )NULL ) - , ::getCppuType( ( const uno::Reference< io::XTruncate >* )NULL ) - , ::getCppuType( ( const uno::Reference< lang::XComponent >* )NULL ) - , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); + ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XInputStream >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XOutputStream >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XStream >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XSeekable >* )NULL ) + , ::getCppuType( ( const uno::Reference< io::XTruncate >* )NULL ) + , ::getCppuType( ( const uno::Reference< lang::XComponent >* )NULL ) + , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); } } } @@ -2186,7 +2186,7 @@ uno::Sequence< sal_Int8 > SAL_CALL OWriteStream::getImplementationId() } //----------------------------------------------- -sal_Int32 SAL_CALL OWriteStream::readBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) +sal_Int32 SAL_CALL OWriteStream::readBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw ( io::NotConnectedException, io::BufferSizeExceededException, io::IOException, @@ -2209,7 +2209,7 @@ sal_Int32 SAL_CALL OWriteStream::readBytes( uno::Sequence< sal_Int8 >& aData, sa } //----------------------------------------------- -sal_Int32 SAL_CALL OWriteStream::readSomeBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) +sal_Int32 SAL_CALL OWriteStream::readSomeBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) throw ( io::NotConnectedException, io::BufferSizeExceededException, io::IOException, @@ -2232,7 +2232,7 @@ sal_Int32 SAL_CALL OWriteStream::readSomeBytes( uno::Sequence< sal_Int8 >& aData } //----------------------------------------------- -void SAL_CALL OWriteStream::skipBytes( sal_Int32 nBytesToSkip ) +void SAL_CALL OWriteStream::skipBytes( sal_Int32 nBytesToSkip ) throw ( io::NotConnectedException, io::BufferSizeExceededException, io::IOException, @@ -2255,7 +2255,7 @@ void SAL_CALL OWriteStream::skipBytes( sal_Int32 nBytesToSkip ) } //----------------------------------------------- -sal_Int32 SAL_CALL OWriteStream::available( ) +sal_Int32 SAL_CALL OWriteStream::available( ) throw ( io::NotConnectedException, io::IOException, uno::RuntimeException ) @@ -2278,7 +2278,7 @@ sal_Int32 SAL_CALL OWriteStream::available( ) } //----------------------------------------------- -void SAL_CALL OWriteStream::closeInput( ) +void SAL_CALL OWriteStream::closeInput( ) throw ( io::NotConnectedException, io::IOException, uno::RuntimeException ) @@ -2412,7 +2412,7 @@ void SAL_CALL OWriteStream::writeBytes( const uno::Sequence< sal_Int8 >& aData ) } //----------------------------------------------- -void SAL_CALL OWriteStream::flush() +void SAL_CALL OWriteStream::flush() throw ( io::NotConnectedException, io::BufferSizeExceededException, io::IOException, @@ -2445,7 +2445,7 @@ void SAL_CALL OWriteStream::flush() void OWriteStream::CloseOutput_Impl() { // all the checks must be done in calling method - + m_xOutStream->closeOutput(); m_xOutStream = uno::Reference< io::XOutputStream >(); @@ -2483,7 +2483,7 @@ void SAL_CALL OWriteStream::closeOutput() if ( !m_xOutStream.is() ) throw io::NotConnectedException(); - + CloseOutput_Impl(); if ( m_bInStreamDisconnected || !m_xInStream.is() ) @@ -2514,7 +2514,7 @@ void SAL_CALL OWriteStream::seek( sal_Int64 location ) //----------------------------------------------- sal_Int64 SAL_CALL OWriteStream::getPosition() - throw ( io::IOException, + throw ( io::IOException, uno::RuntimeException) { ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); @@ -2838,7 +2838,7 @@ uno::Sequence< beans::StringPair > SAL_CALL OWriteStream::getRelationshipByID( return aSeq[nInd1]; break; } - + throw container::NoSuchElementException(); } @@ -3043,7 +3043,7 @@ void SAL_CALL OWriteStream::insertRelationships( const uno::Sequence< uno::Sequ nIndSourceSame = nIndSource1; } - + break; } } @@ -3173,7 +3173,7 @@ void SAL_CALL OWriteStream::setPropertyValue( const ::rtl::OUString& aPropertyNa && aPropertyName.equalsAscii( "UseCommonStoragePasswordEncryption" ) ) { sal_Bool bUseCommonPass = sal_False; - if ( aValue >>= bUseCommonPass ) + if ( aValue >>= bUseCommonPass ) { if ( m_bInitOnDemand && m_pImpl->m_bHasInsertedStreamOptimization ) { @@ -3300,7 +3300,7 @@ uno::Any SAL_CALL OWriteStream::getPropertyValue( const ::rtl::OUString& aProp ) //----------------------------------------------- -void SAL_CALL OWriteStream::addPropertyChangeListener( +void SAL_CALL OWriteStream::addPropertyChangeListener( const ::rtl::OUString& /*aPropertyName*/, const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/ ) throw ( beans::UnknownPropertyException, @@ -3379,7 +3379,7 @@ void SAL_CALL OWriteStream::removeVetoableChangeListener( } //____________________________________________________________________________________________________ -// XTransactedObject +// XTransactedObject //____________________________________________________________________________________________________ //----------------------------------------------- @@ -3456,7 +3456,7 @@ void SAL_CALL OWriteStream::commit() throw lang::DisposedException(); } - m_pImpl->Commit(); + m_pImpl->Commit(); // when the storage is commited the parent is modified ModifyParentUnlockMutex_Impl( aGuard ); @@ -3560,7 +3560,7 @@ void SAL_CALL OWriteStream::revert() } //____________________________________________________________________________________________________ -// XTransactionBroadcaster +// XTransactionBroadcaster //____________________________________________________________________________________________________ //----------------------------------------------- diff --git a/package/source/xstor/owriteablestream.hxx b/package/source/xstor/owriteablestream.hxx index d3c15f00d44c..1247a92408b7 100644 --- a/package/source/xstor/owriteablestream.hxx +++ b/package/source/xstor/owriteablestream.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -85,7 +85,7 @@ struct WSInternalData_Impl ::cppu::OTypeCollection* m_pTypeCollection; ::cppu::OMultiTypeInterfaceContainerHelper m_aListenersContainer; // list of listeners sal_Int32 m_nStorageType; - + // the mutex reference MUST NOT be empty WSInternalData_Impl( const SotMutexHolderRef rMutexRef, sal_Int32 nStorageType ) : m_rSharedMutexRef( rMutexRef ) @@ -106,12 +106,12 @@ struct OWriteStream_Impl : public PreCreationStruct friend class OWriteStream; friend class OInputCompStream; - OWriteStream* m_pAntiImpl; + OWriteStream* m_pAntiImpl; ::rtl::OUString m_aTempURL; - + ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > m_xCacheStream; ::com::sun::star::uno::Reference< ::com::sun::star::io::XSeekable > m_xCacheSeek; - + InputStreamsList_Impl m_aInputStreamsList; sal_Bool m_bHasDataToFlush; // only modified elements will be sent to the original content @@ -131,7 +131,7 @@ struct OWriteStream_Impl : public PreCreationStruct sal_Bool m_bUseCommonPass; sal_Bool m_bHasCachedPassword; ::rtl::OUString m_aPass; - + sal_Bool m_bCompressedSetExplicit; ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > m_xPackage; @@ -144,7 +144,7 @@ struct OWriteStream_Impl : public PreCreationStruct ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xOrigRelInfoStream; ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > m_aOrigRelInfo; sal_Bool m_bOrigRelInfoBroken; - + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > m_aNewRelInfo; ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xNewRelInfoStream; sal_Int16 m_nRelInfoStatus; @@ -156,8 +156,8 @@ private: ::rtl::OUString GetFilledTempFileIfNo( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xStream ); ::rtl::OUString FillTempGetFileName(); - ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > GetTempFileAsStream(); - ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetTempFileAsInputStream(); + ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > GetTempFileAsStream(); + ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetTempFileAsInputStream(); ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > GetStream_Impl( sal_Int32 nStreamMode, sal_Bool bHierarchyAccess ); @@ -182,7 +182,7 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >() ); ~OWriteStream_Impl(); - + void CleanCacheStream(); void AddLog( const ::rtl::OUString& aMessage ); @@ -217,7 +217,7 @@ public: void Revert(); void Free( sal_Bool bMust ); // allows to try to disconnect from the temporary stream - // in case bMust is set to sal_True the method + // in case bMust is set to sal_True the method // will throw exception in case the file is still busy void SetModified(); // can be done only by parent storage after renaming @@ -315,26 +315,26 @@ public: void DeInit(); // XInterface - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType ) + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType ) throw( ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL acquire() throw(); virtual void SAL_CALL release() throw(); - // XTypeProvider + // XTypeProvider virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw( ::com::sun::star::uno::RuntimeException ); virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw( ::com::sun::star::uno::RuntimeException ); // XInputStream - virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) + virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) + virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL available( ) + virtual sal_Int32 SAL_CALL available( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL closeInput( ) + virtual void SAL_CALL closeInput( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); // XOutputStream diff --git a/package/source/xstor/register.cxx b/package/source/xstor/register.cxx index b398b61e7f5e..d81c5b4a80b8 100644 --- a/package/source/xstor/register.cxx +++ b/package/source/xstor/register.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -49,7 +49,7 @@ void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTyp void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) { void * pRet = 0; - + ::rtl::OUString aImplName( ::rtl::OUString::createFromAscii( pImplName ) ); uno::Reference< lang::XSingleServiceFactory > xFactory; @@ -60,13 +60,13 @@ void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServic OStorageFactory::impl_staticCreateSelfInstance, OStorageFactory::impl_staticGetSupportedServiceNames() ); } - + if ( xFactory.is() ) { xFactory->acquire(); pRet = xFactory.get(); } - + return pRet; } @@ -80,7 +80,7 @@ sal_Bool SAL_CALL component_writeInfo( void * /*pServiceManager*/, void * pRegis uno::Reference< registry::XRegistryKey > xNewKey; - xNewKey = xKey->createKey( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + + xNewKey = xKey->createKey( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + OStorageFactory::impl_staticGetImplementationName() + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) ); diff --git a/package/source/xstor/selfterminatefilestream.cxx b/package/source/xstor/selfterminatefilestream.cxx index b69170a57791..2c6f177e6856 100644 --- a/package/source/xstor/selfterminatefilestream.cxx +++ b/package/source/xstor/selfterminatefilestream.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -80,7 +80,7 @@ void OSelfTerminateFileStream::CloseStreamDeleteFile() } //----------------------------------------------- -sal_Int32 SAL_CALL OSelfTerminateFileStream::readBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) +sal_Int32 SAL_CALL OSelfTerminateFileStream::readBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw ( io::NotConnectedException, io::BufferSizeExceededException, io::IOException, @@ -90,7 +90,7 @@ sal_Int32 SAL_CALL OSelfTerminateFileStream::readBytes( uno::Sequence< sal_Int8 } //----------------------------------------------- -sal_Int32 SAL_CALL OSelfTerminateFileStream::readSomeBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) +sal_Int32 SAL_CALL OSelfTerminateFileStream::readSomeBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) throw ( io::NotConnectedException, io::BufferSizeExceededException, io::IOException, @@ -100,7 +100,7 @@ sal_Int32 SAL_CALL OSelfTerminateFileStream::readSomeBytes( uno::Sequence< sal_I } //----------------------------------------------- -void SAL_CALL OSelfTerminateFileStream::skipBytes( sal_Int32 nBytesToSkip ) +void SAL_CALL OSelfTerminateFileStream::skipBytes( sal_Int32 nBytesToSkip ) throw ( io::NotConnectedException, io::BufferSizeExceededException, io::IOException, @@ -110,7 +110,7 @@ void SAL_CALL OSelfTerminateFileStream::skipBytes( sal_Int32 nBytesToSkip ) } //----------------------------------------------- -sal_Int32 SAL_CALL OSelfTerminateFileStream::available( ) +sal_Int32 SAL_CALL OSelfTerminateFileStream::available( ) throw ( io::NotConnectedException, io::IOException, uno::RuntimeException ) @@ -119,7 +119,7 @@ sal_Int32 SAL_CALL OSelfTerminateFileStream::available( ) } //----------------------------------------------- -void SAL_CALL OSelfTerminateFileStream::closeInput( ) +void SAL_CALL OSelfTerminateFileStream::closeInput( ) throw ( io::NotConnectedException, io::IOException, uno::RuntimeException ) @@ -138,7 +138,7 @@ void SAL_CALL OSelfTerminateFileStream::seek( sal_Int64 location ) //----------------------------------------------- sal_Int64 SAL_CALL OSelfTerminateFileStream::getPosition() - throw ( io::IOException, + throw ( io::IOException, uno::RuntimeException) { return m_xSeekable->getPosition(); diff --git a/package/source/xstor/selfterminatefilestream.hxx b/package/source/xstor/selfterminatefilestream.hxx index 16bc65c5d6cd..a9d28f0a6f85 100644 --- a/package/source/xstor/selfterminatefilestream.hxx +++ b/package/source/xstor/selfterminatefilestream.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -55,15 +55,15 @@ public: void CloseStreamDeleteFile(); // XInputStream - virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) + virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) + virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) + virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL available() + virtual sal_Int32 SAL_CALL available() throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL closeInput() + virtual void SAL_CALL closeInput() throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); //XSeekable diff --git a/package/source/xstor/switchpersistencestream.cxx b/package/source/xstor/switchpersistencestream.cxx index 84dc04e0ed95..c3121a9cfa85 100644 --- a/package/source/xstor/switchpersistencestream.cxx +++ b/package/source/xstor/switchpersistencestream.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -132,7 +132,7 @@ void SwitchablePersistenceStream::SwitchPersistenceTo( const uno::Reference< io: } xNewSeekable->seek( nPos ); - + CloseAll_Impl(); m_pStreamData = new SPStreamData_Impl( m_xFactory, sal_False, @@ -184,7 +184,7 @@ void SwitchablePersistenceStream::CopyAndSwitchPersistenceTo( const uno::Referen if ( !xTargetStream.is() ) { - xTargetStream = uno::Reference < io::XStream >( + xTargetStream = uno::Reference < io::XStream >( m_xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.io.TempFile" ) ), uno::UNO_QUERY_THROW ); diff --git a/package/source/xstor/switchpersistencestream.hxx b/package/source/xstor/switchpersistencestream.hxx index a1f47b4063db..730aca1bff35 100644 --- a/package/source/xstor/switchpersistencestream.hxx +++ b/package/source/xstor/switchpersistencestream.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -61,7 +61,7 @@ class SwitchablePersistenceStream ::com::sun::star::io::XSeekable, ::com::sun::star::io::XAsyncOutputMonitor > { - ::osl::Mutex m_aMutex; + ::osl::Mutex m_aMutex; const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory; diff --git a/package/source/xstor/xfactory.cxx b/package/source/xstor/xfactory.cxx index 160162e47267..2e1656b437c8 100644 --- a/package/source/xstor/xfactory.cxx +++ b/package/source/xstor/xfactory.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -92,15 +92,15 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstance() uno::RuntimeException ) { // TODO: reimplement TempStream service to support XStream interface - uno::Reference < io::XStream > xTempStream( + uno::Reference < io::XStream > xTempStream( m_xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.io.TempFile" ) ), uno::UNO_QUERY ); if ( !xTempStream.is() ) throw uno::RuntimeException(); // TODO: - return uno::Reference< uno::XInterface >( - static_cast< OWeakObject* >( new OStorage( xTempStream, + return uno::Reference< uno::XInterface >( + static_cast< OWeakObject* >( new OStorage( xTempStream, embed::ElementModes::READWRITE, uno::Sequence< beans::PropertyValue >(), m_xFactory, @@ -164,8 +164,8 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr throw lang::IllegalArgumentException(); // TODO: } - uno::Reference < ::com::sun::star::ucb::XSimpleFileAccess > xTempAccess( - m_xFactory->createInstance ( + uno::Reference < ::com::sun::star::ucb::XSimpleFileAccess > xTempAccess( + m_xFactory->createInstance ( ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY ); @@ -186,9 +186,9 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr // retrieve mediadescriptor and set storage properties uno::Sequence< beans::PropertyValue > aDescr; uno::Sequence< beans::PropertyValue > aPropsToSet; - + sal_Int32 nStorageType = embed::StorageFormats::PACKAGE; - + if ( nArgNum >= 3 ) { if( aArguments[2] >>= aDescr ) @@ -268,7 +268,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr if ( !CheckPackageSignature_Impl( xInputStream, xSeekable ) ) throw io::IOException(); // TODO: this is not a package file - return uno::Reference< uno::XInterface >( + return uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( new OStorage( xInputStream, nStorageMode, aPropsToSet, m_xFactory, nStorageType ) ), uno::UNO_QUERY ); } @@ -288,7 +288,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr if ( !CheckPackageSignature_Impl( xStream->getInputStream(), xSeekable ) ) throw io::IOException(); // TODO: this is not a package file - return uno::Reference< uno::XInterface >( + return uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( new OStorage( xStream, nStorageMode, aPropsToSet, m_xFactory, nStorageType ) ), uno::UNO_QUERY ); } diff --git a/package/source/xstor/xfactory.hxx b/package/source/xstor/xfactory.hxx index 86dca8dc264c..0a6a5fad7f39 100644 --- a/package/source/xstor/xfactory.hxx +++ b/package/source/xstor/xfactory.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -56,7 +56,7 @@ public: static ::rtl::OUString SAL_CALL impl_staticGetImplementationName(); static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL - impl_staticCreateSelfInstance( + impl_staticCreateSelfInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ); diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index a99170749a0d..e45427e4858d 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -81,9 +81,9 @@ struct StorInternalData_Impl OChildDispListener_Impl* m_pSubElDispListener; WeakComponentList m_aOpenSubComponentsList; - + ::rtl::Reference< OHierarchyHolder_Impl > m_rHierarchyHolder; - + // the mutex reference MUST NOT be empty StorInternalData_Impl( const SotMutexHolderRef& rMutexRef, sal_Bool bRoot, sal_Int32 nStorageType, sal_Bool bReadOnlyWrap ) : m_rSharedMutexRef( rMutexRef ) @@ -194,7 +194,7 @@ SotElement_Impl::~SotElement_Impl() //----------------------------------------------- // most of properties are holt by the storage but are not used -OStorage_Impl::OStorage_Impl( uno::Reference< io::XInputStream > xInputStream, +OStorage_Impl::OStorage_Impl( uno::Reference< io::XInputStream > xInputStream, sal_Int32 nMode, uno::Sequence< beans::PropertyValue > xProperties, uno::Reference< lang::XMultiServiceFactory > xFactory, @@ -234,7 +234,7 @@ OStorage_Impl::OStorage_Impl( uno::Reference< io::XInputStream > xInputStream, //----------------------------------------------- // most of properties are holt by the storage but are not used -OStorage_Impl::OStorage_Impl( uno::Reference< io::XStream > xStream, +OStorage_Impl::OStorage_Impl( uno::Reference< io::XStream > xStream, sal_Int32 nMode, uno::Sequence< beans::PropertyValue > xProperties, uno::Reference< lang::XMultiServiceFactory > xFactory, @@ -276,7 +276,7 @@ OStorage_Impl::OStorage_Impl( uno::Reference< io::XStream > xStream, } //----------------------------------------------- -OStorage_Impl::OStorage_Impl( OStorage_Impl* pParent, +OStorage_Impl::OStorage_Impl( OStorage_Impl* pParent, sal_Int32 nMode, uno::Reference< container::XNameContainer > xPackageFolder, uno::Reference< lang::XSingleServiceFactory > xPackage, @@ -603,7 +603,7 @@ void OStorage_Impl::ReadRelInfoIfNecessary() xRelInfoStream, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels/.rels" ) ), m_xFactory ); - + m_nRelInfoStatus = RELINFO_READ; } else if ( m_nRelInfoStatus == RELINFO_CHANGED_STREAM ) @@ -764,16 +764,16 @@ void OStorage_Impl::CopyToStorage( const uno::Reference< embed::XStorage >& xDes } else if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { - + // TODO/LATER: currently the optimization is not active // uno::Reference< io::XInputStream > xRelInfoStream = GetRelInfoStreamForName( ::rtl::OUString() ); // own stream // if ( xRelInfoStream.is() ) // { - // // Relations info stream is a writeonly property, introduced only to optimyze copying - // // Should be used carefuly since no check for stream consistency is done, and the stream must not stay locked + // // Relations info stream is a writeonly property, introduced only to optimyze copying + // // Should be used carefuly since no check for stream consistency is done, and the stream must not stay locked // - // ::rtl::OUString aRelInfoString = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RelationsInfoStream" ) ); - // xPropSet->setPropertyValue( aRelInfoString, uno::makeAny( GetSeekableTempCopy( xRelInfoStream, m_xFactory ) ) ); + // ::rtl::OUString aRelInfoString = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RelationsInfoStream" ) ); + // xPropSet->setPropertyValue( aRelInfoString, uno::makeAny( GetSeekableTempCopy( xRelInfoStream, m_xFactory ) ) ); // } uno::Reference< embed::XRelationshipAccess > xRels( xDest, uno::UNO_QUERY ); @@ -865,9 +865,9 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement, // uno::Reference< io::XInputStream > xInStream = GetRelInfoStreamForName( ::rtl::OUString() ); // own rels stream // if ( xInStream.is() ) // { - // aStrProps.realloc( ++nNum ); - // aStrProps[nNum-1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RelationsInfoStream" ) ); - // aStrProps[nNum-1].Value <<= GetSeekableTempCopy( xInStream, m_xFactory ); + // aStrProps.realloc( ++nNum ); + // aStrProps[nNum-1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RelationsInfoStream" ) ); + // aStrProps[nNum-1].Value <<= GetSeekableTempCopy( xInStream, m_xFactory ); // } uno::Reference< embed::XRelationshipAccess > xRels( xDest, uno::UNO_QUERY ); @@ -891,7 +891,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement, { // for now get just nonseekable access to the stream // TODO/LATER: the raw stream can be used - + xInputToInsert = pElement->m_pStream->m_xPackageStream->getDataStream(); } @@ -1001,7 +1001,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > OStorage_Impl::GetAllRelatio return uno::Sequence< uno::Sequence< beans::StringPair > >(); ReadRelInfoIfNecessary(); - + if ( m_nRelInfoStatus == RELINFO_READ || m_nRelInfoStatus == RELINFO_CHANGED_STREAM_READ || m_nRelInfoStatus == RELINFO_CHANGED ) return m_aRelInfo; @@ -1027,7 +1027,7 @@ void OStorage_Impl::CopyLastCommitTo( const uno::Reference< embed::XStorage >& x m_nStorageType); // TODO/LATER: could use direct copying - aTempRepresent.CopyToStorage( xNewStor, sal_False ); + aTempRepresent.CopyToStorage( xNewStor, sal_False ); } //----------------------------------------------- @@ -1167,7 +1167,7 @@ void OStorage_Impl::Commit() // the renamed elements are not in new temporary storage if ( m_bCommited || m_bIsRoot ) xNewPackageFolder->removeByName( (*pElementIter)->m_aOriginalName ); - + (*pElementIter)->m_pStream->InsertIntoPackageFolder( (*pElementIter)->m_aName, xNewPackageFolder ); } else if ( !m_bCommited && !m_bIsRoot ) @@ -1733,7 +1733,7 @@ void OStorage_Impl::RemoveStreamRelInfo( const ::rtl::OUString& aOriginalName ) { ::rtl::OUString aRelStreamName = aOriginalName; aRelStreamName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".rels" ) ); - + if ( m_xRelStorage->hasByName( aRelStreamName ) ) m_xRelStorage->removeElement( aRelStreamName ); } @@ -1784,7 +1784,7 @@ void OStorage_Impl::CommitStreamRelInfo( SotElement_Impl* pStreamElement ) // Create new rels storage, this is commit scenario so it must be possible CreateRelStorage(); } - + pStreamElement->m_pStream->CommitStreamRelInfo( m_xRelStorage, pStreamElement->m_aOriginalName, pStreamElement->m_aName ); } } @@ -1825,7 +1825,7 @@ void OStorage_Impl::CommitRelInfo( const uno::Reference< container::XNameContain if ( m_nRelInfoStatus == RELINFO_BROKEN || m_nRelInfoStatus == RELINFO_CHANGED_BROKEN ) throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - if ( m_nRelInfoStatus == RELINFO_CHANGED + if ( m_nRelInfoStatus == RELINFO_CHANGED || m_nRelInfoStatus == RELINFO_CHANGED_STREAM_READ || m_nRelInfoStatus == RELINFO_CHANGED_STREAM ) { @@ -1873,7 +1873,7 @@ void OStorage_Impl::CommitRelInfo( const uno::Reference< container::XNameContain uno::Reference< io::XSeekable > xSeek( m_xNewRelInfoStream, uno::UNO_QUERY_THROW ); xSeek->seek( 0 ); ::comphelper::OStorageHelper::CopyInputToOutput( m_xNewRelInfoStream, xOutputStream ); - + // set the mediatype uno::Reference< beans::XPropertySet > xPropSet( xRelsStream, uno::UNO_QUERY_THROW ); xPropSet->setPropertyValue( @@ -1922,7 +1922,7 @@ void OStorage_Impl::CommitRelInfo( const uno::Reference< container::XNameContain //===================================================== //----------------------------------------------- -OStorage::OStorage( uno::Reference< io::XInputStream > xInputStream, +OStorage::OStorage( uno::Reference< io::XInputStream > xInputStream, sal_Int32 nMode, uno::Sequence< beans::PropertyValue > xProperties, uno::Reference< lang::XMultiServiceFactory > xFactory, @@ -1934,7 +1934,7 @@ OStorage::OStorage( uno::Reference< io::XInputStream > xInputStream, } //----------------------------------------------- -OStorage::OStorage( uno::Reference< io::XStream > xStream, +OStorage::OStorage( uno::Reference< io::XStream > xStream, sal_Int32 nMode, uno::Sequence< beans::PropertyValue > xProperties, uno::Reference< lang::XMultiServiceFactory > xFactory, @@ -1946,7 +1946,7 @@ OStorage::OStorage( uno::Reference< io::XStream > xStream, } //----------------------------------------------- -OStorage::OStorage( OStorage_Impl* pImpl, sal_Bool bReadOnlyWrap ) +OStorage::OStorage( OStorage_Impl* pImpl, sal_Bool bReadOnlyWrap ) : m_pImpl( pImpl ) { // this call can be done only from OStorage_Impl implementation to create child storage @@ -2046,7 +2046,7 @@ void SAL_CALL OStorage::InternalDispose( sal_Bool bNotifyImpl ) } } } - + m_pData->m_aOpenSubComponentsList.clear(); } } @@ -2235,7 +2235,7 @@ void OStorage::MakeLinkToSubComponent_Impl( const uno::Reference< lang::XCompone } //____________________________________________________________________________________________________ -// XInterface +// XInterface //____________________________________________________________________________________________________ //----------------------------------------------- @@ -2246,18 +2246,18 @@ uno::Any SAL_CALL OStorage::queryInterface( const uno::Type& rType ) // common interfaces aReturn <<= ::cppu::queryInterface - ( rType - , static_cast<lang::XTypeProvider*> ( this ) - , static_cast<embed::XStorage*> ( this ) - , static_cast<embed::XTransactedObject*> ( this ) - , static_cast<embed::XTransactionBroadcaster*> ( this ) - , static_cast<util::XModifiable*> ( this ) - , static_cast<container::XNameAccess*> ( this ) - , static_cast<container::XElementAccess*> ( this ) - , static_cast<lang::XComponent*> ( this ) - , static_cast<beans::XPropertySet*> ( this ) - , static_cast<embed::XOptimizedStorage*> ( this ) - , static_cast<embed::XHierarchicalStorageAccess*> ( this ) ); + ( rType + , static_cast<lang::XTypeProvider*> ( this ) + , static_cast<embed::XStorage*> ( this ) + , static_cast<embed::XTransactedObject*> ( this ) + , static_cast<embed::XTransactionBroadcaster*> ( this ) + , static_cast<util::XModifiable*> ( this ) + , static_cast<container::XNameAccess*> ( this ) + , static_cast<container::XElementAccess*> ( this ) + , static_cast<lang::XComponent*> ( this ) + , static_cast<beans::XPropertySet*> ( this ) + , static_cast<embed::XOptimizedStorage*> ( this ) + , static_cast<embed::XHierarchicalStorageAccess*> ( this ) ); if ( aReturn.hasValue() == sal_True ) return aReturn ; @@ -2267,22 +2267,22 @@ uno::Any SAL_CALL OStorage::queryInterface( const uno::Type& rType ) if ( m_pData->m_bIsRoot ) { aReturn <<= ::cppu::queryInterface - ( rType - , static_cast<embed::XStorageRawAccess*> ( this ) - , static_cast<embed::XEncryptionProtectedSource*> ( this ) ); + ( rType + , static_cast<embed::XStorageRawAccess*> ( this ) + , static_cast<embed::XEncryptionProtectedSource*> ( this ) ); } else { aReturn <<= ::cppu::queryInterface - ( rType - , static_cast<embed::XStorageRawAccess*> ( this ) ); + ( rType + , static_cast<embed::XStorageRawAccess*> ( this ) ); } } else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { aReturn <<= ::cppu::queryInterface - ( rType - , static_cast<embed::XRelationshipAccess*> ( this ) ); + ( rType + , static_cast<embed::XRelationshipAccess*> ( this ) ); } if ( aReturn.hasValue() == sal_True ) @@ -2304,7 +2304,7 @@ void SAL_CALL OStorage::release() throw() } //____________________________________________________________________________________________________ -// XTypeProvider +// XTypeProvider //____________________________________________________________________________________________________ //----------------------------------------------- @@ -2322,47 +2322,47 @@ uno::Sequence< uno::Type > SAL_CALL OStorage::getTypes() if ( m_pData->m_bIsRoot ) { m_pData->m_pTypeCollection = new ::cppu::OTypeCollection - ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XStorage >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XStorageRawAccess >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XTransactedObject >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XTransactionBroadcaster >* )NULL ) - , ::getCppuType( ( const uno::Reference< util::XModifiable >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XEncryptionProtectedSource >* )NULL ) - , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); + ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XStorage >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XStorageRawAccess >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XTransactedObject >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XTransactionBroadcaster >* )NULL ) + , ::getCppuType( ( const uno::Reference< util::XModifiable >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XEncryptionProtectedSource >* )NULL ) + , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); } else { m_pData->m_pTypeCollection = new ::cppu::OTypeCollection - ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XStorage >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XStorageRawAccess >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XTransactedObject >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XTransactionBroadcaster >* )NULL ) - , ::getCppuType( ( const uno::Reference< util::XModifiable >* )NULL ) - , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); + ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XStorage >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XStorageRawAccess >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XTransactedObject >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XTransactionBroadcaster >* )NULL ) + , ::getCppuType( ( const uno::Reference< util::XModifiable >* )NULL ) + , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); } } else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { m_pData->m_pTypeCollection = new ::cppu::OTypeCollection - ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XStorage >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XTransactedObject >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XTransactionBroadcaster >* )NULL ) - , ::getCppuType( ( const uno::Reference< util::XModifiable >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XRelationshipAccess >* )NULL ) - , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); + ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XStorage >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XTransactedObject >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XTransactionBroadcaster >* )NULL ) + , ::getCppuType( ( const uno::Reference< util::XModifiable >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XRelationshipAccess >* )NULL ) + , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); } else { m_pData->m_pTypeCollection = new ::cppu::OTypeCollection - ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XStorage >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XTransactedObject >* )NULL ) - , ::getCppuType( ( const uno::Reference< embed::XTransactionBroadcaster >* )NULL ) - , ::getCppuType( ( const uno::Reference< util::XModifiable >* )NULL ) - , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); + ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XStorage >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XTransactedObject >* )NULL ) + , ::getCppuType( ( const uno::Reference< embed::XTransactionBroadcaster >* )NULL ) + , ::getCppuType( ( const uno::Reference< util::XModifiable >* )NULL ) + , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); } } } @@ -2381,7 +2381,7 @@ uno::Sequence< sal_Int8 > SAL_CALL OStorage::getImplementationId() } //____________________________________________________________________________________________________ -// XStorage +// XStorage //____________________________________________________________________________________________________ @@ -2555,7 +2555,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::openStreamElement( } //----------------------------------------------- -uno::Reference< io::XStream > SAL_CALL OStorage::openEncryptedStreamElement( +uno::Reference< io::XStream > SAL_CALL OStorage::openEncryptedStreamElement( const ::rtl::OUString& aStreamName, sal_Int32 nOpenMode, const ::rtl::OUString& aPass ) throw ( embed::InvalidStorageException, lang::IllegalArgumentException, @@ -2736,7 +2736,7 @@ uno::Reference< embed::XStorage > SAL_CALL OStorage::openStorageElement( // virtual, that means that it is just enough to change the flag to let it be writable // and since there is no AntiImpl nobody should be notified about it pElement->m_pStorage->m_nStorageMode = nStorageMode | embed::ElementModes::READ; - + if ( ( nStorageMode & embed::ElementModes::TRUNCATE ) ) { for ( SotElementList_Impl::iterator pElementIter = pElement->m_pStorage->m_aChildrenList.begin(); @@ -2744,7 +2744,7 @@ uno::Reference< embed::XStorage > SAL_CALL OStorage::openStorageElement( { SotElement_Impl* pElementToDel = (*pElementIter); pElementIter++; - + m_pImpl->RemoveElement( pElementToDel ); } } @@ -2765,12 +2765,12 @@ uno::Reference< embed::XStorage > SAL_CALL OStorage::openStorageElement( { // Before this call is done the object must be refcounted already pElement->m_pStorage->SetReadOnlyWrap( *pResultStorage ); - + // before the storage disposes the stream it must deregister itself as listener uno::Reference< lang::XComponent > xStorageComponent( xResult, uno::UNO_QUERY ); if ( !xStorageComponent.is() ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - + MakeLinkToSubComponent_Impl( xStorageComponent ); } } @@ -3107,7 +3107,7 @@ void SAL_CALL OStorage::copyStorageElementLastCommitTo( { // the existence of m_pAntiImpl of the child is not interesting, // the copy will be created internally - + pElement->m_pStorage->CopyLastCommitTo( xTargetStorage ); } else @@ -3178,7 +3178,7 @@ sal_Bool SAL_CALL OStorage::isStreamElement( const ::rtl::OUString& aElementName throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // unacceptable name SotElement_Impl* pElement = NULL; - + try { pElement = m_pImpl->FindElement( aElementName ); @@ -3247,7 +3247,7 @@ sal_Bool SAL_CALL OStorage::isStorageElement( const ::rtl::OUString& aElementNam throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); SotElement_Impl* pElement = NULL; - + try { pElement = m_pImpl->FindElement( aElementName ); @@ -3492,7 +3492,7 @@ void SAL_CALL OStorage::renameElement( const ::rtl::OUString& aElementName, cons } //----------------------------------------------- -void SAL_CALL OStorage::copyElementTo( const ::rtl::OUString& aElementName, +void SAL_CALL OStorage::copyElementTo( const ::rtl::OUString& aElementName, const uno::Reference< embed::XStorage >& xDest, const ::rtl::OUString& aNewName ) throw ( embed::InvalidStorageException, @@ -3517,7 +3517,7 @@ void SAL_CALL OStorage::copyElementTo( const ::rtl::OUString& aElementName, || !aNewName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aNewName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( !xDest.is() ) + if ( !xDest.is() ) // || xDest == uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 2 ); @@ -3597,7 +3597,7 @@ void SAL_CALL OStorage::copyElementTo( const ::rtl::OUString& aElementName, //----------------------------------------------- -void SAL_CALL OStorage::moveElementTo( const ::rtl::OUString& aElementName, +void SAL_CALL OStorage::moveElementTo( const ::rtl::OUString& aElementName, const uno::Reference< embed::XStorage >& xDest, const ::rtl::OUString& aNewName ) throw ( embed::InvalidStorageException, @@ -3647,7 +3647,7 @@ void SAL_CALL OStorage::moveElementTo( const ::rtl::OUString& aElementName, throw container::ElementExistException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); m_pImpl->CopyStorageElement( pElement, xDest, aNewName, sal_False ); - + m_pImpl->RemoveElement( pElement ); m_pImpl->m_bIsModified = sal_True; @@ -3712,7 +3712,7 @@ void SAL_CALL OStorage::moveElementTo( const ::rtl::OUString& aElementName, } //____________________________________________________________________________________________________ -// XStorageRawAccess +// XStorageRawAccess //____________________________________________________________________________________________________ //----------------------------------------------- @@ -3759,8 +3759,8 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getPlainRawStreamElement( if ( !xRawInStream.is() ) throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - uno::Reference < io::XOutputStream > xTempOut( - m_pImpl->GetServiceFactory()->createInstance ( + uno::Reference < io::XOutputStream > xTempOut( + m_pImpl->GetServiceFactory()->createInstance ( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) ) ), uno::UNO_QUERY ); xTempIn = uno::Reference < io::XInputStream >( xTempOut, uno::UNO_QUERY ); @@ -3857,7 +3857,7 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getRawEncrStreamElement( SotElement_Impl* pElement = m_pImpl->FindElement( sStreamName ); if ( !pElement ) throw container::NoSuchElementException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - + if ( !pElement->m_pStream ) { m_pImpl->OpenSubStream( pElement ); @@ -3872,8 +3872,8 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getRawEncrStreamElement( if ( !xRawInStream.is() ) throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - uno::Reference < io::XOutputStream > xTempOut( - m_pImpl->GetServiceFactory()->createInstance ( + uno::Reference < io::XOutputStream > xTempOut( + m_pImpl->GetServiceFactory()->createInstance ( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) ) ), uno::UNO_QUERY ); xTempIn = uno::Reference < io::XInputStream >( xTempOut, uno::UNO_QUERY ); @@ -4040,7 +4040,7 @@ void SAL_CALL OStorage::insertRawEncrStreamElement( const ::rtl::OUString& aStre } //____________________________________________________________________________________________________ -// XTransactedObject +// XTransactedObject //____________________________________________________________________________________________________ //----------------------------------------------- @@ -4183,7 +4183,7 @@ void SAL_CALL OStorage::revert() } //____________________________________________________________________________________________________ -// XTransactionBroadcaster +// XTransactionBroadcaster //____________________________________________________________________________________________________ //----------------------------------------------- @@ -4219,10 +4219,10 @@ void SAL_CALL OStorage::removeTransactionListener( const uno::Reference< embed:: } //____________________________________________________________________________________________________ -// XModifiable +// XModifiable // TODO: if there will be no demand on this interface it will be removed from implementation, -// I do not want to remove it now since it is still possible that it will be inserted -// to the service back. +// I do not want to remove it now since it is still possible that it will be inserted +// to the service back. //____________________________________________________________________________________________________ //----------------------------------------------- @@ -4304,7 +4304,7 @@ void SAL_CALL OStorage::removeModifyListener( } //____________________________________________________________________________________________________ -// XNameAccess +// XNameAccess //____________________________________________________________________________________________________ //----------------------------------------------- @@ -4518,7 +4518,7 @@ sal_Bool SAL_CALL OStorage::hasElements() //____________________________________________________________________________________________________ -// XComponent +// XComponent //____________________________________________________________________________________________________ //----------------------------------------------- @@ -4591,7 +4591,7 @@ void SAL_CALL OStorage::removeEventListener( } //____________________________________________________________________________________________________ -// XEncryptionProtectedSource +// XEncryptionProtectedSource //____________________________________________________________________________________________________ void SAL_CALL OStorage::setEncryptionPassword( const ::rtl::OUString& aPass ) @@ -4616,7 +4616,7 @@ void SAL_CALL OStorage::setEncryptionPassword( const ::rtl::OUString& aPass ) if ( m_pData->m_bIsRoot ) { try { - m_pImpl->ReadContents(); + m_pImpl->ReadContents(); } catch ( uno::RuntimeException& aRuntimeException ) { @@ -4635,7 +4635,7 @@ void SAL_CALL OStorage::setEncryptionPassword( const ::rtl::OUString& aPass ) uno::UNO_QUERY ), aCaught ); } - + uno::Reference< beans::XPropertySet > xPackPropSet( m_pImpl->m_xPackage, uno::UNO_QUERY ); if ( !xPackPropSet.is() ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); @@ -4729,7 +4729,7 @@ void SAL_CALL OStorage::removeEncryption() } //____________________________________________________________________________________________________ -// XPropertySet +// XPropertySet //____________________________________________________________________________________________________ //----------------------------------------------- @@ -4783,7 +4783,7 @@ void SAL_CALL OStorage::setPropertyValue( const ::rtl::OUString& aPropertyName, { aValue >>= m_pImpl->m_aMediaType; m_pImpl->m_bControlMediaType = sal_True; - + m_pImpl->m_bBroadcastModified = sal_True; m_pImpl->m_bIsModified = sal_True; } @@ -4791,7 +4791,7 @@ void SAL_CALL OStorage::setPropertyValue( const ::rtl::OUString& aPropertyName, { aValue >>= m_pImpl->m_aVersion; m_pImpl->m_bControlVersion = sal_True; - + // this property can be set even for readonly storage if ( !m_pData->m_bReadOnlyWrap ) { @@ -4938,7 +4938,7 @@ uno::Any SAL_CALL OStorage::getPropertyValue( const ::rtl::OUString& aPropertyNa else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE && ( aPropertyName.equalsAscii( "HasEncryptedEntries" ) || aPropertyName.equalsAscii( "HasNonEncryptedEntries" ) - || aPropertyName.equalsAscii( "IsInconsistent" ) ) ) + || aPropertyName.equalsAscii( "IsInconsistent" ) ) ) { try { m_pImpl->ReadContents(); @@ -5052,7 +5052,7 @@ void SAL_CALL OStorage::removeVetoableChangeListener( } //____________________________________________________________________________________________________ -// XRelationshipAccess +// XRelationshipAccess //____________________________________________________________________________________________________ // TODO/LATER: the storage and stream implementations of this interface are very similar, they could use a helper class @@ -5164,7 +5164,7 @@ uno::Sequence< beans::StringPair > SAL_CALL OStorage::getRelationshipByID( cons return aSeq[nInd1]; break; } - + throw container::NoSuchElementException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } @@ -5370,7 +5370,7 @@ void SAL_CALL OStorage::insertRelationships( const uno::Sequence< uno::Sequence nIndSourceSame = nIndSource1; } - + break; } } @@ -5435,7 +5435,7 @@ void SAL_CALL OStorage::clearRelationships() } //____________________________________________________________________________________________________ -// XOptimizedStorage +// XOptimizedStorage //____________________________________________________________________________________________________ //----------------------------------------------- void SAL_CALL OStorage::insertRawNonEncrStreamElementDirect( @@ -5545,7 +5545,7 @@ void SAL_CALL OStorage::insertStreamElementDirect( aCaught ); } } - + //----------------------------------------------- void SAL_CALL OStorage::copyElementDirectlyTo( const ::rtl::OUString& aElementName, @@ -5675,7 +5675,7 @@ void SAL_CALL OStorage::writeAndAttachToStream( const uno::Reference< io::XStrea if ( !m_pImpl->m_pSwitchStream ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - + try { m_pImpl->m_pSwitchStream->CopyAndSwitchPersistenceTo( xStream ); @@ -5747,12 +5747,12 @@ void SAL_CALL OStorage::attachToURL( const ::rtl::OUString& sURL, if ( !m_pImpl->m_pSwitchStream ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - - uno::Reference < ucb::XSimpleFileAccess > xAccess( - m_pImpl->m_xFactory->createInstance ( + + uno::Reference < ucb::XSimpleFileAccess > xAccess( + m_pImpl->m_xFactory->createInstance ( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ucb.SimpleFileAccess" ) ) ), uno::UNO_QUERY_THROW ); - + try { if ( bReadOnly ) @@ -6006,7 +6006,7 @@ void SAL_CALL OStorage::copyStreamElementData( const ::rtl::OUString& aStreamNam //____________________________________________________________________________________________________ //----------------------------------------------- -uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openStreamElementByHierarchicalName( const ::rtl::OUString& aStreamPath, ::sal_Int32 nOpenMode ) +uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openStreamElementByHierarchicalName( const ::rtl::OUString& aStreamPath, ::sal_Int32 nOpenMode ) throw ( embed::InvalidStorageException, lang::IllegalArgumentException, packages::WrongPasswordException, @@ -6065,7 +6065,7 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openStreamEle } //----------------------------------------------- -uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openEncryptedStreamElementByHierarchicalName( const ::rtl::OUString& aStreamPath, ::sal_Int32 nOpenMode, const ::rtl::OUString& sPassword ) +uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openEncryptedStreamElementByHierarchicalName( const ::rtl::OUString& aStreamPath, ::sal_Int32 nOpenMode, const ::rtl::OUString& sPassword ) throw ( embed::InvalidStorageException, lang::IllegalArgumentException, packages::NoEncryptionException, @@ -6132,7 +6132,7 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openEncrypted } //----------------------------------------------- -void SAL_CALL OStorage::removeStreamElementByHierarchicalName( const ::rtl::OUString& aStreamPath ) +void SAL_CALL OStorage::removeStreamElementByHierarchicalName( const ::rtl::OUString& aStreamPath ) throw ( embed::InvalidStorageException, lang::IllegalArgumentException, container::NoSuchElementException, diff --git a/package/source/xstor/xstorage.hxx b/package/source/xstor/xstorage.hxx index 330b4c800f28..39c61e25b241 100644 --- a/package/source/xstor/xstorage.hxx +++ b/package/source/xstor/xstorage.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -58,13 +58,13 @@ #include "mutexholder.hxx" -#define RELINFO_NO_INIT 1 -#define RELINFO_READ 2 -#define RELINFO_CHANGED 3 -#define RELINFO_CHANGED_STREAM 4 -#define RELINFO_CHANGED_STREAM_READ 5 -#define RELINFO_BROKEN 6 -#define RELINFO_CHANGED_BROKEN 7 +#define RELINFO_NO_INIT 1 +#define RELINFO_READ 2 +#define RELINFO_CHANGED 3 +#define RELINFO_CHANGED_STREAM 4 +#define RELINFO_CHANGED_STREAM_READ 5 +#define RELINFO_BROKEN 6 +#define RELINFO_CHANGED_BROKEN 7 #define STOR_MESS_PRECOMMIT 1 #define STOR_MESS_COMMITED 2 @@ -85,14 +85,14 @@ struct OWriteStream_Impl; struct SotElement_Impl { - ::rtl::OUString m_aName; + ::rtl::OUString m_aName; ::rtl::OUString m_aOriginalName; sal_Bool m_bIsRemoved; sal_Bool m_bIsInserted; - sal_Bool m_bIsStorage; - - OStorage_Impl* m_pStorage; - OWriteStream_Impl* m_pStream; + sal_Bool m_bIsStorage; + + OStorage_Impl* m_pStorage; + OWriteStream_Impl* m_pStream; public: SotElement_Impl( const ::rtl::OUString& rName, sal_Bool bStor, sal_Bool bNew ); @@ -131,12 +131,12 @@ typedef ::std::list< StorageHolder_Impl > OStorageList_Impl; class SwitchablePersistenceStream; struct OStorage_Impl { - SotMutexHolderRef m_rMutexRef; + SotMutexHolderRef m_rMutexRef; - OStorage* m_pAntiImpl; // only valid if external references exists - OStorageList_Impl m_aReadOnlyWrapList; // only valid if readonly external reference exists + OStorage* m_pAntiImpl; // only valid if external references exists + OStorageList_Impl m_aReadOnlyWrapList; // only valid if readonly external reference exists - sal_Int32 m_nStorageMode; // open mode ( read/write/trunc/nocreate ) + sal_Int32 m_nStorageMode; // open mode ( read/write/trunc/nocreate ) sal_Bool m_bIsModified; // only modified elements will be sent to the original content sal_Bool m_bBroadcastModified; // will be set if notification is required sal_Bool m_bCommited; // sending the streams is coordinated by the root storage of the package @@ -145,8 +145,8 @@ struct OStorage_Impl sal_Bool m_bListCreated; - SotElementList_Impl m_aChildrenList; - SotElementList_Impl m_aDeletedList; + SotElementList_Impl m_aChildrenList; + SotElementList_Impl m_aDeletedList; ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > m_xPackageFolder; ::com::sun::star::uno::Reference< ::com::sun::star::logging::XSimpleLogRing > m_xLogRing; @@ -164,11 +164,11 @@ struct OStorage_Impl // must be empty in case of root storage OStorage_Impl* m_pParent; - sal_Bool m_bControlMediaType; + sal_Bool m_bControlMediaType; ::rtl::OUString m_aMediaType; - sal_Bool m_bMTFallbackUsed; + sal_Bool m_bMTFallbackUsed; - sal_Bool m_bControlVersion; + sal_Bool m_bControlVersion; ::rtl::OUString m_aVersion; SwitchablePersistenceStream* m_pSwitchStream; @@ -176,7 +176,7 @@ struct OStorage_Impl sal_Int32 m_nStorageType; // the mode in wich the storage is used // the _rels substorage that is handled in a special way in embed::StorageFormats::OFOPXML - SotElement_Impl* m_pRelStorElement; + SotElement_Impl* m_pRelStorElement; ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xRelStorage; ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > m_aRelInfo; ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xNewRelInfoStream; @@ -185,20 +185,20 @@ struct OStorage_Impl ////////////////////////////////////////// // Constructors - OStorage_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xInputStream, + OStorage_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xInputStream, sal_Int32 nMode, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory, sal_Int32 nStorageType ); - OStorage_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xStream, + OStorage_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xStream, sal_Int32 nMode, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory, sal_Int32 nStorageType ); // constructor for a substorage - OStorage_Impl( OStorage_Impl* pParent, + OStorage_Impl( OStorage_Impl* pParent, sal_Int32 nMode, ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > xPackageFolder, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > xPackage, @@ -289,7 +289,7 @@ struct OStorage_Impl }; -class OStorage : public ::com::sun::star::lang::XTypeProvider +class OStorage : public ::com::sun::star::lang::XTypeProvider , public ::com::sun::star::embed::XStorage , public ::com::sun::star::embed::XStorageRawAccess , public ::com::sun::star::embed::XTransactedObject @@ -304,7 +304,7 @@ class OStorage : public ::com::sun::star::lang::XTypeProvider , public ::com::sun::star::embed::XHierarchicalStorageAccess , public ::cppu::OWeakObject { - OStorage_Impl* m_pImpl; + OStorage_Impl* m_pImpl; StorInternalData_Impl* m_pData; protected: @@ -322,19 +322,19 @@ protected: public: - OStorage( ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xInputStream, + OStorage( ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xInputStream, sal_Int32 nMode, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory, sal_Int32 nStorageType ); - OStorage( ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xStream, + OStorage( ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xStream, sal_Int32 nMode, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory, sal_Int32 nStorageType ); - OStorage( OStorage_Impl* pImpl, sal_Bool bReadOnlyWrap ); + OStorage( OStorage_Impl* pImpl, sal_Bool bReadOnlyWrap ); virtual ~OStorage(); @@ -345,10 +345,10 @@ public: sal_Int32 GetRefCount_Impl() { return m_refCount; } //____________________________________________________________________________________________________ - // XInterface + // XInterface //____________________________________________________________________________________________________ - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType ) + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType ) throw( ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL acquire() throw(); @@ -356,7 +356,7 @@ public: virtual void SAL_CALL release() throw(); //____________________________________________________________________________________________________ - // XTypeProvider + // XTypeProvider //____________________________________________________________________________________________________ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() @@ -366,7 +366,7 @@ public: throw( ::com::sun::star::uno::RuntimeException ); //____________________________________________________________________________________________________ - // XStorage + // XStorage //____________________________________________________________________________________________________ virtual void SAL_CALL copyToStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xDest ) @@ -376,7 +376,7 @@ public: ::com::sun::star::embed::StorageWrappedTargetException, ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL openStreamElement( + virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL openStreamElement( const ::rtl::OUString& aStreamName, sal_Int32 nOpenMode ) throw ( ::com::sun::star::embed::InvalidStorageException, ::com::sun::star::lang::IllegalArgumentException, @@ -385,7 +385,7 @@ public: ::com::sun::star::embed::StorageWrappedTargetException, ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL openEncryptedStreamElement( + virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL openEncryptedStreamElement( const ::rtl::OUString& aStreamName, sal_Int32 nOpenMode, const ::rtl::OUString& aPass ) throw ( ::com::sun::star::embed::InvalidStorageException, ::com::sun::star::lang::IllegalArgumentException, @@ -395,7 +395,7 @@ public: ::com::sun::star::embed::StorageWrappedTargetException, ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > SAL_CALL openStorageElement( + virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > SAL_CALL openStorageElement( const ::rtl::OUString& aStorName, sal_Int32 nStorageMode ) throw ( ::com::sun::star::embed::InvalidStorageException, ::com::sun::star::lang::IllegalArgumentException, @@ -403,7 +403,7 @@ public: ::com::sun::star::embed::StorageWrappedTargetException, ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL cloneStreamElement( + virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL cloneStreamElement( const ::rtl::OUString& aStreamName ) throw ( ::com::sun::star::embed::InvalidStorageException, ::com::sun::star::lang::IllegalArgumentException, @@ -412,7 +412,7 @@ public: ::com::sun::star::embed::StorageWrappedTargetException, ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL cloneEncryptedStreamElement( + virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL cloneEncryptedStreamElement( const ::rtl::OUString& aStreamName, const ::rtl::OUString& aPass ) throw ( ::com::sun::star::embed::InvalidStorageException, ::com::sun::star::lang::IllegalArgumentException, @@ -468,7 +468,7 @@ public: ::com::sun::star::embed::StorageWrappedTargetException, ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL copyElementTo( const ::rtl::OUString& aElementName, + virtual void SAL_CALL copyElementTo( const ::rtl::OUString& aElementName, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xDest, const ::rtl::OUString& aNewName ) throw ( ::com::sun::star::embed::InvalidStorageException, @@ -479,7 +479,7 @@ public: ::com::sun::star::embed::StorageWrappedTargetException, ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL moveElementTo( const ::rtl::OUString& aElementName, + virtual void SAL_CALL moveElementTo( const ::rtl::OUString& aElementName, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xDest, const ::rtl::OUString& rNewName ) throw ( ::com::sun::star::embed::InvalidStorageException, @@ -491,7 +491,7 @@ public: ::com::sun::star::uno::RuntimeException ); //____________________________________________________________________________________________________ - // XStorageRawAccess + // XStorageRawAccess //____________________________________________________________________________________________________ virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getPlainRawStreamElement( @@ -550,7 +550,7 @@ public: throw ( ::com::sun::star::uno::RuntimeException ); //____________________________________________________________________________________________________ - // XModifiable + // XModifiable //____________________________________________________________________________________________________ virtual sal_Bool SAL_CALL isModified() @@ -569,7 +569,7 @@ public: throw ( ::com::sun::star::uno::RuntimeException ); //____________________________________________________________________________________________________ - // XNameAccess + // XNameAccess //____________________________________________________________________________________________________ virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) @@ -590,7 +590,7 @@ public: throw ( ::com::sun::star::uno::RuntimeException ); //____________________________________________________________________________________________________ - // XComponent + // XComponent //____________________________________________________________________________________________________ virtual void SAL_CALL dispose() @@ -605,7 +605,7 @@ public: throw ( ::com::sun::star::uno::RuntimeException ); //____________________________________________________________________________________________________ - // XEncryptionProtectedSource + // XEncryptionProtectedSource //____________________________________________________________________________________________________ virtual void SAL_CALL setEncryptionPassword( const ::rtl::OUString& aPass ) @@ -617,7 +617,7 @@ public: ::com::sun::star::io::IOException ); //____________________________________________________________________________________________________ - // XPropertySet + // XPropertySet //____________________________________________________________________________________________________ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() @@ -635,7 +635,7 @@ public: ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL addPropertyChangeListener( + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw ( ::com::sun::star::beans::UnknownPropertyException, @@ -662,7 +662,7 @@ public: ::com::sun::star::uno::RuntimeException ); //____________________________________________________________________________________________________ - // XOptimizedStorage + // XOptimizedStorage //____________________________________________________________________________________________________ virtual void SAL_CALL insertRawNonEncrStreamElementDirect( const ::rtl::OUString& sStreamName, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream ) throw ( ::com::sun::star::embed::InvalidStorageException, @@ -680,7 +680,7 @@ public: ::com::sun::star::io::IOException, ::com::sun::star::embed::StorageWrappedTargetException, ::com::sun::star::uno::RuntimeException ); - + virtual void SAL_CALL copyElementDirectlyTo( const ::rtl::OUString& sSourceName, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XOptimizedStorage >& xTargetStorage, const ::rtl::OUString& sTargetName ) throw ( ::com::sun::star::embed::InvalidStorageException, ::com::sun::star::lang::IllegalArgumentException, @@ -776,7 +776,7 @@ public: // XHierarchicalStorageAccess //____________________________________________________________________________________________________ - virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XExtendedStorageStream > SAL_CALL openStreamElementByHierarchicalName( const ::rtl::OUString& sStreamPath, ::sal_Int32 nOpenMode ) + virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XExtendedStorageStream > SAL_CALL openStreamElementByHierarchicalName( const ::rtl::OUString& sStreamPath, ::sal_Int32 nOpenMode ) throw ( ::com::sun::star::embed::InvalidStorageException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::packages::WrongPasswordException, @@ -784,7 +784,7 @@ public: ::com::sun::star::embed::StorageWrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XExtendedStorageStream > SAL_CALL openEncryptedStreamElementByHierarchicalName( const ::rtl::OUString& sStreamName, ::sal_Int32 nOpenMode, const ::rtl::OUString& sPassword ) + virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XExtendedStorageStream > SAL_CALL openEncryptedStreamElementByHierarchicalName( const ::rtl::OUString& sStreamName, ::sal_Int32 nOpenMode, const ::rtl::OUString& sPassword ) throw ( ::com::sun::star::embed::InvalidStorageException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::packages::NoEncryptionException, @@ -793,7 +793,7 @@ public: ::com::sun::star::embed::StorageWrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeStreamElementByHierarchicalName( const ::rtl::OUString& sElementPath ) + virtual void SAL_CALL removeStreamElementByHierarchicalName( const ::rtl::OUString& sElementPath ) throw ( ::com::sun::star::embed::InvalidStorageException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, diff --git a/package/source/zipapi/ByteChucker.cxx b/package/source/zipapi/ByteChucker.cxx index 8ff31dc49926..73025fe12515 100644 --- a/package/source/zipapi/ByteChucker.cxx +++ b/package/source/zipapi/ByteChucker.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -38,7 +38,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; ByteChucker::ByteChucker(Reference<XOutputStream> xOstream) -: xStream(xOstream) +: xStream(xOstream) , xSeek (xOstream, UNO_QUERY ) , a1Sequence ( 1 ) , a2Sequence ( 2 ) @@ -59,7 +59,7 @@ void ByteChucker::WriteBytes( const Sequence< sal_Int8 >& aData ) xStream->writeBytes(aData); } -sal_Int64 ByteChucker::GetPosition( ) +sal_Int64 ByteChucker::GetPosition( ) throw(IOException, RuntimeException) { return xSeek->getPosition(); diff --git a/package/source/zipapi/ByteGrabber.cxx b/package/source/zipapi/ByteGrabber.cxx index 50546707d54e..34bd9a7ac827 100644 --- a/package/source/zipapi/ByteGrabber.cxx +++ b/package/source/zipapi/ByteGrabber.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,7 +39,7 @@ using namespace ::com::sun::star; */ ByteGrabber::ByteGrabber(uno::Reference < io::XInputStream > xIstream) -: xStream(xIstream) +: xStream(xIstream) , xSeek (xIstream, uno::UNO_QUERY ) , aSequence ( 4 ) { @@ -58,8 +58,8 @@ void ByteGrabber::setInputStream (uno::Reference < io::XInputStream > xNewStream } // XInputStream chained -sal_Int32 SAL_CALL ByteGrabber::readBytes( uno::Sequence< sal_Int8 >& aData, - sal_Int32 nBytesToRead ) +sal_Int32 SAL_CALL ByteGrabber::readBytes( uno::Sequence< sal_Int8 >& aData, + sal_Int32 nBytesToRead ) throw(io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -67,7 +67,7 @@ sal_Int32 SAL_CALL ByteGrabber::readBytes( uno::Sequence< sal_Int8 >& aData, } // XSeekable chained... -sal_Int64 SAL_CALL ByteGrabber::seek( sal_Int64 location ) +sal_Int64 SAL_CALL ByteGrabber::seek( sal_Int64 location ) throw(lang::IllegalArgumentException, io::IOException, uno::RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -80,12 +80,12 @@ sal_Int64 SAL_CALL ByteGrabber::seek( sal_Int64 location ) location = nLen; xSeek->seek( location ); return location; - } + } else throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } -sal_Int64 SAL_CALL ByteGrabber::getPosition( ) +sal_Int64 SAL_CALL ByteGrabber::getPosition( ) throw(io::IOException, uno::RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -123,8 +123,8 @@ ByteGrabber& ByteGrabber::operator >> (sal_Int16& rInt16) else { pSequence = aSequence.getConstArray(); - rInt16 = static_cast <sal_Int16> - ( (pSequence[0] & 0xFF) + rInt16 = static_cast <sal_Int16> + ( (pSequence[0] & 0xFF) | (pSequence[1] & 0xFF) << 8); } return *this; @@ -139,9 +139,9 @@ ByteGrabber& ByteGrabber::operator >> (sal_Int32& rInt32) else { pSequence = aSequence.getConstArray(); - rInt32 = static_cast < sal_Int32 > + rInt32 = static_cast < sal_Int32 > ( (pSequence[0] & 0xFF) - | ( pSequence[1] & 0xFF ) << 8 + | ( pSequence[1] & 0xFF ) << 8 | ( pSequence[2] & 0xFF ) << 16 | ( pSequence[3] & 0xFF ) << 24 ); } @@ -167,8 +167,8 @@ ByteGrabber& ByteGrabber::operator >> (sal_uInt16& rInt16) else { pSequence = aSequence.getConstArray(); - rInt16 = static_cast <sal_uInt16> - ( (pSequence[0] & 0xFF) + rInt16 = static_cast <sal_uInt16> + ( (pSequence[0] & 0xFF) | (pSequence[1] & 0xFF) << 8); } return *this; @@ -182,9 +182,9 @@ ByteGrabber& ByteGrabber::operator >> (sal_uInt32& ruInt32) else { pSequence = aSequence.getConstArray(); - ruInt32 = static_cast < sal_uInt32 > + ruInt32 = static_cast < sal_uInt32 > ( (pSequence[0] & 0xFF) - | ( pSequence[1] & 0xFF ) << 8 + | ( pSequence[1] & 0xFF ) << 8 | ( pSequence[2] & 0xFF ) << 16 | ( pSequence[3] & 0xFF ) << 24 ); } diff --git a/package/source/zipapi/CRC32.cxx b/package/source/zipapi/CRC32.cxx index 9334831ea30c..6e15614bf67c 100644 --- a/package/source/zipapi/CRC32.cxx +++ b/package/source/zipapi/CRC32.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -48,10 +48,10 @@ using namespace com::sun::star::io; CRC32::CRC32() : nCRC(0) -{ +{ } CRC32::~CRC32() -{ +{ } void SAL_CALL CRC32::reset() throw(RuntimeException) @@ -65,8 +65,8 @@ sal_Int32 SAL_CALL CRC32::getValue() } /** Update CRC32 with specified sequence of bytes */ -void SAL_CALL CRC32::updateSegment(const Sequence< sal_Int8 > &b, - sal_Int32 off, +void SAL_CALL CRC32::updateSegment(const Sequence< sal_Int8 > &b, + sal_Int32 off, sal_Int32 len) throw(RuntimeException) { diff --git a/package/source/zipapi/Deflater.cxx b/package/source/zipapi/Deflater.cxx index b2c1edb07cbc..a0005f5fe973 100644 --- a/package/source/zipapi/Deflater.cxx +++ b/package/source/zipapi/Deflater.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -48,7 +48,7 @@ using namespace com::sun::star; Deflater::~Deflater(void) { - end(); + end(); } void Deflater::init (sal_Int32 nLevelArg, sal_Int32 nStrategyArg, sal_Bool bNowrap) { @@ -142,15 +142,15 @@ sal_Int32 Deflater::doDeflateBytes (uno::Sequence < sal_Int8 > &rBuffer, sal_Int } } -void SAL_CALL Deflater::setInputSegment( const uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength ) +void SAL_CALL Deflater::setInputSegment( const uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength ) { OSL_ASSERT( !(nNewOffset < 0 || nNewLength < 0 || nNewOffset + nNewLength > rBuffer.getLength())); - + sInBuffer = rBuffer; nOffset = nNewOffset; nLength = nNewLength; } -void SAL_CALL Deflater::setLevel( sal_Int32 nNewLevel ) +void SAL_CALL Deflater::setLevel( sal_Int32 nNewLevel ) { if ((nNewLevel < 0 || nNewLevel > 9) && nNewLevel != DEFAULT_COMPRESSION) { @@ -162,32 +162,32 @@ void SAL_CALL Deflater::setLevel( sal_Int32 nNewLevel ) bSetParams = sal_True; } } -sal_Bool SAL_CALL Deflater::needsInput( ) +sal_Bool SAL_CALL Deflater::needsInput( ) { return nLength <=0; } -void SAL_CALL Deflater::finish( ) +void SAL_CALL Deflater::finish( ) { bFinish = sal_True; } -sal_Bool SAL_CALL Deflater::finished( ) +sal_Bool SAL_CALL Deflater::finished( ) { return bFinished; } -sal_Int32 SAL_CALL Deflater::doDeflateSegment( uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength ) +sal_Int32 SAL_CALL Deflater::doDeflateSegment( uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength ) { OSL_ASSERT( !(nNewOffset < 0 || nNewLength < 0 || nNewOffset + nNewLength > rBuffer.getLength())); return doDeflateBytes(rBuffer, nNewOffset, nNewLength); } -sal_Int32 SAL_CALL Deflater::getTotalIn( ) +sal_Int32 SAL_CALL Deflater::getTotalIn( ) { return pStream->total_in; } -sal_Int32 SAL_CALL Deflater::getTotalOut( ) +sal_Int32 SAL_CALL Deflater::getTotalOut( ) { return pStream->total_out; } -void SAL_CALL Deflater::reset( ) +void SAL_CALL Deflater::reset( ) { #ifdef SYSTEM_ZLIB deflateReset(pStream); @@ -198,7 +198,7 @@ void SAL_CALL Deflater::reset( ) bFinished = sal_False; nOffset = nLength = 0; } -void SAL_CALL Deflater::end( ) +void SAL_CALL Deflater::end( ) { if (pStream != NULL) { diff --git a/package/source/zipapi/EntryInputStream.cxx b/package/source/zipapi/EntryInputStream.cxx index cd43622ea8ac..eb89646916e4 100644 --- a/package/source/zipapi/EntryInputStream.cxx +++ b/package/source/zipapi/EntryInputStream.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -40,7 +40,7 @@ using namespace com::sun::star::uno; using namespace com::sun::star::packages::zip; using namespace com::sun::star::packages::zip::ZipConstants; -/** Provides access to the compressed data in a zipfile. +/** Provides access to the compressed data in a zipfile. * * 04/12/00 - uncompresses the stream into memory and seeks on it 'in memory' * This and the ZipPackageBuffer used in the ZipOutputStream are memory hogs @@ -51,7 +51,7 @@ using namespace com::sun::star::packages::zip::ZipConstants; * seek to it before performing any reads. */ -EntryInputStream::EntryInputStream( Reference < io::XInputStream > xNewInput, +EntryInputStream::EntryInputStream( Reference < io::XInputStream > xNewInput, const ZipEntry & rNewEntry, const rtl::Reference < EncryptionData > &xEncryptData, sal_Bool bGetRawStream) @@ -99,22 +99,22 @@ void EntryInputStream::readIntoMemory() // Get the key rtl_digest_PBKDF2 ( aDerivedKey.getArray(), 16, - reinterpret_cast < const sal_uInt8 * > (xEncryptionData->aKey.getConstArray()), + reinterpret_cast < const sal_uInt8 * > (xEncryptionData->aKey.getConstArray()), xEncryptionData->aKey.getLength(), - xEncryptionData->aSalt.getConstArray(), + xEncryptionData->aSalt.getConstArray(), xEncryptionData->aSalt.getLength(), xEncryptionData->nIterationCount ); - + rtlCipher aCipher = rtl_cipher_create (rtl_Cipher_AlgorithmBF, rtl_Cipher_ModeStream); - aResult = rtl_cipher_init( aCipher, rtl_Cipher_DirectionDecode, + aResult = rtl_cipher_init( aCipher, rtl_Cipher_DirectionDecode, aDerivedKey.getConstArray(), aDerivedKey.getLength(), xEncryptionData->aInitVector.getConstArray(), xEncryptionData->aInitVector.getLength()); OSL_ASSERT (aResult == rtl_Cipher_E_None); aDecryptBuffer.realloc ( nSize ); - aResult = rtl_cipher_decode ( aCipher, - aReadBuffer.getConstArray(), + aResult = rtl_cipher_decode ( aCipher, + aReadBuffer.getConstArray(), nSize, reinterpret_cast < sal_uInt8 * > (aDecryptBuffer.getArray()), nSize); @@ -171,17 +171,17 @@ void SAL_CALL EntryInputStream::skipBytes( sal_Int32 nBytesToSkip ) nCurrent+=nBytesToSkip; } -sal_Int32 SAL_CALL EntryInputStream::available( ) +sal_Int32 SAL_CALL EntryInputStream::available( ) throw(io::NotConnectedException, io::IOException, RuntimeException) { return static_cast < sal_Int32 > (nUncompressedSize - nCurrent); } -void SAL_CALL EntryInputStream::closeInput( ) +void SAL_CALL EntryInputStream::closeInput( ) throw(io::NotConnectedException, io::IOException, RuntimeException) { } -void SAL_CALL EntryInputStream::seek( sal_Int64 location ) +void SAL_CALL EntryInputStream::seek( sal_Int64 location ) throw(lang::IllegalArgumentException, io::IOException, RuntimeException) { if (location > nUncompressedSize) @@ -190,7 +190,7 @@ void SAL_CALL EntryInputStream::seek( sal_Int64 location ) location = 0; nCurrent = location; } -sal_Int64 SAL_CALL EntryInputStream::getPosition( ) +sal_Int64 SAL_CALL EntryInputStream::getPosition( ) throw(io::IOException, RuntimeException) { return nCurrent; diff --git a/package/source/zipapi/EntryInputStream.hxx b/package/source/zipapi/EntryInputStream.hxx index 8a5bf0dc835f..cf1bf5aeb58f 100644 --- a/package/source/zipapi/EntryInputStream.hxx +++ b/package/source/zipapi/EntryInputStream.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,7 +35,7 @@ #include <com/sun/star/packages/zip/ZipEntry.hpp> #include <rtl/ref.hxx> #include <EncryptionData.hxx> -class EntryInputStream : public cppu::WeakImplHelper2< com::sun::star::io::XInputStream, +class EntryInputStream : public cppu::WeakImplHelper2< com::sun::star::io::XInputStream, com::sun::star::io::XSeekable > { protected: @@ -50,29 +50,29 @@ protected: void readIntoMemory() throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); public: - EntryInputStream( com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xInput, - const com::sun::star::packages::zip::ZipEntry &rNewEntry, + EntryInputStream( com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xInput, + const com::sun::star::packages::zip::ZipEntry &rNewEntry, const rtl::Reference < EncryptionData > &xEncryptData, sal_Bool bGetRawStream = sal_False); virtual ~EntryInputStream(); // XInputStream - virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) + virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) + virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) + virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL available( ) + virtual sal_Int32 SAL_CALL available( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL closeInput( ) + virtual void SAL_CALL closeInput( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); // XSeekable - virtual void SAL_CALL seek( sal_Int64 location ) + virtual void SAL_CALL seek( sal_Int64 location ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual sal_Int64 SAL_CALL getPosition( ) + virtual sal_Int64 SAL_CALL getPosition( ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual sal_Int64 SAL_CALL getLength( ) + virtual sal_Int64 SAL_CALL getLength( ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); /* private: diff --git a/package/source/zipapi/Inflater.cxx b/package/source/zipapi/Inflater.cxx index 26ba278cc9de..398742022138 100644 --- a/package/source/zipapi/Inflater.cxx +++ b/package/source/zipapi/Inflater.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -76,24 +76,24 @@ Inflater::~Inflater() end(); } -void SAL_CALL Inflater::setInput( const Sequence< sal_Int8 >& rBuffer ) +void SAL_CALL Inflater::setInput( const Sequence< sal_Int8 >& rBuffer ) { sInBuffer = rBuffer; nOffset = 0; nLength = rBuffer.getLength(); } -sal_Bool SAL_CALL Inflater::needsDictionary( ) +sal_Bool SAL_CALL Inflater::needsDictionary( ) { return bNeedDict; } -sal_Bool SAL_CALL Inflater::finished( ) +sal_Bool SAL_CALL Inflater::finished( ) { return bFinished; } -sal_Int32 SAL_CALL Inflater::doInflateSegment( Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength ) +sal_Int32 SAL_CALL Inflater::doInflateSegment( Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength ) { if (nNewOffset < 0 || nNewLength < 0 || nNewOffset + nNewLength > rBuffer.getLength()) { @@ -102,7 +102,7 @@ sal_Int32 SAL_CALL Inflater::doInflateSegment( Sequence< sal_Int8 >& rBuffer, sa return doInflateBytes(rBuffer, nNewOffset, nNewLength); } -void SAL_CALL Inflater::end( ) +void SAL_CALL Inflater::end( ) { if (pStream != NULL) { diff --git a/package/source/zipapi/MemoryByteGrabber.hxx b/package/source/zipapi/MemoryByteGrabber.hxx index 5e167490d632..bc413490443f 100644 --- a/package/source/zipapi/MemoryByteGrabber.hxx +++ b/package/source/zipapi/MemoryByteGrabber.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -32,7 +32,7 @@ #include <com/sun/star/io/XSeekable.hpp> #include <string.h> -class MemoryByteGrabber +class MemoryByteGrabber { protected: const com::sun::star::uno::Sequence < sal_Int8 > maBuffer; @@ -42,8 +42,8 @@ public: MemoryByteGrabber ( const com::sun::star::uno::Sequence < sal_Int8 > & rBuffer ) : maBuffer ( rBuffer ) , mpBuffer ( rBuffer.getConstArray() ) - , mnCurrent ( 0 ) - , mnEnd ( rBuffer.getLength() ) + , mnCurrent ( 0 ) + , mnEnd ( rBuffer.getLength() ) { } MemoryByteGrabber() @@ -52,8 +52,8 @@ public: const sal_Int8 * getCurrentPos () { return mpBuffer + mnCurrent; } // XInputStream chained - sal_Int32 SAL_CALL readBytes( com::sun::star::uno::Sequence< sal_Int8 >& aData, - sal_Int32 nBytesToRead ) + sal_Int32 SAL_CALL readBytes( com::sun::star::uno::Sequence< sal_Int8 >& aData, + sal_Int32 nBytesToRead ) throw(com::sun::star::io::NotConnectedException, com::sun::star::io::BufferSizeExceededException, com::sun::star::io::IOException, com::sun::star::uno::RuntimeException) { if ( nBytesToRead < 0) @@ -68,29 +68,29 @@ public: return nBytesToRead; } - sal_Int32 SAL_CALL readSomeBytes( com::sun::star::uno::Sequence< sal_Int8 >& aData, - sal_Int32 nMaxBytesToRead ) + sal_Int32 SAL_CALL readSomeBytes( com::sun::star::uno::Sequence< sal_Int8 >& aData, + sal_Int32 nMaxBytesToRead ) throw(com::sun::star::io::NotConnectedException, com::sun::star::io::BufferSizeExceededException, com::sun::star::io::IOException, com::sun::star::uno::RuntimeException) { - return readBytes( aData, nMaxBytesToRead ); + return readBytes( aData, nMaxBytesToRead ); } - void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) + void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) throw(com::sun::star::io::NotConnectedException, com::sun::star::io::BufferSizeExceededException, com::sun::star::io::IOException, com::sun::star::uno::RuntimeException) { mnCurrent += nBytesToSkip; } - sal_Int32 SAL_CALL available( ) + sal_Int32 SAL_CALL available( ) throw(com::sun::star::io::NotConnectedException, com::sun::star::io::IOException, com::sun::star::uno::RuntimeException) { return mnEnd - mnCurrent; } - void SAL_CALL closeInput( ) + void SAL_CALL closeInput( ) throw(com::sun::star::io::NotConnectedException, com::sun::star::io::IOException, com::sun::star::uno::RuntimeException) { } // XSeekable chained... - sal_Int64 SAL_CALL seek( sal_Int64 location ) + sal_Int64 SAL_CALL seek( sal_Int64 location ) throw(com::sun::star::lang::IllegalArgumentException, com::sun::star::io::IOException, com::sun::star::uno::RuntimeException) { if ( location < 0 || location > mnEnd ) @@ -98,7 +98,7 @@ public: mnCurrent = static_cast < sal_Int32 > ( location ); return mnCurrent; } - sal_Int64 SAL_CALL getPosition( ) + sal_Int64 SAL_CALL getPosition( ) throw(com::sun::star::io::IOException, com::sun::star::uno::RuntimeException) { return mnCurrent; diff --git a/package/source/zipapi/XMemoryStream.cxx b/package/source/zipapi/XMemoryStream.cxx index 7003bf1b814b..8b737db6e2d2 100644 --- a/package/source/zipapi/XMemoryStream.cxx +++ b/package/source/zipapi/XMemoryStream.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -40,16 +40,16 @@ XMemoryStream::XMemoryStream ( com::sun::star::uno::Sequence < sal_Int8 > & rNew XMemoryStream::~XMemoryStream(void) { } -::com::sun::star::uno::Any SAL_CALL XMemoryStream::queryInterface( const com::sun::star::uno::Type& rType ) +::com::sun::star::uno::Any SAL_CALL XMemoryStream::queryInterface( const com::sun::star::uno::Type& rType ) throw(com::sun::star::uno::RuntimeException) { - return ::cppu::queryInterface ( rType , + return ::cppu::queryInterface ( rType , // OWeakObject interfaces - reinterpret_cast< XInterface* > ( this ) , - static_cast< XWeak* > ( this ) , + reinterpret_cast< XInterface* > ( this ) , + static_cast< XWeak* > ( this ) , // my interfaces - static_cast< XInputStream* > ( this ) , - static_cast< XSeekable* > ( this ) ); + static_cast< XInputStream* > ( this ) , + static_cast< XSeekable* > ( this ) ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zipapi/XMemoryStream.hxx b/package/source/zipapi/XMemoryStream.hxx index 935712abbe42..e6bc88e81797 100644 --- a/package/source/zipapi/XMemoryStream.hxx +++ b/package/source/zipapi/XMemoryStream.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,7 +37,7 @@ class XMemoryStream: public ZipPackageBuffer public: XMemoryStream ( com::sun::star::uno::Sequence < sal_Int8 > & rNewBuffer ); virtual ~XMemoryStream(void); - virtual com::sun::star::uno::Any SAL_CALL queryInterface( const com::sun::star::uno::Type& rType ) + virtual com::sun::star::uno::Any SAL_CALL queryInterface( const com::sun::star::uno::Type& rType ) throw(com::sun::star::uno::RuntimeException); }; #endif diff --git a/package/source/zipapi/XUnbufferedStream.hxx b/package/source/zipapi/XUnbufferedStream.hxx index 6da133e32ef4..6f9e0d572b3e 100644 --- a/package/source/zipapi/XUnbufferedStream.hxx +++ b/package/source/zipapi/XUnbufferedStream.hxx @@ -40,9 +40,9 @@ #include <CRC32.hxx> #include <mutexholder.hxx> -#define UNBUFF_STREAM_DATA 0 -#define UNBUFF_STREAM_RAW 1 -#define UNBUFF_STREAM_WRAPPEDRAW 2 +#define UNBUFF_STREAM_DATA 0 +#define UNBUFF_STREAM_RAW 1 +#define UNBUFF_STREAM_WRAPPEDRAW 2 class EncryptionData; typedef void* rtlCipher; diff --git a/package/source/zipapi/ZipEnumeration.cxx b/package/source/zipapi/ZipEnumeration.cxx index 767aacc92a54..45ac260ea7e8 100644 --- a/package/source/zipapi/ZipEnumeration.cxx +++ b/package/source/zipapi/ZipEnumeration.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index 005d29196fd6..7a1b5d964ba9 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -252,9 +252,9 @@ sal_Bool ZipFile::StaticFillData ( rtl::Reference < EncryptionData > & rData, sal_Int16 nSaltLength = pBuffer[nPos++] & 0xFF; nSaltLength |= ( pBuffer[nPos++] & 0xFF ) << 8; sal_Int16 nIVLength = ( pBuffer[nPos++] & 0xFF ); - nIVLength |= ( pBuffer[nPos++] & 0xFF ) << 8; + nIVLength |= ( pBuffer[nPos++] & 0xFF ) << 8; sal_Int16 nDigestLength = pBuffer[nPos++] & 0xFF; - nDigestLength |= ( pBuffer[nPos++] & 0xFF ) << 8; + nDigestLength |= ( pBuffer[nPos++] & 0xFF ) << 8; sal_Int16 nMediaTypeLength = pBuffer[nPos++] & 0xFF; nMediaTypeLength |= ( pBuffer[nPos++] & 0xFF ) << 8; @@ -286,7 +286,7 @@ sal_Bool ZipFile::StaticFillData ( rtl::Reference < EncryptionData > & rData, return bOk; } -Reference< XInputStream > ZipFile::StaticGetDataFromRawStream( const Reference< XInputStream >& xStream, +Reference< XInputStream > ZipFile::StaticGetDataFromRawStream( const Reference< XInputStream >& xStream, const rtl::Reference < EncryptionData > &rData ) throw ( packages::WrongPasswordException, ZipIOException, RuntimeException ) { diff --git a/package/source/zipapi/ZipOutputStream.cxx b/package/source/zipapi/ZipOutputStream.cxx index 02b66bad182b..d4778a87b04b 100644 --- a/package/source/zipapi/ZipOutputStream.cxx +++ b/package/source/zipapi/ZipOutputStream.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -68,18 +68,18 @@ ZipOutputStream::~ZipOutputStream( void ) delete aZipList[i]; } -void SAL_CALL ZipOutputStream::setMethod( sal_Int32 nNewMethod ) +void SAL_CALL ZipOutputStream::setMethod( sal_Int32 nNewMethod ) throw(RuntimeException) { nMethod = static_cast < sal_Int16 > (nNewMethod); } -void SAL_CALL ZipOutputStream::setLevel( sal_Int32 nNewLevel ) +void SAL_CALL ZipOutputStream::setLevel( sal_Int32 nNewLevel ) throw(RuntimeException) { aDeflater.setLevel( nNewLevel); } -void SAL_CALL ZipOutputStream::putNextEntry( ZipEntry& rEntry, +void SAL_CALL ZipOutputStream::putNextEntry( ZipEntry& rEntry, rtl::Reference < EncryptionData > &xEncryptData, sal_Bool bEncrypt) throw(IOException, RuntimeException) @@ -113,7 +113,7 @@ void SAL_CALL ZipOutputStream::putNextEntry( ZipEntry& rEntry, pCurrentEntry = &rEntry; } -void SAL_CALL ZipOutputStream::closeEntry( ) +void SAL_CALL ZipOutputStream::closeEntry( ) throw(IOException, RuntimeException) { ZipEntry *pEntry = pCurrentEntry; @@ -170,7 +170,7 @@ void SAL_CALL ZipOutputStream::closeEntry( ) bEncryptCurrentEntry = sal_False; rtl_cipher_destroy ( aCipher ); pCurrentEncryptData->aDigest.realloc ( RTL_DIGEST_LENGTH_SHA1 ); - aDigestResult = rtl_digest_getSHA1 ( aDigest, + aDigestResult = rtl_digest_getSHA1 ( aDigest, reinterpret_cast < sal_uInt8 * > ( pCurrentEncryptData->aDigest.getArray() ), RTL_DIGEST_LENGTH_SHA1 ); OSL_ASSERT( aDigestResult == rtl_Digest_E_None ); @@ -180,7 +180,7 @@ void SAL_CALL ZipOutputStream::closeEntry( ) } } -void SAL_CALL ZipOutputStream::write( const Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength ) +void SAL_CALL ZipOutputStream::write( const Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength ) throw(IOException, RuntimeException) { switch (pCurrentEntry->nMethod) @@ -204,14 +204,14 @@ void SAL_CALL ZipOutputStream::write( const Sequence< sal_Int8 >& rBuffer, sal_I } } -void SAL_CALL ZipOutputStream::rawWrite( Sequence< sal_Int8 >& rBuffer, sal_Int32 /*nNewOffset*/, sal_Int32 nNewLength ) +void SAL_CALL ZipOutputStream::rawWrite( Sequence< sal_Int8 >& rBuffer, sal_Int32 /*nNewOffset*/, sal_Int32 nNewLength ) throw(IOException, RuntimeException) { Sequence < sal_Int8 > aTmpBuffer ( rBuffer.getConstArray(), nNewLength ); aChucker.WriteBytes( aTmpBuffer ); } -void SAL_CALL ZipOutputStream::rawCloseEntry( ) +void SAL_CALL ZipOutputStream::rawCloseEntry( ) throw(IOException, RuntimeException) { if ( pCurrentEntry->nMethod == DEFLATED && ( pCurrentEntry->nFlag & 8 ) ) @@ -219,7 +219,7 @@ void SAL_CALL ZipOutputStream::rawCloseEntry( ) pCurrentEntry = NULL; } -void SAL_CALL ZipOutputStream::finish( ) +void SAL_CALL ZipOutputStream::finish( ) throw(IOException, RuntimeException) { if (bFinished) @@ -295,7 +295,7 @@ void ZipOutputStream::writeCEN( const ZipEntry &rEntry ) throw IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unexpected character is used in file name." ) ), Reference< XInterface >() ); ::rtl::OString sUTF8Name = ::rtl::OUStringToOString( rEntry.sPath, RTL_TEXTENCODING_UTF8 ); - sal_Int16 nNameLength = static_cast < sal_Int16 > ( sUTF8Name.getLength() ); + sal_Int16 nNameLength = static_cast < sal_Int16 > ( sUTF8Name.getLength() ); aChucker << CENSIG; aChucker << rEntry.nVersion; @@ -344,7 +344,7 @@ sal_Int32 ZipOutputStream::writeLOC( const ZipEntry &rEntry ) throw IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unexpected character is used in file name." ) ), Reference< XInterface >() ); ::rtl::OString sUTF8Name = ::rtl::OUStringToOString( rEntry.sPath, RTL_TEXTENCODING_UTF8 ); - sal_Int16 nNameLength = static_cast < sal_Int16 > ( sUTF8Name.getLength() ); + sal_Int16 nNameLength = static_cast < sal_Int16 > ( sUTF8Name.getLength() ); aChucker << LOCSIG; aChucker << rEntry.nVersion; @@ -397,7 +397,7 @@ sal_uInt32 ZipOutputStream::getCurrentDosTime( ) nYear-=1980; else if (nYear>80) nYear-=80; - sal_uInt32 nResult = static_cast < sal_uInt32>( ( ( ( aDateTime.Day) + + sal_uInt32 nResult = static_cast < sal_uInt32>( ( ( ( aDateTime.Day) + ( 32 * (aDateTime.Month)) + ( 512 * nYear ) ) << 16) | ( ( aDateTime.Seconds/2) + @@ -407,7 +407,7 @@ sal_uInt32 ZipOutputStream::getCurrentDosTime( ) } /* - This is actually never used, so I removed it, but thought that the + This is actually never used, so I removed it, but thought that the implementation details may be useful in the future...mtg 20010307 I stopped using the time library and used the OSL version instead, but diff --git a/package/source/zippackage/ContentInfo.hxx b/package/source/zippackage/ContentInfo.hxx index baf5078147a2..65a8a0c7a240 100644 --- a/package/source/zippackage/ContentInfo.hxx +++ b/package/source/zippackage/ContentInfo.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -44,19 +44,19 @@ public: ZipPackageFolder *pFolder; ZipPackageStream *pStream; }; - ContentInfo ( ZipPackageStream * pNewStream ) + ContentInfo ( ZipPackageStream * pNewStream ) : xTunnel ( pNewStream ) , bFolder ( false ) , pStream ( pNewStream ) { } - ContentInfo ( ZipPackageFolder * pNewFolder ) + ContentInfo ( ZipPackageFolder * pNewFolder ) : xTunnel ( pNewFolder ) , bFolder ( true ) , pFolder ( pNewFolder ) { } - virtual ~ContentInfo () + virtual ~ContentInfo () { if ( bFolder ) pFolder->releaseUpwardRef(); diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index fbfb575d9dfb..89767c9acf5a 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -144,22 +144,22 @@ class ActiveDataStreamer : public ::cppu::WeakImplHelper1< XActiveDataStreamer > uno::Reference< XStream > mStream; public: - virtual uno::Reference< XStream > SAL_CALL getStream() - throw( RuntimeException ) + virtual uno::Reference< XStream > SAL_CALL getStream() + throw( RuntimeException ) { return mStream; } - virtual void SAL_CALL setStream( const uno::Reference< XStream >& stream ) - throw( RuntimeException ) + virtual void SAL_CALL setStream( const uno::Reference< XStream >& stream ) + throw( RuntimeException ) { mStream = stream; } }; class DummyInputStream : public ::cppu::WeakImplHelper1< XInputStream > { - virtual sal_Int32 SAL_CALL readBytes( Sequence< sal_Int8 >&, sal_Int32 ) + virtual sal_Int32 SAL_CALL readBytes( Sequence< sal_Int8 >&, sal_Int32 ) throw ( NotConnectedException, BufferSizeExceededException, IOException, RuntimeException) { return 0; } - virtual sal_Int32 SAL_CALL readSomeBytes( Sequence< sal_Int8 >&, sal_Int32 ) + virtual sal_Int32 SAL_CALL readSomeBytes( Sequence< sal_Int8 >&, sal_Int32 ) throw ( NotConnectedException, BufferSizeExceededException, IOException, RuntimeException) { return 0; } @@ -227,7 +227,7 @@ void ZipPackage::parseManifest() if ( m_xRootFolder->hasByName( sMeta ) ) { const OUString sManifest (RTL_CONSTASCII_USTRINGPARAM( "manifest.xml") ); - + try { uno::Reference< XUnoTunnel > xTunnel; Any aAny = m_xRootFolder->getByName( sMeta ); @@ -252,13 +252,13 @@ void ZipPackage::parseManifest() const OUString sPropIterationCount ( RTL_CONSTASCII_USTRINGPARAM ( "IterationCount" ) ); const OUString sPropSize ( RTL_CONSTASCII_USTRINGPARAM ( "Size" ) ); const OUString sPropDigest ( RTL_CONSTASCII_USTRINGPARAM ( "Digest" ) ); - + Sequence < Sequence < PropertyValue > > aManifestSequence = xReader->readManifestSequence ( xSink->getInputStream() ); sal_Int32 nLength = aManifestSequence.getLength(); const Sequence < PropertyValue > *pSequence = aManifestSequence.getConstArray(); ZipPackageStream *pStream = NULL; ZipPackageFolder *pFolder = NULL; - + for (sal_Int32 i = 0; i < nLength ; i++, pSequence++) { OUString sPath, sMediaType, sVersion; @@ -301,31 +301,31 @@ void ZipPackage::parseManifest() pStream = reinterpret_cast < ZipPackageStream* > ( xUnoTunnel->getSomething(ZipPackageStream::static_getImplementationId())); pStream->SetMediaType ( sMediaType ); pStream->SetFromManifest( sal_True ); - + if (pSalt && pVector && pCount && pSize) { Sequence < sal_uInt8 > aSequence; sal_Int32 nCount = 0, nSize = 0; pStream->SetToBeEncrypted ( sal_True ); - + *pSalt >>= aSequence; pStream->setSalt ( aSequence ); - + *pVector >>= aSequence; pStream->setInitialisationVector ( aSequence ); - + *pCount >>= nCount; pStream->setIterationCount ( nCount ); - + *pSize >>= nSize; pStream->setSize ( nSize ); - + if ( pDigest ) { *pDigest >>= aSequence; pStream->setDigest ( aSequence ); } - + pStream->SetToBeCompressed ( sal_True ); pStream->SetToBeEncrypted ( sal_True ); pStream->SetIsEncrypted ( sal_True ); @@ -344,7 +344,7 @@ void ZipPackage::parseManifest() else throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "No manifes parser!" ) ), uno::Reference< uno::XInterface >() ); } - + // now hide the manifest.xml file from user xMetaInfFolder->removeByName( sManifest ); } @@ -385,7 +385,7 @@ void ZipPackage::parseManifest() } } - + if ( !bManifestParsed ) { // the manifest.xml could not be successfuly parsed, this is an inconsistent package @@ -468,7 +468,7 @@ void ZipPackage::parseContentType() aPath = aContentTypeInfo[1][nInd].First.copy( 1 ); else aPath = aContentTypeInfo[1][nInd].First; - + if ( aPath.getLength() && hasByHierarchicalName( aPath ) ) { uno::Any aIterAny = getByHierarchicalName( aPath ); @@ -533,7 +533,7 @@ void ZipPackage::getZipFileContents() while ( (nIndex = rName.indexOf('/', nOldIndex) ) != -1 ) { sTemp = rName.copy ( nOldIndex, nIndex - nOldIndex ); - if (nIndex == nOldIndex) + if (nIndex == nOldIndex) break; if ( !pCurrent->hasByName( sTemp ) ) { @@ -544,7 +544,7 @@ void ZipPackage::getZipFileContents() } else pCurrent = pCurrent->doGetByName(sTemp).pFolder; - nOldIndex = nIndex+1; + nOldIndex = nIndex+1; } if ( nStreamIndex != -1 && sDirName.getLength() ) m_aRecent [ sDirName ] = pCurrent; @@ -558,7 +558,7 @@ void ZipPackage::getZipFileContents() pPkgStream->setZipEntryOnLoading( rEntry ); pPkgStream->setName( sTemp ); pPkgStream->doSetParent( pCurrent, sal_True ); - } + } } if ( m_nFormat == embed::StorageFormats::PACKAGE ) @@ -568,10 +568,10 @@ void ZipPackage::getZipFileContents() } // XInitialization -void SAL_CALL ZipPackage::initialize( const Sequence< Any >& aArguments ) +void SAL_CALL ZipPackage::initialize( const Sequence< Any >& aArguments ) throw(Exception, RuntimeException) { - RTL_LOGFILE_TRACE_AUTHOR ( "package", LOGFILE_AUTHOR, "{ ZipPackage::initialize" ); + RTL_LOGFILE_TRACE_AUTHOR ( "package", LOGFILE_AUTHOR, "{ ZipPackage::initialize" ); sal_Bool bBadZipFile = sal_False, bHaveZipFile = sal_True; uno::Reference< XProgressHandler > xProgressHandler; beans::NamedValue aNamedValue; @@ -618,7 +618,7 @@ void SAL_CALL ZipPackage::initialize( const Sequence< Any >& aArguments ) } else m_aURL = aParamUrl; - + Content aContent ( m_aURL, uno::Reference < XCommandEnvironment >() ); Any aAny = aContent.getPropertyValue( OUString::createFromAscii( "Size" ) ); sal_uInt64 aSize = 0; @@ -637,7 +637,7 @@ void SAL_CALL ZipPackage::initialize( const Sequence< Any >& aArguments ) catch (com::sun::star::uno::Exception&) { // Exception derived from uno::Exception thrown. This probably - // means the file doesn't exist...we'll create it at + // means the file doesn't exist...we'll create it at // commitChanges time bHaveZipFile = sal_False; } @@ -734,7 +734,7 @@ void SAL_CALL ZipPackage::initialize( const Sequence< Any >& aArguments ) catch (com::sun::star::uno::Exception&) { // Exception derived from uno::Exception thrown. This probably - // means the file doesn't exist...we'll create it at + // means the file doesn't exist...we'll create it at // commitChanges time bHaveZipFile = sal_False; } @@ -742,7 +742,7 @@ void SAL_CALL ZipPackage::initialize( const Sequence< Any >& aArguments ) { try { - m_pZipFile = new ZipFile ( m_xContentStream, m_xFactory, sal_True, m_bForceRecovery, xProgressHandler ); + m_pZipFile = new ZipFile ( m_xContentStream, m_xFactory, sal_True, m_bForceRecovery, xProgressHandler ); getZipFileContents(); } catch ( IOException & ) @@ -758,7 +758,7 @@ void SAL_CALL ZipPackage::initialize( const Sequence< Any >& aArguments ) if( m_pZipFile ) { delete m_pZipFile; m_pZipFile = NULL; } throw; } - + if ( bBadZipFile ) { // clean up the memory, and tell the UCB about the error @@ -771,19 +771,19 @@ void SAL_CALL ZipPackage::initialize( const Sequence< Any >& aArguments ) } } - RTL_LOGFILE_TRACE_AUTHOR ( "package", LOGFILE_AUTHOR, "} ZipPackage::initialize" ); + RTL_LOGFILE_TRACE_AUTHOR ( "package", LOGFILE_AUTHOR, "} ZipPackage::initialize" ); } -Any SAL_CALL ZipPackage::getByHierarchicalName( const OUString& aName ) +Any SAL_CALL ZipPackage::getByHierarchicalName( const OUString& aName ) throw(NoSuchElementException, RuntimeException) { - OUString sTemp, sDirName; + OUString sTemp, sDirName; sal_Int32 nOldIndex, nIndex, nStreamIndex; FolderHash::iterator aIter; if ( (nIndex = aName.getLength() ) == 1 && *aName.getStr() == '/' ) return makeAny ( uno::Reference < XUnoTunnel > (m_pRootFolder) ); - else + else { nStreamIndex = aName.lastIndexOf ( '/' ); bool bFolder = nStreamIndex == nIndex-1; @@ -832,7 +832,7 @@ Any SAL_CALL ZipPackage::getByHierarchicalName( const OUString& aName ) } else throw NoSuchElementException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - nOldIndex = nIndex+1; + nOldIndex = nIndex+1; } if ( bFolder ) { @@ -855,16 +855,16 @@ Any SAL_CALL ZipPackage::getByHierarchicalName( const OUString& aName ) } } -sal_Bool SAL_CALL ZipPackage::hasByHierarchicalName( const OUString& aName ) +sal_Bool SAL_CALL ZipPackage::hasByHierarchicalName( const OUString& aName ) throw(RuntimeException) { - OUString sTemp, sDirName; + OUString sTemp, sDirName; sal_Int32 nOldIndex, nIndex, nStreamIndex; FolderHash::iterator aIter; if ( (nIndex = aName.getLength() ) == 1 && *aName.getStr() == '/' ) return sal_True; - else + else { nStreamIndex = aName.lastIndexOf ( '/' ); bool bFolder = nStreamIndex == nIndex-1; @@ -913,7 +913,7 @@ sal_Bool SAL_CALL ZipPackage::hasByHierarchicalName( const OUString& aName ) } else return sal_False; - nOldIndex = nIndex+1; + nOldIndex = nIndex+1; } if ( bFolder ) { @@ -935,13 +935,13 @@ sal_Bool SAL_CALL ZipPackage::hasByHierarchicalName( const OUString& aName ) } // XSingleServiceFactory -uno::Reference< XInterface > SAL_CALL ZipPackage::createInstance( ) +uno::Reference< XInterface > SAL_CALL ZipPackage::createInstance( ) throw(Exception, RuntimeException) { uno::Reference < XInterface > xRef = *(new ZipPackageStream ( *this, m_xFactory, m_bAllowRemoveOnInsert )); return xRef; } -uno::Reference< XInterface > SAL_CALL ZipPackage::createInstanceWithArguments( const Sequence< Any >& aArguments ) +uno::Reference< XInterface > SAL_CALL ZipPackage::createInstanceWithArguments( const Sequence< Any >& aArguments ) throw(Exception, RuntimeException) { sal_Bool bArg = sal_False; @@ -968,7 +968,7 @@ void ZipPackage::WriteMimetypeMagicFile( ZipOutputStream& aZipOut ) Sequence< sal_Int8 > aType( (sal_Int8*)sMediaType.getStr(), nBufferLength ); - + pEntry->sPath = sMime; pEntry->nMethod = STORED; pEntry->nSize = pEntry->nCompressedSize = nBufferLength; @@ -988,9 +988,9 @@ void ZipPackage::WriteMimetypeMagicFile( ZipOutputStream& aZipOut ) catch ( ::com::sun::star::io::IOException & r ) { OSL_ENSURE( 0, "Error adding mimetype to the ZipOutputStream" ); - throw WrappedTargetException( + throw WrappedTargetException( OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "Error adding mimetype to the ZipOutputStream!" ) ), - static_cast < OWeakObject * > ( this ), + static_cast < OWeakObject * > ( this ), makeAny( r ) ); } } @@ -1034,9 +1034,9 @@ void ZipPackage::WriteManifest( ZipOutputStream& aZipOut, const vector< Sequence { OSL_ENSURE ( 0, "Couldn't get a ManifestWriter!" ); IOException aException; - throw WrappedTargetException( + throw WrappedTargetException( OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "Couldn't get a ManifestWriter!" ) ), - static_cast < OWeakObject * > ( this ), + static_cast < OWeakObject * > ( this ), makeAny( aException ) ); } } @@ -1099,12 +1099,12 @@ void ZipPackage::ConnectTo( const uno::Reference< io::XInputStream >& xInStream m_xContentSeek.set( xInStream, uno::UNO_QUERY_THROW ); m_xContentStream = xInStream; - // seek back to the beginning of the temp file so we can read segments from it + // seek back to the beginning of the temp file so we can read segments from it m_xContentSeek->seek( 0 ); if ( m_pZipFile ) m_pZipFile->setInputStream( m_xContentStream ); else - m_pZipFile = new ZipFile ( m_xContentStream, m_xFactory, sal_False ); + m_pZipFile = new ZipFile ( m_xContentStream, m_xFactory, sal_False ); } uno::Reference< io::XInputStream > ZipPackage::writeTempFile() @@ -1113,7 +1113,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile() // write directly to it otherwize create a temporary file to write to. // If a temporary file is created it is returned back by the method. // If the data written directly, xComponentStream will be switched here - + sal_Bool bUseTemp = sal_True; uno::Reference < io::XInputStream > xResult; uno::Reference < io::XInputStream > xTempIn; @@ -1142,7 +1142,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile() if( xTempOut.is() ) bUseTemp = sal_False; } - + if( bUseTemp ) { // create temporary file @@ -1151,7 +1151,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile() xTempOut.set( xTempFile->getOutputStream(), UNO_SET_THROW ); xTempIn.set( xTempFile->getInputStream(), UNO_SET_THROW ); } - + // Hand it to the ZipOutputStream: ZipOutputStream aZipOut ( xTempOut ); aZipOut.setMethod(DEFLATED); @@ -1162,14 +1162,14 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile() if ( m_nFormat == embed::StorageFormats::PACKAGE ) { // Remove the old manifest.xml file as the - // manifest will be re-generated and the + // manifest will be re-generated and the // META-INF directory implicitly created if does not exist const OUString sMeta ( RTL_CONSTASCII_USTRINGPARAM ( "META-INF" ) ); if ( m_xRootFolder->hasByName( sMeta ) ) { const OUString sManifest (RTL_CONSTASCII_USTRINGPARAM( "manifest.xml") ); - + uno::Reference< XUnoTunnel > xTunnel; Any aAny = m_xRootFolder->getByName( sMeta ); aAny >>= xTunnel; @@ -1218,13 +1218,13 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile() TimeValue aTime; osl_getSystemTime( &aTime ); rtlRandomPool aRandomPool = rtl_random_createPool (); - rtl_random_addBytes ( aRandomPool, &aTime, 8 ); - + rtl_random_addBytes ( aRandomPool, &aTime, 8 ); + // call saveContents (it will recursively save sub-directories OUString aEmptyString; m_pRootFolder->saveContents( aEmptyString, aManList, aZipOut, m_aEncryptionKey, aRandomPool ); - + // Clean up random pool memory rtl_random_destroyPool ( aRandomPool ); @@ -1238,7 +1238,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile() } aZipOut.finish(); - + if( bUseTemp ) xResult = xTempIn; @@ -1303,7 +1303,7 @@ uno::Reference< XActiveDataStreamer > ZipPackage::openOriginalForOutput() Content aOriginalContent (m_aURL, uno::Reference < XCommandEnvironment >() ); uno::Reference< XActiveDataStreamer > xSink = new ActiveDataStreamer; - if ( m_eMode == e_IMode_URL ) + if ( m_eMode == e_IMode_URL ) { try { @@ -1331,11 +1331,11 @@ uno::Reference< XActiveDataStreamer > ZipPackage::openOriginalForOutput() } OpenCommandArgument2 aArg; - aArg.Mode = OpenMode::DOCUMENT; - aArg.Priority = 0; // unused + aArg.Mode = OpenMode::DOCUMENT; + aArg.Priority = 0; // unused aArg.Sink = xSink; aArg.Properties = Sequence< Property >( 0 ); // unused - + aOriginalContent.executeCommand( OUString::createFromAscii( "open" ), makeAny( aArg ) ); } catch( Exception& ) @@ -1349,7 +1349,7 @@ uno::Reference< XActiveDataStreamer > ZipPackage::openOriginalForOutput() } // XChangesBatch -void SAL_CALL ZipPackage::commitChanges() +void SAL_CALL ZipPackage::commitChanges() throw(WrappedTargetException, RuntimeException) { // lock the component for the time of commiting @@ -1362,7 +1362,7 @@ void SAL_CALL ZipPackage::commitChanges() static_cast < OWeakObject * > ( this ), makeAny ( aException ) ); } - RTL_LOGFILE_TRACE_AUTHOR ( "package", LOGFILE_AUTHOR, "{ ZipPackage::commitChanges" ); + RTL_LOGFILE_TRACE_AUTHOR ( "package", LOGFILE_AUTHOR, "{ ZipPackage::commitChanges" ); // first the writeTempFile is called, if it returns a stream the stream should be written to the target // if no stream was returned, the file was written directly, nothing should be done @@ -1430,7 +1430,7 @@ void SAL_CALL ZipPackage::commitChanges() { uno::Reference< XOutputStream > aOrigFileStream; sal_Bool bCanBeCorrupted = sal_False; - + if( isLocalFile_Impl( m_aURL ) ) { // write directly in case of local file @@ -1471,7 +1471,7 @@ void SAL_CALL ZipPackage::commitChanges() } } } - + if( !aOrigFileStream.is() ) { try @@ -1483,11 +1483,11 @@ void SAL_CALL ZipPackage::commitChanges() OUString sTargetFolder = m_aURL.copy ( 0, m_aURL.lastIndexOf ( static_cast < sal_Unicode > ( '/' ) ) ); Content aContent ( sTargetFolder, uno::Reference < XCommandEnvironment > () ); - + OUString sTempURL; Any aAny = xPropSet->getPropertyValue ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Uri" ) ) ); aAny >>= sTempURL; - + TransferInfo aInfo; aInfo.NameClash = NameClash::OVERWRITE; aInfo.MoveData = sal_False; @@ -1517,7 +1517,7 @@ void SAL_CALL ZipPackage::commitChanges() // after successful storing it can be set to false m_bMediaTypeFallbackUsed = sal_False; - RTL_LOGFILE_TRACE_AUTHOR ( "package", LOGFILE_AUTHOR, "} ZipPackage::commitChanges" ); + RTL_LOGFILE_TRACE_AUTHOR ( "package", LOGFILE_AUTHOR, "} ZipPackage::commitChanges" ); } void ZipPackage::DisconnectFromTargetAndThrowException_Impl( const uno::Reference< io::XInputStream >& xTempStream ) @@ -1548,12 +1548,12 @@ void ZipPackage::DisconnectFromTargetAndThrowException_Impl( const uno::Referenc makeAny ( aException ) ); } -sal_Bool SAL_CALL ZipPackage::hasPendingChanges( ) +sal_Bool SAL_CALL ZipPackage::hasPendingChanges( ) throw(RuntimeException) { return sal_False; } -Sequence< ElementChange > SAL_CALL ZipPackage::getPendingChanges( ) +Sequence< ElementChange > SAL_CALL ZipPackage::getPendingChanges( ) throw(RuntimeException) { return Sequence < ElementChange > (); @@ -1612,27 +1612,27 @@ uno::Reference < XSingleServiceFactory > ZipPackage::createServiceFactory( uno:: namespace { struct lcl_ImplId : public rtl::Static< ::cppu::OImplementationId, lcl_ImplId > {}; } // XUnoTunnel -Sequence< sal_Int8 > ZipPackage::getUnoTunnelImplementationId( void ) +Sequence< sal_Int8 > ZipPackage::getUnoTunnelImplementationId( void ) throw (RuntimeException) { ::cppu::OImplementationId &rId = lcl_ImplId::get(); return rId.getImplementationId(); } -sal_Int64 SAL_CALL ZipPackage::getSomething( const Sequence< sal_Int8 >& aIdentifier ) +sal_Int64 SAL_CALL ZipPackage::getSomething( const Sequence< sal_Int8 >& aIdentifier ) throw(RuntimeException) -{ +{ if (aIdentifier.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) return reinterpret_cast < sal_Int64 > ( this ); return 0; } -uno::Reference< XPropertySetInfo > SAL_CALL ZipPackage::getPropertySetInfo( ) +uno::Reference< XPropertySetInfo > SAL_CALL ZipPackage::getPropertySetInfo( ) throw(RuntimeException) { return uno::Reference < XPropertySetInfo > (); } -void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const Any& aValue ) +void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const Any& aValue ) throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { if ( m_nFormat != embed::StorageFormats::PACKAGE ) @@ -1656,12 +1656,12 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const else throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } -Any SAL_CALL ZipPackage::getPropertyValue( const OUString& PropertyName ) +Any SAL_CALL ZipPackage::getPropertyValue( const OUString& PropertyName ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { // TODO/LATER: Activate the check when zip-ucp is ready // if ( m_nFormat != embed::StorageFormats::PACKAGE ) - // throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + // throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); Any aAny; if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "EncryptionKey" ) ) ) @@ -1696,19 +1696,19 @@ Any SAL_CALL ZipPackage::getPropertyValue( const OUString& PropertyName ) } throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } -void SAL_CALL ZipPackage::addPropertyChangeListener( const OUString& /*aPropertyName*/, const uno::Reference< XPropertyChangeListener >& /*xListener*/ ) +void SAL_CALL ZipPackage::addPropertyChangeListener( const OUString& /*aPropertyName*/, const uno::Reference< XPropertyChangeListener >& /*xListener*/ ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { } -void SAL_CALL ZipPackage::removePropertyChangeListener( const OUString& /*aPropertyName*/, const uno::Reference< XPropertyChangeListener >& /*aListener*/ ) +void SAL_CALL ZipPackage::removePropertyChangeListener( const OUString& /*aPropertyName*/, const uno::Reference< XPropertyChangeListener >& /*aListener*/ ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { } -void SAL_CALL ZipPackage::addVetoableChangeListener( const OUString& /*PropertyName*/, const uno::Reference< XVetoableChangeListener >& /*aListener*/ ) +void SAL_CALL ZipPackage::addVetoableChangeListener( const OUString& /*PropertyName*/, const uno::Reference< XVetoableChangeListener >& /*aListener*/ ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { } -void SAL_CALL ZipPackage::removeVetoableChangeListener( const OUString& /*PropertyName*/, const uno::Reference< XVetoableChangeListener >& /*aListener*/ ) +void SAL_CALL ZipPackage::removeVetoableChangeListener( const OUString& /*PropertyName*/, const uno::Reference< XVetoableChangeListener >& /*aListener*/ ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { } diff --git a/package/source/zippackage/ZipPackageBuffer.cxx b/package/source/zippackage/ZipPackageBuffer.cxx index d6a20eb0b96c..2fbbd01e234c 100644 --- a/package/source/zippackage/ZipPackageBuffer.cxx +++ b/package/source/zippackage/ZipPackageBuffer.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -43,11 +43,11 @@ ZipPackageBuffer::ZipPackageBuffer(sal_Int64 nNewBufferSize ) , m_bMustInitBuffer ( sal_True ) { } -ZipPackageBuffer::~ZipPackageBuffer(void) +ZipPackageBuffer::~ZipPackageBuffer(void) { } -sal_Int32 SAL_CALL ZipPackageBuffer::readBytes( Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) +sal_Int32 SAL_CALL ZipPackageBuffer::readBytes( Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw(NotConnectedException, BufferSizeExceededException, IOException, RuntimeException) { if (nBytesToRead < 0) @@ -62,12 +62,12 @@ sal_Int32 SAL_CALL ZipPackageBuffer::readBytes( Sequence< sal_Int8 >& aData, sal return nBytesToRead; } -sal_Int32 SAL_CALL ZipPackageBuffer::readSomeBytes( Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) +sal_Int32 SAL_CALL ZipPackageBuffer::readSomeBytes( Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) throw(NotConnectedException, BufferSizeExceededException, IOException, RuntimeException) { return readBytes(aData, nMaxBytesToRead); } -void SAL_CALL ZipPackageBuffer::skipBytes( sal_Int32 nBytesToSkip ) +void SAL_CALL ZipPackageBuffer::skipBytes( sal_Int32 nBytesToSkip ) throw(NotConnectedException, BufferSizeExceededException, IOException, RuntimeException) { if (nBytesToSkip < 0) @@ -78,16 +78,16 @@ void SAL_CALL ZipPackageBuffer::skipBytes( sal_Int32 nBytesToSkip ) m_nCurrent+=nBytesToSkip; } -sal_Int32 SAL_CALL ZipPackageBuffer::available( ) +sal_Int32 SAL_CALL ZipPackageBuffer::available( ) throw(NotConnectedException, IOException, RuntimeException) { return static_cast < sal_Int32 > (m_nEnd - m_nCurrent); } -void SAL_CALL ZipPackageBuffer::closeInput( ) +void SAL_CALL ZipPackageBuffer::closeInput( ) throw(NotConnectedException, IOException, RuntimeException) { } -void SAL_CALL ZipPackageBuffer::writeBytes( const Sequence< sal_Int8 >& aData ) +void SAL_CALL ZipPackageBuffer::writeBytes( const Sequence< sal_Int8 >& aData ) throw(NotConnectedException, BufferSizeExceededException, IOException, RuntimeException) { sal_Int64 nDataLen = aData.getLength(), nCombined = m_nEnd + nDataLen; @@ -110,27 +110,27 @@ void SAL_CALL ZipPackageBuffer::writeBytes( const Sequence< sal_Int8 >& aData ) if (m_nCurrent>m_nEnd) m_nEnd = m_nCurrent; } -void SAL_CALL ZipPackageBuffer::flush( ) +void SAL_CALL ZipPackageBuffer::flush( ) throw(NotConnectedException, BufferSizeExceededException, IOException, RuntimeException) { } -void SAL_CALL ZipPackageBuffer::closeOutput( ) +void SAL_CALL ZipPackageBuffer::closeOutput( ) throw(NotConnectedException, BufferSizeExceededException, IOException, RuntimeException) { } -void SAL_CALL ZipPackageBuffer::seek( sal_Int64 location ) +void SAL_CALL ZipPackageBuffer::seek( sal_Int64 location ) throw( IllegalArgumentException, IOException, RuntimeException) { if ( location > m_nEnd || location < 0 ) throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); m_nCurrent = location; } -sal_Int64 SAL_CALL ZipPackageBuffer::getPosition( ) +sal_Int64 SAL_CALL ZipPackageBuffer::getPosition( ) throw(IOException, RuntimeException) { return m_nCurrent; } -sal_Int64 SAL_CALL ZipPackageBuffer::getLength( ) +sal_Int64 SAL_CALL ZipPackageBuffer::getLength( ) throw(IOException, RuntimeException) { return m_nEnd; diff --git a/package/source/zippackage/ZipPackageEntry.cxx b/package/source/zippackage/ZipPackageEntry.cxx index df789850189f..6d764133e463 100644 --- a/package/source/zippackage/ZipPackageEntry.cxx +++ b/package/source/zippackage/ZipPackageEntry.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -61,12 +61,12 @@ ZipPackageEntry::~ZipPackageEntry() } // XChild -OUString SAL_CALL ZipPackageEntry::getName( ) +OUString SAL_CALL ZipPackageEntry::getName( ) throw(RuntimeException) { return msName; } -void SAL_CALL ZipPackageEntry::setName( const OUString& aName ) +void SAL_CALL ZipPackageEntry::setName( const OUString& aName ) throw(RuntimeException) { if ( pParent && msName.getLength() && pParent->hasByName ( msName ) ) @@ -82,7 +82,7 @@ void SAL_CALL ZipPackageEntry::setName( const OUString& aName ) if ( pParent ) pParent->doInsertByName ( this, sal_False ); } -Reference< XInterface > SAL_CALL ZipPackageEntry::getParent( ) +Reference< XInterface > SAL_CALL ZipPackageEntry::getParent( ) throw(RuntimeException) { // return Reference< XInterface >( xParent, UNO_QUERY ); @@ -97,7 +97,7 @@ void ZipPackageEntry::doSetParent ( ZipPackageFolder * pNewParent, sal_Bool bIns pNewParent->doInsertByName ( this, sal_False ); } -void SAL_CALL ZipPackageEntry::setParent( const Reference< XInterface >& xNewParent ) +void SAL_CALL ZipPackageEntry::setParent( const Reference< XInterface >& xNewParent ) throw(NoSupportException, RuntimeException) { sal_Int64 nTest(0); @@ -115,24 +115,24 @@ void SAL_CALL ZipPackageEntry::setParent( const Reference< XInterface >& xNewPar } } //XPropertySet -Reference< beans::XPropertySetInfo > SAL_CALL ZipPackageEntry::getPropertySetInfo( ) +Reference< beans::XPropertySetInfo > SAL_CALL ZipPackageEntry::getPropertySetInfo( ) throw(RuntimeException) { return Reference < beans::XPropertySetInfo > (); } -void SAL_CALL ZipPackageEntry::addPropertyChangeListener( const OUString& /*aPropertyName*/, const Reference< beans::XPropertyChangeListener >& /*xListener*/ ) +void SAL_CALL ZipPackageEntry::addPropertyChangeListener( const OUString& /*aPropertyName*/, const Reference< beans::XPropertyChangeListener >& /*xListener*/ ) throw(beans::UnknownPropertyException, WrappedTargetException, RuntimeException) { } -void SAL_CALL ZipPackageEntry::removePropertyChangeListener( const OUString& /*aPropertyName*/, const Reference< beans::XPropertyChangeListener >& /*aListener*/ ) +void SAL_CALL ZipPackageEntry::removePropertyChangeListener( const OUString& /*aPropertyName*/, const Reference< beans::XPropertyChangeListener >& /*aListener*/ ) throw(beans::UnknownPropertyException, WrappedTargetException, RuntimeException) { } -void SAL_CALL ZipPackageEntry::addVetoableChangeListener( const OUString& /*PropertyName*/, const Reference< beans::XVetoableChangeListener >& /*aListener*/ ) +void SAL_CALL ZipPackageEntry::addVetoableChangeListener( const OUString& /*PropertyName*/, const Reference< beans::XVetoableChangeListener >& /*aListener*/ ) throw(beans::UnknownPropertyException, WrappedTargetException, RuntimeException) { } -void SAL_CALL ZipPackageEntry::removeVetoableChangeListener( const OUString& /*PropertyName*/, const Reference< beans::XVetoableChangeListener >& /*aListener*/ ) +void SAL_CALL ZipPackageEntry::removeVetoableChangeListener( const OUString& /*PropertyName*/, const Reference< beans::XVetoableChangeListener >& /*aListener*/ ) throw(beans::UnknownPropertyException, WrappedTargetException, RuntimeException) { } diff --git a/package/source/zippackage/ZipPackageEntry.hxx b/package/source/zippackage/ZipPackageEntry.hxx index 6ae623a50664..eef9dd9ae461 100644 --- a/package/source/zippackage/ZipPackageEntry.hxx +++ b/package/source/zippackage/ZipPackageEntry.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,7 +39,7 @@ class ZipPackageFolder; -class ZipPackageEntry : public cppu::WeakImplHelper5 +class ZipPackageEntry : public cppu::WeakImplHelper5 < com::sun::star::container::XNamed, com::sun::star::container::XChild, @@ -53,7 +53,7 @@ protected: bool mbIsFolder:1; bool mbAllowRemoveOnInsert:1; // com::sun::star::uno::Reference < com::sun::star::container::XNameContainer > xParent; - ::rtl::OUString sMediaType; + ::rtl::OUString sMediaType; ZipPackageFolder * pParent; public: ZipEntry aEntry; @@ -73,32 +73,32 @@ public: pParent = NULL; } // XNamed - virtual ::rtl::OUString SAL_CALL getName( ) + virtual ::rtl::OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setName( const ::rtl::OUString& aName ) + virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException); // XChild - virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) + virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) + virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw(::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException) = 0; // XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) = 0; - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) = 0; - virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); }; #endif diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx index 011bd65990d9..cdff1b23010e 100644 --- a/package/source/zippackage/ZipPackageFolder.cxx +++ b/package/source/zippackage/ZipPackageFolder.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -65,7 +65,7 @@ namespace { struct lcl_CachedImplId : public rtl::Static< Sequence < sal_Int8 >, ZipPackageFolder::ZipPackageFolder ( const Reference< XMultiServiceFactory >& xFactory, sal_Int32 nFormat, - sal_Bool bAllowRemoveOnInsert ) + sal_Bool bAllowRemoveOnInsert ) : m_xFactory( xFactory ) , m_nFormat( nFormat ) { @@ -74,14 +74,14 @@ ZipPackageFolder::ZipPackageFolder ( const Reference< XMultiServiceFactory >& xF this->mbAllowRemoveOnInsert = bAllowRemoveOnInsert; SetFolder ( sal_True ); - aEntry.nVersion = -1; - aEntry.nFlag = 0; - aEntry.nMethod = STORED; - aEntry.nTime = -1; - aEntry.nCrc = 0; - aEntry.nCompressedSize = 0; - aEntry.nSize = 0; - aEntry.nOffset = -1; + aEntry.nVersion = -1; + aEntry.nFlag = 0; + aEntry.nMethod = STORED; + aEntry.nTime = -1; + aEntry.nCrc = 0; + aEntry.nCompressedSize = 0; + aEntry.nSize = 0; + aEntry.nOffset = -1; Sequence < sal_Int8 > &rCachedImplId = lcl_CachedImplId::get(); if ( !rCachedImplId.getLength() ) rCachedImplId = getImplementationId(); @@ -97,9 +97,9 @@ sal_Bool ZipPackageFolder::LookForUnexpectedODF12Streams( const ::rtl::OUString& sal_Bool bHasUnexpected = sal_False; for ( ContentHash::const_iterator aCI = maContents.begin(), aEnd = maContents.end(); - !bHasUnexpected && aCI != aEnd; + !bHasUnexpected && aCI != aEnd; aCI++) - { + { const OUString &rShortName = (*aCI).first; const ContentInfo &rInfo = *(*aCI).second; @@ -120,7 +120,7 @@ sal_Bool ZipPackageFolder::LookForUnexpectedODF12Streams( const ::rtl::OUString& { if ( aPath.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "META-INF/" ) ) ) ) { - if ( !rShortName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "manifest.xml" ) ) ) + if ( !rShortName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "manifest.xml" ) ) ) && rShortName.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "signatures" ) ) ) == -1 ) { // a stream from META-INF with unexpected name @@ -136,7 +136,7 @@ sal_Bool ZipPackageFolder::LookForUnexpectedODF12Streams( const ::rtl::OUString& if ( aPath.getLength() || !rShortName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "mimetype" ) ) ) ) { - // if it is not "mimetype" from the root it is not a part of the package + // if it is not "mimetype" from the root it is not a part of the package bHasUnexpected = sal_True; } } @@ -155,9 +155,9 @@ void ZipPackageFolder::setChildStreamsTypeByExtension( const beans::StringPair& aExt = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) ) + aPair.First; for ( ContentHash::const_iterator aCI = maContents.begin(), aEnd = maContents.end(); - aCI != aEnd; + aCI != aEnd; aCI++) - { + { const OUString &rShortName = (*aCI).first; const ContentInfo &rInfo = *(*aCI).second; @@ -175,17 +175,17 @@ void ZipPackageFolder::setChildStreamsTypeByExtension( const beans::StringPair& void ZipPackageFolder::copyZipEntry( ZipEntry &rDest, const ZipEntry &rSource) { - rDest.nVersion = rSource.nVersion; - rDest.nFlag = rSource.nFlag; - rDest.nMethod = rSource.nMethod; - rDest.nTime = rSource.nTime; - rDest.nCrc = rSource.nCrc; - rDest.nCompressedSize = rSource.nCompressedSize; - rDest.nSize = rSource.nSize; - rDest.nOffset = rSource.nOffset; - rDest.sPath = rSource.sPath; - rDest.nPathLen = rSource.nPathLen; - rDest.nExtraLen = rSource.nExtraLen; + rDest.nVersion = rSource.nVersion; + rDest.nFlag = rSource.nFlag; + rDest.nMethod = rSource.nMethod; + rDest.nTime = rSource.nTime; + rDest.nCrc = rSource.nCrc; + rDest.nCompressedSize = rSource.nCompressedSize; + rDest.nSize = rSource.nSize; + rDest.nOffset = rSource.nOffset; + rDest.sPath = rSource.sPath; + rDest.nPathLen = rSource.nPathLen; + rDest.nExtraLen = rSource.nExtraLen; } const ::com::sun::star::uno::Sequence < sal_Int8 >& ZipPackageFolder::static_getImplementationId() @@ -194,7 +194,7 @@ const ::com::sun::star::uno::Sequence < sal_Int8 >& ZipPackageFolder::static_get } // XNameContainer -void SAL_CALL ZipPackageFolder::insertByName( const OUString& aName, const Any& aElement ) +void SAL_CALL ZipPackageFolder::insertByName( const OUString& aName, const Any& aElement ) throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException) { if (hasByName(aName)) @@ -224,11 +224,11 @@ void SAL_CALL ZipPackageFolder::insertByName( const OUString& aName, const Any& pEntry->setName (aName); doInsertByName ( pEntry, sal_True ); } - else + else throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 0 ); } } -void SAL_CALL ZipPackageFolder::removeByName( const OUString& Name ) +void SAL_CALL ZipPackageFolder::removeByName( const OUString& Name ) throw(NoSuchElementException, WrappedTargetException, RuntimeException) { ContentHash::iterator aIter = maContents.find ( Name ); @@ -237,18 +237,18 @@ void SAL_CALL ZipPackageFolder::removeByName( const OUString& Name ) maContents.erase( aIter ); } // XEnumerationAccess -Reference< XEnumeration > SAL_CALL ZipPackageFolder::createEnumeration( ) +Reference< XEnumeration > SAL_CALL ZipPackageFolder::createEnumeration( ) throw(RuntimeException) { return Reference < XEnumeration> (new ZipPackageFolderEnumeration(maContents)); } // XElementAccess -Type SAL_CALL ZipPackageFolder::getElementType( ) +Type SAL_CALL ZipPackageFolder::getElementType( ) throw(RuntimeException) { return ::getCppuType ((const Reference< XUnoTunnel > *) 0); } -sal_Bool SAL_CALL ZipPackageFolder::hasElements( ) +sal_Bool SAL_CALL ZipPackageFolder::hasElements( ) throw(RuntimeException) { return maContents.size() > 0; @@ -262,30 +262,30 @@ ContentInfo& ZipPackageFolder::doGetByName( const OUString& aName ) throw NoSuchElementException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); return *(*aIter).second; } -Any SAL_CALL ZipPackageFolder::getByName( const OUString& aName ) +Any SAL_CALL ZipPackageFolder::getByName( const OUString& aName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException) { return makeAny ( doGetByName ( aName ).xTunnel ); } -Sequence< OUString > SAL_CALL ZipPackageFolder::getElementNames( ) +Sequence< OUString > SAL_CALL ZipPackageFolder::getElementNames( ) throw(RuntimeException) { sal_uInt32 i=0, nSize = maContents.size(); Sequence < OUString > aSequence ( nSize ); OUString *pNames = aSequence.getArray(); - for ( ContentHash::const_iterator aIterator = maContents.begin(), aEnd = maContents.end(); - aIterator != aEnd; + for ( ContentHash::const_iterator aIterator = maContents.begin(), aEnd = maContents.end(); + aIterator != aEnd; ++i, ++aIterator) pNames[i] = (*aIterator).first; return aSequence; } -sal_Bool SAL_CALL ZipPackageFolder::hasByName( const OUString& aName ) +sal_Bool SAL_CALL ZipPackageFolder::hasByName( const OUString& aName ) throw(RuntimeException) { return maContents.find ( aName ) != maContents.end (); } // XNameReplace -void SAL_CALL ZipPackageFolder::replaceByName( const OUString& aName, const Any& aElement ) +void SAL_CALL ZipPackageFolder::replaceByName( const OUString& aName, const Any& aElement ) throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException) { if ( hasByName( aName ) ) @@ -298,7 +298,7 @@ void SAL_CALL ZipPackageFolder::replaceByName( const OUString& aName, const Any& static void ImplSetStoredData( ZipEntry & rEntry, Reference < XInputStream> & rStream ) { // It's very annoying that we have to do this, but lots of zip packages - // don't allow data descriptors for STORED streams, meaning we have to + // don't allow data descriptors for STORED streams, meaning we have to // know the size and CRC32 of uncompressed streams before we actually // write them ! CRC32 aCRC32; @@ -352,9 +352,9 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr } for ( ContentHash::const_iterator aCI = maContents.begin(), aEnd = maContents.end(); - aCI != aEnd; + aCI != aEnd; aCI++) - { + { const OUString &rShortName = (*aCI).first; const ContentInfo &rInfo = *(*aCI).second; @@ -365,7 +365,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr pFolder = rInfo.pFolder; else pStream = rInfo.pStream; - + if ( rInfo.bFolder ) { OUString sTempName = rPath + rShortName + OUString( RTL_CONSTASCII_USTRINGPARAM ( "/" ) ); @@ -376,13 +376,13 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr pValue[PKG_MNFST_VERSION].Value <<= pFolder->GetVersion(); pValue[PKG_MNFST_FULLPATH].Name = sFullPathProperty; pValue[PKG_MNFST_FULLPATH].Value <<= sTempName; - + pFolder->saveContents( sTempName, rManList, rZipOut, rEncryptionKey, rRandomPool); } else { // if pTempEntry is necessary, it will be released and passed to the ZipOutputStream - // and be deleted in the ZipOutputStream destructor + // and be deleted in the ZipOutputStream destructor auto_ptr < ZipEntry > pAutoTempEntry ( new ZipEntry ); ZipEntry* pTempEntry = pAutoTempEntry.get(); @@ -455,7 +455,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr OSL_ENSURE( !bRawStream || !bToBeCompressed && !bToBeEncrypted, "The stream is already encrypted!\n" ); xSeek->seek ( bRawStream ? pStream->GetMagicalHackPos() : 0 ); ImplSetStoredData ( *pTempEntry, xStream ); - + // TODO/LATER: Get rid of hacks related to switching of Flag Method and Size properties! } else if ( bToBeEncrypted ) @@ -464,7 +464,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr pTempEntry->nSize = static_cast < sal_Int32 > ( xSeek->getLength() ); nOwnStreamOrigSize = pTempEntry->nSize; } - + xSeek->seek ( 0 ); } else @@ -481,7 +481,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr // Should be handled close to the raw stream handling bTransportOwnEncrStreamAsRaw = sal_True; pTempEntry->nMethod = STORED; - + // TODO/LATER: get rid of this situation // this size should be different from the one that will be stored in manifest.xml // it is used in storing algorithms and after storing the correct size will be set @@ -501,16 +501,16 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr bWritingFailed = sal_True; continue; } - + if ( bToBeEncrypted || bRawStream || bTransportOwnEncrStreamAsRaw ) { if ( bToBeEncrypted && !bTransportOwnEncrStreamAsRaw ) { - Sequence < sal_uInt8 > aSalt ( 16 ), aVector ( 8 ); + Sequence < sal_uInt8 > aSalt ( 16 ), aVector ( 8 ); rtl_random_getBytes ( rRandomPool, aSalt.getArray(), 16 ); rtl_random_getBytes ( rRandomPool, aVector.getArray(), 8 ); sal_Int32 nIterationCount = 1024; - + if ( !pStream->HasOwnKey() ) pStream->setKey ( rEncryptionKey ); @@ -518,7 +518,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr pStream->setSalt ( aSalt ); pStream->setIterationCount ( nIterationCount ); } - + // last property is digest, which is inserted later if we didn't have // a magic header aPropSet.realloc(PKG_SIZE_ENCR_MNFST); @@ -530,12 +530,12 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr pValue[PKG_MNFST_SALT].Value <<= pStream->getSalt(); pValue[PKG_MNFST_ITERATION].Name = sIterationCountProperty; pValue[PKG_MNFST_ITERATION].Value <<= pStream->getIterationCount (); - + // Need to store the uncompressed size in the manifest OSL_ENSURE( nOwnStreamOrigSize >= 0, "The stream size was not correctly initialized!\n" ); pValue[PKG_MNFST_UCOMPSIZE].Name = sSizeProperty; pValue[PKG_MNFST_UCOMPSIZE].Value <<= nOwnStreamOrigSize; - + if ( bRawStream || bTransportOwnEncrStreamAsRaw ) { pValue[PKG_MNFST_DIGEST].Name = sDigestProperty; @@ -555,7 +555,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr // If it's a PackageMember, then it's an unbuffered stream and we need // to get a new version of it as we can't seek backwards. if ( pStream->IsPackageMember() ) - { + { xStream = pStream->getRawData(); if ( !xStream.is() ) { @@ -600,17 +600,17 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr else { // This stream is defenitly not a raw stream - + // If nonseekable access is used the stream should be at the beginning and // is useless after the storing. Thus if the storing fails the package should // be thrown away ( as actually it is done currently )! // To allow to reuse the package after the error, the optimization must be removed! - + // If it's a PackageMember, then our previous reference held a 'raw' stream // so we need to re-get it, unencrypted, uncompressed and positioned at the // beginning of the stream if ( pStream->IsPackageMember() ) - { + { xStream = pStream->getInputStream(); if ( !xStream.is() ) { @@ -676,7 +676,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr // as usual encrypted stream pStream->SetToBeEncrypted( sal_True ); } - + // Remove hacky bit from entry flags if ( pTempEntry->nFlag & ( 1 << 4 ) ) { @@ -699,7 +699,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr if ( m_nFormat == embed::StorageFormats::PACKAGE || ( m_nFormat == embed::StorageFormats::OFOPXML && !rInfo.bFolder ) ) rManList.push_back( aPropSet ); } - + if( bWritingFailed ) throw RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } @@ -720,7 +720,7 @@ void ZipPackageFolder::releaseUpwardRef( void ) for ( ContentHash::const_iterator aCI = maContents.begin(); aCI!=maContents.end(); aCI++) - { + { ContentInfo &rInfo = * (*aCI).second; if ( rInfo.bFolder )// && ! rInfo.pFolder->HasReleased () ) rInfo.pFolder->releaseUpwardRef(); @@ -733,24 +733,24 @@ void ZipPackageFolder::releaseUpwardRef( void ) #endif } -sal_Int64 SAL_CALL ZipPackageFolder::getSomething( const Sequence< sal_Int8 >& aIdentifier ) +sal_Int64 SAL_CALL ZipPackageFolder::getSomething( const Sequence< sal_Int8 >& aIdentifier ) throw(RuntimeException) -{ +{ sal_Int64 nMe = 0; - if ( aIdentifier.getLength() == 16 && + if ( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory(static_getImplementationId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) nMe = reinterpret_cast < sal_Int64 > ( this ); return nMe; } -void SAL_CALL ZipPackageFolder::setPropertyValue( const OUString& aPropertyName, const Any& aValue ) +void SAL_CALL ZipPackageFolder::setPropertyValue( const OUString& aPropertyName, const Any& aValue ) throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { if (aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("MediaType"))) { // TODO/LATER: activate when zip ucp is ready // if ( m_nFormat != embed::StorageFormats::PACKAGE ) - // throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - + // throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + aValue >>= sMediaType; } else if (aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Version"))) @@ -760,14 +760,14 @@ void SAL_CALL ZipPackageFolder::setPropertyValue( const OUString& aPropertyName, else throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } -Any SAL_CALL ZipPackageFolder::getPropertyValue( const OUString& PropertyName ) +Any SAL_CALL ZipPackageFolder::getPropertyValue( const OUString& PropertyName ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) ) { // TODO/LATER: activate when zip ucp is ready // if ( m_nFormat != embed::StorageFormats::PACKAGE ) - // throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + // throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); return makeAny ( sMediaType ); } diff --git a/package/source/zippackage/ZipPackageFolderEnumeration.cxx b/package/source/zippackage/ZipPackageFolderEnumeration.cxx index ed1bfbdf1d30..155b398c0037 100644 --- a/package/source/zippackage/ZipPackageFolderEnumeration.cxx +++ b/package/source/zippackage/ZipPackageFolderEnumeration.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -44,12 +44,12 @@ ZipPackageFolderEnumeration::~ZipPackageFolderEnumeration( void ) { } -sal_Bool SAL_CALL ZipPackageFolderEnumeration::hasMoreElements( ) +sal_Bool SAL_CALL ZipPackageFolderEnumeration::hasMoreElements( ) throw(uno::RuntimeException) { return (aIterator != rContents.end() ); } -uno::Any SAL_CALL ZipPackageFolderEnumeration::nextElement( ) +uno::Any SAL_CALL ZipPackageFolderEnumeration::nextElement( ) throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) { uno::Any aAny; diff --git a/package/source/zippackage/ZipPackageFolderEnumeration.hxx b/package/source/zippackage/ZipPackageFolderEnumeration.hxx index ee38ad734e84..751ffbfb417f 100644 --- a/package/source/zippackage/ZipPackageFolderEnumeration.hxx +++ b/package/source/zippackage/ZipPackageFolderEnumeration.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -34,7 +34,7 @@ #include <HashMaps.hxx> class ZipPackageFolderEnumeration : public cppu::WeakImplHelper2 -< +< com::sun::star::container::XEnumeration, com::sun::star::lang::XServiceInfo > @@ -48,19 +48,19 @@ public: virtual ~ZipPackageFolderEnumeration( void ); // XEnumeration - virtual sal_Bool SAL_CALL hasMoreElements( ) + virtual sal_Bool SAL_CALL hasMoreElements( ) throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL nextElement( ) + virtual ::com::sun::star::uno::Any SAL_CALL nextElement( ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName( ) + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); - + }; #endif diff --git a/package/source/zippackage/ZipPackageSink.cxx b/package/source/zippackage/ZipPackageSink.cxx index 2f9202398493..2270063797e5 100644 --- a/package/source/zippackage/ZipPackageSink.cxx +++ b/package/source/zippackage/ZipPackageSink.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -34,15 +34,15 @@ ZipPackageSink::ZipPackageSink(void) : xStream ( com::sun::star::uno::Reference < com::sun::star::io::XInputStream > (NULL)) { } -ZipPackageSink::~ZipPackageSink(void) +ZipPackageSink::~ZipPackageSink(void) { } -void SAL_CALL ZipPackageSink::setInputStream( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& aStream ) +void SAL_CALL ZipPackageSink::setInputStream( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& aStream ) throw(::com::sun::star::uno::RuntimeException) { xStream = aStream; } -::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL ZipPackageSink::getInputStream( ) +::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL ZipPackageSink::getInputStream( ) throw(::com::sun::star::uno::RuntimeException) { return xStream; diff --git a/package/source/zippackage/ZipPackageSink.hxx b/package/source/zippackage/ZipPackageSink.hxx index a90d40131072..f8e0eb1684ed 100644 --- a/package/source/zippackage/ZipPackageSink.hxx +++ b/package/source/zippackage/ZipPackageSink.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -41,9 +41,9 @@ protected: public: ZipPackageSink(); virtual ~ZipPackageSink(); - virtual void SAL_CALL setInputStream( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& aStream ) + virtual void SAL_CALL setInputStream( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& aStream ) throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getInputStream( ) + virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getInputStream( ) throw(::com::sun::star::uno::RuntimeException); }; #endif diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx index 318a6a52b873..f3c6d713fbf3 100644 --- a/package/source/zippackage/ZipPackageStream.cxx +++ b/package/source/zippackage/ZipPackageStream.cxx @@ -89,16 +89,16 @@ ZipPackageStream::ZipPackageStream ( ZipPackage & rNewPackage, this->mbAllowRemoveOnInsert = bAllowRemoveOnInsert; SetFolder ( sal_False ); - aEntry.nVersion = -1; - aEntry.nFlag = 0; - aEntry.nMethod = -1; - aEntry.nTime = -1; - aEntry.nCrc = -1; - aEntry.nCompressedSize = -1; - aEntry.nSize = -1; - aEntry.nOffset = -1; - aEntry.nPathLen = -1; - aEntry.nExtraLen = -1; + aEntry.nVersion = -1; + aEntry.nFlag = 0; + aEntry.nMethod = -1; + aEntry.nTime = -1; + aEntry.nCrc = -1; + aEntry.nCompressedSize = -1; + aEntry.nSize = -1; + aEntry.nOffset = -1; + aEntry.nPathLen = -1; + aEntry.nExtraLen = -1; Sequence < sal_Int8 > &rCachedImplId = lcl_CachedImplId::get(); if ( !rCachedImplId.getLength() ) diff --git a/package/source/zippackage/ZipPackageStream.hxx b/package/source/zippackage/ZipPackageStream.hxx index 9bdc09d04f92..321e385a519d 100644 --- a/package/source/zippackage/ZipPackageStream.hxx +++ b/package/source/zippackage/ZipPackageStream.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,11 +37,11 @@ #include <cppuhelper/implbase2.hxx> #include <mutexholder.hxx> -#define PACKAGE_STREAM_NOTSET 0 -#define PACKAGE_STREAM_PACKAGEMEMBER 1 -#define PACKAGE_STREAM_DETECT 2 -#define PACKAGE_STREAM_DATA 3 -#define PACKAGE_STREAM_RAW 4 +#define PACKAGE_STREAM_NOTSET 0 +#define PACKAGE_STREAM_PACKAGEMEMBER 1 +#define PACKAGE_STREAM_DETECT 2 +#define PACKAGE_STREAM_DATA 3 +#define PACKAGE_STREAM_RAW 4 class ZipPackage; struct ZipEntry; @@ -55,13 +55,13 @@ class ZipPackageStream : public cppu::ImplInheritanceHelper2 protected: com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xStream; const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > m_xFactory; - ZipPackage &rZipPackage; - sal_Bool bToBeCompressed, bToBeEncrypted, bHaveOwnKey, bIsEncrypted; + ZipPackage &rZipPackage; + sal_Bool bToBeCompressed, bToBeEncrypted, bHaveOwnKey, bIsEncrypted; rtl::Reference < EncryptionData > xEncryptionData; - sal_uInt8 m_nStreamMode; - sal_uInt32 m_nMagicalHackPos; - sal_uInt32 m_nMagicalHackSize; + sal_uInt8 m_nStreamMode; + sal_uInt32 m_nMagicalHackPos; + sal_uInt32 m_nMagicalHackSize; sal_Bool m_bHasSeekable; @@ -72,10 +72,10 @@ protected: ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& GetOwnSeekStream(); public: - sal_Bool HasOwnKey () const { return bHaveOwnKey;} + sal_Bool HasOwnKey () const { return bHaveOwnKey;} sal_Bool IsToBeCompressed () const { return bToBeCompressed;} sal_Bool IsToBeEncrypted () const { return bToBeEncrypted;} - sal_Bool IsEncrypted () const { return bIsEncrypted;} + sal_Bool IsEncrypted () const { return bIsEncrypted;} sal_Bool IsPackageMember () const { return m_nStreamMode == PACKAGE_STREAM_PACKAGEMEMBER;} sal_Bool IsFromManifest() const { return m_bFromManifest; } @@ -102,8 +102,8 @@ public: void SetToBeCompressed (sal_Bool bNewValue) { bToBeCompressed = bNewValue;} void SetIsEncrypted (sal_Bool bNewValue) { bIsEncrypted = bNewValue;} - void SetToBeEncrypted (sal_Bool bNewValue) - { + void SetToBeEncrypted (sal_Bool bNewValue) + { bToBeEncrypted = bNewValue; if ( bToBeEncrypted && !xEncryptionData.is()) xEncryptionData = new EncryptionData; @@ -141,13 +141,13 @@ public: void setZipEntryOnLoading( const ZipEntry &rInEntry); ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getRawData() throw(::com::sun::star::uno::RuntimeException); - + static const ::com::sun::star::uno::Sequence < sal_Int8 >& static_getImplementationId(); // XActiveDataSink - virtual void SAL_CALL setInputStream( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& aStream ) + virtual void SAL_CALL setInputStream( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& aStream ) throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getInputStream( ) + virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getInputStream( ) throw(::com::sun::star::uno::RuntimeException); // XDataSinkEncrSupport @@ -174,21 +174,21 @@ public: ::com::sun::star::uno::RuntimeException ); // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); // XPropertySet - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName( ) + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); }; #endif diff --git a/package/source/zippackage/wrapstreamforshare.cxx b/package/source/zippackage/wrapstreamforshare.cxx index 9afb2f8f9428..ff871d49a1a0 100644 --- a/package/source/zippackage/wrapstreamforshare.cxx +++ b/package/source/zippackage/wrapstreamforshare.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -54,7 +54,7 @@ WrapStreamForShare::~WrapStreamForShare() } // XInputStream -sal_Int32 SAL_CALL WrapStreamForShare::readBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) +sal_Int32 SAL_CALL WrapStreamForShare::readBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw ( io::NotConnectedException, io::BufferSizeExceededException, io::IOException, @@ -92,7 +92,7 @@ sal_Int32 SAL_CALL WrapStreamForShare::readSomeBytes( uno::Sequence< sal_Int8 >& return nRead; } -void SAL_CALL WrapStreamForShare::skipBytes( sal_Int32 nBytesToSkip ) +void SAL_CALL WrapStreamForShare::skipBytes( sal_Int32 nBytesToSkip ) throw ( io::NotConnectedException, io::BufferSizeExceededException, io::IOException, @@ -122,7 +122,7 @@ sal_Int32 SAL_CALL WrapStreamForShare::available() return m_xInStream->available(); } -void SAL_CALL WrapStreamForShare::closeInput() +void SAL_CALL WrapStreamForShare::closeInput() throw ( io::NotConnectedException, io::IOException, uno::RuntimeException ) @@ -156,7 +156,7 @@ void SAL_CALL WrapStreamForShare::seek( sal_Int64 location ) } sal_Int64 SAL_CALL WrapStreamForShare::getPosition() - throw ( io::IOException, + throw ( io::IOException, uno::RuntimeException) { ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); diff --git a/package/source/zippackage/wrapstreamforshare.hxx b/package/source/zippackage/wrapstreamforshare.hxx index 85b03c62943c..90b6ef496050 100644 --- a/package/source/zippackage/wrapstreamforshare.hxx +++ b/package/source/zippackage/wrapstreamforshare.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -51,15 +51,15 @@ public: virtual ~WrapStreamForShare(); // XInputStream - virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) + virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) + virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL available( ) + virtual sal_Int32 SAL_CALL available( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL closeInput( ) + virtual void SAL_CALL closeInput( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); diff --git a/package/source/zippackage/zipfileaccess.cxx b/package/source/zippackage/zipfileaccess.cxx index 3690b636df68..88b4530b5684 100644 --- a/package/source/zippackage/zipfileaccess.cxx +++ b/package/source/zippackage/zipfileaccess.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -81,7 +81,7 @@ uno::Sequence< ::rtl::OUString > OZipFileAccess::GetPatternsFromString_Impl( con if ( !aString.getLength() ) return uno::Sequence< ::rtl::OUString >(); - uno::Sequence< ::rtl::OUString > aPattern( 1 ); + uno::Sequence< ::rtl::OUString > aPattern( 1 ); sal_Int32 nInd = 0; const sal_Unicode* pString = aString.getStr(); @@ -118,18 +118,18 @@ uno::Sequence< ::rtl::OUString > OZipFileAccess::GetPatternsFromString_Impl( con pString++; } } - + return aPattern; } // ---------------------------------------------------------------- sal_Bool OZipFileAccess::StringGoodForPattern_Impl( const ::rtl::OUString& aString, const uno::Sequence< ::rtl::OUString >& aPattern ) -{ +{ sal_Int32 nInd = aPattern.getLength() - 1; if ( nInd < 0 ) return sal_False; - + if ( nInd == 0 ) { if ( !aPattern[0].getLength() ) @@ -143,7 +143,7 @@ sal_Bool OZipFileAccess::StringGoodForPattern_Impl( const ::rtl::OUString& aStri if ( nEndInd >= nBeginInd && ( nEndInd == aString.getLength() || aString.copy( nEndInd ).equals( aPattern[nInd] ) ) && ( nBeginInd == 0 || aString.copy( 0, nBeginInd ).equals( aPattern[0] ) ) ) - { + { for ( sal_Int32 nCurInd = aPattern.getLength() - 2; nCurInd > 0; nCurInd-- ) { if ( !aPattern[nCurInd].getLength() ) @@ -218,7 +218,7 @@ void SAL_CALL OZipFileAccess::initialize( const uno::Sequence< uno::Any >& aArgu if ( !m_xContentStream.is() ) throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - + if ( !xSeekable.is() ) { // TODO: after fwkbugfix02 is integrated a helper class can be used to make the stream seekable @@ -229,7 +229,7 @@ void SAL_CALL OZipFileAccess::initialize( const uno::Sequence< uno::Any >& aArgu m_pZipFile = new ZipFile( m_xContentStream, m_xFactory, - sal_True ); + sal_True ); } // XNameAccess @@ -366,8 +366,8 @@ uno::Reference< io::XInputStream > SAL_CALL OZipFileAccess::getStreamByPattern( { if ( StringGoodForPattern_Impl( (*aIter).second.sPath, aPattern ) ) { - uno::Reference< io::XInputStream > xEntryStream( m_pZipFile->getDataStream( (*aIter).second, - new EncryptionData(), + uno::Reference< io::XInputStream > xEntryStream( m_pZipFile->getDataStream( (*aIter).second, + new EncryptionData(), sal_False, m_aMutexHolder ) ); |