summaryrefslogtreecommitdiff
path: root/package/source/zippackage
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2009-10-14 16:58:08 +0000
committerKurt Zenker <kz@openoffice.org>2009-10-14 16:58:08 +0000
commitdd74e6d59eab15a9ad7c674372293a7d3dbad975 (patch)
tree476cd284f1003569e254ff567be850908f07aea7 /package/source/zippackage
parent9033e68b120609c2817915b9b6c024a395f09280 (diff)
CWS-TOOLING: integrate CWS fwk121
2009-09-30 11:20:33 +0200 mav r276548 : #i105387# allow manifest.xml have no ODF version attribute even for ODF1.2 2009-09-30 10:54:46 +0200 mav r276545 : #i105387# allow manifest.xml have no ODF version attribute even for ODF1.2 2009-09-30 10:02:12 +0200 mav r276543 : #i105082# integrating the fix from fwk117, since it is necessary for some scenarios fixed in this cws 2009-09-30 07:33:48 +0200 jsc r276537 : #i105360# explicitly flush OStorageStream after write operations and OStoreFile when registry file is closed 2009-09-29 14:15:09 +0200 jsc r276528 : #i105360# explicitly flush OStorageStream after write operations and OStoreFile when registry file is closed 2009-09-29 09:45:28 +0200 dr r276507 : #i105325# set correct format while opening zip package 2009-09-28 18:46:45 +0200 mav r276500 : CWS-TOOLING: rebase CWS fwk121 to trunk@276429 (milestone: DEV300:m60)
Diffstat (limited to 'package/source/zippackage')
-rw-r--r--package/source/zippackage/ZipPackage.cxx20
1 files changed, 15 insertions, 5 deletions
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index b95711778e77..6ca9981d2291 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -201,6 +201,7 @@ ZipPackage::ZipPackage (const uno::Reference < XMultiServiceFactory > &xNewFacto
: m_aMutexHolder( new SotMutexHolder )
, m_bHasEncryptedEntries ( sal_False )
, m_bHasNonEncryptedEntries ( sal_False )
+, m_bInconsistent ( sal_False )
, m_bUseManifest ( sal_True )
, m_bForceRecovery ( sal_False )
, m_bMediaTypeFallbackUsed ( sal_False )
@@ -426,20 +427,23 @@ void ZipPackage::parseManifest()
m_xRootFolder->removeByName( sMimetype );
}
+ m_bInconsistent = m_pRootFolder->LookForUnexpectedODF12Streams( ::rtl::OUString() );
+
sal_Bool bODF12AndOlder = ( m_pRootFolder->GetVersion().compareTo( ODFVER_012_TEXT ) >= 0 );
- if ( !m_bForceRecovery && bODF12AndOlder && m_pRootFolder->LookForUnexpectedODF12Streams( ::rtl::OUString() ) )
+ if ( !m_bForceRecovery && bODF12AndOlder && m_bInconsistent )
{
- // this is an ODF1.2 document that contains streams not referred in the manifest.xml
+ // this is an ODF1.2 document that contains streams not referred in the manifest.xml;
+ // in case of ODF1.2 documents without version in manifest.xml the property IsInconsistent
+ // should be checked later
throw ZipIOException(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "there are streams not referred in manifest.xml\n" ) ),
uno::Reference< uno::XInterface >() );
}
+ // in case it is a correct ODF1.2 document, the version must be set
+ // and the META-INF folder is reserved for package format
if ( bODF12AndOlder )
- {
- // it is ODF1.2 or later, let the META-INF folder be unavailable for user
m_xRootFolder->removeByName( sMeta );
- }
}
}
@@ -1633,6 +1637,7 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const
if (aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("HasEncryptedEntries") )
||aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("HasNonEncryptedEntries") )
+ ||aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("IsInconsistent") )
||aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("MediaTypeFallbackUsed") ) )
throw PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
else if (aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("EncryptionKey") ) )
@@ -1671,6 +1676,11 @@ Any SAL_CALL ZipPackage::getPropertyValue( const OUString& PropertyName )
aAny <<= m_bHasNonEncryptedEntries;
return aAny;
}
+ else if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "IsInconsistent" ) ) )
+ {
+ aAny <<= m_bInconsistent;
+ return aAny;
+ }
else if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "UseManifest" ) ) )
{
aAny <<= m_bUseManifest;