summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
Diffstat (limited to 'package')
-rw-r--r--package/source/xstor/xstorage.hxx13
-rw-r--r--package/source/zipapi/Deflater.cxx4
-rw-r--r--package/source/zipapi/Inflater.cxx2
-rw-r--r--package/source/zipapi/ZipFile.cxx10
-rw-r--r--package/source/zipapi/ZipOutputStream.cxx4
-rw-r--r--package/source/zippackage/ZipPackage.cxx4
6 files changed, 19 insertions, 18 deletions
diff --git a/package/source/xstor/xstorage.hxx b/package/source/xstor/xstorage.hxx
index 3d70f3dd9ce7..d15b39bd86a8 100644
--- a/package/source/xstor/xstorage.hxx
+++ b/package/source/xstor/xstorage.hxx
@@ -102,12 +102,7 @@ struct StorageHolder_Impl
OStorage* m_pPointer;
::com::sun::star::uno::WeakReference< ::com::sun::star::embed::XStorage > m_xWeakRef;
- StorageHolder_Impl( OStorage* pStorage )
- : m_pPointer( pStorage )
- , m_xWeakRef( ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >(
- (::com::sun::star::embed::XStorage*)pStorage ) )
- {
- }
+ inline StorageHolder_Impl( OStorage* pStorage );
StorageHolder_Impl( const StorageHolder_Impl& aSH )
: m_pPointer( aSH.m_pPointer )
@@ -810,6 +805,12 @@ public:
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
};
+StorageHolder_Impl::StorageHolder_Impl( OStorage* pStorage )
+: m_pPointer( pStorage )
+, m_xWeakRef( ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >( pStorage ) )
+{
+}
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/package/source/zipapi/Deflater.cxx b/package/source/zipapi/Deflater.cxx
index 70fe26dde107..9ff3e7d5d1b8 100644
--- a/package/source/zipapi/Deflater.cxx
+++ b/package/source/zipapi/Deflater.cxx
@@ -70,8 +70,8 @@ Deflater::Deflater(sal_Int32 nSetLevel, bool bNowrap)
sal_Int32 Deflater::doDeflateBytes (uno::Sequence < sal_Int8 > &rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength)
{
sal_Int32 nResult;
- pStream->next_in = (unsigned char*) sInBuffer.getConstArray() + nOffset;
- pStream->next_out = (unsigned char*) rBuffer.getArray()+nNewOffset;
+ pStream->next_in = reinterpret_cast<unsigned char*>(sInBuffer.getArray()) + nOffset;
+ pStream->next_out = reinterpret_cast<unsigned char*>(rBuffer.getArray())+nNewOffset;
pStream->avail_in = nLength;
pStream->avail_out = nNewLength;
diff --git a/package/source/zipapi/Inflater.cxx b/package/source/zipapi/Inflater.cxx
index a9e372c860cf..17a83fa59868 100644
--- a/package/source/zipapi/Inflater.cxx
+++ b/package/source/zipapi/Inflater.cxx
@@ -102,7 +102,7 @@ sal_Int32 Inflater::doInflateBytes (Sequence < sal_Int8 > &rBuffer, sal_Int32 n
nLastInflateError = 0;
- pStream->next_in = ( unsigned char* ) ( sInBuffer.getConstArray() + nOffset );
+ pStream->next_in = reinterpret_cast<unsigned char*>( sInBuffer.getArray() + nOffset );
pStream->avail_in = nLength;
pStream->next_out = reinterpret_cast < unsigned char* > ( rBuffer.getArray() + nNewOffset );
pStream->avail_out = nNewLength;
diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx
index ad35ea24d6de..f595803f6737 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -365,7 +365,7 @@ bool ZipFile::StaticFillData ( ::rtl::Reference< BaseEncryptionData > & rData,
if ( nMediaTypeLength == rStream->readBytes ( aBuffer, nMediaTypeLength ) )
{
- aMediaType = OUString( (sal_Unicode*)aBuffer.getConstArray(),
+ aMediaType = OUString( reinterpret_cast<sal_Unicode const *>(aBuffer.getConstArray()),
nMediaTypeLength / sizeof( sal_Unicode ) );
bOk = true;
}
@@ -672,7 +672,7 @@ bool ZipFile::readLOC( ZipEntry &rEntry )
if (nRead < aNameBuffer.getLength())
aNameBuffer.realloc(nRead);
- OUString sLOCPath = OUString::intern( (sal_Char *) aNameBuffer.getArray(),
+ OUString sLOCPath = OUString::intern( reinterpret_cast<char *>(aNameBuffer.getArray()),
aNameBuffer.getLength(),
RTL_TEXTENCODING_UTF8 );
@@ -845,7 +845,7 @@ sal_Int32 ZipFile::readCEN()
throw ZipException("unexpected extra header info length" );
// read always in UTF8, some tools seem not to set UTF8 bit
- aEntry.sPath = OUString::intern ( (sal_Char *) aMemGrabber.getCurrentPos(),
+ aEntry.sPath = OUString::intern ( reinterpret_cast<char const *>(aMemGrabber.getCurrentPos()),
aEntry.nPathLen,
RTL_TEXTENCODING_UTF8 );
@@ -935,7 +935,7 @@ sal_Int32 ZipFile::recover()
{
// read always in UTF8, some tools seem not to set UTF8 bit
if( nPos + 30 + aEntry.nPathLen <= nBufSize )
- aEntry.sPath = OUString ( (sal_Char *) &pBuffer[nPos + 30],
+ aEntry.sPath = OUString ( reinterpret_cast<char const *>(&pBuffer[nPos + 30]),
aEntry.nPathLen,
RTL_TEXTENCODING_UTF8 );
else
@@ -943,7 +943,7 @@ sal_Int32 ZipFile::recover()
Sequence < sal_Int8 > aFileName;
aGrabber.seek( nGenPos + nPos + 30 );
aGrabber.readBytes( aFileName, aEntry.nPathLen );
- aEntry.sPath = OUString ( (sal_Char *) aFileName.getArray(),
+ aEntry.sPath = OUString ( reinterpret_cast<char *>(aFileName.getArray()),
aFileName.getLength(),
RTL_TEXTENCODING_UTF8 );
aEntry.nPathLen = static_cast< sal_Int16 >(aFileName.getLength());
diff --git a/package/source/zipapi/ZipOutputStream.cxx b/package/source/zipapi/ZipOutputStream.cxx
index 518058ec1de3..7cf7074548f5 100644
--- a/package/source/zipapi/ZipOutputStream.cxx
+++ b/package/source/zipapi/ZipOutputStream.cxx
@@ -198,7 +198,7 @@ void ZipOutputStream::writeCEN( const ZipEntry &rEntry )
throw IOException( "File contains streams that are too large." );
}
- Sequence < sal_Int8 > aSequence( (sal_Int8*)sUTF8Name.getStr(), sUTF8Name.getLength() );
+ Sequence < sal_Int8 > aSequence( reinterpret_cast<sal_Int8 const *>(sUTF8Name.getStr()), sUTF8Name.getLength() );
m_aChucker.WriteBytes( aSequence );
}
@@ -271,7 +271,7 @@ void ZipOutputStream::writeLOC( ZipEntry *pEntry, bool bEncrypt )
throw IOException( "File contains streams that are too large." );
}
- Sequence < sal_Int8 > aSequence( (sal_Int8*)sUTF8Name.getStr(), sUTF8Name.getLength() );
+ Sequence < sal_Int8 > aSequence( reinterpret_cast<sal_Int8 const *>(sUTF8Name.getStr()), sUTF8Name.getLength() );
m_aChucker.WriteBytes( aSequence );
m_pCurrentEntry->nOffset = m_aChucker.GetPosition() - (LOCHDR + nNameLength);
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index 9eee46e82194..15d5f9469a67 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -376,7 +376,7 @@ void ZipPackage::parseManifest()
nRead = aData.getLength();
if ( nRead )
- aPackageMediatype = OUString( ( sal_Char* )aData.getConstArray(), nRead, RTL_TEXTENCODING_ASCII_US );
+ aPackageMediatype = OUString( reinterpret_cast<char const *>(aData.getConstArray()), nRead, RTL_TEXTENCODING_ASCII_US );
}
}
@@ -986,7 +986,7 @@ void ZipPackage::WriteMimetypeMagicFile( ZipOutputStream& aZipOut )
ZipEntry * pEntry = new ZipEntry;
sal_Int32 nBufferLength = m_pRootFolder->GetMediaType().getLength();
OString sMediaType = OUStringToOString( m_pRootFolder->GetMediaType(), RTL_TEXTENCODING_ASCII_US );
- const uno::Sequence< sal_Int8 > aType( ( sal_Int8* )sMediaType.getStr(),
+ const uno::Sequence< sal_Int8 > aType( reinterpret_cast<sal_Int8 const *>(sMediaType.getStr()),
nBufferLength );
pEntry->sPath = sMime;