diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2016-12-24 03:02:26 +0100 |
---|---|---|
committer | Björn Michaelsen <bjoern.michaelsen@canonical.com> | 2016-12-24 12:09:18 +0000 |
commit | 4280607328c1c46b566719212ae3f802d511493b (patch) | |
tree | c0352b55c2d64bcf62a3318a713ffcaa4b7b1e38 /sw/inc/frmfmt.hxx | |
parent | 09a0a1d760c9786c0cfb0911244892538838a284 (diff) |
kill FindContactObject and adapt FindSdrObject
- the latter is cheating for now, the FrameFormat should really actively bookkeep
those
Change-Id: Icf64256ba5277dc4d1ec9ac8858bdc014b3f95f5
Reviewed-on: https://gerrit.libreoffice.org/32392
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Diffstat (limited to 'sw/inc/frmfmt.hxx')
-rw-r--r-- | sw/inc/frmfmt.hxx | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx index f1ebc09e8c2c..fafa003e423f 100644 --- a/sw/inc/frmfmt.hxx +++ b/sw/inc/frmfmt.hxx @@ -33,7 +33,19 @@ class IMapObject; class SwRect; class SwContact; class SdrObject; -namespace sw { class DocumentLayoutManager; } +namespace sw +{ + class DocumentLayoutManager; + // This is cheating: we are not really decoupling much with this hint. + // SwDrawFrameFormat should probably bookkeep its SdrObject (and + // SwDrawFrameFormat too) as members + struct SW_DLLPUBLIC FindSdrObjectHint final : SfxHint + { + SdrObject** m_ppObject; + FindSdrObjectHint(SdrObject** ppObject) : m_ppObject(ppObject) {}; + virtual ~FindSdrObjectHint() override; + }; +} class SwFrameFormats; /// Style of a layout element. @@ -106,17 +118,16 @@ public: SwRect FindLayoutRect( const bool bPrtArea = false, const Point* pPoint = nullptr ) const; - /** Searches SdrObject. SdrObjUserCall is client of the format. - The UserCall knows its SdrObject. */ - SwContact *FindContactObj(); - const SwContact *FindContactObj() const - { return const_cast<SwFrameFormat*>(this)->FindContactObj(); } - /** @return the SdrObject, that is connected to the ContactObject. Only DrawFrameFormats are connected to the "real SdrObject". FlyFrameFormats are connected to a Master and all FlyFrames has the "real SdrObject". "Real SdrObject" has position and a Z-order. */ - SdrObject *FindSdrObject(); + SdrObject* FindSdrObject() + { + SdrObject* pObject(nullptr); + CallSwClientNotify(sw::FindSdrObjectHint(&pObject)); + return pObject; + } const SdrObject *FindSdrObject() const { return const_cast<SwFrameFormat*>(this)->FindSdrObject(); } |