Date: prev next · Thread: first prev next last
2016 Archives by date, by thread · List index


Hi,

On Sun, Jan 03, 2016 at 10:43:05AM +0100, Markus Mohrhard wrote:
In fact, wouldn’t a dynamic_cast be better, as this most specifically down
or upcasts a pointer, and returns NULL if it fails?


That depends on all the code around it. Here the code just assumes that all
returned SwModify objects are actually SwFormat objects.

This is the core of the issue:
- Practically everything in writer is a SwClient, and most is a SwModify too
- Instead of using this as the (already quite broken) Observer pattern
  implementation, a lot of (esp. layout code) code (ab-)uses the client/modify
  relation for various other relations making wild assumptions on the type of
  object behind a GetRegisteredIn() or the kind of listeners an SwModify can have
  ...

Any advise on this would be greatly appreciated, got me thoroughly
tricked...

Congratulations on finding the dark secret of writer: Everything in sw is a
SwClient and those are all connected in a mad web of intrinsic double-linked
list of effective void-pointers (as m_pLeft and m_pRight in WriterListener are
WriterListeners, pRegisteredIn in SwModify is also a WriterListener and
_everthing_ of relevance in sw a WriterListener).

Best,

Bjoern

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.