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
30f80f12
Kaydet (Commit)
30f80f12
authored
Eki 21, 2014
tarafından
Matúš Kukan
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
package: Do not use hacky bit 1<<4 in ZipEntry::nFlag
Change-Id: I504f5c0c9aa9b655ffb53d9820a33677dad6aa08
üst
ef8e7eab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
34 deletions
+11
-34
ZipOutputStream.hxx
package/inc/ZipOutputStream.hxx
+1
-0
ZipOutputStream.cxx
package/source/zipapi/ZipOutputStream.cxx
+10
-27
ZipPackageStream.cxx
package/source/zippackage/ZipPackageStream.cxx
+0
-7
No files found.
package/inc/ZipOutputStream.hxx
Dosyayı görüntüle @
30f80f12
...
@@ -37,6 +37,7 @@ class ZipOutputStream
...
@@ -37,6 +37,7 @@ class ZipOutputStream
ByteChucker
m_aChucker
;
ByteChucker
m_aChucker
;
bool
m_bFinished
;
bool
m_bFinished
;
ZipEntry
*
m_pCurrentEntry
;
ZipEntry
*
m_pCurrentEntry
;
bool
m_bEncrypt
;
public
:
public
:
ZipOutputStream
(
ZipOutputStream
(
...
...
package/source/zipapi/ZipOutputStream.cxx
Dosyayı görüntüle @
30f80f12
...
@@ -66,10 +66,7 @@ void ZipOutputStream::putNextEntry( ZipEntry& rEntry, bool bEncrypt )
...
@@ -66,10 +66,7 @@ void ZipOutputStream::putNextEntry( ZipEntry& rEntry, bool bEncrypt )
rEntry
.
nSize
=
rEntry
.
nCompressedSize
=
0
;
rEntry
.
nSize
=
rEntry
.
nCompressedSize
=
0
;
rEntry
.
nFlag
|=
8
;
rEntry
.
nFlag
|=
8
;
}
}
if
(
bEncrypt
)
m_bEncrypt
=
bEncrypt
;
{
rEntry
.
nFlag
|=
1
<<
4
;
}
sal_Int32
nLOCLength
=
writeLOC
(
rEntry
);
sal_Int32
nLOCLength
=
writeLOC
(
rEntry
);
rEntry
.
nOffset
=
m_aChucker
.
GetPosition
()
-
nLOCLength
;
rEntry
.
nOffset
=
m_aChucker
.
GetPosition
()
-
nLOCLength
;
...
@@ -88,6 +85,10 @@ void ZipOutputStream::rawCloseEntry()
...
@@ -88,6 +85,10 @@ void ZipOutputStream::rawCloseEntry()
{
{
if
(
m_pCurrentEntry
->
nMethod
==
DEFLATED
&&
(
m_pCurrentEntry
->
nFlag
&
8
)
)
if
(
m_pCurrentEntry
->
nMethod
==
DEFLATED
&&
(
m_pCurrentEntry
->
nFlag
&
8
)
)
writeEXT
(
*
m_pCurrentEntry
);
writeEXT
(
*
m_pCurrentEntry
);
if
(
m_bEncrypt
)
m_pCurrentEntry
->
nMethod
=
STORED
;
m_pCurrentEntry
=
NULL
;
m_pCurrentEntry
=
NULL
;
}
}
...
@@ -144,19 +145,8 @@ void ZipOutputStream::writeCEN( const ZipEntry &rEntry )
...
@@ -144,19 +145,8 @@ void ZipOutputStream::writeCEN( const ZipEntry &rEntry )
m_aChucker
<<
CENSIG
;
m_aChucker
<<
CENSIG
;
m_aChucker
<<
rEntry
.
nVersion
;
m_aChucker
<<
rEntry
.
nVersion
;
m_aChucker
<<
rEntry
.
nVersion
;
m_aChucker
<<
rEntry
.
nVersion
;
if
(
rEntry
.
nFlag
&
(
1
<<
4
)
)
m_aChucker
<<
rEntry
.
nFlag
;
{
m_aChucker
<<
rEntry
.
nMethod
;
// If it's an encrypted entry, we pretend its stored plain text
ZipEntry
*
pEntry
=
const_cast
<
ZipEntry
*
>
(
&
rEntry
);
pEntry
->
nFlag
&=
~
(
1
<<
4
);
m_aChucker
<<
rEntry
.
nFlag
;
m_aChucker
<<
static_cast
<
sal_Int16
>
(
STORED
);
}
else
{
m_aChucker
<<
rEntry
.
nFlag
;
m_aChucker
<<
rEntry
.
nMethod
;
}
bool
bWrite64Header
=
false
;
bool
bWrite64Header
=
false
;
m_aChucker
<<
static_cast
<
sal_uInt32
>
(
rEntry
.
nTime
);
m_aChucker
<<
static_cast
<
sal_uInt32
>
(
rEntry
.
nTime
);
...
@@ -214,19 +204,12 @@ sal_Int32 ZipOutputStream::writeLOC( const ZipEntry &rEntry )
...
@@ -214,19 +204,12 @@ sal_Int32 ZipOutputStream::writeLOC( const ZipEntry &rEntry )
m_aChucker
<<
LOCSIG
;
m_aChucker
<<
LOCSIG
;
m_aChucker
<<
rEntry
.
nVersion
;
m_aChucker
<<
rEntry
.
nVersion
;
if
(
rEntry
.
nFlag
&
(
1
<<
4
)
)
m_aChucker
<<
rEntry
.
nFlag
;
{
// If it's an encrypted entry, we pretend its stored plain text
// If it's an encrypted entry, we pretend its stored plain text
if
(
m_bEncrypt
)
sal_Int16
nTmpFlag
=
rEntry
.
nFlag
;
nTmpFlag
&=
~
(
1
<<
4
);
m_aChucker
<<
nTmpFlag
;
m_aChucker
<<
static_cast
<
sal_Int16
>
(
STORED
);
m_aChucker
<<
static_cast
<
sal_Int16
>
(
STORED
);
}
else
else
{
m_aChucker
<<
rEntry
.
nFlag
;
m_aChucker
<<
rEntry
.
nMethod
;
m_aChucker
<<
rEntry
.
nMethod
;
}
bool
bWrite64Header
=
false
;
bool
bWrite64Header
=
false
;
...
...
package/source/zippackage/ZipPackageStream.cxx
Dosyayı görüntüle @
30f80f12
...
@@ -809,13 +809,6 @@ bool ZipPackageStream::saveChild(
...
@@ -809,13 +809,6 @@ bool ZipPackageStream::saveChild(
// Then copy it back afterwards...
// Then copy it back afterwards...
ZipPackageFolder
::
copyZipEntry
(
aEntry
,
*
pTempEntry
);
ZipPackageFolder
::
copyZipEntry
(
aEntry
,
*
pTempEntry
);
// Remove hacky bit from entry flags
if
(
aEntry
.
nFlag
&
(
1
<<
4
)
)
{
aEntry
.
nFlag
&=
~
(
1
<<
4
);
aEntry
.
nMethod
=
STORED
;
}
// TODO/LATER: get rid of this hack ( the encrypted stream size property is changed during saving )
// TODO/LATER: get rid of this hack ( the encrypted stream size property is changed during saving )
if
(
IsEncrypted
()
)
if
(
IsEncrypted
()
)
setSize
(
nOwnStreamOrigSize
);
setSize
(
nOwnStreamOrigSize
);
...
...
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