diff options
author | Attila Bakos (NISZ) <bakos.attilakaroly@nisz.hu> | 2021-11-03 15:39:32 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2021-11-24 11:51:07 +0100 |
commit | eabcfb3f18a6944d9ad89cecd3eb3ca7a2259cf3 (patch) | |
tree | d1c66ab6056a467e3fc07bdbf6f07e179cb9e678 /sw/source/core/doc/docfly.cxx | |
parent | becd76743fd7a3ae84404f26b1afb60b923cabb2 (diff) |
tdf#129183 sw: textboxes in group shapes - part 3
Grouping/ungrouping nested groups works now.
Manual test:
1. Insert Shape.
2. Right-click on selected shape, Add Text Box (and some text).
3. Insert a new shape.
4. Select and group the two shapes.
3. Insert a third shape.
4. Select and group the shape and the previously grouped shapes.
The text box remains in the nested shape group.
Details:
1) tdf#144271 memory leak of SwTextBoxHelper, by replacing the
textbox structure vector with std::unordered map, and rethinking
of the ownership of the objects. If a SwFrameFormat dies, and that
is a FLYFRMFMT, it will be deleted from the textbox node and the
FrameFormat table in the doc too, and the drawing will be stay as
it was before. If the dying format is a drawing, all the textboxes,
and the node will be deleted.
2) Introducing the new UNO property TextBoxContent, which is needed
for writerfilter/xmloff later to set a new textbox for the shape
via UNO.
3) Missing parameters are present now for syncing the textbox
parameters.
4) Introducing a new function namely the handleGroupTextBox() to
do the tasks simply with all textboxes in a group shape.
This can handle nested groups as well (group in a group).
Known issues: now copy of nested group objects is implemented
but not enabled, because it causes an assert.
Change-Id: I931886eda01c7a3db93098de10f5e5f48f2f217b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124657
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/core/doc/docfly.cxx')
-rw-r--r-- | sw/source/core/doc/docfly.cxx | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index 6b73f1f756b5..16365ebbbfec 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -577,8 +577,6 @@ bool SwDoc::SetFlyFrameAttr( SwFrameFormat& rFlyFormat, SfxItemSet& rSet ) getIDocumentState().SetModified(); - //SwTextBoxHelper::syncFlyFrameAttr(rFlyFormat, rSet); - return bRet; } @@ -920,12 +918,9 @@ bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, pNd->InsertItem( aFormat, aPos.nContent.GetIndex(), 0 ); // Has a textbox attached to the format? Sync it as well! - if (SwTextBoxHelper::getOtherTextBoxFormat(pContact->GetFormat(), - RES_DRAWFRMFMT)) - { - SwTextBoxHelper::syncFlyFrameAttr(*pContact->GetFormat(), - pContact->GetFormat()->GetAttrSet(), pObj); - } + SwTextBoxHelper::syncFlyFrameAttr(*pContact->GetFormat(), + pContact->GetFormat()->GetAttrSet(), pObj); + } break; default: |