Issue 120832

Summary: Test for bug 120578: some of the font color is not correct
Product: Writer Reporter: wujinlong
Component: codeAssignee: zhang jianfang <zhangjf>
Status: CLOSED FIXED QA Contact:
Severity: Normal    
Priority: P3 CC: bjdujing, companycy, zhangjf
Version: 4.0.0-dev   
Target Milestone: 4.0.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Sample docx has text in table whose color is incorrect
none
patch for font color in table
zhangjf: review+
UT docx has text in table none

Description wujinlong 2012-09-06 08:12:52 UTC
Some of the font color is not correct in sample files.
Comment 1 bjcheny 2012-09-06 08:17:56 UTC
I'm working on it.
Comment 2 bjcheny 2012-09-06 08:39:55 UTC
Created attachment 79317 [details]
Sample docx has text in table whose color is incorrect

Upload sample file.
Comment 3 bjcheny 2012-09-06 08:54:37 UTC
Created attachment 79319 [details]
patch for font color in table

Both table style and color you set in table will affect last font color for text in table. In this sample, the color set manually should have higher priority than that from table style.

The patch involves:
1. In unotext.cxx::lcl_ApplyCellProperties(), when the char color fails to be set on cell object, it will throw an exception. When the exception is caught, we should check whether the char color is already existing or not, instead of replacing it directly. Because if the color is already existing, it means color comes from manually customization.
2. In DomainMapper.cxx, the table style's text properties will go to table's properties in DomainMapperTableHandler::endTableGetTableStyle(). Thus, it shouldn't  be merged here. Otherwise, it will be considered as those set manually, and confuses logic mentioned above.
Comment 4 bjcheny 2012-09-06 09:14:28 UTC
Created attachment 79321 [details]
UT docx has text in table

The sample's font color in table is decided by whole table type from table style.

 w:type="table" w:styleId="MediumList1-Accent2">
<w:rPr>
	<w:color w:val="00FF00"/>
	<w:kern w:val="0"/>
	<w:sz w:val="22"/>
</w:rPr>
Comment 5 zhang jianfang 2012-09-11 12:20:34 UTC
take the bug
Comment 6 zhang jianfang 2012-09-11 12:21:04 UTC
Comment on attachment 79319 [details]
patch for font color in table

The fix works fine.
Comment 7 SVN Robot 2012-09-11 12:45:17 UTC
"zhangjf" committed SVN revision 1383383 into trunk:
#i120832#, the style and color set on table text by user should have higher p...
Comment 8 zhang jianfang 2012-09-11 12:47:20 UTC
change to resolved state
Comment 9 Du Jing 2012-09-21 02:41:32 UTC
verified on the build AOO3.5_r1387482