Merge remote-tracking branch 'origin/KDE/4.11' into KDE/4.12

remotes/origin/KDE/4.12
Albert Astals Cid 12 years ago
commit f3418d0423
  1. 2
      generators/ooo/converter.cpp
  2. 34
      generators/ooo/document.cpp
  3. 6
      generators/ooo/styleparser.cpp

@ -585,4 +585,4 @@ bool Converter::convertAnnotation( QTextCursor *cursor, const QDomElement &eleme
emit addAnnotation( annotation, position, position + 3 ); emit addAnnotation( annotation, position, position + 3 );
return true; return true;
} }

@ -65,28 +65,22 @@ bool Document::open()
mContent = file->data(); mContent = file->data();
} }
if ( !entries.contains( "styles.xml" ) ) { if ( entries.contains( "styles.xml" ) ) {
setError( i18n( "Invalid document structure (styles.xml is missing)" ) ); file = static_cast<const KArchiveFile*>( directory->entry( "styles.xml" ) );
return false; if ( mManifest->testIfEncrypted( "styles.xml" ) ) {
} mStyles = mManifest->decryptFile( "styles.xml", file->data() );
} else {
file = static_cast<const KArchiveFile*>( directory->entry( "styles.xml" ) ); mStyles = file->data();
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;
} }
file = static_cast<const KArchiveFile*>( directory->entry( "meta.xml" ) ); if ( entries.contains( "meta.xml" ) ) {
if ( mManifest->testIfEncrypted( "meta.xml" ) ) { file = static_cast<const KArchiveFile*>( directory->entry( "meta.xml" ) );
mMeta = mManifest->decryptFile( "meta.xml", file->data() ); if ( mManifest->testIfEncrypted( "meta.xml" ) ) {
} else { mMeta = mManifest->decryptFile( "meta.xml", file->data() );
mMeta = file->data(); } else {
mMeta = file->data();
}
} }
if ( entries.contains( "Pictures" ) ) { if ( entries.contains( "Pictures" ) ) {

@ -70,6 +70,9 @@ bool StyleParser::parseContentFile()
bool StyleParser::parseStyleFile() bool StyleParser::parseStyleFile()
{ {
if ( mDocument->styles().isEmpty() )
return true;
QXmlSimpleReader reader; QXmlSimpleReader reader;
QXmlInputSource source; QXmlInputSource source;
@ -106,6 +109,9 @@ bool StyleParser::parseStyleFile()
bool StyleParser::parseMetaFile() bool StyleParser::parseMetaFile()
{ {
if ( mDocument->meta().isEmpty() )
return true;
QXmlSimpleReader reader; QXmlSimpleReader reader;
QXmlInputSource source; QXmlInputSource source;

Loading…
Cancel
Save