Bug 96708 - Numerous errors that duplicate master when slide is copied and pasted back
Summary: Numerous errors that duplicate master when slide is copied and pasted back
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:5.2.0 target:5.1.0.2
Keywords:
Depends on:
Blocks: Master-Slide
  Show dependency treegraph
 
Reported: 2015-12-24 11:00 UTC by Mike Kaganski
Modified: 2022-10-28 12:00 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Test file: master with line color same as changed default (11.70 KB, application/vnd.oasis.opendocument.presentation)
2015-12-24 11:00 UTC, Mike Kaganski
Details
Copying and pasting back each slide duplicates its master (7.58 KB, application/vnd.oasis.opendocument.presentation)
2015-12-24 12:36 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2015-12-24 11:00:40 UTC
Created attachment 121532 [details]
Test file: master with line color same as changed default

Steps:

1. Create new Impress presentation
2. Change to slide master view, rename default master to some other name (e.g. Default1)
3. On master page, draw a line, and set its line color to something non-default (I used black)
4. Deselect everything, Format->Object and Shape -> Line... -> set line color to the same color used for line on step 3 (thus changing default)
5. Return to normal view, select slide on slide sorter, copy and paste

This will also duplicate master.
Comment 1 Mike Kaganski 2015-12-24 12:36:53 UTC
Created attachment 121534 [details]
Copying and pasting back each slide duplicates its master

There are many reasons found that fail the check in InsertBookmarkAsPage_FindDuplicateLayouts::operator():

1. If the master is selected. The comment 1 is actually this manifestation. Reason: SdPage::stringify() takes selected state into account.
2. If an object tries to adapt size to text in void SdrObjCustomShape::AdaptTextMinSize(). Slide 1 in attachment.
3. If the master hasn't layout. Reason: IMPL_LINK_NOARG_TYPED(SdDrawDocument, WorkStartupHdl, Timer *, void) is triggered by timer and creates the layout for copy in clipboard. Slide 3.
4. If an object on master has a property that is the same as the document's defalt that was changed from app default. Then clipboard doc has different defaults set, so InvalidateDefaultItems gives different results in document and clipboard for identical items.

A patch is submitted to gerrit: https://gerrit.libreoffice.org/#/c/20871/
Comment 2 Commit Notification 2016-01-05 07:20:14 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3b4059dc53ec764be5423517363223043d6dbfad

tdf#96708: don't modify document while copying to clipboard

It will be available in 5.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 3 Commit Notification 2016-01-07 10:37:37 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=30eaaad63faca5908c4c8e30e0967ee262fd7e3f&h=libreoffice-5-1

tdf#96708: don't modify document while copying to clipboard

It will be available in 5.1.0.2.

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

Affected users are encouraged to test the fix and report feedback.