Bug 120283 - connector view changes when duplicating slide
Summary: connector view changes when duplicating slide
Status: ASSIGNED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
4.4.0.3 release
Hardware: All All
: medium normal
Assignee: Dave Gilbert
URL:
Whiteboard: target:7.6.0
Keywords:
Depends on:
Blocks: Connectors
  Show dependency treegraph
 
Reported: 2018-10-03 11:56 UTC by Dr. David Alan Gilbert
Modified: 2023-05-23 13:05 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Slide deck showing problem (44.20 KB, application/vnd.oasis.opendocument.presentation)
2018-10-03 11:57 UTC, Dr. David Alan Gilbert
Details
screen capture of correct original rendering (17.89 KB, image/png)
2018-10-03 12:01 UTC, Dr. David Alan Gilbert
Details
screen capture of bad copy (16.29 KB, image/png)
2018-10-03 12:01 UTC, Dr. David Alan Gilbert
Details
More minimal document (18.97 KB, application/vnd.oasis.opendocument.presentation)
2023-01-22 16:06 UTC, Dave Gilbert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dr. David Alan Gilbert 2018-10-03 11:56:20 UTC
Description:
See attached; slide 2 was created by clicking on the slide in the slide list on the left and using 'duplicate slide' - note that the arrow from 'RAMList' to the first RAMBlock is different in the duplicate

Steps to Reproduce:
1. Open attached slide set
2. Click on the 1st slide in the 'slides' list at the left
3. Right click and select 'duplicate slide'

Actual Results:
The arrow from RAMList->RAMBlock is different from the original in slide 1 (and is what is seen in slide 2)

Expected Results:
An exact duplicate


Reproducible: Always


User Profile Reset: No



Additional Info:
Fedora 29:
libreoffice-impress-6.1.1.2-1.fc29.x86_64
Comment 1 Dr. David Alan Gilbert 2018-10-03 11:57:29 UTC
Created attachment 145346 [details]
Slide deck showing problem
Comment 2 Dr. David Alan Gilbert 2018-10-03 12:01:30 UTC
Created attachment 145347 [details]
screen capture of correct original rendering
Comment 3 Dr. David Alan Gilbert 2018-10-03 12:01:48 UTC
Created attachment 145348 [details]
screen capture of bad copy
Comment 4 raal 2018-10-03 16:40:14 UTC
repro Version: 4.4.0.0.alpha0+
Build ID: dea4a3b9d7182700abeb4dc756a24a9e8dea8474 and LO 6.2, win7
Comment 5 QA Administrators 2021-01-09 03:50:17 UTC Comment hidden (obsolete)
Comment 6 QA Administrators 2023-01-10 03:18:00 UTC Comment hidden (obsolete)
Comment 7 Dr. David Alan Gilbert 2023-01-10 12:07:25 UTC
Still present in 7.4.3.2 (on Fedora 37)
Comment 8 Dave Gilbert 2023-01-15 18:44:36 UTC
Diffing the content.xml:

