Bug 105991 - Changing legend's font changes also the legend position
Summary: Changing legend's font changes also the legend position
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
4.3 all versions
Hardware: All All
: medium normal
Assignee: Ekansh Jha
URL:
Whiteboard: target:6.0.0
Keywords: bibisected, bisected, difficultyBeginner, easyHack, regression, skillCpp
Depends on:
Blocks:
 
Reported: 2017-02-13 22:20 UTC by Tamás Zolnai
Modified: 2017-10-17 13:48 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Test document with a chart (29.30 KB, application/vnd.oasis.opendocument.spreadsheet)
2017-02-13 22:21 UTC, Tamás Zolnai
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tamás Zolnai 2017-02-13 22:20:36 UTC
Description:
When I open the test document and try to change the legend font properties (in chart edit mode) the legend position is also changes when closing Legend dialog (legend is repositioned to the left side of the chart area).

Steps to Reproduce:
1. Open attached test document
2. Double click on chart -> enter into edit mode
3. Double click on legend -> Legend dialog is opened
4. Change font type on Font tab page
-> Font type changes, but Legend also moves to the left.

Actual Results:  
Legend position changes when I set a new font type.

Expected Results:
Legend position should not change.


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
Comment 1 Tamás Zolnai 2017-02-13 22:21:24 UTC
Created attachment 131195 [details]
Test document with a chart
Comment 2 Buovjaga 2017-02-19 17:24:04 UTC
Repro.

No problem with 3.6.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.4.0.0.alpha0+
Build ID: 7ec0500e20cf273d70c4fbddb4063b8f8295307c
CPU Threads: 8; OS Version: Linux 4.9; UI Render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on February 18th 2016

Arch Linux 64-bit
Version 3.6.7.2 (Build ID: e183d5b)
Comment 3 Xisco Faulí 2017-02-19 17:45:51 UTC
Regression introduced by:

author	Caolán McNamara <caolanm@redhat.com>	2013-11-27 10:31:37 (GMT)
committer	Caolán McNamara <caolanm@redhat.com>	2013-11-27 10:33:25 (GMT)
commit 07a58db41301d15523519b99d2c64f1885909cda (patch)
tree 1eb5286d2703541b65d1ee144eb300aa52338e59
parent 4f94f16ba15218e5e7a9eb4d72ddb4cb62884dbb (diff)
provide two LegendPositionResources for the interim
LegendPositionResources for .ui based stuff and a legacy
oldLegendPositionResources which can be phased out when
the last .res based user is gone

Adding Cc: to Caolán McNamara
Comment 4 Tamás Zolnai 2017-08-26 12:13:44 UTC
Let's turn this into a easy hack. The code is here:
chart2/uiconfig/ui/tp_LegendPosition.ui -> defines the structure of the font page
chart2/source/controller/dialogs/res_LegendPosition.cxx -> implementation of the font page
Comment 5 Ekansh Jha 2017-10-15 14:38:57 UTC
Hello, I want to work on this easyhack. A little help will be really appreciated.
Thanks
Comment 6 Tamás Zolnai 2017-10-16 14:58:32 UTC
(In reply to Ekansh Jha from comment #5)
> Hello, I want to work on this easyhack. A little help will be really
> appreciated.
> Thanks

Hi,

First of all, if you are working on a bug, set Assigne field to your email address and also change Status field to ASSIGNED. So others can recognize easily that somebody is working on this issue.

Now, about the code. Most dialogs get their input from an SfxItemSet container and also write their output back to this item set. When the dialog opens the settings are loaded from this SfxItemSet in LegendPositionResources::initFromItemSet(). When the dialog is closed the itemset is updated by LegendPositionResources::writeToItemSet() method. So you need to check what happens in these two methods. The expected behavior is that the legend position properties does not change if the user does not change them in the dialog.
Comment 7 Ekansh Jha 2017-10-16 16:22:17 UTC
May I know what is the use of "chart2/uiconfig/ui/tp_LegendPosition.ui"?
Comment 8 Tamás Zolnai 2017-10-16 18:52:10 UTC
(In reply to Ekansh Jha from comment #7)
> May I know what is the use of "chart2/uiconfig/ui/tp_LegendPosition.ui"?

The *.ui files describe the view of the the dialog. This file contains the GUI elements what the dialog has and also position, size and other informations. When you need to define the behavior of the dialog you can do that in the *.cxx file and you can get a GUI element defined in *ui. with the get function (e.g. "rParent.get(m_pRbtLeft, "left");").
Comment 9 Commit Notification 2017-10-17 13:43:22 UTC
ekuiitr committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ee2051f27592e8dfa6c0069b261d6742614fd2e1

tdf#105991 - Changing legend's font also changes the legend position

It will be available in 6.0.0.

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

Affected users are encouraged to test the fix and report feedback.