Bug Hunting Session
Bug 116382 - UI: Border and background item of header and footer drop-down menu should open the dialog of Page style > Header > 'More' button
Summary: UI: Border and background item of header and footer drop-down menu should ope...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Aditya Sahu
URL:
Whiteboard: target:6.3.0 target:6.2.2 target:6.1.6
Keywords: difficultyInteresting, easyHack, skillCpp, topicUI
Depends on:
Blocks: Writer-Header-Footer Writer-Styles-Page
  Show dependency treegraph
 
Reported: 2018-03-13 14:31 UTC by Thomas Lendo
Modified: 2019-03-12 18:41 UTC (History)
10 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Lendo 2018-03-13 14:31:23 UTC
There are 2 ways to format a header/footer:

A) Page style dialog sub-window:
1. Open a new text document.
2. Click at Insert > Header and Footer > Header > Default Style.
3. Click into the header area.
4. Click at the blue header drop-down menu.
5. Select 'Format Header...'.
6. The Header tab of the Page Style dialog opens, click the 'More' button.
7. A dialog window with 3 tabs opens: Borders, Area, Transparency.

This dialog window is streamlined, has the same dimensions as the Page style dialog window and includes the current improved Area tab implementation.

B) 'Border and Background...' dialog window:
1. Click back into the header area.
2. Click at the blue header drop-down menu.
3. Select 'Border and Background...'.
4. A dialog window with 2 tabs opens: Borders, Background.

This dialog seems one from older days and doesn't include neither the Transparency tab nor the new implementation of the Area tab.

Actual result:
2 different dialog windows and one of them is outdated and provides less options than the other dialog window.

Expected result:
Clicking at the 'More' button of the Header tab of the Page Style dialog should open the identical dialog that opens when clicking at blue header drop-down menu > 'Border and Background...'.


I don't know the technical reasons why there are 2 different implementations for a UI that provides a nearly identical solution for the user.

Suggestion:
Drop the dialog window that opens after clicking at 'Border and Background...' and--instead of that--show the dialog window that opens when clicking at the 'More' button in the Page style dialog.
Comment 1 Thomas Lendo 2018-03-13 14:33:20 UTC
Tested with Version: 6.1.0.0.alpha0+ (x64)
Build ID: cab04bc39b5164ea74216cd849c3af5f5b298f79
CPU threads: 8; OS: Windows 10.0; UI render: GL; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-03-12_00:50:50
Locale: de-AT (de_AT); Calc: CL
Comment 2 Dieter Praas 2018-03-13 18:09:10 UTC
I confirm this with

Version: 6.1.0.0.alpha0+ (x64)
Build ID: d64ce643275e0b2b0dea9e532fc261391dc8793c
CPU threads: 4; OS: Windows 10.0; UI render: GL; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-03-01_03:24:30
Locale: de-DE (de_DE); Calc: CL
Comment 3 Heiko Tietze 2018-03-19 14:11:24 UTC
Quite confusing to be in the page dialog with area/border settings related to the page having a More... button where the same features are applied to the header. 

Anyway, there is likely no drawback from getting rid of the "old" dialog.
Comment 4 Heiko Tietze 2018-04-06 09:59:48 UTC
Code pointers:

Event handler for the menu item is here sw/source/uibase/docvw/HeaderFooterWin.cxx SwHeaderFooterWin::ExecuteCommand() 
Event handler for the More button at svx/source/dialog/hdft.cxx IMPL_LINK_NOARG(SvxHFPage, BackgroundHdl, Button*, void)
Comment 5 Aditya Sahu 2019-02-04 14:56:52 UTC
I'm interested in fixing this issue. Thank you for the code pointers, will surely take a look at it.
Comment 6 Aditya Sahu 2019-02-07 07:55:26 UTC
I'm not sure how to call the new dialog present in svx/source/dialog/hdft.cxx from a the file ( sw/source/uibase/docvw/HeaderFooterWin.cxx ) that has not declared or prepared itself for opening the dialog. 
For now, I have removed the call of old dialog and need some help to call the newer dialog. Please review the change and advise what is needed.
see: https://gerrit.libreoffice.org/#/c/67483/
Comment 7 Heiko Tietze 2019-02-10 13:54:58 UTC
(In reply to Aditya Sahu from comment #6)
> I'm not sure how to...

Please ask the developers on the IRC channel (https://wiki.documentfoundation.org/Development).
Comment 8 Jim Raykowski 2019-02-12 08:27:21 UTC
Hi Aditya,

One approach is as follows:

Create a temporary item set from pHFFormat attribute set (SfxItemSet::SfxItemSet)

Use merge range SID_COLOR_TABLE, SID_PATTERN_LIST items to the item set (SfxItemSet::MergeRange)

Use put area list items into the item set 
  sw/source/uibase/shells/textsh1.cxx:993 
  or shorter way sw/source/uibase/shells/frmsh.cxx:437 
  or even shorter way /home/lo/Dev/LO1/core/sw/source/uibase/shells/textsh.cxx:853

execute svx::ShowBorderBackgroundDlg with the temporary item set (see original code)

Set pHFFormat attributes to the temporary item set (SwFormat::SetFormatAttr)

Set the doc modified (see original code)

Modify CreateSvxBorderBackgroundDlg in svx::ShowBorderBackgroundDlg to use drawing layer fill styles

Feel free to add me as a reviewer for this patch in Gerrit.
Comment 9 Commit Notification 2019-02-28 21:05:08 UTC
Aditya committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/55042cb54fea5f7ad777c03af9bf8197127b6736%5E%21

tdf#116382 Replace old dialog in header and footer drop-down menu

It will be available in 6.3.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 10 Commit Notification 2019-03-01 13:54:24 UTC
Aditya committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/7d7396d096369be06e7de3df566c5da7b25ef2c7%5E%21

tdf#116382 Replace old dialog in header and footer drop-down menu

It will be available in 6.2.2.

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 11 Commit Notification 2019-03-01 13:54:36 UTC
Aditya committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

https://git.libreoffice.org/core/+/01d140e2205306159da57b9ec703e1a54802115c%5E%21

tdf#116382 Replace old dialog in header and footer drop-down menu

It will be available in 6.1.6.

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 12 BogdanB 2019-03-04 08:45:50 UTC
We have the same implementation on 6.3 on A and B.

Tested on Version: 6.3.0.0.alpha0+
Build ID: d4e3b48ee4c32bdb4e6cc37fb618cf818e152c31
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2019-03-02_23:38:22
Locale: ro-RO (ro_RO.UTF-8); UI-Language: en-US
Calc: threaded
Comment 13 BogdanB 2019-03-04 08:46:03 UTC Comment hidden (obsolete)
Comment 14 Xisco Faulí 2019-03-12 18:41:28 UTC
Considering it's an easyhack and a non regression bug, I don't think it was necessary to backport it to 6-1 branch, specially considering 6.1.6 is the last release of that branch. Anyway, it's done now so let's hope it doesn't cause any problem. it's just a note for similar bugs in the future. Aditya, thank you very much for fixing this!