Apache OpenOffice (AOO) Bugzilla – Issue 122120
Crash when load a new arrow style in line dialog.
Last modified: 2022-10-28 12:54:34 UTC
Trunk build: r1413470 steps: 1)Create a new spreadsheet/text document 2)Click View->Toolbars->Drawing to show drawing toolbar 3)insert a new line 4)Load a new arrow style via Line dialog->arrow styles->load arrow styles. defect: AOO crash when click "ok" button of line dialog.
ALG: This also happens with versions without Sidebar -> To reproduce: - Open app (any, Draw/Impress simplest) - Open LineStyle dialog - In TabPage ArrowStyles, load some and press OK -> crash Seems to have to do with a callback when the dialog already is deleted. Taking a look...
ALG: Reason is that someone changed with r1380436 the SdrModel::SetLineEndList to always create the destructor for the current list. Despite that there are (prob many) places in cui and other dialogs where something like delete pDrawModel->GetLineEndList(); is used before setting the new list -> The list is deleted twice, this crashes. This is done for all 6 lists in the SdrModel, thus I'm thinking about using shared_ptr here and building incompatible up to make this safe...
ALG: Basic changes in svx done, working up the build hierarchy...
ALG: Isolating the XPropertyList derivate constructors (to private), adding a factory to allow only instances of SharedPtrs of the XPropertyList-classes...
ALG: Pretty far in changes, but need a complete incompatible build to check. Preparing, also prepatring local update (at this occasion)...
ALG: Checked behaviour, all UI previews work as before, all XPropertyList instances are now handled as refcounted ones. It could be seen from the changed code that already many fixes in this area had happened to avoid memory leaks. This is over now. - XPropertyList no longer freely incarnatable - Only XPropertyXXXSharedPtr are allowed - All methods/members/exchanges use this now, no more unclear ownerships - Changed from List to stl::vector usage - Unified all XPropertyList derived implementations to use a single SdrModel/VirtualDevice instance for preview generation Preparing commit...
"alg" committed SVN revision 1476756 into trunk: i122120 Cleanup of XPropertyList and derivates to RefCounted instances, more ...
ALG: OKay, comitted, done. The error after load does not happen anymore.
"alg" committed SVN revision 1476949 into trunk: i122120 WaE corrections, missing definition in sd
"alg" committed SVN revision 1476958 into trunk: i122120 corected error in XPropertyList::Insert when index is equal to -1
ALG: When using this i stumbled over a recursion problem when the temp SdrModel for preview creation itself creates XPropertyList(s), so the shared model will not be freed. Looking for a solution...
ALG: Okay, works with a flag in the SdrModel. Not nice, but good enough for now. The better solution would be to create the previews without needing SdrObjects/SdrModel at all (use primitives directly). It is even possible to use SdrObjects in this case without SdrModel, but this does not correlate with the paradigm of aw080 that all SdrObjects need a SdrModel at construction time.
"alg" committed SVN revision 1477102 into trunk: i122120 Make sure helper model itself will not allocate XPropertyLists
ALG: Changed all UI preview creators to no longer need SdrModel/SdrObject at all, instead base on primitives. This avoids problems and will make the expensive ressource SdrModel obsolete for this purpose, thus being faster and less mem consuming.
"alg" committed SVN revision 1477598 into trunk: i122120 Changed all UI preview creators to no longer need SdrModel/SdrObject
ALG: Checking all ListEntry creators - sometimes entries with no preview are generated. Also seen: Pattern editor for Bitmap fill somehow works wrong...
"alg" committed SVN revision 1478365 into trunk: i122120 Ensured Append/Modify methods in LB implementations always add a UI g...
Controls 'Style' and 'Arrow' in 'Line' panel show checkerboard backgrounds. This is probably an artifact from the preview creation. The fact that these previews are bitmaps and are created on the fly is an implementation detail that should not be exposed to the user. Seen on Linux (Ubuntu 12.04 64bit).
"alg" committed SVN revision 1479829 into trunk: i122120 corrected flag for drawing checkerboards, adapted previews, added to ...
ALG: My experiments with visualizing transparency in all previews were not complete and the default was wrong; have now completed, added a switch to the user settings and corrected the default (also for the gallery). Comitted, done.