Bug 120801 - The background color is active when inserting a header using Insert Header/Footer - Header default style.
Summary: The background color is active when inserting a header using Insert Header/Fo...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4 all versions
Hardware: All All
: low minor
Assignee: Radhey Parekh
URL:
Whiteboard: target:7.2.0
Keywords: bibisected, bisected, difficultyBeginner, easyHack, regression, skillCpp, topicDebug
Depends on:
Blocks: Writer-Header-Footer Area-Fill-Tab
  Show dependency treegraph
 
Reported: 2018-10-22 16:36 UTC by Telesto
Modified: 2021-06-08 07:59 UTC (History)
10 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
video of the bug (3.90 MB, video/mp4)
2021-06-08 04:42 UTC, BogdanB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2018-10-22 16:36:49 UTC
Description:
The background color is active when inserting a header using Insert Header/Footer - Header default style. 

Steps to Reproduce:
1. Open Writer
2. Insert -> Header/Footer -> Header -> Default style
3. Format -> Page -> Header tab
4. Click More -> Area tab -> Color tab will be active
5. Press OK, OK -> Header will be blue

Color tab should be set to none.

Actual Results:
Color is enabled

Expected Results:
No color. Same as when insert a header from: Format -> Page -> Header tab


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.2.0.0.alpha0+
Build ID: 3846561f79cf9065abd9ca83c9fbfbe7e52e28e2
CPU threads: 4; OS: Windows 6.3; UI render: default; VCL: win; 
TinderBox: Win-x86@42, Branch:master, Time: 2018-10-20_23:33:00
Locale: nl-NL (nl_NL); Calc: CL
Comment 1 Durgapriyanka 2018-11-15 21:58:20 UTC
Version: 6.0.6.2
Build ID: 0c292870b25a325b5ed35f6b45599d2ea4458e77
CPU threads: 2; OS: Windows 6.1; UI render: default; 
Locale: en-US (en_US); Calc: group

Thank you for reporting the bug. I can confirm that the bug is present.
Comment 2 Xisco Faulí 2018-11-16 11:27:15 UTC
Regression introduced by:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=7d9bb549d498d6beed2c4050c402d09643febdfa

author	Armin Le Grand <alg@apache.org>	2014-06-02 15:00:50 +0000
committer	Miklos Vajna <vmiklos@collabora.co.uk>	2014-07-01 13:30:09 +0200
commit 7d9bb549d498d6beed2c4050c402d09643febdfa (patch)
tree 2caf67e36c9ccd058268b003cf2bc39b9b102b53
parent a5e137eb1d37361c60175e8fba780fc46b377a23 (diff)
Related: #i124638# Second step of DrawingLayer FillAttributes...

Bisected with: bibisect-44max

Adding Cc: to Armin Le Grand
Comment 3 Jim Raykowski 2019-03-10 19:48:09 UTC
Code Pointer:

One approach is to check the fill style attribute item state in the border background set, pBBSet, after the page header or footer set is put. If the fill style attribute is not SET put the fill style item to none.

LO code that will be used in this approach
SfxItemSet
SfxItemSet::GetItemState
SfxItemState::SET
SfxTabPage::GetWhich
XATTR_FILLSTYLE
SfxItemSet::Put
XFillStyleItem
drawing::FillStyle_NONE

https://opengrok.libreoffice.org/xref/core/svx/source/dialog/hdft.cxx?r=55042cb5#594
Comment 4 Justin L 2021-03-18 13:56:46 UTC
I'd say this is no big deal. The highlight is NOT added UNLESS you go to the area tab (which as stated introduces a default blue colour instead of showing the current value of NONE), and then OK the result. In other words, by not changing the blue colour, you are accepting its default of blue.

But yes, it is a bit unexpected to just browse through settings and then have the document change on you.
Comment 5 Justin L 2021-03-19 11:23:15 UTC
svx/source/xoutdev/xpool.cxx
    const Color aNullFillCol(COL_DEFAULT_SHAPE_FILLING); //light blue 2
    rPoolDefaults XATTR_FILLSTYLE = new XFillStyleItem(); //default SOLID


