Bug 210098

Summary: Kword can't open files (doc, rtf, etc...)
Product: kde-windows Reporter: jfaryeeman
Component: network and filesAssignee: KDE-Windows <kde-windows>
Status: RESOLVED FIXED    
Severity: normal CC: cberger, halla, sebsauer
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:

Description jfaryeeman 2009-10-10 19:16:54 UTC
Version:           2.1 beta 3 (using KDE 4.3.1)
OS:                MS Windows
Installed from:    MS Windows

Kword on Windows can't open files.

How To Reproduce
----------------

Run Kword
Choose "Open Document"
Browse to the file you want; In my case several files in rtf, doc, odt. It seems not to support opening HTML files!?
Try to open them, fail and get this message:

"Could not read the beginning of the file"

The second time you try to open a file you don't even get that error message; nothing happens then

Expected behavior
-----------------

Kword should open the file. In case of error it should provide better information.

PS: You should consider add support for more files, at least for opening. For those that you can't or won't, you should then add a converter application allowing batch conversion to odt. Example: user tries to open docx, wpd, application detects this, informs the user and then  provides a conversion system to odt.
Comment 1 Thomas Zander 2009-10-12 12:43:36 UTC
Could a kde-windows guy maybe verify this bug?  I have the suspicion this is a packaging or Windows specific issue.
Comment 2 Jarosław Staniek 2009-10-12 14:22:42 UTC
Hi,
I confirm exactly this error message. The problem is in KoFilter or
even in KZip.
I've been trying to debug this, but no results yet.
Comment 3 Jarosław Staniek 2009-10-12 14:34:47 UTC
BTW, the created temporary odf file has 0 size.
Comment 4 Cyrille Berger 2009-10-13 17:43:14 UTC
Sounds like a duplicate of bug:209652 . Someone mentioned on IRC that saving from Krita to .png/.jpeg produces a .kra file instead. I am suspecting that kdelibs doesn't return the correct mimetype (I don't think there is anything os-specific in KoFilter that would justify the behaviour), so when opening .doc/.rtf in kword (or .png/.jpeg in krita), KoFilterChain think the file is a .odt (or .kra) file and that would explain the failure.
Comment 5 Sebastian Sauer 2012-03-01 03:40:47 UTC
The debug-out from comment 5 at bug #291374 says;

[8732] words(8732) bool __thiscall DocxImport::acceptsSourceMimeType(const class QByteArray &) const: Entering DOCX Import filter: from  "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
[8732] words(8732) bool __thiscall DocxImport::acceptsDestinationMimeType(const class QByteArray &) const: Entering DOCX Import filter: to  "application/vnd.oasis.opendocument.text"

what means the mimetypes are proper detected. I do think too that it's a bug in KZip. Probably similar to what was fixed with commit 9f9e302d0b8b in kzip.
Comment 6 Halla Rempt 2012-03-09 12:56:11 UTC
Fixed in bf47fed5ead06f2128abf042897f86bab39cf333