[Libreoffice-bugs] [Bug 135888] New: copy/paste of text boxes results in separate shape and text frame

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Tue Aug 18 17:48:40 UTC 2020


https://bugs.documentfoundation.org/show_bug.cgi?id=135888

            Bug ID: 135888
           Summary: copy/paste of text boxes results in separate shape and
                    text frame
           Product: LibreOffice
           Version: 5.3.0.3 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Keywords: regression
          Severity: normal
          Priority: medium
         Component: Writer
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: michael.stahl at cib.de
                CC: glogow at fbihome.de, vmiklos at collabora.com

in Writer, copy a shape w/ text-box and paste it, the result will be 2
unconnected objects, a shape and a text frame.

the problem is that in DocumentContentOperationsManager::CopyFlyInFlyImpl(),
the

  SwTextBoxHelper::resetLink(pFormat, aOldContent);

removes the RES_CNTNT property that isTextBox() checks to determine it's a text
box (it's also required in CopyLayoutFormat()).

   if (!pShape || pShape->Which() != nType ||
!pShape->GetAttrSet().HasItem(RES_CNTNT))
       return false;

it's only restored at the end of the function, when it's too late:

  SwTextBoxHelper::restoreLinks(aSet, aVecSwFrameFormat, aOldTextBoxes,
aOldContent);

i don't understand why we need this?

reading the git log it looks to me that this caused it:

commit 0bcc5b3daebeb2a7d2b5ba132af4745cc6c78cd0
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Fri Jul 22 17:50:52 2016 +0200

    Switch isTextBox to use the format pointers

    This replaces all possible occurences of the text box format
    maps, which just want to know, if a SwFrameFormat is part of a
    text box to use the direct lookup via the isTextBox, which is
    now a cheap call.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200818/4b635c6c/attachment.htm>


More information about the Libreoffice-bugs mailing list