Issue 125189

Summary: Derivation of FillStyle for Writer Frames goes wrong in special case
Product: Writer Reporter: Armin Le Grand <Armin.Le.Grand>
Component: formattingAssignee: Armin Le Grand <Armin.Le.Grand>
Status: CLOSED FIXED QA Contact:
Severity: Normal    
Priority: P3    
Version: 4.2.0-dev   
Target Milestone: 4.2.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description Armin Le Grand 2014-07-02 11:57:27 UTC
To Reproduce:
- New Writer doc in AOO410
- Add a frame, fill with some color
- Add a Frame *inside* the 1st frame, also fill with color, 100% transparent
- save, load with AOO trunk
-> color is derived from parent frame while it should not be

Other way:
- New Writer in AOO trunk
- Add a frame, fill with some color
- Add a Frame *inside* the 1st frame, also fill with color, 100% transparent
-> color is derived from parent frame while it should not be
Comment 1 Armin Le Grand 2014-07-02 12:03:23 UTC
Grepping. Reason is that the 0xff transparency value in SvxBrushItem's Color is used in a special way. Transparency there is only allowed for 0x00 to 0xfe. The value 0xff is 'no fill' and means to derive the color from parent.
The change to full DrawingLayer FillStyle already does a good conversion, 0xff creates a XFILL_NONE and other values create XFILL_COLOR (or as needed) with 100% transparency. The decision if the fill is derivated from it's parent frame is based on SdrAllFillAttributesHelper which already has optimized 100% transparence to no fill, thus being correct for painting but not for evaluating the derivation condition.
Thus two changes needed:
- Base the derivation condition on XFillStyleItem directly
- Adapt helpers getSvxBrushItemFromSourceSet/setSvxBrushItemAsFillAttributesToTargetSet to transparency values in the range [0x00 .. 0xfe]
Comment 2 Armin Le Grand 2014-07-02 16:05:27 UTC
Had to adapt some more places, did extensive checks with forward and backward compatibility. Preparing commit...
Comment 3 SVN Robot 2014-07-02 16:06:42 UTC
"alg" committed SVN revision 1607407 into trunk:
i125189 corrected used transparency and handling to values used in the fallba...
Comment 4 Armin Le Grand 2014-07-02 16:08:20 UTC
Committed, done.