Apache OpenOffice (AOO) Bugzilla – Issue 121448
Inconsistent fill and line color across applications
Last modified: 2022-10-28 12:54:31 UTC
1) Insert a chart in a Writer document. Draw a rectangle on the chart. Default line color is Black, default fill color is Blue 8 2) Install the Report Builder extension, draw a rectangle. Default line color is Black, default fill color is Blue 8 3) Create a new Writer document. Insert a rectangle. Default line color is Gray, default fill color is Blue 9. 4) Create a new Writer document. Insert a rectangle from the Basic Shapes toolbar: though the toolbars say line color is Gray and fill color is Blue 9, in the view the line color is Black and fill color is Blue 8. The different behavior between both rectangles can be reproduced also in Calc, but not in Draw/Impress. In Writer/Calc all custom shapes have this misbehavior: the shape model informs fill color = Blue 8, line color = Gray; but the view shows the old defaults. (3) and (4) seems to be fixed by changing the defaults in XOutdevItemPool constructor: svx/source/xoutdev/xpool.cxx const Color aNullLineCol(RGB_Color(COL_BLACK)); const Color aNullFillCol(RGB_COLORDATA( 153, 204, 255 )); replacing them with the new default defined in svx/inc/svx/xdef.hxx #define COL_DEFAULT_SHAPE_FILLING RGB_COLORDATA( 0xCF, 0xE7, 0xF5 ) #define COL_DEFAULT_SHAPE_STROKE RGB_COLORDATA( 128, 128, 128 ) In (1) and (2) both model and view have old defaults, this seems to happen because in chart2 and reportdesign there is no call to SetDrawingLayerPoolDefaults like in the other modules.
Assigning to the expert. @Armin: I just git grepped blue 8 nad found the svx/source/xoutdev/xpool.cxx:52 which seems to work [ariel@localhost main]$ git grep -n "153, *204, *255" binfilter/bf_sch/source/core/sch_chtmode2.cxx:837:/*N*/ aRowColors[7] = Color(153, 204, 255); binfilter/bf_svx/source/xoutdev/svx_xtabcolr.cxx:334:/*N*/ Insert(48, new XColorEntry( Color(153,204,255 ), aStr ) ); sd/source/core/drawdoc4.cxx:677: Any aBlue1( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("blue1") ), aDefaultCellStyleName, RGB_COLORDATA(153,204 svx/source/xoutdev/xpool.cxx:52: const Color aNullFillCol(RGB_COLORDATA( 153, 204, 255 )); svx/source/xoutdev/xtabcolr.cxx:301: Insert(48, new XColorEntry( Color(153,204,255 ), aStr ) );
ALG: Taking a look...
ALG: I see no reason why not to set the values used in SetDrawingLayerPoolDefaults() directly in XOutdevItemPool::XOutdevItemPool, it does anyways nothing else than changing these. Leaving it the way it is just leads to the possibility that modules might forget to call it :-/ It should have no drawbacks to load/asve, file formats or data exchange, but I need to ckeck this deeply...
ALG: Filkeformat and exchange are okay, the defaults are part of ODF. Works as expected, comitting.
"alg" committed SVN revision 1419491 into trunk: #121448# Aligned default fill color/ line style for all apps
ALG: Okay, done.