Bug 156993 - Snap guides are not visible anymore
Summary: Snap guides are not visible anymore
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
24.2.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:24.8.0 target:24.2.1.2
Keywords: bibisected, bisected, regression
: 159761 159859 159873 (view as bug list)
Depends on:
Blocks: Snap
  Show dependency treegraph
 
Reported: 2023-08-29 21:33 UTC by Regina Henschel
Modified: 2024-02-29 18:09 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2023-08-29 21:33:26 UTC
Start Impress. Show Rulers. Make sure for Snap Guides "Display" and "in Front" is on. That is in menu View > Snap Guides. Drag from the ruler to the slide. While you are dragging, the guide is visible. When you release the mouse, the guide becomes invisible. It is still there. When you hover it with the mouse you see the drag arrows. And when you right click in that moment, you get the "Edit Snap Line" dialog.
The problem is independent of Skia on or off.

I see the error in Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 6256d5fe2e7cb1bb002d5fe59527d3a3fbf6963f
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: default; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded

It was OK in Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: fcbae818b793a9ee97a1b5ddc53902be7a2376f5
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 1 Sophie Sipasseuth 2023-09-28 08:59:12 UTC
No repro, on my computer, with the oldest and the master version of LO in the repository win64-24.2, the guides don't disappear when I drag them in the rule and then release the mouse.

But, the guides disappear when I change the size of a textbox sometimes. In this case,  the guides are displayed again after I stop the change of size and click on the background of my slide to deselect the textbox.

Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 6f227b0dd912d4c70a01eb3872fff15d52de543a
CPU threads: 8; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: fr-FR (fr_FR); UI: en-US
Calc: threaded

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 486ae5db6987411d5e394de94b2b077099d03856
CPU threads: 8; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: fr-FR (fr_FR); UI: en-US
Calc: threaded
Comment 2 Stéphane Guillou (stragu) 2023-09-28 19:44:01 UTC
I can reproduce in 24.2 but not in 7.6.

Bibisected with linux-64-24.2 repo to first bad commit e60cc9022aa1b951337b6ebeea701148255f1113 which points to core commit:

commit 3996eed1870ced736d9f4a01550f5c9f0568edfa
author	Armin Le Grand Tue Jul 11 13:57:52 2023 +0200
committer	Armin Le Grand Wed Jul 12 17:59:46 2023 +0200
tdf#105362 better support for transparency in PNG & GIF export
The granularity to decide at the SdrView what to paint was not
fine enough, so I added code to get what we need: Do avoid
page decorations (including PageBackgrund aka 'wiese'), but
do include/process MasterPage content.
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154301

Armin, can you please have a look?

