Download it now!
Bug 111747 - Selecting position protection disables rotation settings only after reopening the dialog
Summary: Selecting position protection disables rotation settings only after reopening...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Kshitij
URL:
Whiteboard: target:6.1.0
Keywords: difficultyBeginner, easyHack, skillCpp
Depends on:
Blocks: Dialog
  Show dependency treegraph
 
Reported: 2017-08-12 20:53 UTC by Tamás Zolnai
Modified: 2018-01-19 11:49 UTC (History)
3 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 20:53:42 UTC
Description:
Position and Size dialog for shapes in Impress has an option to set position protection. When this option is enabled most of the settings made disabled on the dialog. The controls on rotation tab page are not disabled immediately after the position protection is enabled, but only after the dialog is closed and reopened. Similar thing happens when we disable the position protection, the rotation settings remain disabled and we need to reopen the dialog to be able to set any rotation.

Steps to Reproduce:
1. Open Impress
2. Open position and size dialog for title shape
3. Turn on position protection (Position and Size tab, Protect label)
4. Switch to Rotation tab -> all settings are enabled
5. Close and reopen the dialog -> settings on Rotation tab are disabled

Actual Results:  
Disabling settings on rotation tab page is done only after closing and reopening the whole dialog.

Expected Results:
Rotation settings should be enabled / disabled immediately as the position protection changes.


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 Xisco Faulí 2017-08-15 17:37:20 UTC
Reproduced in

Version: 6.0.0.0.alpha0+
Build ID: ef2e6260fad38e26c8591ea88ded348db618270d
CPU threads: 4; OS: Linux 4.10; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group

and in

LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 2 Tamás Zolnai 2017-08-26 11:56:55 UTC
Let's turn this into a easy hack. The code is here:
cui/uiconfig/ui/rotationtabpage.ui -> defines the structure of the tab page
cui/source/tabpages/transfrm.cxx -> implementation of the tab page
Comment 3 Ekansh Jha 2017-10-24 16:41:42 UTC
Hello, This bug looks interesting for me, hence i would like to give it a try. Please guide me on this.
Comment 4 Tamás Zolnai 2017-10-24 18:03:39 UTC
(In reply to Ekansh Jha from comment #3)
> Hello, This bug looks interesting for me, hence i would like to give it a
> try. Please guide me on this.

You've already got the guide points. See the previous comment, there you can find code pointers. So please read the code and try to understand how this tab page works.
You can also find the whole dialog's code by add a breakpoint in the constructor of the tab page (SvxTransformTabDialog). Since disabling this rotation settings works when the dialog opens, I expect that you can find the code which is used for disabling these settings. It seems everything is in the code you need.
Comment 5 Ekansh Jha 2017-10-25 22:05:02 UTC
I looked into the functions you suggested, it looks like when page is created the constructor completes its work but when protect button is clicked, I think its the work of SvxPositionSizeTabPage::UpdateControlStates(), but I don't know how to execute it, and also what is the difference between nPosSize and nSWPosSize. 
I even tried to insert code in "PageCreated"  but it always gives error of "not a member of class". Please help me.

Thanks
Comment 6 Tamás Zolnai 2017-10-25 23:25:34 UTC
(In reply to Ekansh Jha from comment #5)
> I looked into the functions you suggested, it looks like when page is
> created the constructor completes its work but when protect button is
> clicked, I think its the work of
> SvxPositionSizeTabPage::UpdateControlStates(), but I don't know how to
> execute it,

You need to understand what is OOP first, then you will see why you can't use directly SvxAngleTabPage class' private members from an other class. I suggest you to try to understand first the objects we have here (SvxPositionSizeTabPage, SvxAngleTabPage and SvxTransformTabDialog) and how they can manipulate each other and then you'll find a way to disable rotation when it's needed.

> and also what is the difference between nPosSize and nSWPosSize.

Please look into the code, how these variables are used. If you do that then you will see a comment about that the position tab is different in Writer as in other components (e.g. Impress) so that's why we have two of these variables.

> I even tried to insert code in "PageCreated"  but it always gives error of
> "not a member of class". Please help me.

Yes. I guess this is because you tried to use a variable not in the right scope. It seems to me you need to get a better understanding of variable scoping in C++. Sorry, but I can't help you with C++ basics here. If you learnt to use a different programing language, then it might be better to find something with that language. In the LibreOffice project we have also some python code.
Comment 7 Ekansh Jha 2017-10-26 13:36:07 UTC
Hi, I have unassigned this bug, as it was taking long time. I will start working again after November.

Thanks
Comment 8 Kshitij 2017-12-09 15:29:02 UTC
Hi! I would like to work on this bug.
Comment 9 Xisco Faulí 2018-01-10 03:30:17 UTC Comment hidden (obsolete)
Comment 10 Kshitij 2018-01-10 09:14:12 UTC
(In reply to Xisco Faulí from comment #9)
> A polite ping, still working on this bug?

Yes ,working on it
Comment 11 Commit Notification 2018-01-19 11:48:17 UTC
Kshitij Pathania committed a patch related to this issue.
It has been pushed to "master":

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

tdf#111747 Enabled position protection immediately after protection is checked

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.