[REVIEW 3-5] fdo#49342 crash in cell merge of "old-school" tables

classic Classic list List threaded Threaded
2 messages Options
Caolán McNamara Caolán McNamara
Reply | Threaded
Open this post in threaded view
|

[REVIEW 3-5] fdo#49342 crash in cell merge of "old-school" tables

This is a revert of 858b5b4f36a357fe7192e7c2ed9cc3cdfc81fd8f and some
related follow up fixes to convert SwSelBoxes to a std::map from a
SV_DECL_PTRARR_SORT

The std::map uses SwTableBox::GetSttIdx as a key, which looked like a
good idea, but digging into fdo#49342 there are a number of scenarios
where content gets added to the document after the Boxes are shoved into
a SwSelBoxes but before the SwSelBox is used. Which means the nodes get
moved so their GetSttIdx returns a different value, but the std::map's
key is a stale copy of the GetSttIdx, so it can't find them by their new
keys. Onwards to epic fails :-(

Suggest the attached revert for 3-5, which I'll try and massage into
master as well. A sorted std::vector looks like the best fit. rather
than a std::map, to keep the current tangled logic working post stl
conversion.

C.

this might be the reason behind the other rtf table crash mentioned
earlier, I've yet to dig out the bug no for that to re-test.

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

0001-Revert-conversion-to-std-map.patch (116K) Download Attachment
Michael Stahl-2 Michael Stahl-2
Reply | Threaded
Open this post in threaded view
|

[PUSHED][3-5] Re: [REVIEW 3-5] fdo#49342 crash in cell merge of "old-school" tables

On 04/05/12 21:14, Caolán McNamara wrote:

> This is a revert of 858b5b4f36a357fe7192e7c2ed9cc3cdfc81fd8f and some
> related follow up fixes to convert SwSelBoxes to a std::map from a
> SV_DECL_PTRARR_SORT
>
> The std::map uses SwTableBox::GetSttIdx as a key, which looked like a
> good idea, but digging into fdo#49342 there are a number of scenarios
> where content gets added to the document after the Boxes are shoved into
> a SwSelBoxes but before the SwSelBox is used. Which means the nodes get
> moved so their GetSttIdx returns a different value, but the std::map's
> key is a stale copy of the GetSttIdx, so it can't find them by their new
> keys. Onwards to epic fails :-(
>
> Suggest the attached revert for 3-5, which I'll try and massage into
> master as well. A sorted std::vector looks like the best fit. rather
> than a std::map, to keep the current tangled logic working post stl
> conversion.

sounds reasonable, fixes the crash, pushed to libreoffice-3-5.

> C.
>
> this might be the reason behind the other rtf table crash mentioned
> earlier, I've yet to dig out the bug no for that to re-test.

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice