diff --git a/generators/ooo/converter.cpp b/generators/ooo/converter.cpp index 5c150457c..1124e2a51 100644 --- a/generators/ooo/converter.cpp +++ b/generators/ooo/converter.cpp @@ -585,4 +585,4 @@ bool Converter::convertAnnotation( QTextCursor *cursor, const QDomElement &eleme emit addAnnotation( annotation, position, position + 3 ); return true; -} \ No newline at end of file +} diff --git a/generators/ooo/document.cpp b/generators/ooo/document.cpp index 4fe5538fc..51d0765a5 100644 --- a/generators/ooo/document.cpp +++ b/generators/ooo/document.cpp @@ -65,28 +65,22 @@ bool Document::open() mContent = file->data(); } - if ( !entries.contains( "styles.xml" ) ) { - setError( i18n( "Invalid document structure (styles.xml is missing)" ) ); - return false; - } - - file = static_cast( directory->entry( "styles.xml" ) ); - if ( mManifest->testIfEncrypted( "styles.xml" ) ) { - mStyles = mManifest->decryptFile( "styles.xml", file->data() ); - } else { - mStyles = file->data(); - } - - if ( !entries.contains( "meta.xml" ) ) { - setError( i18n( "Invalid document structure (meta.xml is missing)" ) ); - return false; + if ( entries.contains( "styles.xml" ) ) { + file = static_cast( directory->entry( "styles.xml" ) ); + if ( mManifest->testIfEncrypted( "styles.xml" ) ) { + mStyles = mManifest->decryptFile( "styles.xml", file->data() ); + } else { + mStyles = file->data(); + } } - file = static_cast( directory->entry( "meta.xml" ) ); - if ( mManifest->testIfEncrypted( "meta.xml" ) ) { - mMeta = mManifest->decryptFile( "meta.xml", file->data() ); - } else { - mMeta = file->data(); + if ( entries.contains( "meta.xml" ) ) { + file = static_cast( directory->entry( "meta.xml" ) ); + if ( mManifest->testIfEncrypted( "meta.xml" ) ) { + mMeta = mManifest->decryptFile( "meta.xml", file->data() ); + } else { + mMeta = file->data(); + } } if ( entries.contains( "Pictures" ) ) { diff --git a/generators/ooo/styleparser.cpp b/generators/ooo/styleparser.cpp index 57c710fbd..220b121b0 100644 --- a/generators/ooo/styleparser.cpp +++ b/generators/ooo/styleparser.cpp @@ -70,6 +70,9 @@ bool StyleParser::parseContentFile() bool StyleParser::parseStyleFile() { + if ( mDocument->styles().isEmpty() ) + return true; + QXmlSimpleReader reader; QXmlInputSource source; @@ -106,6 +109,9 @@ bool StyleParser::parseStyleFile() bool StyleParser::parseMetaFile() { + if ( mDocument->meta().isEmpty() ) + return true; + QXmlSimpleReader reader; QXmlInputSource source;