Issue 4378 - orientation of cell content gets lost if exporting as excel 97 or html
Summary: orientation of cell content gets lost if exporting as excel 97 or html
Status: CLOSED FIXED
Alias: None
Product: Calc
Classification: Application
Component: code (show other issues)
Version: OOo 1.0.0
Hardware: PC Linux, all
: P3 Trivial (vote)
Target Milestone: ---
Assignee: oc
QA Contact: issues@sc
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-02 17:34 UTC by Unknown
Modified: 2013-08-07 15:14 UTC (History)
1 user (show)

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


Attachments
Text in calc sheet of Staroffice 5.1. Converting to MS97 shows the error (only) in the second table. (49.50 KB, application/octet-stream)
2002-05-19 14:30 UTC, Unknown
no flags Details
Proposed patch to fix this issue (719 bytes, patch)
2002-12-11 15:49 UTC, john.marmion
no flags Details | Diff
Use the more readable 90 and 180 rather than the hex values (712 bytes, patch)
2002-12-12 14:02 UTC, john.marmion
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Unknown 2002-05-02 17:34:40 UTC
in my spreadsheet I rotated the writing in one row for 90 degrees to the left.
If I export the sheet as excel 97 or html the writing is not rotated anymore.
Exporting as excel 95 works fine
Comment 1 oc 2002-05-17 09:11:06 UTC
Hi Norbert,
I can't reproduce this problem. Could you please attach a sample 
document?
Thanks and bye,
Oliver
Comment 2 Unknown 2002-05-19 14:30:43 UTC
Created attachment 1698 [details]
Text in calc sheet of Staroffice 5.1. Converting to MS97 shows the error (only) in the second table.
Comment 3 daniel.rentz 2002-05-21 12:38:18 UTC
Reproduced with bugdoc only on second sheet. Weird.
Comment 4 daniel.rentz 2002-05-21 12:38:39 UTC
Take it.
Comment 5 daniel.rentz 2002-05-21 12:38:53 UTC
.
Comment 6 rmano 2002-06-17 16:32:33 UTC
I too have the problem of disappearing regular and bold-regular 
font shapes, so I tried the workaround... 

(0)pern:~/lib/OpenOffice.org1.0/user/psprint% ls -l
total 8
drwxr-xr-x    2 romano   romano       4096 Jun  7 15:37 driver
drwxr-xr-x    2 romano   romano       4096 Jun  7 15:37 fontmetric
-r--r--r--    1 romano   romano          0 Jun 17 17:23 
pspfontcache

Now I cannot run openoffice: 

(134)pern:~% lib/OpenOffice.org1.0/soffice
zsh: 12158 abort      lib/OpenOffice.org1.0/soffice
(134)pern:~% 

...any idea? My system is a RH7.3 one. Will try the other tricks...

Comment 7 john.marmion 2002-12-11 12:47:46 UTC
I have agreed with Daniel to have a look at this. My first impression
is that I can where this error occurs:

xcl97rec.cxx: ExcXf8::ExcXf8()

if nTrot == xlTextOrientTopBottom
nTrot = 0x00FF;
else if(pPattAttr)
nTrot = XclTools::GetExcRotation(....);

I can see that nTrot is set to 90 for sheet 1 and set to 0 for sheet
2 by the 'else' statement above despite the fact that both rows have
correctly set the orientation to xlTextOrient90ccw.

There is a lot I am not sure about: like why does row 0 on sheet 1
have the nTrot = xlTextOrientTopBottom. But for now I will ignore that
and concentrate on why nTrot is set to 0 for sheet 2.

Comment 8 daniel.rentz 2002-12-11 14:25:06 UTC
Hi John,

You are clearly on the right way. As you can see in the documentation
for XF records, BIFF2-BIFF7 supports only 0°, 90°, -90° and stacked.
In BIFF8 this is replaced by a rotation angle.

In Calc there is a similar thing:
An (old) SvxOrientationItem, containing an enum with the values from
above, and a (newer) SfxInt32Item containing an angle.
The ExcXf c'tor (excel/excrecds.cxx) translates the SvxOrientationItem
item to the eOri enum (for BIFF5/BIFF7). Then, the ExcXf8 c'tor
translates the SfxInt32Item to the rotation, using GetExcRotation().

The cells in the second sheet do not contain the new item, only the
old item (it seems to be an old file). The ExcXf c'tor sets the 90°
enum, but the ExcXf8 c'tor doesn't care and looks only for the
SfxInt32Item. If this item is not present, the GetItem() method
returns the default value 0.

The solution would be to check whether an enum is already set
(something like eOri!=xlTextOrientNoRot) and translate this enum to an
angle, otherwise read the rotation from the SfxInt32Item item (the
existing code).

I reassign this issue to you.
Comment 9 john.marmion 2002-12-11 15:49:08 UTC
Created attachment 4004 [details]
Proposed patch to fix this issue
Comment 10 john.marmion 2002-12-12 14:02:23 UTC
Created attachment 4009 [details]
Use the more readable 90 and 180 rather than the hex values
Comment 11 john.marmion 2002-12-13 12:08:00 UTC
Thanks to all who contributed to this. Checked this code fix in today. 
Comment 12 john.marmion 2003-02-19 13:32:53 UTC
re-open to assign to QA
Comment 13 john.marmion 2003-02-19 13:33:41 UTC
re-assign to QA
Comment 14 john.marmion 2003-02-19 13:34:52 UTC
re-set to fixed
Comment 15 thorsten.ziehm 2003-05-20 11:22:44 UTC
Verified in OOo 1.1 Beta2.
Comment 16 thorsten.ziehm 2003-05-20 11:24:58 UTC
closed ...