diff options
author | Attila Bakos (NISZ) <bakos.attilakaroly@nisz.hu> | 2022-03-30 13:05:37 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2022-04-01 08:01:57 +0200 |
commit | 2110597ac730fa07dbbdd603fda82b182ed27c9e (patch) | |
tree | 61553a1fb72d01db0c5b260fb470fbc189bffbf1 /sw/inc/ddefld.hxx | |
parent | d3e7dd4d4ddc88ba60be6ce5e90a1d1fcde47cca (diff) |
tdf#147485 sw: fix group shape crash using std::shared_ptr
for SwFrameFormat::m_pOtherTextBoxeFormats.
Before there was broken manual handling of this
member, resulting random crashes.
Details: Writer textboxes are textframe + shape
pairs. Accordingly the shape has a draw format,
the frame has a fly format. In case of group
shapes the paired structure doesn't work, because
there is one shape format and many fly formats.
To handle this there is a class (SwTextBoxNode)
which has a small frame format table inside.
This cache gives the possibility to handle
each frame shape pairs inside the group depending
on what SdrObject owns that textbox.
However there is another place where these formats
stored, namely the SpzFrameFormatTable in SwDoc.
The only problem is that, when a flyframe removed,
it has to be deleted from both tables, but if the
DelLayoutFormat() is called, that will call the
~FrameFormat(), and if the format already deleted
from the SwTextBoxNode, there will be double deleting
for the same address, which caused the crash.
To avoid this the following is present:
When fly deletion occurs, first the format is
deleted from the doc, then via the ~SwFrameFomat()
will be deleted from the TextBoxNode. If the deleted
format is a drawing, the whole node will be destructed
via the shared_ptr. Hopefully that will be fine,
without any leak.
Change-Id: I007724695bc035998cb35efeefecd308aae36e85
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132308
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/inc/ddefld.hxx')
0 files changed, 0 insertions, 0 deletions