Bug 153102 - docx: instead of line showing triangle at left bottom
Summary: docx: instead of line showing triangle at left bottom
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Android Viewer (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: ARM Android
: medium normal
Assignee: Armin Le Grand (allotropia)
URL:
Whiteboard: target:24.2.0 target:7.6.1
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-19 03:37 UTC by jindam, vani
Modified: 2023-08-04 19:56 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshot showing sloped line at bottom left of docx file on word android app (34.22 KB, image/png)
2023-01-19 03:40 UTC, jindam, vani
Details
screenshot showing rectangle instead of sloped line at bottom left of docx file on lo viewer 7.6 alpha android app (31.67 KB, image/png)
2023-01-19 03:43 UTC, jindam, vani
Details
Modified screenshot with red rectangle around page area (36.53 KB, image/png)
2023-01-25 15:50 UTC, Michael Weghorn
Details
Screenshot with LO desktop, Version: 5.2.8.0.0+ Build ID: e5ebc3d73156f217161e6b857026eae49fa91ea9 (6.20 KB, image/png)
2023-01-26 10:48 UTC, Michael Weghorn
Details
Screenshot with gtktiledviewer from LO master bfb8706466b52298def33d47d31b6efffc3ed531 (6.19 KB, image/png)
2023-01-26 10:54 UTC, Michael Weghorn
Details
Newly created test document with a rectangle overlapping the lower left of the page (13.84 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2023-08-02 11:23 UTC, Armin Le Grand (allotropia)
Details
Possible but rough fix. Works, but not recommended. (2.55 KB, patch)
2023-08-02 12:24 UTC, Armin Le Grand (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jindam, vani 2023-01-19 03:37:58 UTC
Description:
it does not show line at left bottom, it shows rectangle

Steps to Reproduce:
1. open attachment 130196 [details] on bug 105143

Actual Results:
it shows rectangle at bottom left

Expected Results:
it shows sloped line at bottom left


Reproducible: Always


User Profile Reset: No

Additional Info:
libreoffice viwer android [fdroid version]:
Version: 7.6.0.0.alpha0+ Build ID: d6c54b3d4ee7

probably regression of bug 105143?
Comment 1 jindam, vani 2023-01-19 03:40:50 UTC
Created attachment 184768 [details]
screenshot showing sloped line at bottom left of docx file on word android app
Comment 2 jindam, vani 2023-01-19 03:43:24 UTC
Created attachment 184769 [details]
screenshot showing rectangle instead of sloped line at bottom left of docx file on lo viewer 7.6 alpha android app
Comment 3 Michael Weghorn 2023-01-25 15:50:00 UTC
Created attachment 184908 [details]
Modified screenshot with red rectangle around page area

(In reply to jindam, vani from comment #0)
> probably regression of bug 105143?

From what I can see, the shape is correctly placed, i.e. it is not a regression regarding the implementation that was done to fix bug 105143.

Do I understand correctly that the correct part of the shape is within the page area (s.a. attached screenshot, i.e. within the red rectangle there)?

If so, is that which is confusing (and possibly incorrect) here that the shape is shown beyond the area covered by the actual page?
Comment 4 jindam, vani 2023-01-25 17:16:51 UTC
https://bugs.documentfoundation.org/show_bug.cgi?id=105143#c0 : See the attached bug document. In practice what should be visible is just a line at the bottom left corner of the page, not the whole triangle.

i assumed it must show only line at bottom left of the document [ similar to attach 184768]

not the whole triangle. [ similar to attach 184769 184908]
Comment 5 Michael Weghorn 2023-01-26 10:48:47 UTC
Created attachment 184923 [details]
Screenshot with LO desktop, Version: 5.2.8.0.0+ Build ID: e5ebc3d73156f217161e6b857026eae49fa91ea9
Comment 6 Michael Weghorn 2023-01-26 10:51:07 UTC
(In reply to jindam, vani from comment #4)
> https://bugs.documentfoundation.org/show_bug.cgi?id=105143#c0 : See the
> attached bug document. In practice what should be visible is just a line at
> the bottom left corner of the page, not the whole triangle.

It probably makes sense to not show what goes beyond the page area (as in the desktop version of LO), but that's something different from what tdf#105143 was about (so it's not a regression to that).

attachment 184923 [details] shows the the position/placement was incorrect before tdf#105143 was fixed, i.e. the whole shape is incorrectly positioned within the page area. The Android case now is different.
Comment 7 Michael Weghorn 2023-01-26 10:54:45 UTC
Created attachment 184924 [details]
Screenshot with gtktiledviewer from LO master bfb8706466b52298def33d47d31b6efffc3ed531

Looks similar with gtktiledviewer, s. attached screenshot
Comment 8 Armin Le Grand (allotropia) 2023-08-02 11:21:40 UTC
Indeed, capture.docx looks different in LO and tiled viewer AKA android viewer (AV). The shape is a filled polygon. tn LO it gets clipped to the Page - due to writer pages not allowing overhanging objects, but in AV it's shown (partially - what is another error). AV just does different things when painting, not always to the better.
It will not be sufficient to e.g. just clip the polygon to the page dimensions, that would create the clipped lines bottom and left. It is also not sufficient to only clip the line (and ignore the fill), that will not do the needed overpaint of the filled part. It needs to be a 'visual clip' aka limiting the paint area. LO does that already.
Tried to re-create that just with LO for a new doc -> does not work since LO already prevents interactions that move the shape outside of the page, so that situation cannot be created by using LO.
Using MSO Word you can move objects 'outside' the page, but only the part in the page gets visualized. Loading this in LO does (again) correct visual clip, while AW does (again) not -> error simply reproducible.

Objects in SW get painted each single using primitives during the repaint. While in LO paint a ClipRegion using the old OutDev stuff seems to be set, this seems not the case for AV repaint.
Comment 9 Armin Le Grand (allotropia) 2023-08-02 11:23:50 UTC
Created attachment 188723 [details]
Newly created test document with a rectangle overlapping the lower left of the page
Comment 10 Armin Le Grand (allotropia) 2023-08-02 12:22:20 UTC
Rough fix: Add clipping to SwRootFrame::PaintSwFrame where DrawObjects are painted as Heaven/Hell layers usiing PaintLayer.
That works, will add patch. But is not a good fix since it only fixes one plave where PaintLayer is used. It *could* be added to all places where PaintLayer is used, but that means to figure out the correct ClipRegion/Rectangle in all places, too.
There *must* be a more general difference between true == comphelper::LibreOfficeKit::isTiledPainting() between LO paint and AV paint, debugging for it...
Comment 11 Armin Le Grand (allotropia) 2023-08-02 12:24:52 UTC
Created attachment 188727 [details]
Possible but rough fix. Works, but not recommended.
Comment 12 Armin Le Grand (allotropia) 2023-08-02 14:01:43 UTC
Looks like I found it after some debugging. In ObjectContactOfPageView::DoProcessDisplay someone changed (seven years ago) to ignore the given RedrawArea if comphelper::LibreOfficeKit::isActive(). Using and setting that RedrawArea is what does the visual clipping against e.g. PageBounds in Writer paint. Adding that again.
Comment 13 Commit Notification 2023-08-02 22:58:37 UTC
Armin Le Grand (allotropia) committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/34387332173782498acd4998c7c665d04ebc3c7d

tdf#153102: use given RedrawArea in DoProcessDisplay

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 14 Commit Notification 2023-08-03 02:40:57 UTC
Armin Le Grand (allotropia) committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/142e8c023575e2aabc7f60110137da85e5a06770

tdf#153102: use given RedrawArea in DoProcessDisplay

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 15 Michael Weghorn 2023-08-04 19:56:34 UTC
Fix verified n a current Android Viewer build, thanks!

Version: 24.2.0.0.alpha0+
Build ID: eef0c5d4d45b