Issue 2916 - WW: Export anchored to character as line anchored not para anchored.
Summary: WW: Export anchored to character as line anchored not para anchored.
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: 641
Hardware: Sun Solaris
: P3 Trivial (vote)
Target Milestone: ---
Assignee: michael.ruess
QA Contact: issues@sw
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-01-22 18:19 UTC by Unknown
Modified: 2013-08-07 14:43 UTC (History)
1 user (show)

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


Attachments
Document which does not export to any version of Microsoft word. (9.06 KB, application/octet-stream)
2002-01-22 18:21 UTC, Unknown
no flags Details
resulting file when Night_Photography.sxw is exported as Microsoft word contains misplaced graphics and no text when read in. (21.00 KB, application/octet-stream)
2002-01-22 18:24 UTC, Unknown
no flags Details
Initial patch (3.46 KB, patch)
2002-10-07 14:53 UTC, Unknown
no flags Details | Diff
Updated Night_Photography with the images embedded in the file. (70.46 KB, application/octet-stream)
2002-10-11 16:12 UTC, Unknown
no flags Details
Patch for wrtw8esh.cxx and wrtw8nds.cxx resolving this issue. (3.82 KB, patch)
2002-10-14 13:18 UTC, Unknown
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Unknown 2002-01-22 18:19:50 UTC
When a StarOffice 6.0 text document contains images with wrapped text (a good
example is a converted web page), export to Microsoft Word 6, 95 and 97/2000/XP
will result in a file where the images are displaced or missing and the text may
be missing.
  
The example was created by converting
http://gofree.indigo.ie/nitz/Night_Photography.html
to StarOffice 6 text, then to Microsoft word
Comment 1 Unknown 2002-01-22 18:21:07 UTC
Created attachment 973 [details]
Document which does not export to any version of Microsoft word.
Comment 2 Unknown 2002-01-22 18:24:11 UTC
Created attachment 974 [details]
resulting file when Night_Photography.sxw is exported as Microsoft word contains misplaced graphics and no text when read in.
Comment 3 Martin Hollmichel 2002-02-01 10:10:11 UTC
erassigned
Comment 4 stefan.baltzer 2002-02-21 11:30:07 UTC
Reassigned to Michael.
Comment 5 michael.ruess 2002-05-17 13:21:02 UTC
MRU: The first two graphics are anchored "To character". On export
their anchor moves to the upper left. 
Comment 6 caolanm 2002-05-17 14:09:10 UTC
Damn. We aren't exporting anchored to character correctly to word
format at all. It look so bad in this example because the whole page
is one paragraph, all the line breaks are hard line breaks. 

All anchored to character anchors are being exported as anchored to
(beginning of) paragraph
Comment 7 caolanm 2002-07-24 15:48:42 UTC
cmc->markm: precis; Anchored to character is getting the anchor
exported at the beginning of the para, not at the appropiate position
inside the para. 
Comment 8 Unknown 2002-10-01 17:21:57 UTC
Having looked thorugh some of the code, the Attribute Iterator  used 
by OutWW8_SwTxtNode does not recognise an anchored image as being an 
attribute of the character.
Comment 9 Unknown 2002-10-07 14:53:39 UTC
Created attachment 3081 [details]
Initial patch
Comment 10 Unknown 2002-10-07 15:03:18 UTC
Attached an initial patch.  Results seem promising.  The anchor code, 
0x08, appears in the correct place in the text stream.

Independent of this fix is an apparent problem with the export of 
graphic properties.  The position and relative anchor point (i.e. 
paragraph, page, character, etc.) are not being exported correctly.  
Will try to resolve before finally applying patch.

The attached 'Initial Patch' works as follows:

  - OutWW8_SwTxtNode is called to write the contents of a paragraph.
  - MOD: The initial call to OutFlyFrms does *not* dump character
         anchored graphics.
  - NEW: As part of the constructor for the WW8_SwAttrIter object,
         a list of all fly frames (graphics) associated with the 
         text node is gathered.
  - NEW: As part of the search for attributes within the text, 
         graphics anchored within the paragraph are checked.  
         The position of a graphic anchor may be returned as the
         location of the next attribute in the text.
  - CUR: The text is written up until the next attribute position.
  - NEW: As an attribute is written, if its position maps to that
         of a graphic, the graphic anchored to that position is 
         mapped.

Further modifications may be made to the way the searching of 
graphics anchored to the node are handled.
Comment 11 Unknown 2002-10-11 12:05:28 UTC
The major problem with the export of character anchored graphics is 
that there is no information for them in the export.

The options for paragraph anchored and character anchored properties 
are for the most part the same, but paragraph anchored graphics don't 
have an option to anchor the graphic relative to a character.

In WinwordAnchoring::SetAnchoring (wrtw8esh.cxx) the two are treated 
the same, but no information is present to handle export of anchoring 
that is relative to a character.

