Bug 147666 - Viewport does not jump to location when large image is inserted and window not maximised
Summary: Viewport does not jump to location when large image is inserted and window no...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.1.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:24.2.0 target:7.6.1 target:24.8.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Anchor-and-Text-Wrap Writer-Images
  Show dependency treegraph
 
Reported: 2022-02-26 06:34 UTC by Aron Budea
Modified: 2024-01-10 10:52 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample ODT (38.97 KB, application/vnd.oasis.opendocument.text)
2022-02-26 06:34 UTC, Aron Budea
Details
Sample image (477 bytes, image/png)
2022-02-26 06:34 UTC, Aron Budea
Details
The example file after inserting the example image (90.20 KB, image/png)
2022-03-03 13:06 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2022-02-26 06:34:11 UTC
Created attachment 178550 [details]
Sample ODT

- Open the attached sample document,
- Insert a large image (eg. the attached one) with the caret right below the last line of text.

=> The image is added on the next page (fine, it wouldn't fit anyway), but the view doesn't jump to it.

Observed using LO 7.4.0.0.alpha0+ (0723b41bed9bb4ad50d2993744a60177966d1a21) / Ubuntu.

The view jumped to the newly inserted image until the following commit, bibisected using repo bibisect-linux-64-7.1. Adding CC: to Michael Stahl.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=810f7e4e0b61ee7cb3a7d6a1b503782d7248a4b1
author		Michael Stahl <michael.stahl@allotropia.de>	2021-04-13 20:13:51 +0200
committer	Thorsten Behrens <thorsten.behrens@allotropia.de>	2021-04-23 17:03:13 +0200

"sw: layout: if fly's anchor moves forward, move fly off SwPageFrame"

There's another change coming with the commit. If the caret is around the middle of the otherwise empty second page in the sample, and the image is inserted there:
- in older versions, the image is inserted on the same page,
- from the above commit, it's inserted on the next page (and the view doesn't jump to it).
Comment 1 Aron Budea 2022-02-26 06:34:42 UTC
Created attachment 178551 [details]
Sample image
Comment 2 Gabor Kelemen (allotropia) 2022-03-03 13:06:49 UTC
Created attachment 178638 [details]
The example file after inserting the example image

I can't confirm the issue in:

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: c97a3592c78ce276a353f95ce68c70a8a39174a0
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: x11
Locale: hu-HU (hu_HU.UTF-8); UI: en-US
Calc: threaded

The image is inserted to the second page, it is highlighted and view moved to the second page correctly.
Comment 3 Aron Budea 2022-03-31 17:35:11 UTC
Interesting, what I noticed that if the window size is full-height (on a 1080p display), then indeed it jumps to the next page, but if it's somewhat smaller, around 900 px, it doesn't.

Perhaps something's wrong with the logic of focusing the newly added content, and this isn't a regression in that case.
Comment 4 Aron Budea 2022-03-31 17:36:07 UTC
(In reply to Aron Budea from comment #3)
> ... it jumps to the next page...
It = view.
(the image is always inserted on the next page)
Comment 5 Stéphane Guillou (stragu) 2022-12-31 10:50:28 UTC
I can reproduce if the window is not full height:

Version: 7.1.8.1 / LibreOffice Community
Build ID: e1f30c802c3269a1d052614453f260e49458c82c
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Also in recent master build:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 12e8d57e791bb1befc0716d4d02af7d1d1ccb4ae
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

It is a regression in 7.1, as I can't reproduce the small-window behaviour in:

Version: 7.0.6.2
Build ID: 144abb84a525d8e30c9dbbefa69cbbf2d8d4ae3b
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3; 
Locale: en-AU (en_AU.UTF-8); UI-Language: en-US
Calc: threaded

Nor in:

OpenOffice.org 3.3.0
OOO330m20 (Build:9567)
Comment 6 Commit Notification 2023-08-08 17:30:14 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9c291ea8c63284fe5c344553fcb338e66c17c797

tdf#147666 sw: layout: no IsShortCut() if fly was moved to page

It will be available in 24.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 7 Michael Stahl (allotropia) 2023-08-08 17:30:56 UTC
fixed on master
Comment 8 Commit Notification 2023-08-14 09:25:42 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/ac5d5b4d7901b347b9b610b536317b30ec785f68

tdf#147666 sw: layout: no IsShortCut() if fly was moved to page

It will be available in 7.6.1.

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

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2024-01-10 08:23:23 UTC
Adam Seskunas committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/ab70d0faf602de7d9711d99bd285a25c05335e9a

tdf#147666 sw layout: add test case

It will be available in 24.8.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 10 Stéphane Guillou (stragu) 2024-01-10 10:40:09 UTC
Fix verified in:

Version: 7.6.4.1 (X86_64) / LibreOffice Community
Build ID: e19e193f88cd6c0525a17fb7a176ed8e6a3e2aa1
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Thanks Michael!

Adam, regarding the test: I'm not sure it would fail without the fix. In my testing with 7.5, the viewport would move down on insert, but not enough to see the picture. So CPPUNIT_ASSERT_LESS(nInsertedViewTop, nNonInsertedViewTop) wouldn't fail. I'll comment on gerrit.
Comment 11 Stéphane Guillou (stragu) 2024-01-10 10:52:09 UTC
(In reply to Stéphane Guillou (stragu) from comment #10)
> Adam, regarding the test: I'm not sure it would fail without the fix. In my
> testing with 7.5, the viewport would move down on insert, but not enough to
> see the picture. So CPPUNIT_ASSERT_LESS(nInsertedViewTop,
> nNonInsertedViewTop) wouldn't fail. I'll comment on gerrit.
Xisco already replied, it does fail without the fix. Thanks Adam!