Apache OpenOffice (AOO) Bugzilla – Issue 80282
assertion: Can't get core metric without shell!
Last modified: 2013-08-07 15:31:14 UTC
The assertion "Can't get core metric without shell!" is triggered in sfx2/source/control/unoctitm.cxx, line 1009, when I am leaving the Impress presentation. At the moment I can reproduce this only on the CWS presenterview. However, I have seen this before and the cause for this assertion being triggered looks like it can occur in other contexts as well. What happens is this: The SfxStateCache for a slot (in this case slot 12008, SID_ATTR_METRIC) is invalidated, by calling its Invalidate() method. This leads to calling aSlotServ.SetSlot(0) which resets the SfxSlot pointer of the SfxSlotServer member but not its _nShellLevel. When then eventually SfxDispatchController_Impl::StateChanged() is called with the SfxSlotServer of the above SfxStateCache, the _nShellLevel member of the former is used to determine the shell from which to get the item pool. The slot server is still invalidated, i.e. its _pSlot member is still NULL, but nevertheless the _nShellLevel is used to retrieve a shell from the stack. This fails (probably because the shell stack has been modified since the slot server was last initialized) and an empty SfxShell pointer leads to the assertion being triggered. Two possible solutions come to mind: 1. When an SfxSlotServer object is invalidated, either by calling its Invalidate() method or be explicitly calling SetSlot(NULL), reset the _nShellLevel to 0. This value does not point to the right shell but with high probability will point to shell at all. 2. In SfxDispatchController_Impl::StateChanged() check the slot server state before its GetShellLevel() method is called. Maybe an invalidated SfxSlotServer can be revalidated before being accessed.
cd: Accepted.
cd: Changed target, no more time to fix this issue.
3.1
We are short before code freeze for OOo 3.1. Must be shifted to 3.x.