Bug 82191 - Copy of a shape with enabled textbox refers to the same textbox
Summary: Copy of a shape with enabled textbox refers to the same textbox
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
4.4.0.0.alpha0+ Master
Hardware: Other All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:4.4.0
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-05 13:13 UTC by László Németh
Modified: 2014-10-06 08:18 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
shapes with textboxes (11.04 KB, application/vnd.oasis.opendocument.text)
2014-08-05 13:13 UTC, László Németh
Details
(not so empty) shapes with the same textbox (10.94 KB, image/png)
2014-08-05 13:27 UTC, László Németh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description László Németh 2014-08-05 13:13:47 UTC
Created attachment 104069 [details]
shapes with textboxes

Try to copy one of the shapes of the attached test file. The inner textboxes of the old and the new shapes will miss apparently, but they refers to the same textbox: pressing the Send to Back button of the Drawing Objects Properties toolbar will show the old textbox in the new copy. (The new shape has a larger z-index, than the old textshape, that is copied by reference instead of creating a new textshape.) Moving the old shape will show also the same textbox, sometimes in the vertical or horizontal positions of the new shape, too (see the attached screenshot).

Workaround: saving and loading the document  will really double the textbox in the incomplete copies of the complex shapes.
Comment 1 László Németh 2014-08-05 13:27:18 UTC
Created attachment 104070 [details]
(not so empty) shapes with the same textbox
Comment 2 Miklos Vajna 2014-08-15 13:14:42 UTC
Hm yes, either sw::DocumentLayoutManager::CopyLayoutFmt() directly, or the caller SwFEShell::Copy() / SwFEShell::Paste() methods have to make sure that the textbox content is not copied by reference, but by value. I'll look into this.
Comment 3 Commit Notification 2014-08-15 14:50:36 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

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

fdo#82191 sw::DocumentLayoutManager: copy textbox content of draw formats



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 4 Miklos Vajna 2014-08-15 14:53:30 UTC
4.3 doesn't have the TextBox feature, so no backport.
Comment 5 László Németh 2014-10-06 08:18:23 UTC
@Miklós, it works now, thanks for the quick fix!