Apache OpenOffice (AOO) Bugzilla – Issue 123564
Foreground and background color in bitmap editor exchanged after reopen
Last modified: 2017-05-20 10:34:01 UTC
Goto Draw > Format > Area > Bitmap Create a Bitmap pattern with foreground black and background yellow. Add the pattern and close the dialog. Reopen the dialog and select the newly created pattern. Notice, that the colors in the foreground and background fields are exchanged. Only the list itself is effected. The mouse click in the editor pattern field still produces black on normal left click and yellow on right click.
Bitmap pattern is lost. AOO410m1(Build:9750) - Rev. 1525015 Rev.1525015 Win 7
ALG: Grepping...
ALG: Looks like a combination of small errors. First, it's surprising that indeed the empty 1st entry in the bitmap list is a 8x8, 2 color bitmap with the color[0] being black and the color[1] being white and all pixels set; I would have expected the colors to be swapped and no pixels set. Nonetheless, the bitmap editor has to work with what is there. Correcting isHistorical8x8 to get the correct back (color[0]) and front color (color[1]), this is definitely wrong...
ALG: Basic errors found; this is also affected by the already fixed task 123497, but there is more: - When using bitmaps with 1bit depth (as in this example) and colors, the fill in the view gets Black/white -> the internal bitmap scale used to prepare the tiling paint creates B&W bitmaps when forcing back to 1bit Argh! - When zooming far out and the prescaled bitmaps for tiling get 0 in width and/or height, the fill will be missing completely. Argh! All changed and adapted, looks good now. Preparing checkin...
"alg" committed SVN revision 1536830 into trunk: i123564 corrected some aspects when working whith bitmaps with low color dept...
ALG: This shows again how needed a rework of bitmap processing in the whole AOO would be, sigh...
ALG: Okay, done.
The error, that the color switches between the fields with each opening of the dialog is fixed. But the field "Background color" in the dialog now has "black" and the field "Foreground color" has "white" and changing the color in the field "Foreground color" changes actually the background. Only the fields are affected, the part "Pattern Editor" sets correctly "black" on click. It seems, that the linkage between the dialog fields and the internal meaning of the colors is wrong.
ALG: No, this is irritating but correct; the default 8x8 bitmap 'Blank' used as start for this indeed has background color (color[0]) black and foreground color (color[1]) white and *all* pixels are set. When you change foreground color from white to e.g. red all formally white pixels get red because all pixels are set. When you click in the pattern editor the color gets black (to background color) because the pixel changes from 'set' to 'unset' -> background. You may check with adding (importing) an own 8x8 bitmap with two colors (bg white, fg black and no pixel set), it will also work. Why the initial 'Blank' bitmap is defined as described is strange, but the pixel editor has to work with it as it is.
ALG: Back to resolved after some wait time. Fell free to reopen/comment if you find something!