Issue 76465 - RTF to ODT, then cannot open ODT
Summary: RTF to ODT, then cannot open ODT
Status: CONFIRMED
Alias: None
Product: Writer
Classification: Application
Component: open-import (show other issues)
Version: OOo 2.2
Hardware: All All
: P2 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-18 08:28 UTC by pmike
Modified: 2017-05-20 11:13 UTC (History)
6 users (show)

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


Attachments
sample RTF (329.16 KB, text/rtf)
2007-04-18 08:29 UTC, pmike
no flags Details
saved as ODT (39.48 KB, application/vnd.oasis.opendocument.text)
2007-04-18 08:30 UTC, pmike
no flags Details
More Specific Test Case (11.62 KB, application/msword)
2008-01-11 03:00 UTC, terrye
no flags Details
Odt version of second test case (8.57 KB, application/vnd.sun.xml.writer)
2008-01-11 03:02 UTC, terrye
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description pmike 2007-04-18 08:28:18 UTC
Open sample file with OOo Writer 2.2, then save as ODT.
Created ODT cannot be opened - Writer show error ("error reading file").
Comment 1 pmike 2007-04-18 08:29:30 UTC
Created attachment 44499 [details]
sample RTF
Comment 2 pmike 2007-04-18 08:30:17 UTC
Created attachment 44500 [details]
saved as ODT
Comment 3 michael.ruess 2007-04-18 14:25:21 UTC
MRU->HBRINKM: can confirm this. Open the attached RTF, save as odt and reopen ->
"Error reading file".
Comment 4 terrye 2008-01-11 03:00:52 UTC
Created attachment 50796 [details]
More Specific Test Case
Comment 5 terrye 2008-01-11 03:02:10 UTC
Created attachment 50797 [details]
Odt version of second test case
Comment 6 terrye 2008-01-11 03:56:59 UTC
See http://user.services.openoffice.org/en/forum/viewtopic.php?f=5&t=1532 for
background

This is the same issue but the title is actually wrong: this is a symptom rather
than the underlying bug discussed below.

One of the most common Denial of Service issues that we see on both the
user.services and OooForums is that our users post “I suddenly can't read my
(usually ODT) file and I have now lost all my work. What do I do to get it
back.”  However without hard test cases it hasn't be realistic to raise this as
a hard issue.  However,  this time I took the effort to do a binary chop on the
content.xml to isolate the troublesome tags.  In all three cases, the problem
was caused by style:text-position attribute within a style:text-properties tag
to place the text on the line.  These all conformed to the ODF spec. 

The issue was that whilst MS Word allows vertical offsets > 1 line, in Writer
these are limited in the GIU to a maximum of +/- 100%.   I've had a  look at the
code for the XML exporter and importer. It seems to be using a standard
framework which is generated from the XML DTD with a whole load of stub to do
the filling in so that the internal structures can be mapped to XML and
visa-versa. The issue is that the outbound validation is a lot less lax than the
inbound (After all, why bother validating the outbound — its valid already,
isn't it?).   Well this actually break a pretty design principle for such
converters because if there is any logic path which results in the internal
state being inconsistent with the input validation parameters, you can still
successfully save your document, thereby overwriting a valid document with an
unloadable one.  

This is at *least* a P2 error.

I've created a minimal RTF which replicates the Topic 1532 case.  Here the
problem style is T2.
The equivalent tags in Attachment 2 [details] ODT are P262 an T5.  Set all 3 to “-100%
100% and the docs will load.

This is not an RTF error.  RTF is purely the access path to load the Rich Text
bypassing XML input validation.  There are others: open Attachment 3 [details] RTF and do
a select all and copy.  Now open any large OTD and paste the clipboard. Save.
Close and try the reopen: bang you have now lost your precious document, The
poster on topic 1532 mention that the user was pasting content from PPTs (opened
in Calc) to create this failure.

In general the whole concept of aborting file loads because a parameter is out
of bounds is flawed.  At a minimum there should be a load option to enable
demotion of such errors to a warning or a dialogue to the effect that “This
document contains formatting that may be lost in OpenOffice, Click Yes to
continue loading”.  That way at least the user might have the odd height
position clipped rather than loosing access to the whole document.
Comment 7 Mathias_Bauer 2008-01-11 14:45:48 UTC
target 3.0
Comment 8 openoffice 2008-06-03 14:19:22 UTC
retargeted due to lack of resources
Comment 9 Mathias_Bauer 2009-02-05 16:59:34 UTC
Henning, as this obviously is not an RTF import problem, perhaps OD should take
over?
Comment 10 merschmann 2009-02-09 13:27:26 UTC
No more a blocker for 3.1
Comment 11 Marcus 2017-05-20 11:13:12 UTC
Reset assigne to the default "issues@openoffice.apache.org".