Bug 135198 - EDITING Moving large shape upwards makes its textbox fall out of it
Summary: EDITING Moving large shape upwards makes its textbox fall out of it
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4.0.3 release
Hardware: All All
: medium normal
Assignee: Dániel Arató (NISZ)
URL:
Whiteboard: target:7.1.0 target:7.2.0 target:7.1....
Keywords: filter:docx, implementationError
: 136060 136515 138162 (view as bug list)
Depends on:
Blocks: Shape-Textbox
  Show dependency treegraph
 
Reported: 2020-07-27 13:28 UTC by NISZ LibreOffice Team
Modified: 2021-02-04 16:59 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Word with large shape+textbox (17.02 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-07-27 13:28 UTC, NISZ LibreOffice Team
Details
Screenshot of the document in Writer after opening (50.83 KB, image/png)
2020-07-27 13:28 UTC, NISZ LibreOffice Team
Details
Screenshot of the document in Writer after moving the shape up (52.50 KB, image/png)
2020-07-27 13:29 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2020-07-27 13:28:39 UTC
Created attachment 163631 [details]
Example file from Word with large shape+textbox

Attached anonimized user made document contains a large shape with textbox and lots of text. It’s also anchored to a paragraph in the middle of the page.
When this is opened in Writer and the shape is moved upwards, the textbox falls out of the shape when it gets close to the top of the page.

Steps to reproduce:
    1. Open attached document
    2. Move the shape (with mouse or keyboardtowards the top of the page

Actual results:
Textbox falls out of the shape. Note, this does not happen when the shape is moved towards the bottom of the page, but something similar happens when it is moved towards the left/right edge: the shape moves outside the page boundaries, but the textbox does not, unlike at the bottom of the page where they move correctly together.

Expected results:
Textbox stays inside the shape.

LibreOffice details:
Version: 7.1.0.0.alpha0+ (x64)
Build ID: <buildversion>
CPU szálak: 4; OS: Windows 6.3 Build 9600; Felületmegjelenítés: alapértelmezett; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: CL

Also happens in:
Verzió: 6.0.0.3
Build az.: 64a0f66915f38c6217de274f0aa8e15618924765
CPU szálak: 4; OS: Windows 6.3; Felületmegjelenítés: alapértelmezett; 
Területi beállítások: hu-HU (hu_HU); Calc: CL

Version: 5.0.0.5
Build ID: 1b1a90865e348b492231e1c451437d7a15bb262b
Locale: hu-HU (hu_HU)

Version: 4.4.0.3
Build ID: de093506bcdc5fafd9023ee680b8c60e3e0645d7
Locale: hu_HU

It was imported as frame in: 
Version: 4.3.0.4
Build ID: 62ad5818884a2fc2e5780dd45466868d41009ec0
Comment 1 NISZ LibreOffice Team 2020-07-27 13:28:59 UTC
Created attachment 163632 [details]
Screenshot of the document in Writer after opening
Comment 2 NISZ LibreOffice Team 2020-07-27 13:29:26 UTC
Created attachment 163633 [details]
Screenshot of the document in Writer after moving the shape up
Comment 3 Dániel Arató (NISZ) 2020-10-07 12:16:15 UTC
A little hint that might help: reproduce the bug as stated in the original description, then hit Undo once and Redo once.

1. Open attached document
2. Move the shape (with mouse or keyboardtowards the top of the page
3. Undo the last change
4. Redo the last change

The bug will occur after step 2 but _not_ after step 4!
Comment 4 Commit Notification 2020-10-27 12:28:18 UTC
Daniel Arato (NISZ) committed a patch related to this issue.
It has been pushed to "master":

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

tdf#135198 sw editing: text box fell out of its shape

It will be available in 7.1.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 5 Commit Notification 2020-10-29 18:03:24 UTC
Daniel Arato (NISZ) committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3e2290c55c23c0785763f8de51eba749ab622900

tdf#135198 fix unit test for HiDPI: pick object by index

It will be available in 7.1.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 6 NISZ LibreOffice Team 2020-10-30 15:03:28 UTC
*** Bug 136060 has been marked as a duplicate of this bug. ***
Comment 7 Xisco Faulí 2020-11-09 21:03:43 UTC
Reopening this issue since it has been reintroduced with https://cgit.freedesktop.org/libreoffice/core/commit/?id=f2eef84ff03660cbb46a76c317e640e054ed0a56. I noticed when I see the change in the unittest

-    // Vertically oriented to page due to tdf#135198
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(5304), getProperty<sal_Int32>(xFrame, "VertOrientPosition"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(2805), getProperty<sal_Int32>(xFrame, "VertOrientPosition"));

Reproduced in

Version: 7.1.0.0.alpha1+
Build ID: 0f2bddacae89a50c1349e2511c3b60c7c7120aad
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Steps:
1. Open the document
2. Select the shape
3. Use arrow key a few times ( 4 or more in my case )
Comment 8 Dániel Arató (NISZ) 2020-11-10 13:11:10 UTC
(In reply to Xisco Faulí from comment #7)
> Reopening this issue since it has been reintroduced with
> https://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=f2eef84ff03660cbb46a76c317e640e054ed0a56.

Nice catch. This also means that the unit test included with the fix does not cover arrow movement, unfortunately. :(
Comment 9 Dániel Arató (NISZ) 2020-11-10 13:33:58 UTC
Alright, I've got a plan.

As far as I'm concerned https://cgit.freedesktop.org/libreoffice/core/commit/?id=f2eef84ff03660cbb46a76c317e640e054ed0a56 was a kludge anyway, a workaround to solve one specific case of a more general problem detailed in
https://bugs.documentfoundation.org/show_bug.cgi?id=137980.

Since a general solution to 137980 must be found anyways, I vote for reverting my last commit. That way the original text box issue is fixed and this bug ticket can be closed after all.
Comment 10 Xisco Faulí 2020-11-13 13:08:28 UTC
(In reply to Dániel Arató (NISZ) from comment #9)
> Alright, I've got a plan.
> 
> As far as I'm concerned
> https://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=f2eef84ff03660cbb46a76c317e640e054ed0a56 was a kludge anyway, a
> workaround to solve one specific case of a more general problem detailed in
> https://bugs.documentfoundation.org/show_bug.cgi?id=137980.
> 
> Since a general solution to 137980 must be found anyways, I vote for
> reverting my last commit. That way the original text box issue is fixed and
> this bug ticket can be closed after all.

Your last commit also introduced bug 138162. Should I go ahead and submit the revert ?
Comment 11 Dániel Arató (NISZ) 2020-11-13 13:19:35 UTC
(In reply to Xisco Faulí from comment #10)
> Your last commit also introduced bug 138162. Should I go ahead and submit
> the revert ?

Yeah, that's probably a good idea. The revert will reintroduce 138056 and 137881 though.

Please don't close this ticket yet. I'm looking for a better, less messy solution in the meantime.
Comment 12 Xisco Faulí 2020-11-13 14:43:01 UTC
(In reply to Dániel Arató (NISZ) from comment #8)
> (In reply to Xisco Faulí from comment #7)
> > Reopening this issue since it has been reintroduced with
> > https://cgit.freedesktop.org/libreoffice/core/commit/
> > ?id=f2eef84ff03660cbb46a76c317e640e054ed0a56.
> 
> Nice catch. This also means that the unit test included with the fix does
> not cover arrow movement, unfortunately. :(

maybe a unittest like the one in 768cfcee178b284be6d96d384364e59e40ecb375 would have worked better here ?
Comment 13 Xisco Faulí 2020-11-13 18:37:18 UTC
(In reply to Xisco Faulí from comment #12)
> (In reply to Dániel Arató (NISZ) from comment #8)
> > (In reply to Xisco Faulí from comment #7)
> > > Reopening this issue since it has been reintroduced with
> > > https://cgit.freedesktop.org/libreoffice/core/commit/
> > > ?id=f2eef84ff03660cbb46a76c317e640e054ed0a56.
> > 
> > Nice catch. This also means that the unit test included with the fix does
> > not cover arrow movement, unfortunately. :(
> 
> maybe a unittest like the one in 768cfcee178b284be6d96d384364e59e40ecb375
> would have worked better here ?

I've just submitted a patch to gerrit fixing the unittest: https://gerrit.libreoffice.org/c/core/+/105805
Comment 14 Xisco Faulí 2020-11-13 18:38:20 UTC
*** Bug 138162 has been marked as a duplicate of this bug. ***
Comment 15 Xisco Faulí 2020-11-14 13:40:13 UTC
(In reply to Dániel Arató (NISZ) from comment #11)
> (In reply to Xisco Faulí from comment #10)
> > Your last commit also introduced bug 138162. Should I go ahead and submit
> > the revert ?
> 
> Yeah, that's probably a good idea. The revert will reintroduce 138056 and
> 137881 though.
> 
> Please don't close this ticket yet. I'm looking for a better, less messy
> solution in the meantime.

Reverted in https://git.libreoffice.org/core/+/ad53d723715b2ca3ab0d3415c532295ef17ced29%5E%21
Comment 16 Commit Notification 2020-11-15 14:31:15 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

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

tdf#135198: fix unittest

It will be available in 7.1.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 17 Commit Notification 2020-11-26 13:42:51 UTC
Daniel Arato (NISZ) committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/59fec754a1523eede0f19a59e4eeeff593a4d688

tdf#135198 tdf#138050 sw editing: fix text box position sync

It will be available in 7.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 18 Commit Notification 2020-11-26 15:40:11 UTC
Daniel Arato (NISZ) committed a patch related to this issue.
It has been pushed to "libreoffice-7-1":

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

tdf#135198 tdf#138050 sw editing: fix text box position sync

It will be available in 7.1.0.0.beta2.

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 19 NISZ LibreOffice Team 2020-12-30 09:51:51 UTC
Verified in:

Version: 7.2.0.0.alpha0+ (x64)
Build ID: 368c56144aab5794c39d5bc2082d9b3d6d7cebdb
CPU threads: 4; OS: Windows 10.0 Build 17134; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: threaded

Thanks for fixing!
Comment 20 NISZ LibreOffice Team 2021-02-04 16:59:27 UTC
*** Bug 136515 has been marked as a duplicate of this bug. ***