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
143e8326
Kaydet (Commit)
143e8326
authored
Ock 18, 2011
tarafından
Ivo Hinkelmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
CWS-TOOLING: integrate CWS fwk162
üst
6c8c8f24
71894786
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
29 deletions
+37
-29
ManifestExport.cxx
package/source/manifest/ManifestExport.cxx
+5
-0
ZipPackageFolder.cxx
package/source/zippackage/ZipPackageFolder.cxx
+32
-29
No files found.
package/source/manifest/ManifestExport.cxx
Dosyayı görüntüle @
143e8326
...
@@ -166,6 +166,11 @@ ManifestExport::ManifestExport(Reference < XDocumentHandler > xHandler, const S
...
@@ -166,6 +166,11 @@ ManifestExport::ManifestExport(Reference < XDocumentHandler > xHandler, const S
{
{
// this is ODF12 generation, let encrypted streams contain start-key-generation entry
// this is ODF12 generation, let encrypted streams contain start-key-generation entry
bStoreStartKeyGeneration
=
sal_True
;
bStoreStartKeyGeneration
=
sal_True
;
// starting from ODF12 the version should be also in manifest:manifest element
pRootAttrList
->
AddAttribute
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
ATTRIBUTE_VERSION
)
),
sCdataAttribute
,
aDocVersion
);
}
}
}
}
else
else
...
...
package/source/zippackage/ZipPackageFolder.cxx
Dosyayı görüntüle @
143e8326
...
@@ -271,11 +271,10 @@ Sequence< OUString > SAL_CALL ZipPackageFolder::getElementNames( )
...
@@ -271,11 +271,10 @@ Sequence< OUString > SAL_CALL ZipPackageFolder::getElementNames( )
{
{
sal_uInt32
i
=
0
,
nSize
=
maContents
.
size
();
sal_uInt32
i
=
0
,
nSize
=
maContents
.
size
();
Sequence
<
OUString
>
aSequence
(
nSize
);
Sequence
<
OUString
>
aSequence
(
nSize
);
OUString
*
pNames
=
aSequence
.
getArray
();
for
(
ContentHash
::
const_iterator
aIterator
=
maContents
.
begin
(),
aEnd
=
maContents
.
end
();
for
(
ContentHash
::
const_iterator
aIterator
=
maContents
.
begin
(),
aEnd
=
maContents
.
end
();
aIterator
!=
aEnd
;
aIterator
!=
aEnd
;
++
i
,
++
aIterator
)
++
i
,
++
aIterator
)
pNames
[
i
]
=
(
*
aIterator
).
first
;
aSequence
[
i
]
=
(
*
aIterator
).
first
;
return
aSequence
;
return
aSequence
;
}
}
sal_Bool
SAL_CALL
ZipPackageFolder
::
hasByName
(
const
OUString
&
aName
)
sal_Bool
SAL_CALL
ZipPackageFolder
::
hasByName
(
const
OUString
&
aName
)
...
@@ -358,7 +357,6 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
...
@@ -358,7 +357,6 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
const
ContentInfo
&
rInfo
=
*
(
*
aCI
).
second
;
const
ContentInfo
&
rInfo
=
*
(
*
aCI
).
second
;
Sequence
<
PropertyValue
>
aPropSet
(
PKG_SIZE_NOENCR_MNFST
);
Sequence
<
PropertyValue
>
aPropSet
(
PKG_SIZE_NOENCR_MNFST
);
PropertyValue
*
pValue
=
aPropSet
.
getArray
();
if
(
rInfo
.
bFolder
)
if
(
rInfo
.
bFolder
)
pFolder
=
rInfo
.
pFolder
;
pFolder
=
rInfo
.
pFolder
;
...
@@ -369,12 +367,17 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
...
@@ -369,12 +367,17 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
{
{
OUString
sTempName
=
rPath
+
rShortName
+
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"/"
)
);
OUString
sTempName
=
rPath
+
rShortName
+
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"/"
)
);
pValue
[
PKG_MNFST_MEDIATYPE
].
Name
=
sMediaTypeProperty
;
if
(
pFolder
->
GetMediaType
().
getLength
()
)
pValue
[
PKG_MNFST_MEDIATYPE
].
Value
<<=
pFolder
->
GetMediaType
();
{
pValue
[
PKG_MNFST_VERSION
].
Name
=
sVersionProperty
;
aPropSet
[
PKG_MNFST_MEDIATYPE
].
Name
=
sMediaTypeProperty
;
pValue
[
PKG_MNFST_VERSION
].
Value
<<=
pFolder
->
GetVersion
();
aPropSet
[
PKG_MNFST_MEDIATYPE
].
Value
<<=
pFolder
->
GetMediaType
();
pValue
[
PKG_MNFST_FULLPATH
].
Name
=
sFullPathProperty
;
aPropSet
[
PKG_MNFST_VERSION
].
Name
=
sVersionProperty
;
pValue
[
PKG_MNFST_FULLPATH
].
Value
<<=
sTempName
;
aPropSet
[
PKG_MNFST_VERSION
].
Value
<<=
pFolder
->
GetVersion
();
aPropSet
[
PKG_MNFST_FULLPATH
].
Name
=
sFullPathProperty
;
aPropSet
[
PKG_MNFST_FULLPATH
].
Value
<<=
sTempName
;
}
else
aPropSet
.
realloc
(
0
);
pFolder
->
saveContents
(
sTempName
,
rManList
,
rZipOut
,
rEncryptionKey
,
rRandomPool
);
pFolder
->
saveContents
(
sTempName
,
rManList
,
rZipOut
,
rEncryptionKey
,
rRandomPool
);
}
}
...
@@ -395,12 +398,12 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
...
@@ -395,12 +398,12 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
sal_Bool
bToBeEncrypted
=
pStream
->
IsToBeEncrypted
()
&&
(
bHaveEncryptionKey
||
pStream
->
HasOwnKey
());
sal_Bool
bToBeEncrypted
=
pStream
->
IsToBeEncrypted
()
&&
(
bHaveEncryptionKey
||
pStream
->
HasOwnKey
());
sal_Bool
bToBeCompressed
=
bToBeEncrypted
?
sal_True
:
pStream
->
IsToBeCompressed
();
sal_Bool
bToBeCompressed
=
bToBeEncrypted
?
sal_True
:
pStream
->
IsToBeCompressed
();
pValue
[
PKG_MNFST_MEDIATYPE
].
Name
=
sMediaTypeProperty
;
aPropSet
[
PKG_MNFST_MEDIATYPE
].
Name
=
sMediaTypeProperty
;
pValue
[
PKG_MNFST_MEDIATYPE
].
Value
<<=
pStream
->
GetMediaType
(
);
aPropSet
[
PKG_MNFST_MEDIATYPE
].
Value
<<=
pStream
->
GetMediaType
(
);
pValue
[
PKG_MNFST_VERSION
].
Name
=
sVersionProperty
;
aPropSet
[
PKG_MNFST_VERSION
].
Name
=
sVersionProperty
;
pValue
[
PKG_MNFST_VERSION
].
Value
<<=
::
rtl
::
OUString
();
// no version is stored for streams currently
aPropSet
[
PKG_MNFST_VERSION
].
Value
<<=
::
rtl
::
OUString
();
// no version is stored for streams currently
pValue
[
PKG_MNFST_FULLPATH
].
Name
=
sFullPathProperty
;
aPropSet
[
PKG_MNFST_FULLPATH
].
Name
=
sFullPathProperty
;
pValue
[
PKG_MNFST_FULLPATH
].
Value
<<=
pTempEntry
->
sPath
;
aPropSet
[
PKG_MNFST_FULLPATH
].
Value
<<=
pTempEntry
->
sPath
;
OSL_ENSURE
(
pStream
->
GetStreamMode
()
!=
PACKAGE_STREAM_NOTSET
,
"Unacceptable ZipPackageStream mode!"
);
OSL_ENSURE
(
pStream
->
GetStreamMode
()
!=
PACKAGE_STREAM_NOTSET
,
"Unacceptable ZipPackageStream mode!"
);
...
@@ -522,23 +525,22 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
...
@@ -522,23 +525,22 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
// a magic header
// a magic header
aPropSet
.
realloc
(
PKG_SIZE_ENCR_MNFST
);
aPropSet
.
realloc
(
PKG_SIZE_ENCR_MNFST
);
pValue
=
aPropSet
.
getArray
();
aPropSet
[
PKG_MNFST_INIVECTOR
].
Name
=
sInitialisationVectorProperty
;
pValue
[
PKG_MNFST_INIVECTOR
].
Name
=
sInitialisationVectorProperty
;
aPropSet
[
PKG_MNFST_INIVECTOR
].
Value
<<=
pStream
->
getInitialisationVector
();
pValue
[
PKG_MNFST_INIVECTOR
].
Value
<<=
pStream
->
getInitialisationVector
();
aPropSet
[
PKG_MNFST_SALT
].
Name
=
sSaltProperty
;
pValue
[
PKG_MNFST_SALT
].
Name
=
sSaltProperty
;
aPropSet
[
PKG_MNFST_SALT
].
Value
<<=
pStream
->
getSalt
();
pValue
[
PKG_MNFST_SALT
].
Value
<<=
pStream
->
getSalt
();
aPropSet
[
PKG_MNFST_ITERATION
].
Name
=
sIterationCountProperty
;
pValue
[
PKG_MNFST_ITERATION
].
Name
=
sIterationCountProperty
;
aPropSet
[
PKG_MNFST_ITERATION
].
Value
<<=
pStream
->
getIterationCount
();
pValue
[
PKG_MNFST_ITERATION
].
Value
<<=
pStream
->
getIterationCount
();
// Need to store the uncompressed size in the manifest
// Need to store the uncompressed size in the manifest
OSL_ENSURE
(
nOwnStreamOrigSize
>=
0
,
"The stream size was not correctly initialized!
\n
"
);
OSL_ENSURE
(
nOwnStreamOrigSize
>=
0
,
"The stream size was not correctly initialized!
\n
"
);
pValue
[
PKG_MNFST_UCOMPSIZE
].
Name
=
sSizeProperty
;
aPropSet
[
PKG_MNFST_UCOMPSIZE
].
Name
=
sSizeProperty
;
pValue
[
PKG_MNFST_UCOMPSIZE
].
Value
<<=
nOwnStreamOrigSize
;
aPropSet
[
PKG_MNFST_UCOMPSIZE
].
Value
<<=
nOwnStreamOrigSize
;
if
(
bRawStream
||
bTransportOwnEncrStreamAsRaw
)
if
(
bRawStream
||
bTransportOwnEncrStreamAsRaw
)
{
{
pValue
[
PKG_MNFST_DIGEST
].
Name
=
sDigestProperty
;
aPropSet
[
PKG_MNFST_DIGEST
].
Name
=
sDigestProperty
;
pValue
[
PKG_MNFST_DIGEST
].
Value
<<=
pStream
->
getDigest
();
aPropSet
[
PKG_MNFST_DIGEST
].
Value
<<=
pStream
->
getDigest
();
}
}
}
}
}
}
...
@@ -655,8 +657,8 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
...
@@ -655,8 +657,8 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
if
(
bToBeEncrypted
)
if
(
bToBeEncrypted
)
{
{
pValue
[
PKG_MNFST_DIGEST
].
Name
=
sDigestProperty
;
aPropSet
[
PKG_MNFST_DIGEST
].
Name
=
sDigestProperty
;
pValue
[
PKG_MNFST_DIGEST
].
Value
<<=
pStream
->
getDigest
();
aPropSet
[
PKG_MNFST_DIGEST
].
Value
<<=
pStream
->
getDigest
();
pStream
->
SetIsEncrypted
(
sal_True
);
pStream
->
SetIsEncrypted
(
sal_True
);
}
}
}
}
...
@@ -695,7 +697,8 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
...
@@ -695,7 +697,8 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
}
}
// folder can have a mediatype only in package format
// folder can have a mediatype only in package format
if
(
m_nFormat
==
embed
::
StorageFormats
::
PACKAGE
||
(
m_nFormat
==
embed
::
StorageFormats
::
OFOPXML
&&
!
rInfo
.
bFolder
)
)
if
(
aPropSet
.
getLength
()
&&
(
m_nFormat
==
embed
::
StorageFormats
::
PACKAGE
||
(
m_nFormat
==
embed
::
StorageFormats
::
OFOPXML
&&
!
rInfo
.
bFolder
)
)
)
rManList
.
push_back
(
aPropSet
);
rManList
.
push_back
(
aPropSet
);
}
}
...
...
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