Bug 111723 - Line and Area dialogs do not remember which tab page was opened last time
Summary: Line and Area dialogs do not remember which tab page was opened last time
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Ekansh Jha
URL:
Whiteboard: target:6.1.0
Keywords: difficultyBeginner, easyHack, needUITest, skillCpp
Depends on:
Blocks: Object-Fill Dialog-Remember-Settings Shapes-Line
  Show dependency treegraph
 
Reported: 2017-08-12 14:18 UTC by Tamás Zolnai
Modified: 2018-02-01 17:19 UTC (History)
7 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 Tamás Zolnai 2017-08-12 14:18:54 UTC
Description:
In general dialogs used to remember the last opened tab page and opens the same tab page when the dialog is opened again (see for example character properties dialog, paragraph properties dialog, page properties dialog, etc.). It can be useful when somebody changes a specific setting repeteadly, checks how the object looks like with the new settings and open the setting dialog again.

The issue is that our new area dialog does not work the same way. It always opens the area tab page when the dialog is opened.

Steps to Reproduce:
1. Open Impress
2. Create Shape
3. Open Area dialog (shape cotnext menu -> Area...
4. Swtich to transparency tab page and close the dialog
5. Open the dialog again

Actual Results:  
Dialog does not remember the last opened tab page. It always opens the area tab page.

Expected Results:
Dialog should remember the last used tab page and switch that tab page when the dialog is opened.


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/60.0.3112.90 Safari/537.36
Comment 1 m_a_riosv 2017-08-12 23:21:53 UTC
Repro.
Version: 6.0.0.0.alpha0+
Build ID: 2585eb9d15f5c047d846ccb4b4d606d9ac89e518
CPU threads: 4; OS: Windows 6.19; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2017-08-09_05:41:11
Locale: es-ES (es_ES); Calc: CL
Comment 2 Tamás Zolnai 2017-08-25 17:09:33 UTC
Let's turn this into a easy hack. The code is here:
cui/source/tabpages/tabarea.cxx

An example dialog which works as expected is not Position and Size dialog in the same context menu). It's code is here:
cui/source/tabpages/transfrm.cxx
Comment 3 Tamás Zolnai 2017-11-05 15:21:11 UTC
Nigel Dias, Are you still working on this issue?
Comment 4 Nigel Dias 2017-12-09 03:13:55 UTC
No, sorry :/
Comment 5 Ekansh Jha 2017-12-13 15:03:14 UTC
Hi! I want to work on this issue.
Comment 6 Ekansh Jha 2017-12-14 03:33:20 UTC
I tried to look into cui/source/tabpages/transfrm.cxx and 
found that in SvxTransformTabDialog::PageCreated SetView(pView) 
enable to load the dialog box. moreover there is no function like this in cui/source/tabpages/tabarea.cxx and in SvxAreaTabDialog::PageCreated what does 
ActivatePage do( i am a bit confused about it). Could you please clear my doubts.
Comment 7 Tamás Zolnai 2017-12-15 18:47:47 UTC
(In reply to Ekansh Jha from comment #6)
> I tried to look into cui/source/tabpages/transfrm.cxx and 
> found that in SvxTransformTabDialog::PageCreated SetView(pView) 
> enable to load the dialog box. moreover there is no function like this in
> cui/source/tabpages/tabarea.cxx and in SvxAreaTabDialog::PageCreated what
> does 
> ActivatePage do( i am a bit confused about it). Could you please clear my
> doubts.

It's not really clear what is the question here, but I can give some general info.
In general PageCreated() method is called only once during a dialog lifetime and this method consturcts the different tab pages by calling their constructor.
While ActivatePage() is called when the actual tab page is activated. So this second method is called more times, every time when the user switches to a different tab page in the dialog.
Comment 8 Ekansh Jha 2017-12-16 02:41:05 UTC
basically the arguement "nId" Passed in SvxTransformTabDialog::PageCreated 
decides which tab will show on opening dialog box, but from where this function is called and arguements(nId) is filled. I can't see nId declared anywhere.
Comment 9 Laurent Balland 2017-12-16 08:30:30 UTC
(In reply to Ekansh Jha from comment #8)
> basically the arguement "nId" Passed in SvxTransformTabDialog::PageCreated 
> decides which tab will show on opening dialog box, but from where this
> function is called and arguements(nId) is filled. I can't see nId declared
> anywhere.

Did you have to look with OpenGrok?
https://opengrok.libreoffice.org/search?project=core&q=PageCreated&defs=&refs=&path=&hist=&type=
tabtempl.cxx seems the right place.
Comment 10 Ekansh Jha 2017-12-17 12:07:25 UTC
Tamas:

Till now what i understood is : 

1. Constructor(SvxTransformTabDialog::SvxTransformTabDialog): Only Creates tabpages. 
2. PageCreated(SvxTransformTabDialog::PageCreated): decides which tab page to show when dialog box open. 

I also looked into transfrm.cxx and upto my understanding I got that nId decides which tab will open after opening the dialog, I can't find a way to manipulate nId.
Do i need to change something in activatePage() or deactivatePage().

and Could you explain about SetView(pView), in my opinion it shows the tab. Correct me if i am wrong.
I am little bit confused about it. Please help.
Comment 11 Ekansh Jha 2017-12-17 12:15:31 UTC
I think implementing function like SetView(pView) in tabarea.cxx would help to solve this problem, but I can't fund SetView function. Please help.
Comment 12 Tamás Zolnai 2017-12-17 15:39:03 UTC
I suggest to use a debugger tool to understand the code:
https://wiki.documentfoundation.org/Development/How_to_debug
With a debugger you can check where the nId is set and also what SetView function is doing and where it is defined.
Comment 13 Tamás Zolnai 2017-12-17 15:42:25 UTC
Add a breakpoint inside PageCreated() for example. With that you can check from where this is called and so you will see nId construction. Also you can add a breakpoint at the place where SetView() is called and step into that function. With that you can find the definition of this function.
Comment 14 Commit Notification 2017-12-27 07:09:05 UTC
ekuiitr committed a patch related to this issue.
It has been pushed to "master":

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

tdf#111723 Fixed -  Dialog does not remember the last opened tab page

It will be available in 6.1.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.