summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2009-10-12 14:31:58 +0000
committerOliver Bolte <obo@openoffice.org>2009-10-12 14:31:58 +0000
commitbac3cecbb7babe2aba627c2918628f62d4735d99 (patch)
tree68c6d19e98349ea809e7c80da61521bf47886889 /xmloff
parenta1f5f28b6526ba2b848c0e77b1a5d4f6e7b1b88a (diff)
CWS-TOOLING: integrate CWS fwk121_OOO320
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 'xmloff')
-rw-r--r--xmloff/source/core/xmlimp.cxx20
1 files changed, 19 insertions, 1 deletions
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index df5c7d2987..9807e7982b 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -1629,6 +1629,7 @@ sal_Bool SvXMLImport::IsODFVersionConsistent( const ::rtl::OUString& aODFVersion
if ( aODFVersion.getLength() && aODFVersion.compareTo( ODFVER_012_TEXT ) >= 0 )
{
// check the consistency only for the ODF1.2 and later ( according to content.xml )
+ // manifest.xml might have no version, it should be checked here and the correct version should be set
try
{
uno::Reference< document::XStorageBasedDocument > xDoc( mxModel, uno::UNO_QUERY_THROW );
@@ -1654,7 +1655,24 @@ sal_Bool SvXMLImport::IsODFVersionConsistent( const ::rtl::OUString& aODFVersion
::rtl::OUString aStorVersion;
xStorProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ) )
>>= aStorVersion;
- bResult = aODFVersion.equals( aStorVersion );
+
+ // if the storage version is set in manifest.xml, it must be the same as in content.xml
+ // if not, set it explicitly to be used further ( it will work even for readonly storage )
+ // This workaround is not nice, but I see no other way to handle it, since there are
+ // ODF1.2 documents without version in manifest.xml
+ if ( aStorVersion.getLength() )
+ bResult = aODFVersion.equals( aStorVersion );
+ else
+ xStorProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ),
+ uno::makeAny( aODFVersion ) );
+
+ if ( bResult )
+ {
+ sal_Bool bInconsistent = sal_False;
+ xStorProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsInconsistent" ) ) )
+ >>= bInconsistent;
+ bResult = !bInconsistent;
+ }
}
}
}