Issue 17050 - Font setting export to Excel loss
Summary: Font setting export to Excel loss
Status: CLOSED FIXED
Alias: None
Product: Calc
Classification: Application
Component: code (show other issues)
Version: OOo 1.1 Beta2
Hardware: PC Windows 2000
: P3 Trivial (vote)
Target Milestone: ---
Assignee: oc
QA Contact: issues@sc
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-18 08:35 UTC by waiterevo
Modified: 2013-08-07 15:15 UTC (History)
1 user (show)

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


Attachments
Original Calc document (5.30 KB, application/octet-stream)
2003-07-18 08:36 UTC, waiterevo
no flags Details
Excel docment exported by test.sxc with Chinese font attribute lost (7.50 KB, application/octet-stream)
2003-07-18 08:36 UTC, waiterevo
no flags Details
proposed patch to fix this (1.18 KB, patch)
2003-08-08 17:53 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 waiterevo 2003-07-18 08:35:36 UTC
See the attachment. 

1. Create a Calc spreadsheet with the following content:

Cell A1 has font attribute set to Arial.
Cell B1 has font attribute set to Chinese PMingLiU (Chinese Windows system 
font) 
Cell A2 has font attribute set to Times New Roman
Cell B2 has font attribute set to Chinese KaiShu (Another Chinese font bundled 
with Chinese Windows)

2. Save the spreadsheet as ".XLS" file. Choose Excel 97/2000/XP format.

3. Close the document.

4. Reopen the previous saved XLS file.

Cell B2 has font attribute setting lost. It is set to default system font 
(PMIngLiU). Roman font settings are retained.
Comment 1 waiterevo 2003-07-18 08:36:06 UTC
Created attachment 7829 [details]
Original Calc document
Comment 2 waiterevo 2003-07-18 08:36:52 UTC
Created attachment 7830 [details]
Excel docment exported by test.sxc with Chinese font attribute lost
Comment 3 oc 2003-07-18 12:25:41 UTC
Hi Daniel,
one4you
Comment 4 daniel.rentz 2003-08-06 14:36:09 UTC
accepted.
todo: Select the used font from the 3 fonts western, CJK and CTL.
Comment 5 daniel.rentz 2003-08-07 07:25:02 UTC
John, one for you. In the function XclExpFontBuffer::Insert(const 
SfxItemSet&), the function ScPatternAttr::GetFont 
(sc/source/core/data/patattr.cxx) is called. This function can receive 
an nScript parameter to select the set of items to use. This script 
type has to be found before calling the function, i.e. by looking if a 
CJK fontitem is set in the itemset. Same for CTL.
Comment 6 john.marmion 2003-08-07 15:44:33 UTC
accepting
Comment 7 john.marmion 2003-08-08 17:53:47 UTC
Created attachment 8351 [details]
proposed patch to fix this
Comment 8 john.marmion 2003-08-08 18:01:44 UTC
Daniel, this fixes the attached doc but I have a made a couple of
assumptions. I am assuming that this itemset can only have a CJK or a
CTL and not both despite that fact this nScript can have its values
ORed. I am also ignoring the _LATIN type as the function
ScPatternAttr::GetFont() tests  for a non CJK and a non CTL.  
Comment 9 daniel.rentz 2003-08-11 07:29:27 UTC
OR is not possible, so you can decide what wins if both CJK and CTL
are present (the called function test on equality to the script
types). I think you should initialize nScript with *_LATIN anyway to
better show what will happen when no CJK and no CTL font has been
found. Please add a short comment containing the bug id.
Comment 10 john.marmion 2003-08-11 10:18:52 UTC
checked in this (incorporating requested change) today into CWS
calc16/m15.
Comment 11 john.marmion 2003-08-13 12:21:50 UTC
re-open to assign to QA
Comment 12 john.marmion 2003-08-13 12:22:18 UTC
assign to QA
Comment 13 john.marmion 2003-08-13 12:22:58 UTC
reset to fixed
Comment 14 oc 2003-09-15 11:55:25 UTC
verified in internal build calc16
Comment 15 frank 2004-10-05 13:24:52 UTC
Found fixed on Master src680m54 using Linux and Windows build