Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
363c1ede
Kaydet (Commit)
363c1ede
authored
Agu 31, 2012
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
package: kill RTL_CONSTASCII_USTRINGPARAM in zipapi
Change-Id: Ic53f613cfaa5bd4affd0c27b5ed4ed20536ee055
üst
38d446da
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
52 deletions
+52
-52
ByteGrabber.cxx
package/source/zipapi/ByteGrabber.cxx
+4
-4
XUnbufferedStream.cxx
package/source/zipapi/XUnbufferedStream.cxx
+6
-6
ZipFile.cxx
package/source/zipapi/ZipFile.cxx
+36
-36
ZipOutputStream.cxx
package/source/zipapi/ZipOutputStream.cxx
+2
-2
blowfishcontext.cxx
package/source/zipapi/blowfishcontext.cxx
+3
-3
sha1context.cxx
package/source/zipapi/sha1context.cxx
+1
-1
No files found.
package/source/zipapi/ByteGrabber.cxx
Dosyayı görüntüle @
363c1ede
...
...
@@ -64,14 +64,14 @@ sal_Int64 SAL_CALL ByteGrabber::seek( sal_Int64 location )
{
sal_Int64
nLen
=
xSeek
->
getLength
();
if
(
location
<
0
||
location
>
nLen
)
throw
lang
::
IllegalArgumentException
(
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
OSL_LOG_PREFIX
)
)
,
uno
::
Reference
<
uno
::
XInterface
>
(),
1
);
throw
lang
::
IllegalArgumentException
(
OSL_LOG_PREFIX
,
uno
::
Reference
<
uno
::
XInterface
>
(),
1
);
if
(
location
>
nLen
)
location
=
nLen
;
xSeek
->
seek
(
location
);
return
location
;
}
else
throw
io
::
IOException
(
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
OSL_LOG_PREFIX
)
)
,
uno
::
Reference
<
uno
::
XInterface
>
()
);
throw
io
::
IOException
(
OSL_LOG_PREFIX
,
uno
::
Reference
<
uno
::
XInterface
>
()
);
}
sal_Int64
SAL_CALL
ByteGrabber
::
getPosition
(
)
...
...
@@ -81,7 +81,7 @@ sal_Int64 SAL_CALL ByteGrabber::getPosition( )
if
(
xSeek
.
is
()
)
return
xSeek
->
getPosition
();
else
throw
io
::
IOException
(
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
OSL_LOG_PREFIX
)
)
,
uno
::
Reference
<
uno
::
XInterface
>
()
);
throw
io
::
IOException
(
OSL_LOG_PREFIX
,
uno
::
Reference
<
uno
::
XInterface
>
()
);
}
sal_Int64
SAL_CALL
ByteGrabber
::
getLength
(
)
...
...
@@ -91,7 +91,7 @@ sal_Int64 SAL_CALL ByteGrabber::getLength( )
if
(
xSeek
.
is
()
)
return
xSeek
->
getLength
();
else
throw
io
::
IOException
(
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
OSL_LOG_PREFIX
)
)
,
uno
::
Reference
<
uno
::
XInterface
>
()
);
throw
io
::
IOException
(
OSL_LOG_PREFIX
,
uno
::
Reference
<
uno
::
XInterface
>
()
);
}
ByteGrabber
&
ByteGrabber
::
operator
>>
(
sal_Int8
&
rInt8
)
...
...
package/source/zipapi/XUnbufferedStream.cxx
Dosyayı görüntüle @
363c1ede
...
...
@@ -230,15 +230,15 @@ sal_Int32 SAL_CALL XUnbufferedStream::readBytes( Sequence< sal_Int8 >& aData, sa
if
(
nRead
>
nRequestedBytes
)
throw
RuntimeException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Should not be possible to read more then requested!"
)
)
,
"Should not be possible to read more then requested!"
,
Reference
<
XInterface
>
()
);
if
(
maInflater
.
finished
()
||
maInflater
.
getLastInflateError
()
)
throw
ZipIOException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"The stream seems to be broken!"
)
)
,
throw
ZipIOException
(
"The stream seems to be broken!"
,
Reference
<
XInterface
>
()
);
if
(
maInflater
.
needsDictionary
()
)
throw
ZipIOException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Dictionaries are not supported!"
)
)
,
throw
ZipIOException
(
"Dictionaries are not supported!"
,
Reference
<
XInterface
>
()
);
sal_Int32
nDiff
=
static_cast
<
sal_Int32
>
(
mnZipEnd
-
mnZipCurrent
);
...
...
@@ -253,7 +253,7 @@ sal_Int32 SAL_CALL XUnbufferedStream::readBytes( Sequence< sal_Int8 >& aData, sa
sal_Int32
nZipRead
=
mxZipStream
->
readBytes
(
maCompBuffer
,
nToRead
);
if
(
nZipRead
<
nToRead
)
throw
ZipIOException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"No expected data!"
)
)
,
throw
ZipIOException
(
"No expected data!"
,
Reference
<
XInterface
>
()
);
mnZipCurrent
+=
nZipRead
;
...
...
@@ -280,7 +280,7 @@ sal_Int32 SAL_CALL XUnbufferedStream::readBytes( Sequence< sal_Int8 >& aData, sa
}
else
{
throw
ZipIOException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"The stream seems to be broken!"
)
)
,
throw
ZipIOException
(
"The stream seems to be broken!"
,
Reference
<
XInterface
>
()
);
}
}
...
...
@@ -297,7 +297,7 @@ sal_Int32 SAL_CALL XUnbufferedStream::readBytes( Sequence< sal_Int8 >& aData, sa
maCRC
.
update
(
aData
);
if
(
mnZipSize
+
maHeader
.
getLength
()
==
mnMyCurrent
&&
maCRC
.
getValue
()
!=
maEntry
.
nCrc
)
throw
ZipIOException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"The stream seems to be broken!"
)
)
,
throw
ZipIOException
(
"The stream seems to be broken!"
,
Reference
<
XInterface
>
()
);
}
}
...
...
package/source/zipapi/ZipFile.cxx
Dosyayı görüntüle @
363c1ede
...
...
@@ -76,7 +76,7 @@ ZipFile::ZipFile( uno::Reference < XInputStream > &xInput, const uno::Reference
if
(
readCEN
()
==
-
1
)
{
aEntries
.
clear
();
throw
ZipException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"stream data looks to be broken"
)
)
,
uno
::
Reference
<
XInterface
>
()
);
throw
ZipException
(
"stream data looks to be broken"
,
uno
::
Reference
<
XInterface
>
()
);
}
}
}
...
...
@@ -102,7 +102,7 @@ ZipFile::ZipFile( uno::Reference < XInputStream > &xInput, const uno::Reference
else
if
(
readCEN
()
==
-
1
)
{
aEntries
.
clear
();
throw
ZipException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"stream data looks to be broken"
)
)
,
uno
::
Reference
<
XInterface
>
()
);
throw
ZipException
(
"stream data looks to be broken"
,
uno
::
Reference
<
XInterface
>
()
);
}
}
}
...
...
@@ -131,7 +131,7 @@ uno::Reference< xml::crypto::XDigestContext > ZipFile::StaticGetDigestContextFor
xFactory
.
set
(
comphelper
::
getProcessServiceFactory
(),
uno
::
UNO_SET_THROW
);
uno
::
Reference
<
xml
::
crypto
::
XDigestContextSupplier
>
xDigestContextSupplier
(
xFactory
->
createInstance
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"com.sun.star.xml.crypto.NSSInitializer"
)
)
),
xFactory
->
createInstance
(
"com.sun.star.xml.crypto.NSSInitializer"
),
uno
::
UNO_QUERY_THROW
);
xDigestContext
.
set
(
xDigestContextSupplier
->
getDigestContext
(
xEncryptionData
->
m_nCheckAlg
,
uno
::
Sequence
<
beans
::
NamedValue
>
()
),
uno
::
UNO_SET_THROW
);
...
...
@@ -150,7 +150,7 @@ uno::Reference< xml::crypto::XCipherContext > ZipFile::StaticGetCipher( const un
{
if
(
xEncryptionData
->
m_nDerivedKeySize
<
0
)
{
throw
ZipIOException
(
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Invalid derived key length!"
)
)
,
throw
ZipIOException
(
"Invalid derived key length!"
,
uno
::
Reference
<
XInterface
>
()
);
}
...
...
@@ -163,7 +163,7 @@ uno::Reference< xml::crypto::XCipherContext > ZipFile::StaticGetCipher( const un
xEncryptionData
->
m_aSalt
.
getLength
(),
xEncryptionData
->
m_nIterationCount
)
)
{
throw
ZipIOException
(
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Can not create derived key!"
)
)
,
throw
ZipIOException
(
"Can not create derived key!"
,
uno
::
Reference
<
XInterface
>
()
);
}
...
...
@@ -174,7 +174,7 @@ uno::Reference< xml::crypto::XCipherContext > ZipFile::StaticGetCipher( const un
xFactory
.
set
(
comphelper
::
getProcessServiceFactory
(),
uno
::
UNO_SET_THROW
);
uno
::
Reference
<
xml
::
crypto
::
XCipherContextSupplier
>
xCipherContextSupplier
(
xFactory
->
createInstance
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"com.sun.star.xml.crypto.NSSInitializer"
)
)
),
xFactory
->
createInstance
(
"com.sun.star.xml.crypto.NSSInitializer"
),
uno
::
UNO_QUERY_THROW
);
xResult
=
xCipherContextSupplier
->
getCipherContext
(
xEncryptionData
->
m_nEncAlg
,
aDerivedKey
,
xEncryptionData
->
m_aInitVector
,
bEncrypt
,
uno
::
Sequence
<
beans
::
NamedValue
>
()
);
...
...
@@ -185,7 +185,7 @@ uno::Reference< xml::crypto::XCipherContext > ZipFile::StaticGetCipher( const un
}
else
{
throw
ZipIOException
(
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Unknown cipher algorithm is requested!"
)
)
,
throw
ZipIOException
(
"Unknown cipher algorithm is requested!"
,
uno
::
Reference
<
XInterface
>
()
);
}
}
...
...
@@ -386,15 +386,15 @@ uno::Reference< XInputStream > ZipFile::StaticGetDataFromRawStream( const uno::R
throw
(
packages
::
WrongPasswordException
,
ZipIOException
,
RuntimeException
)
{
if
(
!
rData
.
is
()
)
throw
ZipIOException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Encrypted stream without encryption data!
\n
"
))
,
throw
ZipIOException
(
"Encrypted stream without encryption data!
\n
"
,
uno
::
Reference
<
XInterface
>
()
);
if
(
!
rData
->
m_aKey
.
getLength
()
)
throw
packages
::
WrongPasswordException
(
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
OSL_LOG_PREFIX
)
)
,
uno
::
Reference
<
uno
::
XInterface
>
()
);
throw
packages
::
WrongPasswordException
(
OSL_LOG_PREFIX
,
uno
::
Reference
<
uno
::
XInterface
>
()
);
uno
::
Reference
<
XSeekable
>
xSeek
(
xStream
,
UNO_QUERY
);
if
(
!
xSeek
.
is
()
)
throw
ZipIOException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"The stream must be seekable!
\n
"
))
,
throw
ZipIOException
(
"The stream must be seekable!
\n
"
,
uno
::
Reference
<
XInterface
>
()
);
...
...
@@ -417,7 +417,7 @@ uno::Reference< XInputStream > ZipFile::StaticGetDataFromRawStream( const uno::R
xStream
->
readBytes
(
aReadBuffer
,
nSize
);
if
(
!
StaticHasValidPassword
(
xFactory
,
aReadBuffer
,
rData
)
)
throw
packages
::
WrongPasswordException
(
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
OSL_LOG_PREFIX
)
)
,
uno
::
Reference
<
uno
::
XInterface
>
()
);
throw
packages
::
WrongPasswordException
(
OSL_LOG_PREFIX
,
uno
::
Reference
<
uno
::
XInterface
>
()
);
}
return
new
XUnbufferedStream
(
xFactory
,
xStream
,
rData
);
...
...
@@ -584,14 +584,14 @@ uno::Reference< XInputStream > SAL_CALL ZipFile::getDataStream( ZipEntry& rEntry
// in case no digest is provided there is no way
// to detect password correctness
if
(
!
rData
.
is
()
)
throw
ZipException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Encrypted stream without encryption data!
\n
"
))
,
throw
ZipException
(
"Encrypted stream without encryption data!
\n
"
,
uno
::
Reference
<
XInterface
>
()
);
// if we have a digest, then this file is an encrypted one and we should
// check if we can decrypt it or not
OSL_ENSURE
(
rData
->
m_aDigest
.
getLength
(),
"Can't detect password correctness without digest!
\n
"
);
if
(
rData
->
m_aDigest
.
getLength
()
&&
!
hasValidPassword
(
rEntry
,
rData
)
)
throw
packages
::
WrongPasswordException
(
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
OSL_LOG_PREFIX
)
)
,
uno
::
Reference
<
uno
::
XInterface
>
()
);
throw
packages
::
WrongPasswordException
(
OSL_LOG_PREFIX
,
uno
::
Reference
<
uno
::
XInterface
>
()
);
}
else
bNeedRawStream
=
(
rEntry
.
nMethod
==
STORED
);
...
...
@@ -630,7 +630,7 @@ uno::Reference< XInputStream > SAL_CALL ZipFile::getWrappedRawStream(
::
osl
::
MutexGuard
aGuard
(
m_aMutex
);
if
(
!
rData
.
is
()
)
throw
packages
::
NoEncryptionException
(
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
OSL_LOG_PREFIX
)
)
,
uno
::
Reference
<
uno
::
XInterface
>
()
);
throw
packages
::
NoEncryptionException
(
OSL_LOG_PREFIX
,
uno
::
Reference
<
uno
::
XInterface
>
()
);
if
(
rEntry
.
nOffset
<=
0
)
readLOC
(
rEntry
);
...
...
@@ -651,7 +651,7 @@ sal_Bool ZipFile::readLOC( ZipEntry &rEntry )
aGrabber
>>
nTestSig
;
if
(
nTestSig
!=
LOCSIG
)
throw
ZipIOException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Invalid LOC header (bad signature"
)
)
,
uno
::
Reference
<
XInterface
>
()
);
throw
ZipIOException
(
"Invalid LOC header (bad signature)"
,
uno
::
Reference
<
XInterface
>
()
);
aGrabber
>>
nVersion
;
aGrabber
>>
nFlag
;
aGrabber
>>
nHow
;
...
...
@@ -702,7 +702,7 @@ sal_Bool ZipFile::readLOC( ZipEntry &rEntry )
}
if
(
bBroken
&&
!
bRecoveryMode
)
throw
ZipIOException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"The stream seems to be broken!"
)
)
,
throw
ZipIOException
(
"The stream seems to be broken!"
,
uno
::
Reference
<
XInterface
>
()
);
return
sal_True
;
...
...
@@ -737,17 +737,17 @@ sal_Int32 ZipFile::findEND( )
}
catch
(
IllegalArgumentException
&
)
{
throw
ZipException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Zip END signature not found!"
)
)
,
uno
::
Reference
<
XInterface
>
()
);
throw
ZipException
(
"Zip END signature not found!"
,
uno
::
Reference
<
XInterface
>
()
);
}
catch
(
NotConnectedException
&
)
{
throw
ZipException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Zip END signature not found!"
)
)
,
uno
::
Reference
<
XInterface
>
()
);
throw
ZipException
(
"Zip END signature not found!"
,
uno
::
Reference
<
XInterface
>
()
);
}
catch
(
BufferSizeExceededException
&
)
{
throw
ZipException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Zip END signature not found!"
)
)
,
uno
::
Reference
<
XInterface
>
()
);
throw
ZipException
(
"Zip END signature not found!"
,
uno
::
Reference
<
XInterface
>
()
);
}
throw
ZipException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Zip END signature not found!"
)
)
,
uno
::
Reference
<
XInterface
>
()
);
throw
ZipException
(
"Zip END signature not found!"
,
uno
::
Reference
<
XInterface
>
()
);
}
sal_Int32
ZipFile
::
readCEN
()
...
...
@@ -768,25 +768,25 @@ sal_Int32 ZipFile::readCEN()
aGrabber
>>
nCenOff
;
if
(
nTotal
*
CENHDR
>
nCenLen
)
throw
ZipException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"invalid END header (bad entry count)"
)
)
,
uno
::
Reference
<
XInterface
>
()
);
throw
ZipException
(
"invalid END header (bad entry count)"
,
uno
::
Reference
<
XInterface
>
()
);
if
(
nTotal
>
ZIP_MAXENTRIES
)
throw
ZipException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"too many entries in ZIP File"
)
)
,
uno
::
Reference
<
XInterface
>
()
);
throw
ZipException
(
"too many entries in ZIP File"
,
uno
::
Reference
<
XInterface
>
()
);
if
(
nCenLen
<
0
||
nCenLen
>
nEndPos
)
throw
ZipException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Invalid END header (bad central directory size)"
)
)
,
uno
::
Reference
<
XInterface
>
()
);
throw
ZipException
(
"Invalid END header (bad central directory size)"
,
uno
::
Reference
<
XInterface
>
()
);
nCenPos
=
nEndPos
-
nCenLen
;
if
(
nCenOff
<
0
||
nCenOff
>
nCenPos
)
throw
ZipException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Invalid END header (bad central directory size)"
)
)
,
uno
::
Reference
<
XInterface
>
()
);
throw
ZipException
(
"Invalid END header (bad central directory size)"
,
uno
::
Reference
<
XInterface
>
()
);
nLocPos
=
nCenPos
-
nCenOff
;
aGrabber
.
seek
(
nCenPos
);
Sequence
<
sal_Int8
>
aCENBuffer
(
nCenLen
);
sal_Int64
nRead
=
aGrabber
.
readBytes
(
aCENBuffer
,
nCenLen
);
if
(
static_cast
<
sal_Int64
>
(
nCenLen
)
!=
nRead
)
throw
ZipException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Error reading CEN into memory buffer!"
)
)
,
uno
::
Reference
<
XInterface
>
()
);
throw
ZipException
(
"Error reading CEN into memory buffer!"
,
uno
::
Reference
<
XInterface
>
()
);
MemoryByteGrabber
aMemGrabber
(
aCENBuffer
);
...
...
@@ -798,19 +798,19 @@ sal_Int32 ZipFile::readCEN()
{
aMemGrabber
>>
nTestSig
;
if
(
nTestSig
!=
CENSIG
)
throw
ZipException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Invalid CEN header (bad signature)"
)
)
,
uno
::
Reference
<
XInterface
>
()
);
throw
ZipException
(
"Invalid CEN header (bad signature)"
,
uno
::
Reference
<
XInterface
>
()
);
aMemGrabber
.
skipBytes
(
2
);
aMemGrabber
>>
aEntry
.
nVersion
;
if
(
(
aEntry
.
nVersion
&
1
)
==
1
)
throw
ZipException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Invalid CEN header (encrypted entry)"
)
)
,
uno
::
Reference
<
XInterface
>
()
);
throw
ZipException
(
"Invalid CEN header (encrypted entry)"
,
uno
::
Reference
<
XInterface
>
()
);
aMemGrabber
>>
aEntry
.
nFlag
;
aMemGrabber
>>
aEntry
.
nMethod
;
if
(
aEntry
.
nMethod
!=
STORED
&&
aEntry
.
nMethod
!=
DEFLATED
)
throw
ZipException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Invalid CEN header (bad compression method)"
)
)
,
uno
::
Reference
<
XInterface
>
()
);
throw
ZipException
(
"Invalid CEN header (bad compression method)"
,
uno
::
Reference
<
XInterface
>
()
);
aMemGrabber
>>
aEntry
.
nTime
;
aMemGrabber
>>
aEntry
.
nCrc
;
...
...
@@ -826,13 +826,13 @@ sal_Int32 ZipFile::readCEN()
aEntry
.
nOffset
*=
-
1
;
if
(
aEntry
.
nPathLen
<
0
)
throw
ZipException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"unexpected name length"
)
)
,
uno
::
Reference
<
XInterface
>
()
);
throw
ZipException
(
"unexpected name length"
,
uno
::
Reference
<
XInterface
>
()
);
if
(
nCommentLen
<
0
)
throw
ZipException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"unexpected comment length"
)
)
,
uno
::
Reference
<
XInterface
>
()
);
throw
ZipException
(
"unexpected comment length"
,
uno
::
Reference
<
XInterface
>
()
);
if
(
aEntry
.
nExtraLen
<
0
)
throw
ZipException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"unexpected extra header info length"
)
)
,
uno
::
Reference
<
XInterface
>
()
);
throw
ZipException
(
"unexpected extra header info length"
,
uno
::
Reference
<
XInterface
>
()
);
// read always in UTF8, some tools seem not to set UTF8 bit
aEntry
.
sPath
=
rtl
::
OUString
::
intern
(
(
sal_Char
*
)
aMemGrabber
.
getCurrentPos
(),
...
...
@@ -840,14 +840,14 @@ sal_Int32 ZipFile::readCEN()
RTL_TEXTENCODING_UTF8
);
if
(
!::
comphelper
::
OStorageHelper
::
IsValidZipEntryFileName
(
aEntry
.
sPath
,
sal_True
)
)
throw
ZipException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Zip entry has an invalid name."
)
)
,
uno
::
Reference
<
XInterface
>
()
);
throw
ZipException
(
"Zip entry has an invalid name."
,
uno
::
Reference
<
XInterface
>
()
);
aMemGrabber
.
skipBytes
(
aEntry
.
nPathLen
+
aEntry
.
nExtraLen
+
nCommentLen
);
aEntries
[
aEntry
.
sPath
]
=
aEntry
;
}
if
(
nCount
!=
nTotal
)
throw
ZipException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Count != Total"
)
)
,
uno
::
Reference
<
XInterface
>
()
);
throw
ZipException
(
"Count != Total"
,
uno
::
Reference
<
XInterface
>
()
);
}
catch
(
IllegalArgumentException
&
)
{
...
...
@@ -1020,15 +1020,15 @@ sal_Int32 ZipFile::recover()
}
catch
(
IllegalArgumentException
&
)
{
throw
ZipException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Zip END signature not found!"
)
)
,
uno
::
Reference
<
XInterface
>
()
);
throw
ZipException
(
"Zip END signature not found!"
,
uno
::
Reference
<
XInterface
>
()
);
}
catch
(
NotConnectedException
&
)
{
throw
ZipException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Zip END signature not found!"
)
)
,
uno
::
Reference
<
XInterface
>
()
);
throw
ZipException
(
"Zip END signature not found!"
,
uno
::
Reference
<
XInterface
>
()
);
}
catch
(
BufferSizeExceededException
&
)
{
throw
ZipException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Zip END signature not found!"
)
)
,
uno
::
Reference
<
XInterface
>
()
);
throw
ZipException
(
"Zip END signature not found!"
,
uno
::
Reference
<
XInterface
>
()
);
}
}
...
...
package/source/zipapi/ZipOutputStream.cxx
Dosyayı görüntüle @
363c1ede
...
...
@@ -304,7 +304,7 @@ void ZipOutputStream::writeCEN( const ZipEntry &rEntry )
throw
(
IOException
,
RuntimeException
)
{
if
(
!::
comphelper
::
OStorageHelper
::
IsValidZipEntryFileName
(
rEntry
.
sPath
,
sal_True
)
)
throw
IOException
(
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Unexpected character is used in file name."
)
)
,
uno
::
Reference
<
XInterface
>
()
);
throw
IOException
(
"Unexpected character is used in file name."
,
uno
::
Reference
<
XInterface
>
()
);
::
rtl
::
OString
sUTF8Name
=
::
rtl
::
OUStringToOString
(
rEntry
.
sPath
,
RTL_TEXTENCODING_UTF8
);
sal_Int16
nNameLength
=
static_cast
<
sal_Int16
>
(
sUTF8Name
.
getLength
()
);
...
...
@@ -353,7 +353,7 @@ sal_Int32 ZipOutputStream::writeLOC( const ZipEntry &rEntry )
throw
(
IOException
,
RuntimeException
)
{
if
(
!::
comphelper
::
OStorageHelper
::
IsValidZipEntryFileName
(
rEntry
.
sPath
,
sal_True
)
)
throw
IOException
(
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Unexpected character is used in file name."
)
)
,
uno
::
Reference
<
XInterface
>
()
);
throw
IOException
(
"Unexpected character is used in file name."
,
uno
::
Reference
<
XInterface
>
()
);
::
rtl
::
OString
sUTF8Name
=
::
rtl
::
OUStringToOString
(
rEntry
.
sPath
,
RTL_TEXTENCODING_UTF8
);
sal_Int16
nNameLength
=
static_cast
<
sal_Int16
>
(
sUTF8Name
.
getLength
()
);
...
...
package/source/zipapi/blowfishcontext.cxx
Dosyayı görüntüle @
363c1ede
...
...
@@ -31,7 +31,7 @@ uno::Reference< xml::crypto::XCipherContext > BlowfishCFB8CipherContext::Create(
::
rtl
::
Reference
<
BlowfishCFB8CipherContext
>
xResult
=
new
BlowfishCFB8CipherContext
();
xResult
->
m_pCipher
=
rtl_cipher_create
(
rtl_Cipher_AlgorithmBF
,
rtl_Cipher_ModeStream
);
if
(
!
xResult
->
m_pCipher
)
throw
uno
::
RuntimeException
(
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Can not create cipher!"
))
,
throw
uno
::
RuntimeException
(
"Can not create cipher!"
,
uno
::
Reference
<
XInterface
>
()
);
if
(
rtl_Cipher_E_None
!=
rtl_cipher_init
(
...
...
@@ -42,7 +42,7 @@ uno::Reference< xml::crypto::XCipherContext > BlowfishCFB8CipherContext::Create(
reinterpret_cast
<
const
sal_uInt8
*
>
(
aInitVector
.
getConstArray
()
),
aInitVector
.
getLength
()
)
)
{
throw
uno
::
RuntimeException
(
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Can not initialize cipher!"
)
)
,
throw
uno
::
RuntimeException
(
"Can not initialize cipher!"
,
uno
::
Reference
<
XInterface
>
()
);
}
...
...
@@ -89,7 +89,7 @@ uno::Sequence< sal_Int8 > SAL_CALL BlowfishCFB8CipherContext::convertWithCipherC
if
(
rtl_Cipher_E_None
!=
nError
)
{
throw
uno
::
RuntimeException
(
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Can not decrypt/encrypt with cipher!"
)
)
,
throw
uno
::
RuntimeException
(
"Can not decrypt/encrypt with cipher!"
,
uno
::
Reference
<
uno
::
XInterface
>
()
);
}
...
...
package/source/zipapi/sha1context.cxx
Dosyayı görüntüle @
363c1ede
...
...
@@ -31,7 +31,7 @@ uno::Reference< xml::crypto::XDigestContext > SHA1DigestContext::Create()
::
rtl
::
Reference
<
SHA1DigestContext
>
xResult
=
new
SHA1DigestContext
();
xResult
->
m_pDigest
=
rtl_digest_createSHA1
();
if
(
!
xResult
->
m_pDigest
)
throw
uno
::
RuntimeException
(
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Can not create cipher!"
)
)
,
throw
uno
::
RuntimeException
(
"Can not create cipher!"
,
uno
::
Reference
<
XInterface
>
()
);
return
uno
::
Reference
<
xml
::
crypto
::
XDigestContext
>
(
xResult
.
get
()
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment