summaryrefslogtreecommitdiff
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
commit395cb927618678d852e9dec21d449a7a718fe9d5 (patch)
tree86376858c98cd10a6c3b37f07dd24ad1caadfbb5
parent65a8ecd60714c6ff2917a22a2390ecaf52e076d2 (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)
-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;
+ }
}
}
}