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
eaab276f
Kaydet (Commit)
eaab276f
authored
Agu 14, 2015
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fix my horrible chunk header code
Change-Id: Ic91c06dbe05180d97b0db5de497f26f14b2d4ec4
üst
f9386c07
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
28 deletions
+27
-28
vbaexport.hxx
include/oox/ole/vbaexport.hxx
+2
-3
vbaexport.cxx
oox/source/ole/vbaexport.cxx
+25
-25
No files found.
include/oox/ole/vbaexport.hxx
Dosyayı görüntüle @
eaab276f
...
...
@@ -66,9 +66,6 @@ private:
// DecompressedEnd according to the spec
sal_uInt64
mnDecompressedEnd
;
// Start of the current decompressed chunk
sal_uInt64
mnChunkStart
;
void
PackCompressedChunkSize
(
size_t
nSize
,
sal_uInt16
&
rHeader
);
void
PackCompressedChunkFlag
(
bool
bCompressed
,
sal_uInt16
&
rHeader
);
...
...
@@ -89,6 +86,8 @@ private:
sal_uInt16
&
rBitCount
,
sal_uInt16
&
rMaximumLength
);
void
writeRawChunk
();
sal_uInt16
handleHeader
(
bool
bCompressed
);
};
class
VBACompression
...
...
oox/source/ole/vbaexport.cxx
Dosyayı görüntüle @
eaab276f
...
...
@@ -55,13 +55,27 @@ VBACompressionChunk::VBACompressionChunk(SvStream& rCompressedStream, const sal_
{
}
void
setUInt16
(
sal_uInt8
*
pBuffer
,
size_t
nPos
,
sal_uInt16
nVal
)
{
pBuffer
[
nPos
]
=
nVal
&
0xFF
;
pBuffer
[
nPos
+
1
]
=
(
nVal
&
0xFF00
)
>>
8
;
}
sal_uInt16
VBACompressionChunk
::
handleHeader
(
bool
bCompressed
)
{
// handle header bytes
size_t
nSize
=
mnCompressedCurrent
;
sal_uInt16
nHeader
=
0
;
PackCompressedChunkSize
(
nSize
,
nHeader
);
PackCompressedChunkFlag
(
bCompressed
,
nHeader
);
PackCompressedChunkSignature
(
nHeader
);
return
nHeader
;
}
// section 2.4.1.3.7
void
VBACompressionChunk
::
write
()
{
mnChunkStart
=
mrCompressedStream
.
Tell
();
// we need to fill these two bytes later
mrCompressedStream
.
WriteUInt16
(
0x0
);
mnDecompressedCurrent
=
0
;
mnCompressedCurrent
=
2
;
...
...
@@ -80,30 +94,22 @@ void VBACompressionChunk::write()
compressTokenSequence
();
}
bool
bCompressedFlag
=
true
;
if
(
mnDecompressedCurrent
<
mnDecompressedEnd
)
{
sal_uInt64
nChunkStart
=
mrCompressedStream
.
Tell
();
mrCompressedStream
.
WriteUInt16
(
0
);
writeRawChunk
();
bCompressedFlag
=
false
;
mrCompressedStream
.
Seek
(
nChunkStart
);
sal_uInt16
nHeader
=
handleHeader
(
false
);
mrCompressedStream
.
WriteUInt16
(
nHeader
);
}
else
{
sal_uInt16
nHeader
=
handleHeader
(
true
);
setUInt16
(
pCompressedChunkStream
,
0
,
nHeader
);
// copy the compressed stream to our output stream
mrCompressedStream
.
Write
(
pCompressedChunkStream
,
mnCompressedCurrent
);
}
// handle header bytes
size_t
nSize
=
mnCompressedCurrent
;
sal_uInt16
nHeader
=
0
;
PackCompressedChunkSize
(
nSize
,
nHeader
);
PackCompressedChunkFlag
(
bCompressedFlag
,
nHeader
);
PackCompressedChunkSignature
(
nHeader
);
// overwrite the two bytes
sal_uInt64
nEnd
=
mrCompressedStream
.
Tell
();
mrCompressedStream
.
Seek
(
mnChunkStart
);
mrCompressedStream
.
WriteUInt16
(
nHeader
);
mrCompressedStream
.
Seek
(
nEnd
);
}
// section 2.4.1.3.13
...
...
@@ -146,12 +152,6 @@ void VBACompressionChunk::compressTokenSequence()
mpCompressedChunkStream
[
nFlagByteIndex
]
=
nFlagByte
;
}
void
setUInt16
(
sal_uInt8
*
pBuffer
,
size_t
nPos
,
sal_uInt16
nVal
)
{
pBuffer
[
nPos
]
=
nVal
&
0xFFFF
;
pBuffer
[
nPos
+
1
]
=
(
nVal
&
0xFFFF0000
)
>>
8
;
}
// section 2.4.1.3.9
void
VBACompressionChunk
::
compressToken
(
size_t
index
,
sal_uInt8
&
nFlagByte
)
{
...
...
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