Issue 47323 - Read Error trying to open MS Word file without extension
Summary: Read Error trying to open MS Word file without extension
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: open-import (show other issues)
Version: 680m91
Hardware: PC All
: P3 Trivial with 4 votes (vote)
Target Milestone: ---
Assignee: michael.ruess
QA Contact: issues@sw
URL:
Keywords: oooqa
: 47739 48149 48873 51030 55524 55975 57244 57660 59326 (view as issue list)
Depends on:
Blocks:
 
Reported: 2005-04-13 09:45 UTC by ttrantal
Modified: 2013-08-07 14:42 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
miserable hack (1.10 KB, patch)
2005-06-09 16:46 UTC, caolanm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description ttrantal 2005-04-13 09:45:57 UTC
OOo Writer 1.9.91 fails to open a Microsoft Word file that does not have the   
'.doc' extension. OOo Writer 1.1.4 opens the file without any problems.   
   
To reproduce:   
1. Run OOo writer (1.9.91) and type in 'fuubar'   
2. Save as 'foobar' with type 'Microsoft Word 97/2000/XP' without 'Automatic   
file name extension'   
3. Click 'Yes' to confirm MS format   
4. Try to open in writer (1.9.91) with any of the following ways: 
   A. click 'foobar' in KDE  
   B. $ /opt/openoffice2/program/soffice foobar   
   C. select File->Open from OOo writer menu  
5. OOo writer says 'Read-Error.\nError reading file' [OK]   
   
6. rename to 'foobar.doc' => now it opens in 1.9.91
Comment 1 michael.ruess 2005-04-13 12:43:10 UTC
MRU->MBA: this only happens on Linux. Save a document in MS Word Format without
suffix in Filename, close it and try to open via FIleOpenDialog -> Eror message.
Comment 2 Mathias_Bauer 2005-04-13 16:35:12 UTC
Andreas, one for you
Comment 3 andreas.schluens 2005-04-14 08:36:35 UTC
AS: The problem is the following one:
On Windows we detect this file as "MS_Word_97" format everytimes.
On Linux we detect "MS_Word_97" only if the extension is set. Otherwhise the 
deep detection of the writer detects "writer_MS_Winword_5". Afterwards the sfx try 
to load this file nad runs into an ERROR ... I saw something like 
"ERROR_IO_BROKENPACKAGE" .... May be we cant handle storage and non 
storage based formats in such case right.

AS->MAV: Can you please investigate what's happen there? THX.
Comment 4 michael.ruess 2005-04-19 13:58:05 UTC
*** Issue 47739 has been marked as a duplicate of this issue. ***
Comment 5 michael.ruess 2005-04-26 07:32:50 UTC
*** Issue 48149 has been marked as a duplicate of this issue. ***
Comment 6 michael.ruess 2005-05-10 10:00:26 UTC
*** Issue 48873 has been marked as a duplicate of this issue. ***
Comment 7 mikhail.voytenko 2005-05-24 14:02:16 UTC
Currently there is no "ERROR_IO_BROKENPACKAGE" error during the loading process.
After "ConvertFrom()" is called the error code is set to 0x70B02 that is
application specific error code. I assume that this is a result of using of the
wrong filter for the loading. So either this is a problem of the filter "MS
Winword 5" that is not able to import the document or the problem is in the
writer deep detection that returns the wrong filter.

MAV->FLR: Please take a look whether this filter should be able to open
documents of 'Microsoft Word 97/2000/XP' format. If not ( means that the writer
deep detection is wrong on linux ) please send this bug to the owner of the
writer deep detection.
Comment 8 caolanm 2005-06-09 16:46:18 UTC
hmm... what I'm seeing is that the binfilter
(com.sun.star.comp.sfx2.BinaryFormatDetector) typedetection gets called first on
an unsuffixed file and its ::detect gets the clipboard id of the file (correctly
as the msword type) and uses this to get a filter, and the writer typedetection
service doesn't get a look in. The thing is that there are three filters
writer_MS_WinWord_5/writer_MS_WinWord_60 and writer_MS_Word_97 which have this
clipboard id. So it looks like it grabs the first one which is writer_MS_WinWord_5.

