Issue 85423 - storeAsURL for writer/web document into MS Word 97 (and less) produce corrupted document
Summary: storeAsURL for writer/web document into MS Word 97 (and less) produce corrupt...
Status: CLOSED IRREPRODUCIBLE
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: PC All
: P3 Trivial
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-21 09:18 UTC by ashtokalo
Modified: 2017-08-16 22:31 UTC (History)
3 users (show)

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


Attachments
Converted document in MS Word 2003 (40.25 KB, image/gif)
2008-01-21 09:30 UTC, ashtokalo
no flags Details
Same document in Open Office (9.97 KB, image/gif)
2008-01-21 09:35 UTC, ashtokalo
no flags Details
The MS Word document (85.50 KB, application/msword)
2008-01-21 09:36 UTC, ashtokalo
no flags Details
and original HTML from wich MS document was created (126 bytes, text/html)
2008-01-21 09:38 UTC, ashtokalo
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description ashtokalo 2008-01-21 09:18:43 UTC
In case we need to save writer/web document (e.g. HTML) into MS Word (except MS
Word 2003 XML) we got document that could be viewed and edited with Open Office,
but wrong for Microsoft Office 2003 (maybe other versions too). This only
happens if you do that in Basic or via API by methods storeToURL or storeAsURL.

The problem discovered with following code:

Sub SaveAs(cFilter As String, cSource As String, cTarget As String)
    cUrl = ConvertToURL( cSource )
    oDoc = StarDesktop.LoadComponentFromURL(cUrl, "_blank", 0, _
         Array(MakePropertyValue( "Hidden", True ),))
    cUrl = ConvertToURL( cTarget )
    oDoc.storeToURL( cUrl, Array( MakePropertyValue( "FilterName", cFilter ),))
    oDoc.close( True )
End Sub

Function MakePropertyValue( Optional cName As String, Optional uValue ) _
   As com.sun.star.beans.PropertyValue
   Dim oPropertyValue As New com.sun.star.beans.PropertyValue
   If Not IsMissing( cName ) Then
      oPropertyValue.Name = cName
   EndIf
   If Not IsMissing( uValue ) Then
      oPropertyValue.Value = uValue
   EndIf
   MakePropertyValue() = oPropertyValue
End Function

The value for cFilter is "MS Word 97", cSource is filename of HTML document,
cTarget is name of new file with extension .doc.

I also check this behavior with JodConverter with same result.

The document we got in result looks like normal. But if you open this document
with MS Word you find set of ````` (depends on original text length) drew on
window form without page (for Print layout). For Normal layout the text visible,
but each character placed on separate line. Only in Outline layout the content
visible as it should be.

At the same time Open Office show the document without any artifacts.

Moreover, it's not clear why API allows save writer/web document into MS Word
document if UI limit me to do that.

The bug was reproduced with Windows XP, Windows 2000 and Windows 2003 in Open
Office v 2.0.4 and Open Office 2.2.1.
Comment 1 ashtokalo 2008-01-21 09:30:35 UTC
Created attachment 51043 [details]
Converted document in MS Word 2003
Comment 2 ashtokalo 2008-01-21 09:35:24 UTC
Created attachment 51044 [details]
Same document in Open Office
Comment 3 ashtokalo 2008-01-21 09:36:49 UTC
Created attachment 51045 [details]
The MS Word document
Comment 4 ashtokalo 2008-01-21 09:38:04 UTC
Created attachment 51046 [details]
and original HTML from wich MS document was created
Comment 5 ashtokalo 2008-01-21 09:41:42 UTC
The problem was applicable not only for case writer/web document that need to be
saved to MS Word document. I also found that saving writer/web document into RTF
produce absolutely wrong content. Transitional saving via ODT also not helps...
Comment 6 eric.savary 2008-01-21 10:14:46 UTC
Reassigned to JSK
Comment 7 ashtokalo 2008-01-22 15:13:26 UTC
I found that partial solution for problem is using method
insertDocumentFromUrl() to insert required document into blank and then save new
document as we need.
Comment 8 joerg.skottke 2008-06-03 11:31:47 UTC
This is more API like, forwarding to CN
Comment 9 chne 2008-06-09 12:51:32 UTC
cn->tl: for you
Comment 10 chne 2008-06-09 12:55:13 UTC
ups, wrong target
Comment 11 thomas.lange 2008-06-09 13:01:14 UTC
TL->HB: please have a look. Thanks!
Comment 12 hb 2008-06-09 21:44:08 UTC
not for me.
Comment 13 chne 2008-06-18 20:37:13 UTC
cn->tl: due to the fact of missing MS-Office I forward this Issue blindly.
Comment 14 joerg.skottke 2008-10-24 07:25:55 UTC
jsk->tl: It would be pretty cool if you could have a look at this issue shortly
so we at least could get a decent status other than "unconfirmed".
Comment 15 stefan.baltzer 2008-10-29 14:17:45 UTC
SBA: This issue has a target set but is still in state of "Unconfirmed".
Please re-check with OOo 3.0 or younger if it is (still) valid.
Then confirm it or set an appropriate resolution.
Thank you.
Comment 16 stefan.baltzer 2008-10-29 14:24:50 UTC
SBA: This issue has a target set but is still in state of "Unconfirmed".
Please re-check with OOo 3.0 or younger if it is (still) valid.
Then confirm it or set an appropriate resolution.
Thank you.
Comment 17 thomas.lange 2009-01-19 14:39:21 UTC
Not time left to fix  this one in OO0 3.1 because of other issues.
Comment 18 Mathias_Bauer 2009-02-02 14:29:13 UTC
@ashtokalo:
Can you please re-check with OOo 3.0 if the bug still occurs? And in case it
still exists, can you please check if it goes away if you don't use the "Hidden"
property when you load the document?
Comment 19 ashtokalo 2009-02-03 06:40:13 UTC
Sure, I will try to check the issue with OOo 3.0 this or next week.
Comment 20 Mathias_Bauer 2010-05-17 14:10:26 UTC
Hi, any news?
Comment 21 oooforum (fr) 2017-08-16 14:39:03 UTC
No news from OP