18,20c18,20
<     <style:font-face style:name="Times New Roman" svg:font-family="'Times New Roman'" style:font-family-generic="swiss" style:font-pitch="variable"/>
<     <style:font-face style:name="Times New Roman1" svg:font-family="'Times New Roman'" style:font-family-generic="roman" style:font-pitch="variable"/>
<     <style:font-face style:name="Times New Roman2" svg:font-family="'Times New Roman'" style:font-pitch="variable"/>
---
>     <style:font-face style:name="Times New Roman" svg:font-family="'Times New Roman'" style:font-family-generic="roman" style:font-pitch="variable"/>
>     <style:font-face style:name="Times New Roman1" svg:font-family="'Times New Roman'" style:font-pitch="variable"/>
>     <style:font-face style:name="Times New Roman2" svg:font-family="'Times New Roman'" style:font-family-generic="swiss" style:font-pitch="variable"/>
27c27
<       <style:drawing-page-properties presentation:display-header="true" presentation:display-footer="true" presentation:display-page-number="false" presentation:display-date-time="true"/>
---
>       <style:drawing-page-properties presentation:background-visible="true" presentation:background-objects-visible="true" presentation:display-footer="true" presentation:display-page-number="false" presentation:display-date-time="true"/>
66c66
<       <style:graphic-properties draw:stroke="none" svg:stroke-color="#000000" draw:fill="none" draw:fill-color="#ffffff" draw:auto-grow-height="true" draw:auto-grow-width="false" fo:max-height="0cm" fo:min-height="0.64cm"/>
---
>       <style:graphic-properties draw:stroke="none" svg:stroke-color="#000000" draw:fill="none" draw:fill-color="#ffffff" draw:auto-grow-height="true" draw:auto-grow-width="false" fo:max-height="0cm" fo:min-height="0.865cm"/>
70c70
<       <style:graphic-properties draw:stroke="none" svg:stroke-color="#000000" draw:fill="none" draw:fill-color="#ffffff" draw:auto-grow-height="true" draw:auto-grow-width="false" fo:max-height="0cm" fo:min-height="1.279cm"/>
---
>       <style:graphic-properties draw:stroke="none" svg:stroke-color="#000000" draw:fill="none" draw:fill-color="#ffffff" draw:auto-grow-height="true" draw:auto-grow-width="false" fo:max-height="0cm" fo:min-height="1.729cm"/>
92a93
>       <style:paragraph-properties style:writing-mode="lr-tb"/>
96c97,98
<       <style:paragraph-properties fo:text-align="center"/>
---
>       <style:paragraph-properties fo:text-align="center" style:writing-mode="lr-tb"/>
>       <style:text-properties fo:color="#000000" loext:opacity="100%"/>
100c102
<       <style:paragraph-properties fo:text-align="center"/>
---
>       <style:paragraph-properties fo:text-align="center" style:writing-mode="lr-tb"/>
104c106
<       <style:paragraph-properties fo:text-align="center"/>
---
>       <style:paragraph-properties fo:text-align="center" style:writing-mode="lr-tb"/>
112c114
<       <style:paragraph-properties fo:text-align="start"/>
---
>       <style:paragraph-properties fo:text-align="start" style:writing-mode="lr-tb"/>
125c127
<       <style:paragraph-properties fo:text-align="center"/>
---
>       <style:paragraph-properties fo:text-align="center" style:writing-mode="lr-tb"/>
130c132
<       <style:paragraph-properties fo:text-align="center"/>
---
>       <style:paragraph-properties fo:text-align="center" style:writing-mode="lr-tb"/>
134a137
>       <style:paragraph-properties style:writing-mode="lr-tb"/>
139c142
<       <style:paragraph-properties fo:text-align="center"/>
---
>       <style:paragraph-properties fo:text-align="center" style:writing-mode="lr-tb"/>
143a147
>       <style:paragraph-properties style:writing-mode="lr-tb"/>
306c310
<         <draw:connector draw:style-name="gr6" draw:text-style-name="P8" draw:layer="layout" draw:type="curve" svg:x1="14.829cm" svg:y1="2.381cm" svg:x2="16.086cm" svg:y2="3.766cm" draw:start-shape="id3" draw:start-glue-point="2" draw:end-shape="id2" draw:end-glue-point="0" svg:d="M14829 2381c0 1039 1257 347 1257 1385" svg:viewBox="0 0 1258 1386">
---
>         <draw:connector draw:style-name="gr6" draw:text-style-name="P8" draw:layer="layout" draw:type="curve" svg:x1="14.829cm" svg:y1="2.381cm" svg:x2="16.086cm" svg:y2="3.766cm" draw:start-shape="id3" draw:start-glue-point="2" svg:d="M14829 2381c0 1414 1257 722 1257 1385" svg:viewBox="0 0 1258 1386">
309c313
<         <draw:connector draw:style-name="gr6" draw:text-style-name="P8" draw:layer="layout" draw:type="curve" svg:x1="16.086cm" svg:y1="4.802cm" svg:x2="16.086cm" svg:y2="5.899cm" draw:start-shape="id2" draw:start-glue-point="2" draw:end-shape="id1" svg:d="M16086 4802v1097" svg:viewBox="0 0 1 1098">
---
>         <draw:connector draw:style-name="gr6" draw:text-style-name="P8" draw:layer="layout" draw:type="curve" svg:x1="16.086cm" svg:y1="4.802cm" svg:x2="16.086cm" svg:y2="5.899cm" svg:d="M16086 4802v1097" svg:viewBox="0 0 1 1098">
318c322
<         <draw:connector draw:style-name="gr8" draw:text-style-name="P8" draw:layer="layout" draw:type="line" svg:x1="13.537cm" svg:y1="6.406cm" svg:x2="14.476cm" svg:y2="6.417cm" draw:start-shape="id4" draw:start-glue-point="1" draw:end-shape="id1" draw:end-glue-point="3" svg:d="M13537 6406l939 11" svg:viewBox="0 0 940 12">
---
>         <draw:connector draw:style-name="gr8" draw:text-style-name="P8" draw:layer="layout" draw:type="line" svg:x1="13.537cm" svg:y1="6.406cm" svg:x2="14.476cm" svg:y2="6.417cm" draw:start-shape="id4" draw:start-glue-point="1" svg:d="M13537 6406l939 11" svg:viewBox="0 0 940 12">
404c408
<         <draw:connector draw:style-name="gr6" draw:text-style-name="P8" draw:layer="layout" draw:type="lines" svg:x1="10.553cm" svg:y1="11.716cm" svg:x2="12.144cm" svg:y2="11.716cm" draw:start-shape="id9" draw:start-glue-point="1" draw:end-shape="id7" draw:end-glue-point="3" svg:d="M10553 11716h501 589 501" svg:viewBox="0 0 1592 1">
---
>         <draw:connector draw:style-name="gr6" draw:text-style-name="P8" draw:layer="layout" draw:type="lines" svg:x1="10.553cm" svg:y1="11.716cm" svg:x2="12.144cm" svg:y2="11.716cm" draw:start-shape="id9" draw:start-glue-point="1" draw:end-shape="id7" draw:end-glue-point="3" svg:d="M10553 11716h501 573 517" svg:viewBox="0 0 1592 1">
407a412
>           <office:forms form:automatic-focus="false" form:apply-design-mode="false"/>



