[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: [PATCH] Mime error when loading KWord file
From: Nicolas Goutte <nicog () snafu ! de>
Date: 2001-11-30 20:10:48
[Download RAW message or body]
I have attached a small patch for kword/kwdoc.cc.
At loading, if the KWord file has no mime type defined, the error message
becomes:
"Invalid document. Expected mimetype application/x-kword, got "
As it is a little curious and as it has made me think first that it is a
KWord bug, I have added another message in case of an empty string.
Have a nice day/evening/night!
["patch.txt" (text/x-diff)]
--- kwdoc.cc.orig Thu Nov 29 23:33:32 2001
+++ kwdoc.cc Fri Nov 30 19:07:10 2001
@@ -1035,7 +1035,13 @@
unsigned item;
value = KWDocument::getAttribute( word, "mime", QString::null );
- if ( value != "application/x-kword" )
+ if ( value.isEmpty() )
+ {
+ kdError(32001) << "No mime type specified!" << endl;
+ setErrorMessage( i18n( "Invalid document. No mimetype specified." ) );
+ return false;
+ }
+ else if ( value != "application/x-kword" )
{
kdError(32001) << "Unknown mime type " << value << endl;
setErrorMessage( i18n( "Invalid document. Expected mimetype \
application/x-kword, got %1" ).arg( value ) );
_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic