Issue 17629 - Graphical objects in header and footer are incorrectly displayed when converting sxw to doc
Summary: Graphical objects in header and footer are incorrectly displayed when convert...
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: ui (show other issues)
Version: OOo 1.1 RC2
Hardware: PC All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: michael.ruess
QA Contact: issues@sw
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-30 14:19 UTC by bert.meersma
Modified: 2013-08-07 14:43 UTC (History)
1 user (show)

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


Attachments
rename file to header.doc. Comments are in the file. (20.00 KB, text/plain)
2003-08-08 13:52 UTC, bert.meersma
no flags Details
New attachment (5.33 KB, application/msword)
2003-09-08 16:08 UTC, michael.ruess
no flags Details
load me (21.00 KB, application/octet-stream)
2003-09-10 14:16 UTC, caolanm
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description bert.meersma 2003-07-30 14:19:09 UTC
When I import a Microsoft Word document that has horizontal lines in the header 
and footer, and then I save it again as .doc, and open it MS Word, the lines 
aren't displayed correctly. They are then in the text area.
Comment 1 h.ilter 2003-08-05 13:07:11 UTC
Reassigned to CMC
Comment 2 caolanm 2003-08-05 13:25:28 UTC
Can you attach a sample .sxw to this issue
(http://www.openoffice.org/issues/createattachment.cgi?id=17629) so
that I can reproduce the problem.
Comment 3 caolanm 2003-08-08 12:01:00 UTC
cmc->broxtor: broxtor can you attach an example document which shows
this behaviour when loaded and saved again ? You can do this by
visiting
http://www.openoffice.org/issues/createattachment.cgi?id=17629 and
comment on this bug by visiting
http://www.openoffice.org/issues/show_bug.cgi?id=17629
Comment 4 bert.meersma 2003-08-08 13:52:44 UTC
Created attachment 8337 [details]
rename file to header.doc. Comments are in the file.
Comment 5 bert.meersma 2003-08-08 13:57:56 UTC
Sorry you had to ask twice for this. I had misread the message the 
first time. I thought you had been able to reproduce this, but you 
hadn't. 
The uploaded file is actually an .doc file, but I had to change the 
extension,to make the uploading possible. So all you have to do is 
rename the file to .doc. Comments are in the file.

Broxtor 
Comment 6 caolanm 2003-08-11 14:20:07 UTC
cmc->mru: This looks well in SRX645m15, can you confirm that this is
the case ?
Comment 7 michael.ruess 2003-08-13 15:01:05 UTC
Yes this works now. Drawing lines/objects in headers and footers
hasn't been implemented in Writer until now. This is available for the
community in OO 1.1 final.
Comment 8 michael.ruess 2003-08-13 15:01:44 UTC
Verified in internal build of OO 1.1.
Comment 9 bert.meersma 2003-08-25 20:51:34 UTC
Thank you very much!!! A step closer to saying goodbye to MS Word. 
(Only issue left for me is 1820)
Comment 10 bert.meersma 2003-08-26 10:56:42 UTC
I'm afraid I was happy to soon. When I tried this again in OOo RC3 on 
a Windows 95 system the problem still occured. 
To reproduce this take the following steps:
1. In MS Word 97 create a document that has lines in the header. 
2. Save this file and open it in OOo Writer.
3. Save the file in OOo Writer as an MS Word file.
4. Open the file again in MS Word 97 and see what has happened.
Comment 11 michael.ruess 2003-09-08 16:05:47 UTC
MRU: Generally it works. But there still seems to be a problem in the
Export.
Comment 12 michael.ruess 2003-09-08 16:06:13 UTC
Reopened.
Comment 13 michael.ruess 2003-09-08 16:07:33 UTC
MRU->CMC: open attached file (contains two drawing lines in the
header, save it as WW8, reload -> the first line has an y-position of
more than 3cm now.
Comment 14 michael.ruess 2003-09-08 16:08:26 UTC
Created attachment 9090 [details]
New attachment
Comment 15 caolanm 2003-09-10 11:28:06 UTC
Strange, only seems to happen if two drawing objects share the same
anchor paragraph and are in a header.
Comment 16 caolanm 2003-09-10 14:16:04 UTC
Created attachment 9171 [details]
load me
Comment 17 caolanm 2003-09-10 14:24:26 UTC
Very odd indeed, but I think I see why this is happening.

cmc->od:

Place a breakpoint in sw\source\core\layout\fly.cxx in
void SwFrm::CalcFlys( BOOL bPosOnly ) on line 2342
i.e. the line
((SwDrawContact*)GetUserCall(pO))->ChkPage();
and place a watch on the two values of...
(long*)(pDrawObjs->pData)[0]
(long*)(pDrawObjs->pData)[1]

This is inside a loop of

USHORT nCnt = GetDrawObjs()->Count();
for ( USHORT i = 0; i < nCnt; ++i )
{
        SdrObject *pO = (*GetDrawObjs())[i];
        ....

So the intent is clearly to handle each object in pDrawObjs one after
another.

Now load the last attached example output.doc which has two SdrObjects
anchored to the same paragraph.

The problem is that during the handling of the first object when i is
0, the call to
((SwDrawContact*)GetUserCall(pO))->ChkPage();
*changes* the order of the objects in pDrawObjs!, so in this simple
example the first object is moved to pDrawObjs->pData[1] and the
second is moved to pDrawObjs->pData[0]. So on the second loop when i
is 1 the original first object gets processed again, and the original
second not at all by this toplevel loop in SwFrm::CalcFlys. The
crucial part of this loop for me is that it sets the position of the
anchor into the rectange of the SdrObject.

It looks like a layout bug to me, perhaps triggered by special
handling for header/footer objects ?
Comment 18 Oliver-Rainer Wittmann 2003-09-29 08:39:41 UTC
OD (29.09.2003): accepted.
Comment 19 Oliver-Rainer Wittmann 2003-10-13 09:59:14 UTC
OD (13.10.2003):
Changed files in cws sw7pp1b:
/sw/source/core/layout/fly.cxx, 1.46.52.1.24.1
Comment 20 Oliver-Rainer Wittmann 2003-10-21 12:21:32 UTC
OD (21.10.2003):
correction of fix: 
/sw/source/core/layout/fly.cxx, 1.46.52.1.24.2
Comment 21 Oliver-Rainer Wittmann 2003-10-31 08:35:30 UTC
OD->MRU:
Checked in internal product patch build of cws sw7pp1b. Please verify.
Comment 22 michael.ruess 2003-11-06 15:29:15 UTC
Checked fix with CWS sw7pp1b.
Comment 23 michael.ruess 2003-11-06 15:30:44 UTC
Verified. Fix will be included in OO 1.1.1.
Comment 24 michael.ruess 2004-01-28 11:49:26 UTC
Checked fix with OO 1.1.1 build srx645m27.
Comment 25 bert.meersma 2004-02-29 11:35:22 UTC
Tried this with OOo 1.1.1b and Windows XP. Looking good!! Thanks!!