A couple of those connector diffs have different svg entries; the first one is:

    svg:d="M14829 2381c0 1039 1257 347 1257 1385"
vs  svg:d="M14829 2381c0 1414 1257 722 1257 1385"
(offset of 375)

the last one has:
    svg:d="M10553 11716h501 589 501"
vs  svg:d="M10553 11716h501 573 517"
Comment 9 Dave Gilbert 2023-01-22 16:06:28 UTC
Created attachment 184833 [details]
More minimal document

There's something group related going on.

The bottom box is actually a member of a group; and in the minimal version the only member.
Hit 'ungrup' and the problem goes away.
Comment 10 Dave Gilbert 2023-05-19 00:45:41 UTC
I'm chasing this backwards from the XML output, the points come from 

SdrEdgeObj::ImpCalcEdgeTrack

and it's called very differently in the good and bad cases; I'll follow it back to see why.

In the good case we see (with a bunch of debug):

SdrEdgeObj::ImpCalcEdgeTrack entry: 0x2637f20 eKind: 3 Angles:27000 / 9000 Points:14829,2381 / 16086,3766 BoundRects: 2758x921@(13450,1462) / 3223x1039@(14475,3765) BewareRects: 3758x1921@(12950,962) / 4223x2039@(13975,3265)
  bezier>2 case(Z / 4) Pts: 14829,2381 / 14829,3074 / 16086,3074 / 16086,3766 d1: 0 / 693 d2: 0 / -692

in the bad case it tries a whole bunch of different configurations, 5 point, 4 point Z, 3 point and finally a 4 point U; in all cases the bound and beware rects fro the destination is screwy compared to the original:
SdrEdgeObj::ImpCalcEdgeTrack entry: 0x42daf20 eKind: 3 Angles:27000 / 0 Points:14829,2381 / 16086,3766 BoundRects: 2758x921@(13450,1462) / 1x1@(16086,3766) BewareRects: 3758x1921@(12950,962) / 1x1@(16086,3766)
  bezier>2 case(? / 5) Pts: 14829,2381 / 14829,3324 / 16086,3766 / 16086,3766 d1: 0 / 943 d2: 0 / 0
SdrEdgeObj::ImpCalcEdgeTrack entry: 0x42daf20 eKind: 3 Angles:27000 / 9000 Points:14829,2381 / 16086,3766 BoundRects: 2758x921@(13450,1462) / 1x1@(16086,3766) BewareRects: 3758x1921@(12950,962) / 1x1@(16086,3766)
  bezier>2 case(Z / 4) Pts: 14829,2381 / 14829,3324 / 16086,3324 / 16086,3766 d1: 0 / 943 d2: 0 / -442
SdrEdgeObj::ImpCalcEdgeTrack entry: 0x42daf20 eKind: 3 Angles:27000 / 18000 Points:14829,2381 / 16086,3766 BoundRects: 2758x921@(13450,1462) / 1x1@(16086,3766) BewareRects: 3758x1921@(12950,962) / 1x1@(16086,3766)
  bezier>2 case(L / 3) Pts: 14829,2381 / 14829,3766 / 14829,3766 / 16086,3766 d1: 0 / 1385 d2: -1257 / 0
SdrEdgeObj::ImpCalcEdgeTrack entry: 0x42daf20 eKind: 3 Angles:27000 / 27000 Points:14829,2381 / 16086,3766 BoundRects: 2758x921@(13450,1462) / 1x1@(16086,3766) BewareRects: 3758x1921@(12950,962) / 1x1@(16086,3766)
  bezier>2 case(U / 4) Pts: 14829,2381 / 14829,3766 / 16086,3766 / 16086,3766 d1: 0 / 1385 d2: 0 / 0

I'll chase that back.
Comment 11 Dave Gilbert 2023-05-20 13:46:43 UTC
In the good case, the outer 
XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const XPolygon& rTrack0, SdrObjConnection& rCon1, SdrObjConnection& rCon2, SdrEdgeInfoRec* pInfo) const
(~727 of svdoedge.cxx)
gets called with a valid rCon2:

 rCon2: my SdrPage: 0x1a21af0 rCon2/Page: 0x1a21af0

but in the bad case the rCon2.pObj is NULL.
Comment 12 Dave Gilbert 2023-05-20 23:16:11 UTC
curiously copy-paste works for this case; a bit of digging shows it uses a different path using CloneList::CopyConnections
Comment 13 Commit Notification 2023-05-23 13:05:58 UTC
Dr. David Alan Gilbert committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/26b0870f4e16a8ce53129045d6feea4f8139487f

tdf#120283 CopyObjects: Use CloneList to wire up connectors

It will be available in 7.6.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.