Apache OpenOffice (AOO) Bugzilla – Issue 122111
[sidebar] Crash on working with groups or multiple selection
Last modified: 2022-10-28 12:54:23 UTC
Created attachment 80560 [details] File with 2 groups Open the attached file. The left coordinate system is a group and the right coordinate system is another group. Click on one and the other and back, copy to clipboard, click on the other, copy to clipboard. Play around this kind. Suddenly it will crash. Notice, that when you click on the coordinate system the first time, it takes several seconds until the "copy" icon is enabled, sometimes it doesn't enable at all. The side bar is open all the time at the left side, above the slide pane.
- Open attachment 80560 [details] - Menu View - Sidebar, to hide the sidebar - Select the shape on the left - Menu View - Sidebar, to show the sidebar and wait a seconds, do not change the selection - Crash
Created attachment 80561 [details] Bug doc The document has a rectangle shape and a line shape. They are not grouped. Select both shapes, and wait some seconds. Crash.
Created attachment 80562 [details] GDB backtrace The backtrace with both bug docs is the same: #0 __cxxabiv1::__dynamic_cast (src_ptr=0xffffffffffffffff, src_type=0x7f63b396eb30 <typeinfo for SfxPoolItem>, dst_type=0x7f63934cd8f0 <typeinfo for XLineWidthItem>, src2dst=0) at ../../../../libstdc++-v3/libsupc++/dyncast.cc:51 #1 0x00007f6393c3d8c2 in svx::sidebar::LinePropertyPanel::NotifyItemUpdate (this=0x2e52d38, nSID=10171, eState=16, pState=0xffffffffffffffff, bIsEnabled=true) at /build/aoo/src/playground/trunk/main/svx/source/sidebar/line/LinePropertyPanel.cxx:529 The address of pState looks indeed suspicious
Created attachment 80563 [details] Writer bug doc Document with a rectangle and a line with arrow. Select both, wait some seconds. Crash
ALG: SOunds like a dynamic_cast to that pointer, I'll have a look...
ALG: Indeed, in LinePropertyPanel::NotifyItemUpdate the param pState may be -1 (0xffffffff) when the param eState e.g equals SFX_ITEM_DONTCARE. This does not bode well when a dynamic_cast to an implemented ItemType is done; this already throws an exception since -1 *is* taken as object base address. There may be two reasons for this: - Someone needed a 'flag' value and used -1, somewhere (prob at one place) in the office this is used; - Someone *wanted* AOO to crash when someone tries to use pState when eState is SFX_ITEM_DONTCARE since this cannot be useful. Whatever it is; all cases in NotifyItemUpdate need to be safed to only dynamic_acst pState when eState is >= SFX_ITEM_DEFAULT. Doing this...
ALG: Bugdoc from comment (4) works now. Checked bugdoc from comment (1), it also gets pState ptrs with -1, so base reason is the same. Need to check other implementations of NotifyItemUpdate, too...
ALG: Added #122145#; when both group objects are selected, only PosSize panel stays open; this seems strage.
"alg" committed SVN revision 1470959 into trunk: i122111 Corrected LinePropertyPanel::NotifyItemUpdate implementation to use p...
ALG: Most problems were in LinePropertyPanel, but also reworked some stuff in Area/PosSize/GraphicPropertyPanels. Doing some more checks...
ALG: Adapted PosSizePropertyPanel to also be able to get back to original control positions for various contexts; there was a context coming in-between when selecting another draw object. The correct context comes directly after this, but that switch did not restore the original positions. Being able to do so is correct and will not hurt; nonetheless it might be good to *not* get an in-between context of (Application_DrawImpress, Context_DrawPage)...
"alg" committed SVN revision 1471364 into trunk: i122111 Adapted pState usages in NotifyItemUpdate methods; adapted control po...
ALG: Comitted, done.