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
7088166a
Kaydet (Commit)
7088166a
authored
Eki 27, 2014
tarafından
Matúš Kukan
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Simplify input parameters to just take the sequence
Change-Id: Ic2538ca8b0f7261064e1dfbf3884dd452003c797
üst
a42aa52a
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
38 additions
and
35 deletions
+38
-35
OleHandler.cxx
filter/source/xsltfilter/OleHandler.cxx
+1
-1
Deflater.hxx
include/package/Deflater.hxx
+1
-0
CRC32.hxx
package/inc/CRC32.hxx
+1
-1
ZipOutputEntry.hxx
package/inc/ZipOutputEntry.hxx
+1
-1
ZipOutputStream.hxx
package/inc/ZipOutputStream.hxx
+1
-1
CRC32.cxx
package/source/zipapi/CRC32.cxx
+3
-4
Deflater.cxx
package/source/zipapi/Deflater.cxx
+3
-5
ZipFile.cxx
package/source/zipapi/ZipFile.cxx
+2
-2
ZipOutputEntry.cxx
package/source/zipapi/ZipOutputEntry.cxx
+3
-3
ZipOutputStream.cxx
package/source/zipapi/ZipOutputStream.cxx
+3
-4
ZipPackage.cxx
package/source/zippackage/ZipPackage.cxx
+6
-8
ZipPackageStream.cxx
package/source/zippackage/ZipPackageStream.cxx
+13
-5
No files found.
filter/source/xsltfilter/OleHandler.cxx
Dosyayı görüntüle @
7088166a
...
...
@@ -197,7 +197,7 @@ namespace XSLT
// Compress the bytes
Sequence
<
sal_Int8
>
output
(
oledata
.
getLength
());
boost
::
scoped_ptr
<
::
ZipUtils
::
Deflater
>
compresser
(
new
::
ZipUtils
::
Deflater
((
sal_Int32
)
3
,
false
));
compresser
->
setInputSegment
(
oledata
,
0
,
oledata
.
getLength
()
);
compresser
->
setInputSegment
(
oledata
);
compresser
->
finish
();
int
compressedDataLength
=
compresser
->
doDeflateSegment
(
output
,
0
,
oledata
.
getLength
());
compresser
.
reset
();
...
...
include/package/Deflater.hxx
Dosyayı görüntüle @
7088166a
...
...
@@ -46,6 +46,7 @@ public:
~
Deflater
();
Deflater
(
sal_Int32
nSetLevel
,
bool
bNowrap
);
void
SAL_CALL
setInputSegment
(
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
sal_Int8
>&
rBuffer
,
sal_Int32
nNewOffset
,
sal_Int32
nNewLength
);
void
SAL_CALL
setInputSegment
(
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
sal_Int8
>&
rBuffer
);
bool
SAL_CALL
needsInput
(
);
void
SAL_CALL
finish
(
);
bool
SAL_CALL
finished
(
)
{
return
bFinished
;}
...
...
package/inc/CRC32.hxx
Dosyayı görüntüle @
7088166a
...
...
@@ -35,7 +35,7 @@ public:
sal_Int64
SAL_CALL
updateStream
(
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
io
::
XInputStream
>
&
xStream
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
void
SAL_CALL
updateSegment
(
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
sal_Int8
>
&
b
,
sal_Int32
off
,
sal_Int32
len
)
void
SAL_CALL
updateSegment
(
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
sal_Int8
>
&
b
,
sal_Int32
len
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
void
SAL_CALL
update
(
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
sal_Int8
>
&
b
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
...
...
package/inc/ZipOutputEntry.hxx
Dosyayı görüntüle @
7088166a
...
...
@@ -59,7 +59,7 @@ public:
bool
isEncrypt
()
{
return
m_bEncryptCurrentEntry
;
}
void
closeEntry
();
void
write
(
const
css
::
uno
::
Sequence
<
sal_Int8
>&
rBuffer
,
sal_Int32
nNewOffset
,
sal_Int32
nNewLength
);
void
write
(
const
css
::
uno
::
Sequence
<
sal_Int8
>&
rBuffer
);
private
:
void
doDeflate
();
...
...
package/inc/ZipOutputStream.hxx
Dosyayı görüntüle @
7088166a
...
...
@@ -50,7 +50,7 @@ public:
void
writeLOC
(
ZipEntry
*
pEntry
,
bool
bEncrypt
=
false
)
throw
(
::
com
::
sun
::
star
::
io
::
IOException
,
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
void
rawWrite
(
::
com
::
sun
::
star
::
uno
::
Sequence
<
sal_Int8
>&
rBuffer
,
sal_Int32
nNewOffset
,
sal_Int32
nNewLength
)
void
rawWrite
(
const
css
::
uno
::
Sequence
<
sal_Int8
>&
rBuffer
)
throw
(
::
com
::
sun
::
star
::
io
::
IOException
,
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
void
rawCloseEntry
(
bool
bEncrypt
=
false
)
throw
(
::
com
::
sun
::
star
::
io
::
IOException
,
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
...
...
package/source/zipapi/CRC32.cxx
Dosyayı görüntüle @
7088166a
...
...
@@ -47,11 +47,10 @@ 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
,
sal_Int32
len
)
void
SAL_CALL
CRC32
::
updateSegment
(
const
Sequence
<
sal_Int8
>
&
b
,
sal_Int32
len
)
throw
(
RuntimeException
)
{
nCRC
=
rtl_crc32
(
nCRC
,
b
.
getConstArray
()
+
off
,
len
);
nCRC
=
rtl_crc32
(
nCRC
,
b
.
getConstArray
(),
len
);
}
/** Update CRC32 with specified sequence of bytes
*/
...
...
@@ -70,7 +69,7 @@ sal_Int64 SAL_CALL CRC32::updateStream( Reference < XInputStream > & xStream )
do
{
nLength
=
xStream
->
readBytes
(
aSeq
,
n_ConstBufferSize
);
updateSegment
(
aSeq
,
0
,
nLength
);
updateSegment
(
aSeq
,
nLength
);
nTotal
+=
nLength
;
}
while
(
nLength
==
n_ConstBufferSize
);
...
...
package/source/zipapi/Deflater.cxx
Dosyayı görüntüle @
7088166a
...
...
@@ -92,13 +92,11 @@ 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
)
{
OSL_ASSERT
(
!
(
nNewOffset
<
0
||
nNewLength
<
0
||
nNewOffset
+
nNewLength
>
rBuffer
.
getLength
()));
sInBuffer
=
rBuffer
;
nOffset
=
nNewOffset
;
nLength
=
nNewLength
;
nOffset
=
0
;
nLength
=
rBuffer
.
getLength
()
;
}
bool
SAL_CALL
Deflater
::
needsInput
(
)
...
...
package/source/zipapi/ZipFile.cxx
Dosyayı görüntüle @
7088166a
...
...
@@ -1073,7 +1073,7 @@ sal_Int32 ZipFile::getCRC( sal_Int64 nOffset, sal_Int64 nSize )
++
ind
)
{
sal_Int64
nLen
=
::
std
::
min
(
nBlockSize
,
nSize
-
ind
*
nBlockSize
);
aCRC
.
updateSegment
(
aBuffer
,
0
,
static_cast
<
sal_Int32
>
(
nLen
));
aCRC
.
updateSegment
(
aBuffer
,
static_cast
<
sal_Int32
>
(
nLen
));
}
return
aCRC
.
getValue
();
...
...
@@ -1102,7 +1102,7 @@ void ZipFile::getSizeAndCRC( sal_Int64 nOffset, sal_Int64 nCompressedSize, sal_I
do
{
nLastInflated
=
aInflaterLocal
.
doInflateSegment
(
aData
,
0
,
nBlockSize
);
aCRC
.
updateSegment
(
aData
,
0
,
nLastInflated
);
aCRC
.
updateSegment
(
aData
,
nLastInflated
);
nInBlock
+=
nLastInflated
;
}
while
(
!
aInflater
.
finished
()
&&
nLastInflated
);
...
...
package/source/zipapi/ZipOutputEntry.cxx
Dosyayı görüntüle @
7088166a
...
...
@@ -118,15 +118,15 @@ void ZipOutputEntry::closeEntry()
}
}
void
ZipOutputEntry
::
write
(
const
Sequence
<
sal_Int8
>&
rBuffer
,
sal_Int32
nNewOffset
,
sal_Int32
nNewLength
)
void
ZipOutputEntry
::
write
(
const
Sequence
<
sal_Int8
>&
rBuffer
)
{
if
(
!
m_aDeflater
.
finished
())
{
m_aDeflater
.
setInputSegment
(
rBuffer
,
nNewOffset
,
nNewLength
);
m_aDeflater
.
setInputSegment
(
rBuffer
);
while
(
!
m_aDeflater
.
needsInput
())
doDeflate
();
if
(
!
m_bEncryptCurrentEntry
)
m_aCRC
.
updateSegment
(
rBuffer
,
nNewOffset
,
nNewLength
);
m_aCRC
.
updateSegment
(
rBuffer
,
rBuffer
.
getLength
()
);
}
}
...
...
package/source/zipapi/ZipOutputStream.cxx
Dosyayı görüntüle @
7088166a
...
...
@@ -71,10 +71,10 @@ void ZipOutputStream::addDeflatingThread( ZipOutputEntry *pEntry, comphelper::Th
m_aEntries
.
push_back
(
pEntry
);
}
void
ZipOutputStream
::
rawWrite
(
Sequence
<
sal_Int8
>&
rBuffer
,
sal_Int32
/*nNewOffset*/
,
sal_Int32
nNewLength
)
void
ZipOutputStream
::
rawWrite
(
const
Sequence
<
sal_Int8
>&
rBuffer
)
throw
(
IOException
,
RuntimeException
)
{
m_aChucker
.
WriteBytes
(
Sequence
<
sal_Int8
>
(
rBuffer
.
getConstArray
(),
nNewLength
)
);
m_aChucker
.
WriteBytes
(
rBuffer
);
}
void
ZipOutputStream
::
rawCloseEntry
(
bool
bEncrypt
)
...
...
@@ -100,8 +100,7 @@ void ZipOutputStream::finish()
for
(
size_t
i
=
0
;
i
<
m_aEntries
.
size
();
i
++
)
{
writeLOC
(
m_aEntries
[
i
]
->
getZipEntry
(),
m_aEntries
[
i
]
->
isEncrypt
());
uno
::
Sequence
<
sal_Int8
>
aCompressedData
=
m_aEntries
[
i
]
->
getData
();
rawWrite
(
aCompressedData
,
0
,
aCompressedData
.
getLength
());
rawWrite
(
m_aEntries
[
i
]
->
getData
());
rawCloseEntry
(
m_aEntries
[
i
]
->
isEncrypt
());
m_aEntries
[
i
]
->
getZipPackageStream
()
->
successfullyWritten
(
m_aEntries
[
i
]
->
getZipEntry
());
...
...
package/source/zippackage/ZipPackage.cxx
Dosyayı görüntüle @
7088166a
...
...
@@ -983,7 +983,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
);
uno
::
Sequence
<
sal_Int8
>
aType
(
(
sal_Int8
*
)
sMediaType
.
getStr
(),
const
uno
::
Sequence
<
sal_Int8
>
aType
(
(
sal_Int8
*
)
sMediaType
.
getStr
(),
nBufferLength
);
pEntry
->
sPath
=
sMime
;
...
...
@@ -999,7 +999,7 @@ void ZipPackage::WriteMimetypeMagicFile( ZipOutputStream& aZipOut )
{
ZipOutputStream
::
setEntry
(
pEntry
);
aZipOut
.
writeLOC
(
pEntry
);
aZipOut
.
rawWrite
(
aType
,
0
,
nBufferLength
);
aZipOut
.
rawWrite
(
aType
);
aZipOut
.
rawCloseEntry
();
}
catch
(
const
::
com
::
sun
::
star
::
io
::
IOException
&
r
)
...
...
@@ -1043,10 +1043,9 @@ void ZipPackage::WriteManifest( ZipOutputStream& aZipOut, const vector< uno::Seq
ZipOutputStream
::
setEntry
(
pEntry
);
aZipOut
.
writeLOC
(
pEntry
);
ZipOutputEntry
aZipEntry
(
m_xContext
,
*
pEntry
,
NULL
);
aZipEntry
.
write
(
pBuffer
->
getSequence
()
,
0
,
nBufferLength
);
aZipEntry
.
write
(
pBuffer
->
getSequence
());
aZipEntry
.
closeEntry
();
uno
::
Sequence
<
sal_Int8
>
aCompressedData
=
aZipEntry
.
getData
();
aZipOut
.
rawWrite
(
aCompressedData
,
0
,
aCompressedData
.
getLength
());
aZipOut
.
rawWrite
(
aZipEntry
.
getData
());
aZipOut
.
rawCloseEntry
();
}
...
...
@@ -1098,10 +1097,9 @@ void ZipPackage::WriteContentTypes( ZipOutputStream& aZipOut, const vector< uno:
ZipOutputStream
::
setEntry
(
pEntry
);
aZipOut
.
writeLOC
(
pEntry
);
ZipOutputEntry
aZipEntry
(
m_xContext
,
*
pEntry
,
NULL
);
aZipEntry
.
write
(
pBuffer
->
getSequence
()
,
0
,
nBufferLength
);
aZipEntry
.
write
(
pBuffer
->
getSequence
());
aZipEntry
.
closeEntry
();
uno
::
Sequence
<
sal_Int8
>
aCompressedData
=
aZipEntry
.
getData
();
aZipOut
.
rawWrite
(
aCompressedData
,
0
,
aCompressedData
.
getLength
());
aZipOut
.
rawWrite
(
aZipEntry
.
getData
());
aZipOut
.
rawCloseEntry
();
}
...
...
package/source/zippackage/ZipPackageStream.cxx
Dosyayı görüntüle @
7088166a
...
...
@@ -447,7 +447,10 @@ static void deflateZipEntry(ZipOutputEntry *pZipEntry,
do
{
nLength
=
xInStream
->
readBytes
(
aSeq
,
n_ConstBufferSize
);
pZipEntry
->
write
(
aSeq
,
0
,
nLength
);
if
(
nLength
!=
n_ConstBufferSize
)
aSeq
.
realloc
(
nLength
);
pZipEntry
->
write
(
aSeq
);
}
while
(
nLength
==
n_ConstBufferSize
);
pZipEntry
->
closeEntry
();
...
...
@@ -722,7 +725,10 @@ bool ZipPackageStream::saveChild(
do
{
nLength
=
xStream
->
readBytes
(
aSeq
,
n_ConstBufferSize
);
rZipOut
.
rawWrite
(
aSeq
,
0
,
nLength
);
if
(
nLength
!=
n_ConstBufferSize
)
aSeq
.
realloc
(
nLength
);
rZipOut
.
rawWrite
(
aSeq
);
}
while
(
nLength
==
n_ConstBufferSize
);
...
...
@@ -781,7 +787,10 @@ bool ZipPackageStream::saveChild(
do
{
nLength
=
xStream
->
readBytes
(
aSeq
,
n_ConstBufferSize
);
rZipOut
.
rawWrite
(
aSeq
,
0
,
nLength
);
if
(
nLength
!=
n_ConstBufferSize
)
aSeq
.
realloc
(
nLength
);
rZipOut
.
rawWrite
(
aSeq
);
}
while
(
nLength
==
n_ConstBufferSize
);
rZipOut
.
rawCloseEntry
(
bToBeEncrypted
);
...
...
@@ -800,8 +809,7 @@ bool ZipPackageStream::saveChild(
rZipOut
.
writeLOC
(
pTempEntry
,
bToBeEncrypted
);
ZipOutputEntry
aZipEntry
(
m_xContext
,
*
pTempEntry
,
this
,
bToBeEncrypted
);
deflateZipEntry
(
&
aZipEntry
,
xStream
);
uno
::
Sequence
<
sal_Int8
>
aCompressedData
=
aZipEntry
.
getData
();
rZipOut
.
rawWrite
(
aCompressedData
,
0
,
aCompressedData
.
getLength
());
rZipOut
.
rawWrite
(
aZipEntry
.
getData
());
rZipOut
.
rawCloseEntry
(
bToBeEncrypted
);
}
}
...
...
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