--------------Boundary-00=_830N98T12LWTFAM22NBO Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Subject: The attached patch is for the file lib/kofficecore/koDocument.cc The new code takes care about the return value of QDomDocument::setContent and aborts in case of error. Information about the error is given through kdError and to the user. The user only sees where in the file the parsing error has been but he does not see the error message given by QT, as this message is not translated. The kdError output however also contains his error message. Have a nice day/evening/night! --------------Boundary-00=_830N98T12LWTFAM22NBO Content-Type: text/x-diff; charset="iso-8859-1"; name="patch_koDocument_cc.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="patch_koDocument_cc.txt" --- koDocument.cc.orig=09Sat Nov 17 21:56:59 2001 +++ koDocument.cc=09Sat Dec 1 00:10:05 2001 @@ -910,11 +910,26 @@ if ( strncasecmp( buf, "lastErrorMessage =3D i18n( "Parsing error in file at line %1,= column %2" ) + .arg( errorLine ).arg( errorColumn ); + res=3Dfalse; + } =20 QApplication::restoreOverrideCursor(); in.close(); @@ -935,8 +950,21 @@ =20 if ( store->open( "root" ) ) { + QString errorMsg; + int errorLine; + int errorColumn; QDomDocument doc; - doc.setContent( store->device() ); + if ( !doc.setContent( store->device(), &errorMsg, &errorLine, &err= orColumn ) ) + { + kdError (30003) << "Parsing Error! Aborting! (in KoDocument::loa= dNativeFormat (KoStore))" << endl + << " Line: " << errorLine << " Column: " << errorColumn << en= dl + << " Message: " << errorMsg << endl; + d->lastErrorMessage =3D i18n( "Parsing error in file at line %1,= column %2" ) + .arg( errorLine ).arg( errorColumn ); + delete store; + QApplication::restoreOverrideCursor(); + return false; + } if ( !loadXML( store->device(), doc ) ) { delete store; --------------Boundary-00=_830N98T12LWTFAM22NBO-- _______________________________________________ koffice-devel mailing list koffice-devel@mail.kde.org http://mail.kde.org/mailman/listinfo/koffice-devel