summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2010-10-15 12:18:51 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2010-10-25 19:55:29 -0500
commitd3d553e1ef00b1ae5ac4d65e53e8ea08b24085f3 (patch)
treef7b7ca85c311d220142f93ee4ebf0af9721feb71 /package
parentb10b21b999a36a6925790284c44e7b45283bd104 (diff)
merge vosremoval-reference.diff
Diffstat (limited to 'package')
-rw-r--r--package/inc/HashMaps.hxx4
-rw-r--r--package/inc/ZipFile.hxx30
-rw-r--r--package/inc/ZipOutputStream.hxx6
-rw-r--r--package/source/manifest/ManifestReader.cxx2
-rw-r--r--package/source/manifest/UnoRegister.cxx3
-rw-r--r--package/source/zipapi/EntryInputStream.cxx2
-rw-r--r--package/source/zipapi/EntryInputStream.hxx6
-rw-r--r--package/source/zipapi/XFileStream.cxx2
-rw-r--r--package/source/zipapi/XFileStream.hxx6
-rw-r--r--package/source/zipapi/XUnbufferedStream.cxx6
-rw-r--r--package/source/zipapi/XUnbufferedStream.hxx8
-rw-r--r--package/source/zipapi/ZipFile.cxx43
-rw-r--r--package/source/zipapi/ZipOutputStream.cxx7
-rw-r--r--package/source/zippackage/ZipPackage.cxx6
-rw-r--r--package/source/zippackage/ZipPackageEntry.cxx3
-rw-r--r--package/source/zippackage/ZipPackageFolder.cxx6
-rw-r--r--package/source/zippackage/ZipPackageStream.cxx25
-rw-r--r--package/source/zippackage/ZipPackageStream.hxx12
18 files changed, 89 insertions, 88 deletions
diff --git a/package/inc/HashMaps.hxx b/package/inc/HashMaps.hxx
index b10f42aa7020..31b69bf670c1 100644
--- a/package/inc/HashMaps.hxx
+++ b/package/inc/HashMaps.hxx
@@ -28,7 +28,7 @@
#define _HASHMAPS_HXX
#include <ZipEntry.hxx>
-#include <vos/ref.hxx>
+#include <rtl/ref.hxx>
#include <hash_map>
struct eqFunc
@@ -51,7 +51,7 @@ typedef std::hash_map < rtl::OUString,
eqFunc > FolderHash;
typedef std::hash_map < rtl::OUString,
- vos::ORef < com::sun::star::packages::ContentInfo >,
+ rtl::Reference < com::sun::star::packages::ContentInfo >,
::rtl::OUStringHash,
eqFunc > ContentHash;
diff --git a/package/inc/ZipFile.hxx b/package/inc/ZipFile.hxx
index a50d9e202df2..81b8b4f8951a 100644
--- a/package/inc/ZipFile.hxx
+++ b/package/inc/ZipFile.hxx
@@ -41,9 +41,9 @@ namespace com { namespace sun { namespace star {
namespace lang { class XMultiServiceFactory; }
namespace ucb { class XProgressHandler; }
} } }
-namespace vos
+namespace rtl
{
- template < class T > class ORef;
+ template < class T > class Reference;
}
/*
* We impose arbitrary but reasonable limit on ZIP files.
@@ -75,13 +75,13 @@ protected:
com::sun::star::uno::Reference < com::sun::star::io::XInputStream > createMemoryStream(
ZipEntry & rEntry,
- const vos::ORef < EncryptionData > &rData,
+ const rtl::Reference < EncryptionData > &rData,
sal_Bool bRawStream,
sal_Bool bDecrypt );
com::sun::star::uno::Reference < com::sun::star::io::XInputStream > createFileStream(
ZipEntry & rEntry,
- const vos::ORef < EncryptionData > &rData,
+ const rtl::Reference < EncryptionData > &rData,
sal_Bool bRawStream,
sal_Bool bDecrypt );
@@ -89,12 +89,12 @@ protected:
com::sun::star::uno::Reference < com::sun::star::io::XInputStream > createUnbufferedStream(
SotMutexHolderRef aMutexHolder,
ZipEntry & rEntry,
- const vos::ORef < EncryptionData > &rData,
+ const rtl::Reference < EncryptionData > &rData,
sal_Int8 nStreamMode,
sal_Bool bDecrypt,
::rtl::OUString aMediaType = ::rtl::OUString() );
- sal_Bool hasValidPassword ( ZipEntry & rEntry, const vos::ORef < EncryptionData > &rData );
+ sal_Bool hasValidPassword ( ZipEntry & rEntry, const rtl::Reference < EncryptionData > &rData );
sal_Bool checkSizeAndCRC( const ZipEntry& aEntry );
@@ -125,44 +125,44 @@ public:
void setInputStream ( com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xNewStream );
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getRawData(
ZipEntry& rEntry,
- const vos::ORef < EncryptionData > &rData,
+ const rtl::Reference < EncryptionData > &rData,
sal_Bool bDecrypt,
SotMutexHolderRef aMutexHolder )
throw(::com::sun::star::io::IOException, ::com::sun::star::packages::zip::ZipException, ::com::sun::star::uno::RuntimeException);
- static sal_Bool StaticGetCipher ( const vos::ORef < EncryptionData > & xEncryptionData, rtlCipher &rCipher, sal_Bool bDecode );
+ static sal_Bool StaticGetCipher ( const rtl::Reference < EncryptionData > & xEncryptionData, rtlCipher &rCipher, sal_Bool bDecode );
- static void StaticFillHeader ( const vos::ORef < EncryptionData > & rData,
+ static void StaticFillHeader ( const rtl::Reference < EncryptionData > & rData,
sal_Int32 nSize,
const ::rtl::OUString& aMediaType,
sal_Int8 * & pHeader );
- static sal_Bool StaticFillData ( vos::ORef < EncryptionData > & rData,
+ static sal_Bool StaticFillData ( rtl::Reference < EncryptionData > & rData,
sal_Int32 &rSize,
::rtl::OUString& aMediaType,
::com::sun::star::uno::Reference < com::sun::star::io::XInputStream > &rStream );
static ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > StaticGetDataFromRawStream(
const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xStream,
- const vos::ORef < EncryptionData > &rData )
+ const rtl::Reference < EncryptionData > &rData )
throw ( ::com::sun::star::packages::WrongPasswordException,
::com::sun::star::packages::zip::ZipIOException,
::com::sun::star::uno::RuntimeException );
static sal_Bool StaticHasValidPassword ( const ::com::sun::star::uno::Sequence< sal_Int8 > &aReadBuffer,
- const vos::ORef < EncryptionData > &rData );
+ const rtl::Reference < EncryptionData > &rData );
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getInputStream(
ZipEntry& rEntry,
- const vos::ORef < EncryptionData > &rData,
+ const rtl::Reference < EncryptionData > &rData,
sal_Bool bDecrypt,
SotMutexHolderRef aMutexHolder )
throw(::com::sun::star::io::IOException, ::com::sun::star::packages::zip::ZipException, ::com::sun::star::uno::RuntimeException);
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getDataStream(
ZipEntry& rEntry,
- const vos::ORef < EncryptionData > &rData,
+ const rtl::Reference < EncryptionData > &rData,
sal_Bool bDecrypt,
SotMutexHolderRef aMutexHolder )
throw ( ::com::sun::star::packages::WrongPasswordException,
@@ -172,7 +172,7 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getWrappedRawStream(
ZipEntry& rEntry,
- const vos::ORef < EncryptionData > &rData,
+ const rtl::Reference < EncryptionData > &rData,
const ::rtl::OUString& aMediaType,
SotMutexHolderRef aMutexHolder )
throw ( ::com::sun::star::packages::NoEncryptionException,
diff --git a/package/inc/ZipOutputStream.hxx b/package/inc/ZipOutputStream.hxx
index 552f7449393c..bda715ccf84d 100644
--- a/package/inc/ZipOutputStream.hxx
+++ b/package/inc/ZipOutputStream.hxx
@@ -37,9 +37,9 @@
struct ZipEntry;
class EncryptionData;
-namespace vos
+namespace rtl
{
- template < class T > class ORef;
+ template < class T > class Reference;
}
class ZipOutputStream
{
@@ -74,7 +74,7 @@ public:
void SAL_CALL setLevel( sal_Int32 nNewLevel )
throw(::com::sun::star::uno::RuntimeException);
void SAL_CALL putNextEntry( ZipEntry& rEntry,
- vos::ORef < EncryptionData > &rData,
+ rtl::Reference < EncryptionData > &rData,
sal_Bool bEncrypt = sal_False )
throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
void SAL_CALL closeEntry( )
diff --git a/package/source/manifest/ManifestReader.cxx b/package/source/manifest/ManifestReader.cxx
index da79edabfde9..9e973a65d31e 100644
--- a/package/source/manifest/ManifestReader.cxx
+++ b/package/source/manifest/ManifestReader.cxx
@@ -38,7 +38,6 @@
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <vector>
-using namespace ::rtl;
using namespace ::std;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
@@ -48,6 +47,7 @@ using namespace ::com::sun::star::registry;
using namespace ::com::sun::star::packages;
using namespace ::com::sun::star::xml::sax;
using namespace ::com::sun::star::packages::manifest;
+using ::rtl::OUString;
ManifestReader::ManifestReader( const Reference < XMultiServiceFactory > & xNewFactory )
: xFactory ( xNewFactory )
diff --git a/package/source/manifest/UnoRegister.cxx b/package/source/manifest/UnoRegister.cxx
index 9a3883c4da90..8a234a750d8b 100644
--- a/package/source/manifest/UnoRegister.cxx
+++ b/package/source/manifest/UnoRegister.cxx
@@ -37,7 +37,6 @@
#include <zipfileaccess.hxx>
-using namespace ::rtl;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::lang;
@@ -45,6 +44,8 @@ using namespace ::com::sun::star::registry;
using namespace ::com::sun::star::packages;
using namespace ::com::sun::star::packages::manifest;
+using rtl::OUString;
+
static sal_Bool writeInfo( void * pRegistryKey,
const OUString & rImplementationName,
Sequence< OUString > const & rServiceNames )
diff --git a/package/source/zipapi/EntryInputStream.cxx b/package/source/zipapi/EntryInputStream.cxx
index df64835d2ea0..cd43622ea8ac 100644
--- a/package/source/zipapi/EntryInputStream.cxx
+++ b/package/source/zipapi/EntryInputStream.cxx
@@ -53,7 +53,7 @@ using namespace com::sun::star::packages::zip::ZipConstants;
EntryInputStream::EntryInputStream( Reference < io::XInputStream > xNewInput,
const ZipEntry & rNewEntry,
- const vos::ORef < EncryptionData > &xEncryptData,
+ const rtl::Reference < EncryptionData > &xEncryptData,
sal_Bool bGetRawStream)
: xStream( xNewInput )
, xSeek( xNewInput, UNO_QUERY )
diff --git a/package/source/zipapi/EntryInputStream.hxx b/package/source/zipapi/EntryInputStream.hxx
index fb8153eb11cd..28303907afa1 100644
--- a/package/source/zipapi/EntryInputStream.hxx
+++ b/package/source/zipapi/EntryInputStream.hxx
@@ -32,7 +32,7 @@
#include <com/sun/star/io/XSeekable.hpp>
#include <Inflater.hxx>
#include <com/sun/star/packages/zip/ZipEntry.hpp>
-#include <vos/ref.hxx>
+#include <rtl/ref.hxx>
#include <EncryptionData.hxx>
class EntryInputStream : public cppu::WeakImplHelper2< com::sun::star::io::XInputStream,
com::sun::star::io::XSeekable >
@@ -43,7 +43,7 @@ protected:
sal_Int64 nEnd, nCurrent, nUncompressedSize;
sal_Bool bRawStream, bHaveInMemory, bEncrypted;
com::sun::star::uno::Sequence < sal_Int8 > aBuffer;
- const vos::ORef < EncryptionData > xEncryptionData;
+ const rtl::Reference < EncryptionData > xEncryptionData;
const com::sun::star::packages::zip::ZipEntry aEntry;
Inflater aInflater;
void readIntoMemory()
@@ -51,7 +51,7 @@ protected:
public:
EntryInputStream( com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xInput,
const com::sun::star::packages::zip::ZipEntry &rNewEntry,
- const vos::ORef < EncryptionData > &xEncryptData,
+ const rtl::Reference < EncryptionData > &xEncryptData,
sal_Bool bGetRawStream = sal_False);
virtual ~EntryInputStream();
diff --git a/package/source/zipapi/XFileStream.cxx b/package/source/zipapi/XFileStream.cxx
index 7664e0da2751..6afe8079c5ec 100644
--- a/package/source/zipapi/XFileStream.cxx
+++ b/package/source/zipapi/XFileStream.cxx
@@ -46,7 +46,7 @@ using ::rtl::OUString;
XFileStream::XFileStream( ZipEntry & rEntry,
com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xNewZipStream,
com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xNewTempStream,
- const vos::ORef < EncryptionData > &rData,
+ const rtl::Reference < EncryptionData > &rData,
sal_Bool bNewRawStream,
sal_Bool bIsEncrypted )
: maEntry ( rEntry )
diff --git a/package/source/zipapi/XFileStream.hxx b/package/source/zipapi/XFileStream.hxx
index c89b0b875a62..4fc279faddb8 100644
--- a/package/source/zipapi/XFileStream.hxx
+++ b/package/source/zipapi/XFileStream.hxx
@@ -31,7 +31,7 @@
#include <com/sun/star/io/XSeekable.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <cppuhelper/implbase2.hxx>
-#include <vos/ref.hxx>
+#include <rtl/ref.hxx>
#include <Inflater.hxx>
#include <ZipEntry.hxx>
@@ -54,7 +54,7 @@ protected:
com::sun::star::uno::Reference < com::sun::star::io::XOutputStream > mxTempOut;
com::sun::star::uno::Sequence < sal_Int8 > maBuffer, maCompBuffer;
ZipEntry maEntry;
- vos::ORef < EncryptionData > mxData;
+ rtl::Reference < EncryptionData > mxData;
rtlCipher maCipher;
Inflater maInflater;
sal_Bool mbRawStream, mbFinished;
@@ -65,7 +65,7 @@ public:
XFileStream( ZipEntry & rEntry,
com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xNewZipStream,
com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xNewTempStream,
- const vos::ORef < EncryptionData > &rData,
+ const rtl::Reference < EncryptionData > &rData,
sal_Bool bRawStream,
sal_Bool bIsEncrypted );
virtual ~XFileStream();
diff --git a/package/source/zipapi/XUnbufferedStream.cxx b/package/source/zipapi/XUnbufferedStream.cxx
index 328542208ece..de2a69f646f3 100644
--- a/package/source/zipapi/XUnbufferedStream.cxx
+++ b/package/source/zipapi/XUnbufferedStream.cxx
@@ -58,7 +58,7 @@ using ::rtl::OUString;
XUnbufferedStream::XUnbufferedStream( SotMutexHolderRef aMutexHolder,
ZipEntry & rEntry,
Reference < XInputStream > xNewZipStream,
- const vos::ORef < EncryptionData > &rData,
+ const rtl::Reference < EncryptionData > &rData,
sal_Int8 nStreamMode,
sal_Bool bIsEncrypted,
const ::rtl::OUString& aMediaType,
@@ -91,7 +91,7 @@ XUnbufferedStream::XUnbufferedStream( SotMutexHolderRef aMutexHolder,
mnZipSize = maEntry.nSize;
mnZipEnd = maEntry.nMethod == DEFLATED ? maEntry.nOffset + maEntry.nCompressedSize : maEntry.nOffset + maEntry.nSize;
}
- sal_Bool bHaveEncryptData = ( !rData.isEmpty() && rData->aSalt.getLength() && rData->aInitVector.getLength() && rData->nIterationCount != 0 ) ? sal_True : sal_False;
+ sal_Bool bHaveEncryptData = ( rData.is() && rData->aSalt.getLength() && rData->aInitVector.getLength() && rData->nIterationCount != 0 ) ? sal_True : sal_False;
sal_Bool bMustDecrypt = ( nStreamMode == UNBUFF_STREAM_DATA && bHaveEncryptData && bIsEncrypted ) ? sal_True : sal_False;
if ( bMustDecrypt )
@@ -116,7 +116,7 @@ XUnbufferedStream::XUnbufferedStream( SotMutexHolderRef aMutexHolder,
// allows to read package raw stream
XUnbufferedStream::XUnbufferedStream( const Reference < XInputStream >& xRawStream,
- const vos::ORef < EncryptionData > &rData )
+ const rtl::Reference < EncryptionData > &rData )
: maMutexHolder( new SotMutexHolder )
, mxZipStream ( xRawStream )
, mxZipSeek ( xRawStream, UNO_QUERY )
diff --git a/package/source/zipapi/XUnbufferedStream.hxx b/package/source/zipapi/XUnbufferedStream.hxx
index 321ec10b8032..1a5ffacde07f 100644
--- a/package/source/zipapi/XUnbufferedStream.hxx
+++ b/package/source/zipapi/XUnbufferedStream.hxx
@@ -33,7 +33,7 @@
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
#include <cppuhelper/implbase1.hxx>
-#include <vos/ref.hxx>
+#include <rtl/ref.hxx>
#include <Inflater.hxx>
#include <ZipEntry.hxx>
#include <CRC32.hxx>
@@ -57,7 +57,7 @@ protected:
com::sun::star::uno::Reference < com::sun::star::io::XSeekable > mxZipSeek;
com::sun::star::uno::Sequence < sal_Int8 > maCompBuffer, maHeader;
ZipEntry maEntry;
- vos::ORef < EncryptionData > mxData;
+ rtl::Reference < EncryptionData > mxData;
rtlCipher maCipher;
Inflater maInflater;
sal_Bool mbRawStream, mbWrappedRaw, mbFinished;
@@ -71,7 +71,7 @@ public:
SotMutexHolderRef aMutexHolder,
ZipEntry & rEntry,
com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xNewZipStream,
- const vos::ORef < EncryptionData > &rData,
+ const rtl::Reference < EncryptionData > &rData,
sal_Int8 nStreamMode,
sal_Bool bIsEncrypted,
const ::rtl::OUString& aMediaType,
@@ -79,7 +79,7 @@ public:
// allows to read package raw stream
XUnbufferedStream( const com::sun::star::uno::Reference < com::sun::star::io::XInputStream >& xRawStream,
- const vos::ORef < EncryptionData > &rData );
+ const rtl::Reference < EncryptionData > &rData );
virtual ~XUnbufferedStream();
diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx
index f8efc61bcbb8..969fa64d1720 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -52,8 +52,6 @@
#include <comphelper/storagehelper.hxx>
-using namespace vos;
-using namespace rtl;
using namespace com::sun::star;
using namespace com::sun::star::io;
using namespace com::sun::star::uno;
@@ -63,6 +61,7 @@ using namespace com::sun::star::packages;
using namespace com::sun::star::packages::zip;
using namespace com::sun::star::packages::zip::ZipConstants;
+using rtl::OUString;
/** This class is used to read entries from a zip file
*/
@@ -125,10 +124,10 @@ void ZipFile::setInputStream ( Reference < XInputStream > xNewStream )
aGrabber.setInputStream ( xStream );
}
-sal_Bool ZipFile::StaticGetCipher ( const ORef < EncryptionData > & xEncryptionData, rtlCipher &rCipher, sal_Bool bDecode )
+sal_Bool ZipFile::StaticGetCipher ( const rtl::Reference < EncryptionData > & xEncryptionData, rtlCipher &rCipher, sal_Bool bDecode )
{
sal_Bool bResult = sal_False;
- if ( ! xEncryptionData.isEmpty() )
+ if ( xEncryptionData.is() )
{
Sequence < sal_uInt8 > aDerivedKey (16);
rtlCipherError aResult;
@@ -156,7 +155,7 @@ sal_Bool ZipFile::StaticGetCipher ( const ORef < EncryptionData > & xEncryptionD
return bResult;
}
-void ZipFile::StaticFillHeader ( const ORef < EncryptionData > & rData,
+void ZipFile::StaticFillHeader ( const rtl::Reference < EncryptionData > & rData,
sal_Int32 nSize,
const ::rtl::OUString& aMediaType,
sal_Int8 * & pHeader )
@@ -223,7 +222,7 @@ void ZipFile::StaticFillHeader ( const ORef < EncryptionData > & rData,
pHeader += nMediaTypeLength;
}
-sal_Bool ZipFile::StaticFillData ( ORef < EncryptionData > & rData,
+sal_Bool ZipFile::StaticFillData ( rtl::Reference < EncryptionData > & rData,
sal_Int32 &rSize,
::rtl::OUString& aMediaType,
Reference < XInputStream > &rStream )
@@ -288,10 +287,10 @@ sal_Bool ZipFile::StaticFillData ( ORef < EncryptionData > & rData,
}
Reference< XInputStream > ZipFile::StaticGetDataFromRawStream( const Reference< XInputStream >& xStream,
- const ORef < EncryptionData > &rData )
+ const rtl::Reference < EncryptionData > &rData )
throw ( packages::WrongPasswordException, ZipIOException, RuntimeException )
{
- if ( rData.isEmpty() )
+ if ( !rData.is() )
throw ZipIOException( OUString::createFromAscii( "Encrypted stream without encryption data!\n" ),
Reference< XInterface >() );
@@ -328,9 +327,9 @@ Reference< XInputStream > ZipFile::StaticGetDataFromRawStream( const Reference<
return new XUnbufferedStream ( xStream, rData );
}
-sal_Bool ZipFile::StaticHasValidPassword( const Sequence< sal_Int8 > &aReadBuffer, const ORef < EncryptionData > &rData )
+sal_Bool ZipFile::StaticHasValidPassword( const Sequence< sal_Int8 > &aReadBuffer, const rtl::Reference < EncryptionData > &rData )
{
- if ( !rData.isValid() || !rData->aKey.getLength() )
+ if ( !rData.is() || !rData->aKey.getLength() )
return sal_False;
sal_Bool bRet = sal_False;
@@ -377,7 +376,7 @@ sal_Bool ZipFile::StaticHasValidPassword( const Sequence< sal_Int8 > &aReadBuffe
return bRet;
}
-sal_Bool ZipFile::hasValidPassword ( ZipEntry & rEntry, const ORef < EncryptionData > &rData )
+sal_Bool ZipFile::hasValidPassword ( ZipEntry & rEntry, const rtl::Reference < EncryptionData > &rData )
{
::osl::MutexGuard aGuard( m_aMutex );
@@ -401,7 +400,7 @@ sal_Bool ZipFile::hasValidPassword ( ZipEntry & rEntry, const ORef < EncryptionD
#if 0
Reference < XInputStream > ZipFile::createFileStream(
ZipEntry & rEntry,
- const ORef < EncryptionData > &rData,
+ const rtl::Reference < EncryptionData > &rData,
sal_Bool bRawStream,
sal_Bool bIsEncrypted )
{
@@ -411,7 +410,7 @@ Reference < XInputStream > ZipFile::createFileStream(
}
Reference < XInputStream > ZipFile::createMemoryStream(
ZipEntry & rEntry,
- const ORef < EncryptionData > &rData,
+ const rtl::Reference < EncryptionData > &rData,
sal_Bool bRawStream,
sal_Bool bIsEncrypted )
{
@@ -434,7 +433,7 @@ Reference < XInputStream > ZipFile::createMemoryStream(
// we have the salt. If we have the salt, then check if we have the encryption key
// if not, return rawStream instead.
- sal_Bool bHaveEncryptData = ( !rData.isEmpty() && rData->aSalt.getLength() && rData->aInitVector.getLength() && rData->nIterationCount != 0 ) ? sal_True : sal_False;
+ sal_Bool bHaveEncryptData = ( rData.is() && rData->aSalt.getLength() && rData->aInitVector.getLength() && rData->nIterationCount != 0 ) ? sal_True : sal_False;
sal_Bool bMustDecrypt = ( !bRawStream && bHaveEncryptData && bIsEncrypted ) ? sal_True : sal_False;
if ( bMustDecrypt )
@@ -494,7 +493,7 @@ Reference < XInputStream > ZipFile::createMemoryStream(
Reference < XInputStream > ZipFile::createUnbufferedStream(
SotMutexHolderRef aMutexHolder,
ZipEntry & rEntry,
- const ORef < EncryptionData > &rData,
+ const rtl::Reference < EncryptionData > &rData,
sal_Int8 nStreamMode,
sal_Bool bIsEncrypted,
::rtl::OUString aMediaType )
@@ -511,7 +510,7 @@ ZipEnumeration * SAL_CALL ZipFile::entries( )
}
Reference< XInputStream > SAL_CALL ZipFile::getInputStream( ZipEntry& rEntry,
- const vos::ORef < EncryptionData > &rData,
+ const rtl::Reference < EncryptionData > &rData,
sal_Bool bIsEncrypted,
SotMutexHolderRef aMutexHolder )
throw(IOException, ZipException, RuntimeException)
@@ -528,7 +527,7 @@ Reference< XInputStream > SAL_CALL ZipFile::getInputStream( ZipEntry& rEntry,
// if we have a digest, then this file is an encrypted one and we should
// check if we can decrypt it or not
- if ( bIsEncrypted && !rData.isEmpty() && rData->aDigest.getLength() )
+ if ( bIsEncrypted && rData.is() && rData->aDigest.getLength() )
bNeedRawStream = !hasValidPassword ( rEntry, rData );
return createUnbufferedStream ( aMutexHolder,
@@ -539,7 +538,7 @@ Reference< XInputStream > SAL_CALL ZipFile::getInputStream( ZipEntry& rEntry,
}
Reference< XInputStream > SAL_CALL ZipFile::getDataStream( ZipEntry& rEntry,
- const vos::ORef < EncryptionData > &rData,
+ const rtl::Reference < EncryptionData > &rData,
sal_Bool bIsEncrypted,
SotMutexHolderRef aMutexHolder )
throw ( packages::WrongPasswordException,
@@ -559,7 +558,7 @@ Reference< XInputStream > SAL_CALL ZipFile::getDataStream( ZipEntry& rEntry,
{
// in case no digest is provided there is no way
// to detect password correctness
- if ( rData.isEmpty() )
+ if ( !rData.is() )
throw ZipException( OUString::createFromAscii( "Encrypted stream without encryption data!\n" ),
Reference< XInterface >() );
@@ -580,7 +579,7 @@ Reference< XInputStream > SAL_CALL ZipFile::getDataStream( ZipEntry& rEntry,
}
Reference< XInputStream > SAL_CALL ZipFile::getRawData( ZipEntry& rEntry,
- const vos::ORef < EncryptionData > &rData,
+ const rtl::Reference < EncryptionData > &rData,
sal_Bool bIsEncrypted,
SotMutexHolderRef aMutexHolder )
throw(IOException, ZipException, RuntimeException)
@@ -595,7 +594,7 @@ Reference< XInputStream > SAL_CALL ZipFile::getRawData( ZipEntry& rEntry,
Reference< XInputStream > SAL_CALL ZipFile::getWrappedRawStream(
ZipEntry& rEntry,
- const vos::ORef < EncryptionData > &rData,
+ const rtl::Reference < EncryptionData > &rData,
const ::rtl::OUString& aMediaType,
SotMutexHolderRef aMutexHolder )
throw ( packages::NoEncryptionException,
@@ -605,7 +604,7 @@ Reference< XInputStream > SAL_CALL ZipFile::getWrappedRawStream(
{
::osl::MutexGuard aGuard( m_aMutex );
- if ( rData.isEmpty() )
+ if ( !rData.is() )
throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
if ( rEntry.nOffset <= 0 )
diff --git a/package/source/zipapi/ZipOutputStream.cxx b/package/source/zipapi/ZipOutputStream.cxx
index d06bcc4e0885..02b66bad182b 100644
--- a/package/source/zipapi/ZipOutputStream.cxx
+++ b/package/source/zipapi/ZipOutputStream.cxx
@@ -35,12 +35,11 @@
#include <PackageConstants.hxx>
#include <ZipEntry.hxx>
#include <ZipFile.hxx>
-#include <vos/ref.hxx>
+#include <rtl/ref.hxx>
#include <com/sun/star/io/XOutputStream.hpp>
#include <comphelper/storagehelper.hxx>
-using namespace rtl;
using namespace com::sun::star::io;
using namespace com::sun::star::uno;
using namespace com::sun::star::packages;
@@ -81,7 +80,7 @@ void SAL_CALL ZipOutputStream::setLevel( sal_Int32 nNewLevel )
}
void SAL_CALL ZipOutputStream::putNextEntry( ZipEntry& rEntry,
- vos::ORef < EncryptionData > &xEncryptData,
+ rtl::Reference < EncryptionData > &xEncryptData,
sal_Bool bEncrypt)
throw(IOException, RuntimeException)
{
@@ -106,7 +105,7 @@ void SAL_CALL ZipOutputStream::putNextEntry( ZipEntry& rEntry,
aDigest = rtl_digest_createSHA1();
mnDigested = 0;
rEntry.nFlag |= 1 << 4;
- pCurrentEncryptData = xEncryptData.getBodyPtr();
+ pCurrentEncryptData = xEncryptData.get();
}
sal_Int32 nLOCLength = writeLOC(rEntry);
rEntry.nOffset = static_cast < sal_Int32 > (aChucker.GetPosition()) - nLOCLength;
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index 9db6ec282fcb..fbfb575d9dfb 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -980,7 +980,7 @@ void ZipPackage::WriteMimetypeMagicFile( ZipOutputStream& aZipOut )
try
{
- vos::ORef < EncryptionData > xEmpty;
+ rtl::Reference < EncryptionData > xEmpty;
aZipOut.putNextEntry( *pEntry, xEmpty );
aZipOut.write( aType, 0, nBufferLength );
aZipOut.closeEntry();
@@ -1025,7 +1025,7 @@ void ZipPackage::WriteManifest( ZipOutputStream& aZipOut, const vector< Sequence
pBuffer->realloc( nBufferLength );
// the manifest.xml is never encrypted - so pass an empty reference
- vos::ORef < EncryptionData > xEmpty;
+ rtl::Reference < EncryptionData > xEmpty;
aZipOut.putNextEntry( *pEntry, xEmpty );
aZipOut.write( pBuffer->getSequence(), 0, nBufferLength );
aZipOut.closeEntry();
@@ -1088,7 +1088,7 @@ void ZipPackage::WriteContentTypes( ZipOutputStream& aZipOut, const vector< Sequ
pBuffer->realloc( nBufferLength );
// there is no encryption in this format currently
- vos::ORef < EncryptionData > xEmpty;
+ rtl::Reference < EncryptionData > xEmpty;
aZipOut.putNextEntry( *pEntry, xEmpty );
aZipOut.write( pBuffer->getSequence(), 0, nBufferLength );
aZipOut.closeEntry();
diff --git a/package/source/zippackage/ZipPackageEntry.cxx b/package/source/zippackage/ZipPackageEntry.cxx
index b285210bfaa0..df789850189f 100644
--- a/package/source/zippackage/ZipPackageEntry.cxx
+++ b/package/source/zippackage/ZipPackageEntry.cxx
@@ -38,7 +38,6 @@
#include <comphelper/storagehelper.hxx>
-using namespace rtl;
using namespace com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
@@ -46,6 +45,8 @@ using namespace com::sun::star::container;
using namespace com::sun::star::packages::zip;
using namespace com::sun::star::packages::zip::ZipConstants;
+using rtl::OUString;
+
ZipPackageEntry::ZipPackageEntry ( bool bNewFolder )
: mbIsFolder ( bNewFolder )
, mbAllowRemoveOnInsert( sal_True )
diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx
index 3186a8464c4f..011bd65990d9 100644
--- a/package/source/zippackage/ZipPackageFolder.cxx
+++ b/package/source/zippackage/ZipPackageFolder.cxx
@@ -56,10 +56,10 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::uno;
using namespace com::sun::star::io;
using namespace cppu;
-using namespace rtl;
using namespace std;
using namespace ::com::sun::star;
-using vos::ORef;
+
+using rtl::OUString;
namespace { struct lcl_CachedImplId : public rtl::Static< Sequence < sal_Int8 >, lcl_CachedImplId > {}; }
@@ -335,7 +335,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
try
{
- vos::ORef < EncryptionData > aEmptyEncr;
+ rtl::Reference < EncryptionData > aEmptyEncr;
rZipOut.putNextEntry ( *pTempEntry, aEmptyEncr, sal_False );
rZipOut.rawCloseEntry();
}
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx
index 018b49aa8bd9..318a6a52b873 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -57,7 +57,8 @@ using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star;
using namespace cppu;
-using namespace rtl;
+
+using rtl::OUString;
namespace { struct lcl_CachedImplId : public rtl::Static< Sequence < sal_Int8 >, lcl_CachedImplId > {}; }
@@ -164,7 +165,7 @@ uno::Reference< io::XInputStream > ZipPackageStream::GetRawEncrStreamNoHeaderCop
if ( m_nStreamMode != PACKAGE_STREAM_RAW || !GetOwnSeekStream().is() )
throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
- if ( xEncryptionData.isEmpty() )
+ if ( !xEncryptionData.is() )
throw ZipIOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Encrypted stream without encryption data!\n" ) ),
Reference< XInterface >() );
@@ -204,7 +205,7 @@ Reference< io::XInputStream > ZipPackageStream::TryToGetRawFromDataStream( sal_B
if ( bToBeEncrypted )
{
- aKey = ( xEncryptionData.isEmpty() || !bHaveOwnKey ) ? rZipPackage.getEncryptionKey() :
+ aKey = ( !xEncryptionData.is() || !bHaveOwnKey ) ? rZipPackage.getEncryptionKey() :
xEncryptionData->aKey;
if ( !aKey.getLength() )
throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
@@ -317,7 +318,7 @@ sal_Bool ZipPackageStream::ParsePackageRawStream()
sal_Bool bOk = sal_False;
- vos::ORef < EncryptionData > xTempEncrData;
+ rtl::Reference < EncryptionData > xTempEncrData;
sal_Int32 nMagHackSize = 0;
Sequence < sal_Int8 > aHeader ( 4 );
@@ -403,7 +404,7 @@ Reference< io::XInputStream > SAL_CALL ZipPackageStream::getRawData()
{
if (IsPackageMember())
{
- if ( !xEncryptionData.isEmpty() && !bHaveOwnKey )
+ if ( xEncryptionData.is() && !bHaveOwnKey )
xEncryptionData->aKey = rZipPackage.getEncryptionKey();
return rZipPackage.getZipFile().getRawData( aEntry, xEncryptionData, bIsEncrypted, rZipPackage.GetSharedMutexRef() );
}
@@ -434,7 +435,7 @@ Reference< io::XInputStream > SAL_CALL ZipPackageStream::getInputStream( )
{
if (IsPackageMember())
{
- if ( !xEncryptionData.isEmpty() && !bHaveOwnKey )
+ if ( xEncryptionData.is() && !bHaveOwnKey )
xEncryptionData->aKey = rZipPackage.getEncryptionKey();
return rZipPackage.getZipFile().getInputStream( aEntry, xEncryptionData, bIsEncrypted, rZipPackage.GetSharedMutexRef() );
}
@@ -472,12 +473,12 @@ Reference< io::XInputStream > SAL_CALL ZipPackageStream::getDataStream()
if ( m_nStreamMode == PACKAGE_STREAM_DETECT )
throw packages::zip::ZipIOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
- if ( !xEncryptionData.isEmpty() && !bHaveOwnKey )
+ if ( xEncryptionData.is() && !bHaveOwnKey )
xEncryptionData->aKey = rZipPackage.getEncryptionKey();
if (IsPackageMember())
{
- if ( !xEncryptionData.isEmpty() && !bHaveOwnKey )
+ if ( xEncryptionData.is() && !bHaveOwnKey )
xEncryptionData->aKey = rZipPackage.getEncryptionKey();
return rZipPackage.getZipFile().getDataStream( aEntry, xEncryptionData, bIsEncrypted, rZipPackage.GetSharedMutexRef() );
@@ -508,7 +509,7 @@ Reference< io::XInputStream > SAL_CALL ZipPackageStream::getRawStream()
if (IsPackageMember())
{
- if ( !bIsEncrypted || xEncryptionData.isEmpty() )
+ if ( !bIsEncrypted || !xEncryptionData.is() )
throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
return rZipPackage.getZipFile().getWrappedRawStream( aEntry, xEncryptionData, sMediaType, rZipPackage.GetSharedMutexRef() );
@@ -660,7 +661,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName,
2 );
bToBeEncrypted = bEnc;
- if ( bToBeEncrypted && xEncryptionData.isEmpty())
+ if ( bToBeEncrypted && !xEncryptionData.is())
xEncryptionData = new EncryptionData;
}
else
@@ -697,7 +698,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName,
if ( aNewKey.getLength() )
{
- if ( xEncryptionData.isEmpty())
+ if ( !xEncryptionData.is())
xEncryptionData = new EncryptionData;
xEncryptionData->aKey = aNewKey;
@@ -765,7 +766,7 @@ Any SAL_CALL ZipPackageStream::getPropertyValue( const OUString& PropertyName )
}
else if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "EncryptionKey" ) ) )
{
- aAny <<= xEncryptionData.isEmpty () ? Sequence < sal_Int8 > () : xEncryptionData->aKey;
+ aAny <<= !xEncryptionData.is() ? Sequence < sal_Int8 > () : xEncryptionData->aKey;
return aAny;
}
else
diff --git a/package/source/zippackage/ZipPackageStream.hxx b/package/source/zippackage/ZipPackageStream.hxx
index 75262ed4ab27..a37d92586c49 100644
--- a/package/source/zippackage/ZipPackageStream.hxx
+++ b/package/source/zippackage/ZipPackageStream.hxx
@@ -31,7 +31,7 @@
#include <com/sun/star/io/XSeekable.hpp>
#include <com/sun/star/packages/XDataSinkEncrSupport.hpp>
#include <ZipPackageEntry.hxx>
-#include <vos/ref.hxx>
+#include <rtl/ref.hxx>
#include <EncryptionData.hxx>
#include <cppuhelper/implbase2.hxx>
#include <mutexholder.hxx>
@@ -56,7 +56,7 @@ protected:
const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > m_xFactory;
ZipPackage &rZipPackage;
sal_Bool bToBeCompressed, bToBeEncrypted, bHaveOwnKey, bIsEncrypted;
- vos::ORef < EncryptionData > xEncryptionData;
+ rtl::Reference < EncryptionData > xEncryptionData;
sal_uInt8 m_nStreamMode;
sal_uInt32 m_nMagicalHackPos;
@@ -80,7 +80,7 @@ public:
sal_Bool IsFromManifest() const { return m_bFromManifest; }
void SetFromManifest( sal_Bool bValue ) { m_bFromManifest = bValue; }
- vos::ORef < EncryptionData > & getEncryptionData ()
+ rtl::Reference < EncryptionData > & getEncryptionData ()
{ return xEncryptionData;}
const com::sun::star::uno::Sequence < sal_Int8 >& getKey () const
{ return xEncryptionData->aKey;}
@@ -104,10 +104,10 @@ public:
void SetToBeEncrypted (sal_Bool bNewValue)
{
bToBeEncrypted = bNewValue;
- if ( bToBeEncrypted && xEncryptionData.isEmpty())
+ if ( bToBeEncrypted && !xEncryptionData.is())
xEncryptionData = new EncryptionData;
- else if ( !bToBeEncrypted && !xEncryptionData.isEmpty() )
- xEncryptionData.unbind();
+ else if ( !bToBeEncrypted && xEncryptionData.is() )
+ xEncryptionData.clear();
}
void SetPackageMember (sal_Bool bNewValue);
void setKey (const com::sun::star::uno::Sequence < sal_Int8 >& rNewKey )