Bug 117838 - VIEWING: Showing a picture on full screen will cause a vertical scrollbar to appear
Summary: VIEWING: Showing a picture on full screen will cause a vertical scrollbar to ...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.0.4.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-27 16:03 UTC by Balint Fodor
Modified: 2018-06-21 18:21 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Image on full screen (428.61 KB, application/x-zip-compressed)
2018-05-27 16:03 UTC, Balint Fodor
Details
1079 px height setting (4.57 MB, image/png)
2018-05-27 19:05 UTC, Balint Fodor
Details
Workaround by setting background image. (427.82 KB, application/x-zip-compressed)
2018-06-06 11:10 UTC, Balint Fodor
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Balint Fodor 2018-05-27 16:03:12 UTC
Created attachment 142318 [details]
Image on full screen

I am testing on a Full HD screen, Windows 10.
If I size the image so that it appears 1079 px high, the scrollbar can be avoided. However, if I slowly increase the height, there will soon be a scrollbar at a height of 28548 1/100 mm (the picture is still 1079 px high). 
The image fits the full height for the first time at 28560.
It is a bug, and I have not found a workaround either. 
I looked through the properties of ThisComponent, ThisComponent.CurrentController.Frame.ComponentWindow and ThisComponent.CurrentController.Frame.ContainerWindow, and found nothing related to scrollbars, and there is no option to set the page content height either.
Comment 1 Mike Kaganski 2018-05-27 17:37:14 UTC
To see the problem, one has to enable Java and macros.

This is not a bug. The form is actually a text document, with elements (paragraphs of text, images, controls etc.) being placed relative to one another using usual layout riles. In this specific case, the image is anchored to page, positioned from the very top of the page, and its wrapping set to Page wrap (so the only (empty) paragraph present on the form should be placed to a free place outside of the image).

If you set the wrap to Wrap Through, the positioning will be as you want (but the paragraph will be over the image - don't know if that's what you need).
Comment 2 Balint Fodor 2018-05-27 18:26:18 UTC
Thank you for the suggestion.
I added the line
oControlShape.TextWrap=com.sun.star.text.WrapTextMode.THROUGH
to Sub CreateControl
and I can see a change (there is no space below the image you can scroll to), however the scrollbar is still there.
Comment 3 Mike Kaganski 2018-05-27 18:46:42 UTC
Changing

> aSize.Height=h*ratio

to

> aSize.Height=(h-1)*ratio

made a difference here.
Comment 4 Balint Fodor 2018-05-27 19:05:48 UTC
Created attachment 142320 [details]
1079 px height setting

Of course it does. But then the image does not fill the whole screen, there will be 1 px space to the bottom, and to the left and right (I changed the image control's background color to green, so it is more visible in the attached screenshot.)

It is not just this 1 px I am concerned about, but because the program needs to resize the picture, it will load much slower.
Comment 5 Robert Großkopf 2018-06-05 15:06:27 UTC
Can't test this one in a right way, because the image won't fill the screen here (22"). If I set the window to a smaller window it could be there is one pixel under the picture and the the scrollbar will appear. I couldn't see this, because the border of the window is light grey ...

I don't know what you will get with this construction: A formcontrol for showing images should appear in fullscreen with only an image. Why don't you use the background of the form, if you want to show a fullscreen-image?
Comment 6 Balint Fodor 2018-06-06 11:10:50 UTC
Created attachment 142555 [details]
Workaround by setting background image.

Thanks for the tip, it works!

This is what I needed to use:
oPageStyle=ThisComponent.getStyleFamilies().getByName("PageStyles").getByName("Default Style")
oPageStyle.BackGraphicLocation = com.sun.star.style.GraphicLocation.LEFT_TOP
oPageStyle.BackGraphicURL=url

The BackGraphicLocation needs to be set either LEFT_TOP, LEFT_MIDDLE or TILED, otherwise you will get 1 px borders different places around the image.
Probably this can be reviewed by the developers too.
Comment 7 Buovjaga 2018-06-21 18:21:09 UTC
Seems all is fine and dandy, so closing.