https://issues.apache.org/ooo/show_bug.cgi?id=124372

--- Comment #7 from Andre <[email protected]> ---
The code in nbdtmg.cxx is even worse than I thought:

- The classes BulletsTypeMgr, GraphyicBulletsTypeMgr, MixBulletsTypeMgr,
NumberingTypeMgr and OutlineTypeMgr are created via static GetInstance()
factory methods but their contstructors (including copy constructors) are all
public.

- The GetInstance() methods are accessed via the NBOutlineTypeMgrFact factory
(which is the first class that I see, that does not need a virtual destructor
but still has one).  All implementing classes are publicly visible not just the
base class ("interface") NBOTypeMgrBase.

- Some of the classes have static members, although they are essentially
singletons and static themselves.

- SwTextShell::ExecSetNumber calls NBOTypeMgrBase::SetItems(const SfxItemSet*)
with a pointer to a local SfxItemSet object.  This pointer is stored in the
called (static!) NBOTypeMgrBase object until another call to SetItems().  It is
only luck  that that pointer is only accessed by functions called inside
SetItems.  This is desaster waiting to happen.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
You are watching all bug changes.

Reply via email to