(In reply to Sophie Sipasseuth from comment #1)
> No repro, on my computer, with the oldest and the master version of LO in
> the repository win64-24.2, the guides don't disappear when I drag them in
> the rule and then release the mouse.

Maybe you were looking at something different? Snap guide are dashed lines that can be created by dragging and dropping from the ruler onto the slide. They should go over the slide from side to side. Like here: https://www.linuxtopia.org/online_books/office_guides/openoffice_impress_guide/ImpressGuide3_html_m5ddc8e6.gif
Comment 3 Sophie Sipasseuth 2023-09-29 08:56:53 UTC
 > Maybe you were looking at something different? Snap guide are dashed lines
> that can be created by dragging and dropping from the ruler onto the slide.
> They should go over the slide from side to side. Like here:
> https://www.linuxtopia.org/online_books/office_guides/
> openoffice_impress_guide/ImpressGuide3_html_m5ddc8e6.gif

Yes, Stéphane, You are right.
I thought Snap guides were the little triangle on the rule that can be moved on the rule.
Comment 4 Regina Henschel 2024-02-08 23:43:40 UTC
The problem is in
https://opengrok.libreoffice.org/xref/core/svx/source/sdr/contact/viewcontactofsdrpage.cxx?r=33b7d622#521
514  sal_uInt32 ViewContactOfSdrPage::GetObjectCount() const
515  {
516      // Fixed count of content. It contains PageBackground (Wiese), PageShadow, PageFill,
517      // then - depending on if the page has a MasterPage - either MasterPage Hierarchy
518      // or MPBGO. Also OuterPageBorder, InnerPageBorder and two pairs of Grid and Helplines
519      // (for front and back) which internally are visible or not depending on the current
520      // front/back setting for those.
521      return 10;
522  }

The returned value 10 is used for the upper limit in the for-loop in
https://opengrok.libreoffice.org/xref/core/svx/source/sdr/contact/viewobjectcontact.cxx?r=33b7d622#566
566  void ViewObjectContact::getPrimitive2DSequenceSubHierarchy(DisplayInfo& rDisplayInfo, drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) const
567  {
568      ViewContact& rViewContact = GetViewContact();
569      const sal_uInt32 nSubHierarchyCount(rViewContact.GetObjectCount());
570  
571      for(sal_uInt32 a(0); a < nSubHierarchyCount; a++)
572          rViewContact.getPrimitive2DSequenceHierarchyOfIndex(a, rDisplayInfo, GetObjectContact(), rVisitor);
573  }

So the loop goes from a=0 to a=9 and therefore never reaches the case 10 in
https://opengrok.libreoffice.org/xref/core/svx/source/sdr/contact/viewcontactofsdrpage.cxx?r=33b7d622#524
ViewContactOfSdrPage::GetViewContact(sal_uInt32 nIndex)

The list in the comment #516 to #520 misses the case 8: return const_cast<ViewContactOfPageHierarchy&>(maViewContactOfPageHierarchy);

Armin: Is there any reason not to simply reset the value to 11?
Comment 5 Regina Henschel 2024-02-09 14:12:36 UTC
Patch is in https://gerrit.libreoffice.org/c/core/+/163192
Comment 6 Commit Notification 2024-02-10 14:33:33 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/56517d8a38459f5a9e67327c1ac0dc8bcd07bcb8

tdf#156993 use correct count for ViewContactOfSdrPage

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 7 Regina Henschel 2024-02-10 15:05:18 UTC
Armin mentions a change in the switch statement. But that is independent from to the actual error reported here. In case that change is wanted, it can be done in a separate commit. Therefore I set this issue here to "fixed".
Comment 8 Commit Notification 2024-02-12 10:49:25 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

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

tdf#156993 use correct count for ViewContactOfSdrPage

It will be available in 24.2.2.

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 Regina Henschel 2024-02-18 13:34:14 UTC
*** Bug 159761 has been marked as a duplicate of this bug. ***
Comment 10 Stéphane Guillou (stragu) 2024-02-19 04:56:27 UTC
Thanks Regina! Verified in:

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 5a4ab8cb3a3fbf15de11afc5d8876aaa8a7784c9
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 11 Commit Notification 2024-02-22 20:22:52 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "libreoffice-24-2-1":

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

tdf#156993 use correct count for ViewContactOfSdrPage

It will be available in 24.2.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 12 Regina Henschel 2024-02-24 23:45:39 UTC
*** Bug 159873 has been marked as a duplicate of this bug. ***
Comment 13 Stéphane Guillou (stragu) 2024-02-28 14:08:08 UTC
*** Bug 159859 has been marked as a duplicate of this bug. ***
Comment 14 Piotr Osada 2024-02-29 17:42:52 UTC
(In reply to Regina Henschel from comment #12)
> *** Bug 159873 has been marked as a duplicate of this bug. ***

Now vertical and horizontal gude-lines are visible, but cross guides don't. I can see the same result when dragging from top-left corner as in this attachment:

attachment 192751 [details]
Example of action to use snapguides but not displayed.gif

Version: 24.2.1.2 (X86_64) / LibreOffice Community
Build ID: db4def46b0453cc22e2d0305797cf981b68ef5ac
CPU threads: 8; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: threaded
Comment 15 Regina Henschel 2024-02-29 18:09:37 UTC
(In reply to Piotr Osada from comment #14)
> (In reply to Regina Henschel from comment #12)
> > *** Bug 159873 has been marked as a duplicate of this bug. ***
> 
> Now vertical and horizontal gude-lines are visible, but cross guides don't.

What do you mean by "cross guides"?

> I can see the same result when dragging from top-left corner as in this
> attachment:
> 
> attachment 192751 [details]
> Example of action to use snapguides but not displayed.gif
> 

Dragging from top-left corner does not insert snap guides but moves the origin of the coordinate system. The dashed lines are only temporary lines to help you by positioning the origin. Something like "axis lines through the origin" has never exist.