Issue 120832 - Test for bug 120578: some of the font color is not correct
Test for bug 120578: some of the font color is not correct
Status: CLOSED FIXED
Product: Writer
Classification: Application
Component: code
4.0.0-dev
All All
: P3 normal (vote)
: 4.0.0
Assigned To: zhang jianfang
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-06 08:12 UTC by wujinlong
Modified: 2012-09-21 02:41 UTC (History)
3 users (show)

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


Attachments
Sample docx has text in table whose color is incorrect (357.65 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2012-09-06 08:39 UTC, bjcheny
no flags Details
patch for font color in table (1.84 KB, patch)
2012-09-06 08:54 UTC, bjcheny
zhangjf: review+
Details | Diff
UT docx has text in table (13.66 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2012-09-06 09:14 UTC, bjcheny
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
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