Consequently, character anchored graphics that have a horizontal 
position relative to the character end up with a default of a left 
alignment relative to the page.
Comment 12 Unknown 2002-10-11 16:10:19 UTC
Tested with Night Photography (a version with all graphics 
embedded).  Exports to Word relatively okay.  Anchoring information 
is correct.  Graphics are above text but that is due to Word's 
interpretation of what aligned bottom relative to page means.

Only way to get exact match is to use absolute positioning in Word.  
This is something that cannot be calculated by Writer.


Looking at other issues:

 - Export of vertical alignment, anchored to character 'from bottom'
   does not ahve a matching option in Word.  Only Word alternative is
   to use absolute positioning.

 - Import of character anchored graphics has problems with vertical
   alignment.  This is due to Writer's vertical character anchoring
   not having an option 'From Top' as paragraph anchored graphics do.
   Paragraph anchored graphics import correctly for all horizontal
   relative alignments.

   Will file a feature request to see if that functionality can be
   added to character anchored vertical alignments.

Will clean up patch file and submit patch.



Comment 13 Unknown 2002-10-11 16:12:18 UTC
Created attachment 3131 [details]
Updated Night_Photography with the images embedded in the file.
Comment 14 Unknown 2002-10-14 13:18:49 UTC
Created attachment 3165 [details]
Patch for wrtw8esh.cxx and wrtw8nds.cxx resolving this issue.
Comment 15 caolanm 2002-10-14 15:25:21 UTC
Commited, SRX644 e or something like that will have it.
Comment 16 caolanm 2002-10-23 10:16:14 UTC
This is working well in SRX644f
Comment 17 michael.ruess 2002-11-26 14:17:54 UTC
mru->cmc: maybe the fix didn't make its way to the 644 set. I can see
no difference between 641 and 644o.
Comment 18 caolanm 2003-01-28 13:22:50 UTC
cmc->mru: In SRC641u the Updated Night_Photography final .sxw attached
here crashes office, I'll leave it to you to log a bug for that!

My memory is that the SRC641 series would export these pictures all at
the top left of the huge paragraph that is this document, i.e.
anchored to paragraph, and there is only one paragraph. Not at various
points in the document itself like the source. The SRX644(q2) will
export these graphic anchored "to character" to the closest character
which places the graphics close to where they appear in the sxw, which
resolves this bug as much as is currently possible.

Stack trace for SRC641q is as follows....
TL641MI! ImplStringLen(char const *) + 13 bytes
TL641MI! String::String(char const *,unsigned short,unsigned long) +
171 bytes
VCL641MI! operator>>(class SvStream &,class JobSetup &) + 479 bytes
SFX641MI! SfxPrinter::Create(class SvStream &,class SfxItemSet *) + 55
bytes
SW641MI! SwXDocumentSettings::_setSingleValue(struct
comphelper::PropertyInfo const &,class com::sun::star::uno::Any const
&) + 1209 bytes
SW641MI! 21b0c19b()
SW641MI! 21b0c19b()
SW641MI! 21b03449()
XO641MI! 22953b8c()
XO641MI! 2295f856()
SAX! XmlPrologStateInit + 5786 bytes
SAX! XmlPrologStateInit + 5649 bytes
SAX! XmlPrologStateInit + 5548 bytes
SW641MI! 21b02bd9()
SW641MI! 21b02c56()
SW641MI! 21b02de1()
SFX641MI! 01dd940d()
SFX641MI! 01dd8bf8()
SFX641MI! 01dcb424()
SFX641MI! 01dcb576()
SFX641MI! 01dcb576()
SFX641MI! 01dcb31b()
SFX641MI! 01dcfbc8()
FWK641MI! 1e05bd46()
FWK641MI! 1e05ca77()
SFX641MI! 01dd55ba()
SFX641MI! 01dcba1c()
SFX641MI! 01dcbdd6()
USER32! VRipOutput + 5101 bytes
SOFFICE! 01122b28()
VCL641MI! 004227c9()
SOFFICE! 01122082()
KERNEL32! ValidateLCType + 562 bytes
Comment 19 michael.ruess 2003-02-10 15:13:51 UTC
MRU->CMC: still one problem left: the two grphics at the end of the
document (both anchored "AS character") are exported with their
original size of 0,4cm*0,4cm; and not with the size stated in the
properties
Comment 20 caolanm 2003-03-19 16:53:50 UTC
Incorrect graphic size must be the same thing as #108180#. i.e.
working in SRX644m7 if you scroll through the entire document in
writer before exporting to .doc. Or alternatively it should work with
jollyfilterteam03
Comment 21 michael.ruess 2003-04-22 14:49:54 UTC
Anchor of graphics is now placed correctly.
Comment 22 michael.ruess 2003-04-22 14:50:23 UTC
Fix will be included in OO 1.1 Beta2 at least.
Comment 23 michael.ruess 2003-05-14 09:31:40 UTC
Closed. Fix available in OO 1.1 Beta2.