Hello,
I need to select or unselect "Keep ratio" check box in "Position and Size" dialog window programmatically for embedded image in LibreOffice Calc with Basic macro.
Could you provide some code example?
[Solved] Keep ratio check box in "Position and Size" dialog?
[Solved] Keep ratio check box in "Position and Size" dialog?
Last edited by Serg St on Mon Apr 02, 2018 3:06 pm, edited 2 times in total.
LibreOffice 6.0.0.3 on Windows 7 Professional 32 bit
Re: "Keep ratio" check box in "Position and Size" dialog?
Just two tips:
Apply a predefined style by your macro (instead of the direct formatting commands).
Install and use one of the existing object inspection tools:
MRI
XrayTool
Apply a predefined style by your macro (instead of the direct formatting commands).
Install and use one of the existing object inspection tools:
MRI
XrayTool
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: "Keep ratio" check box in "Position and Size" dialog?
There are two properties of the picture objects (I just Xrayed them):
But when you modify the width or height of a picture by macro, you need to calculate the original ratio, and must calculate the new another size parameter.
But when you modify the width or height of a picture by macro, you need to calculate the original ratio, and must calculate the new another size parameter.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: "Keep ratio" check box in "Position and Size" dialog?
I tried to use Xray.
I saved properties of the object com.sun.star.comp.sc.ScShapeObj to the first text file (the "Keep ratio" checkbox was not checked).
Then i check "Keep ratio", explored object properties again with Xray and saved the result to second text file.
Then i compared this two text files - they was absolutely equal - so Xray didn't show the change of "Keep ratio" checkbox.
What else can i do?
I saved properties of the object com.sun.star.comp.sc.ScShapeObj to the first text file (the "Keep ratio" checkbox was not checked).
Then i check "Keep ratio", explored object properties again with Xray and saved the result to second text file.
Then i compared this two text files - they was absolutely equal - so Xray didn't show the change of "Keep ratio" checkbox.
What else can i do?
LibreOffice 6.0.0.3 on Windows 7 Professional 32 bit
Re: "Keep ratio" check box in "Position and Size" dialog?
I cannot find sufficient property for "Keep ratio" check box.
I tried to do it with MRI and XRay.
But i found the answer here:
viewtopic.php?f=10&t=234
They said in that topic:
"The "Keep ratio" option only affects the dimensions as you enter them in the dialog. If you type 4" for the height, OOo will calculate the appropriate width for that height and put that in the width entry. It has no effect whatsoever on the graphical (mouse) resizing.
If you need that when using the mouse, hold down the shift key while you drag a corner."
From that topic i can make a decision that picture object has no property "Keep ratio" cause this check box only affects the behaviour of "Position and Size" dialog box.
Anyway, thank you Tibor for help.
I tried to do it with MRI and XRay.
But i found the answer here:
viewtopic.php?f=10&t=234
They said in that topic:
"The "Keep ratio" option only affects the dimensions as you enter them in the dialog. If you type 4" for the height, OOo will calculate the appropriate width for that height and put that in the width entry. It has no effect whatsoever on the graphical (mouse) resizing.
If you need that when using the mouse, hold down the shift key while you drag a corner."
From that topic i can make a decision that picture object has no property "Keep ratio" cause this check box only affects the behaviour of "Position and Size" dialog box.
Anyway, thank you Tibor for help.
LibreOffice 6.0.0.3 on Windows 7 Professional 32 bit