Apache OpenOffice (AOO) Bugzilla – Issue 17050
Font setting export to Excel loss
Last modified: 2013-08-07 15:15:02 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.
Created attachment 7829 [details] Original Calc document
Created attachment 7830 [details] Excel docment exported by test.sxc with Chinese font attribute lost
Hi Daniel, one4you
accepted. todo: Select the used font from the 3 fonts western, CJK and CTL.
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.
accepting
Created attachment 8351 [details] proposed patch to fix this
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.
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.
checked in this (incorporating requested change) today into CWS calc16/m15.
re-open to assign to QA
assign to QA
reset to fixed
verified in internal build calc16
Found fixed on Master src680m54 using Linux and Windows build