summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/docfly.cxx
diff options
context:
space:
mode:
authorAttila Bakos (NISZ) <bakos.attilakaroly@nisz.hu>2022-06-20 17:27:53 +0200
committerLászló Németh <nemeth@numbertext.org>2022-07-11 14:09:09 +0200
commit1d3d2a995239c3c71432006cb795324c56a0412a (patch)
treea1cecb5baee2224dcac86f0c46476b92dea99749 /sw/source/core/doc/docfly.cxx
parentf8a84ef8f085251d545597a83d71b5b5b2f547d6 (diff)
tdf#148687 tdf#149173 tdf#149546 sw: fix crash with textboxes
Regression from 2110597ac730fa07dbbdd603fda82b182ed27c9e "tdf#147485 sw: fix group shape crash using std::shared_ptr". Details: 1) Using reference instead of copy assignment in SwTextBoxHelper. 2) Cleanup: Unused parts of SwTextBoxHelper were removed. 3) Fixing destruction of textboxes, in case when first the shape is removed, with clearing all textboxes from the doc and the shape before the pointer is released. All of this only have to be done if the call is not coming from the swdoc dtor, unless there will be double freeing. 4) Missing style conversion was fixed in writerfilter. 5) Don't import sections in textboxes, unless the hack of dummy paragraph before tables in sections will be applied and the paragraph with anchored objects inside will be removed with the objects; 6) ConvertTextRangeToTextFrame also fixed, so embed frames in frames are imported from now. (Also textboxes in frames, this can be useful when there is a floating table having group textbox with nested complex content inside, or floating table in floating table, etc...) Note: Follow up commit will enable group textbox import in frames and tables. 7) Import of group textboxes with complex content in header/footer was impossible, from now this is also supported both from DOCX and ODT (test included). 8) Guard class for blocking unwanted recursive textbox sync has been introduced, and maybe some speedup with group textbox import has been achieved. 9) The anchor sync method got a new function which avoids unnecessary sync when the anchor is the same. 10) Sync of As_char textboxes during layout calculation caused crash so that has a workaround from now, for DOCX import anchor change and Undo. That syncs starts before the layout calculation so sync not needed later. 11) A memory leak was found in Undo, which has been fixed. Note: layout test "testTdf147485Forcepoint" has to be limited to Windows and Mac builds, because font substitution causes crash on the Unix based systems. Change-Id: I69d5d79cc120e3a70ba9285be32ec36a434b2a04 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136192 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.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index 985cf6bbd9fd..41756ff0cd1d 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -916,11 +916,10 @@ 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))
+ if (pContact->GetFormat() && pContact->GetFormat()->GetOtherTextBoxFormats())
{
- SwTextBoxHelper::syncFlyFrameAttr(*pContact->GetFormat(),
- pContact->GetFormat()->GetAttrSet(), pObj);
+ SwTextBoxHelper::synchronizeGroupTextBoxProperty(
+ SwTextBoxHelper::changeAnchor, pContact->GetFormat(), pObj);
}
}
break;