This can forced to NONE when the header is turned on with FN_INSERT_PAGEFOOTER
in sw/source/uibase/wrtsh/wrtsh1.cxx's SwWrtShell::ChangeHeaderOrFooter()
    if( bOn )
    {
       SvxULSpaceItem aUL(bHeader ? 0 : MM50, bHeader ? MM50 : 0, RES_UL_SPACE );
       SwFrameFormat* pFormat = bHeader ?
          const_cast<SwFrameFormat*>(rMaster.GetHeader().GetHeaderFormat()) :
          const_cast<SwFrameFormat*>(rMaster.GetFooter().GetFooterFormat());
       pFormat->SetFormatAttr( aUL );
+      XFillStyleItem aFill(css::drawing::FillStyle_NONE);
+      pFormat->SetFormatAttr(aFill);
    }
Comment 6 Justin L 2021-03-19 11:42:55 UTC
I think the fix I outlined is probably the best approach for this. So this could be a super-easy hack (where the work was all done for you - and you just need to go through the compile and submit stages).
Comment 7 Radhey Parekh 2021-04-01 16:15:50 UTC
I would like to fix this issue!
Comment 8 Buovjaga 2021-04-12 10:22:27 UTC
Looks like there are now two open patches, both failing to compile:
https://gerrit.libreoffice.org/c/core/+/113468
https://gerrit.libreoffice.org/c/core/+/113564

I have to say I am a bit stunned that you decided to skip the compile step in Justin's advice "you just need to go through the compile and submit stages".
Comment 9 Radhey Parekh 2021-04-13 05:09:17 UTC
I had gone through the build stages and it worked pretty fine for me. I need to look into again as it isn't verified.
Comment 10 Buovjaga 2021-04-21 09:33:55 UTC
(In reply to Buovjaga from comment #8)
> Looks like there are now two open patches, both failing to compile:
> https://gerrit.libreoffice.org/c/core/+/113468
> https://gerrit.libreoffice.org/c/core/+/113564

Not sure why the second one is 404, but here is a newer one from Advait: https://gerrit.libreoffice.org/c/core/+/114022
Comment 11 Radhey Parekh 2021-04-29 08:15:26 UTC
Done! I had made some relevant changes in my older patch and its building perfectly now. Changing the status of the bug from asigned to fixed. Thanks.
Comment 12 Buovjaga 2021-04-29 08:19:35 UTC
(In reply to Radhey Parekh from comment #11)
> Done! I had made some relevant changes in my older patch and its building
> perfectly now. Changing the status of the bug from asigned to fixed. Thanks.

The status remains intact until Justin is happy with either your work or Advait's
Comment 13 Commit Notification 2021-05-29 16:03:59 UTC
Radhey Parekh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/307ee1357cf2c4acd2f3e5a90285e8cb7c4c14e2

tdf#120801: The background colour is active when inserting a header

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 BogdanB 2021-06-04 18:39:57 UTC
I tested on this version and not yet solved. I see a difference: active is black, and not anymore blue, but the end result is the same.

Tested in
Version: 7.2.0.0.alpha1+ / LibreOffice Community
Build ID: e96554b67b17f9d3d91b0bb1f29ab0b9cdc43dcb
CPU threads: 4; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 15 Justin L 2021-06-05 06:52:19 UTC
(In reply to BogdanB from comment #14)
> I tested on this version and not yet solved.
That doesn't sound logical. What steps are you taking? Following the steps in comment 1, I get Area:None.

[Yes, if you switch from "none" to "color" then it says the "active" is black / "new" is blue, but that is irrelevant.]
Comment 16 BogdanB 2021-06-08 04:42:33 UTC
Created attachment 172689 [details]
video of the bug

Please see the video, the latest version of 7.2

Version: 7.2.0.0.alpha1+ / LibreOffice Community
Build ID: ec629c5ee22d02f99d66a5cf975ce239876b7f4d
CPU threads: 4; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded

Am I doing something wrong?
Comment 17 Justin L 2021-06-08 05:27:06 UTC
(In reply to BogdanB from comment #16)
> Am I doing something wrong?
Yes - you are not stopping at step 4.

When you get to step four, the Area tab is NOT set to Color, but to none. Prior to the patch it was set to Color.
Comment 18 BogdanB 2021-06-08 07:59:05 UTC
Ok. I agree. I verified in Version: 7.1.3.2 (x64) / LibreOffice Community and in that version indeed is set on color, not on None. So, this bug is fixed in 7.2. Thanks for fixing this.