It's worth saying that all these three filters are all implemented by the same
code in sw/source/filter/ww8 so it's probably feasible in writer to work around
the problem by re-detecting what the format really is when given a MSWordDoc
type. But it looks sort of fragile if the binfilter detect is going to operate
on ClipBoard id's when a single ClipBoard id could map to multiple filters. So I
don't know if the real fix is to 
a) not have the binfilter detect get called first, or 
b) remove the MSWordDoc clipboard id for the non word97 formats in
./registry/modules/org/openoffice/TypeDetection/Types/fcfg_writer_types.xcu, or
c) make them different for different filters to have a single filter to
clipboard id mapping
d) have writer re-detect when given one of the three word filternames which one
to really use. In which case it's worth mentioning that writer_MS_WinWord_5 is
not a storage format, only a stream format.

A nasty quick fix patch for binfilter attached.
Comment 9 caolanm 2005-06-09 16:47:00 UTC
Created attachment 27054 [details]
miserable hack
Comment 10 flr 2005-08-02 09:55:20 UTC
flr->od: take over as discussed
Comment 11 Oliver-Rainer Wittmann 2005-08-02 10:30:52 UTC
OD->CMC: 
Hi Caolan, 
I hope your are fine.

Thx for your patch.

We've already decided to fix this defect more generally:
The filter service of binfilter modul should take only responsibility for the type
detection of files, which the binfilter modul will handle with its import filters.
Thus, we will not only exclude the detection of files with a clipboard ID of
Microsoft Word documents.
Comment 12 Oliver-Rainer Wittmann 2005-08-04 10:45:33 UTC
fixed in cws swqbf35 - changed file:
/binfilter/binfilterdetect/source/bindetect.cxx, 1.6.62.1
Comment 13 Oliver-Rainer Wittmann 2005-08-22 10:01:41 UTC
OD->MRU:
Checked in internal installation set of cws swqbf35 - please verify.

re-open issue and reassign to mru@openoffice.org
Comment 14 Oliver-Rainer Wittmann 2005-08-22 10:01:46 UTC
reassign to mru@openoffice.org
Comment 15 Oliver-Rainer Wittmann 2005-08-22 10:01:59 UTC
reset resolution to FIXED
Comment 16 michael.ruess 2005-08-25 08:05:21 UTC
Verified fix in CWS swqbf35.
Comment 17 mikhail.voytenko 2005-09-06 09:32:07 UTC
*** Issue 51030 has been marked as a duplicate of this issue. ***
Comment 18 Rainer Bielefeld 2005-10-07 18:46:25 UTC
*** Issue 55524 has been marked as a duplicate of this issue. ***
Comment 19 Rainer Bielefeld 2005-10-07 18:47:25 UTC
This is a general problem also for WIN (see issue 55524!) . I hope it has been
veryfied for WIN, too?
Comment 20 michael.ruess 2005-10-13 13:32:36 UTC
Checked fix in 680m132 build.
Comment 21 michael.ruess 2005-10-14 09:36:54 UTC
*** Issue 55975 has been marked as a duplicate of this issue. ***
Comment 22 michael.ruess 2005-11-03 06:31:07 UTC
*** Issue 57244 has been marked as a duplicate of this issue. ***
Comment 23 michael.ruess 2005-11-10 11:07:40 UTC
*** Issue 57660 has been marked as a duplicate of this issue. ***
Comment 24 michael.ruess 2005-12-14 10:49:39 UTC
*** Issue 59326 has been marked as a duplicate of this issue. ***
Comment 25 andrew_cl 2006-03-24 19:19:51 UTC
I am finding the same thing. I have a document server that is serving an MSWord
document without an extension. OOo 2.0 gives a "read error: error reading file"
message. It will open it with a .txt extension but not with .d or .do extensions.

Please fix this. Writer should not require a file extension to determine the
type of file.
Comment 26 michael.ruess 2006-03-27 08:12:43 UTC
Please try out with OO 2.0.2. If you problem still occurs, file a new issue and
do not post into closed/fixed issues.