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.
Created attachment 104070 [details]
(not so empty) shapes with the same textbox
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.
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":
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:
Affected users are encouraged to test the fix and report feedback.
4.3 doesn't have the TextBox feature, so no backport.
@Miklós, it works now, thanks for the quick fix!