Issue 80282 - assertion: Can't get core metric without shell!
Summary: assertion: Can't get core metric without shell!
Status: ACCEPTED
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: 680m222
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-02 09:31 UTC by groucho266
Modified: 2013-08-07 15:31 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description groucho266 2007-08-02 09:31:57 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.
Comment 1 carsten.driesner 2007-08-09 10:58:04 UTC
cd: Accepted.
Comment 2 carsten.driesner 2008-01-09 16:05:59 UTC
cd: Changed target, no more time to fix this issue.
Comment 3 Mathias_Bauer 2008-05-19 10:53:34 UTC
3.1
Comment 4 carsten.driesner 2009-01-27 13:38:06 UTC
We are short before code freeze for OOo 3.1. Must be shifted to 3.x.