summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2017-01-04 16:30:20 +0100
committerBjörn Michaelsen <bjoern.michaelsen@canonical.com>2017-01-05 15:14:32 +0000
commitff4bafa065dd36fe1cdedcc4d20971f3abbd17fb (patch)
tree293f3321669b1be4fee7a34bf13125fdf2969b9d /sw
parent951befe8705b6bbd2cceb19161705ec8fb2d2864 (diff)
use proper message passing
- checking the type of Format hopefully allows skipping contact checks Change-Id: I11690e4ec1e94b809b0ec13f2d9b4e3a22ded213 Reviewed-on: https://gerrit.libreoffice.org/32729 Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com> Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/frmfmt.hxx6
-rw-r--r--sw/source/core/draw/dcontact.cxx4
-rw-r--r--sw/source/core/unocore/unoobj2.cxx10
3 files changed, 10 insertions, 10 deletions
diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index 6c1e2daa1b90..f5e8140f971b 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -42,8 +42,8 @@ namespace sw
// SwDrawFrameFormat too) as members
struct SW_DLLPUBLIC FindSdrObjectHint final : SfxHint
{
- SdrObject** m_ppObject;
- FindSdrObjectHint(SdrObject** ppObject) : m_ppObject(ppObject) {};
+ SdrObject*& m_rpObject;
+ FindSdrObjectHint(SdrObject*& rpObject) : m_rpObject(rpObject) {};
virtual ~FindSdrObjectHint() override;
};
}
@@ -126,7 +126,7 @@ public:
SdrObject* FindSdrObject()
{
SdrObject* pObject(nullptr);
- CallSwClientNotify(sw::FindSdrObjectHint(&pObject));
+ CallSwClientNotify(sw::FindSdrObjectHint(pObject));
return pObject;
}
const SdrObject *FindSdrObject() const
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index dab09e890ec7..977841b415fd 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -408,8 +408,8 @@ void SwContact::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
// this does not call SwClient::SwClientNotify and thus doesnt handle RES_OBJECTDYING as usual. Is this intentional?
if (auto pFindSdrObjectHint = dynamic_cast<const sw::FindSdrObjectHint*>(&rHint))
{
- if(!*pFindSdrObjectHint->m_ppObject)
- *pFindSdrObjectHint->m_ppObject = GetMaster();
+ if(!pFindSdrObjectHint->m_rpObject)
+ pFindSdrObjectHint->m_rpObject = GetMaster();
}
else if (auto pWW8AnchorConvHint = dynamic_cast<const sw::WW8AnchorConvHint*>(&rHint))
{
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index d68923a66aec..a8cf485f2839 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -1705,12 +1705,12 @@ bool SwXParaFrameEnumerationImpl::CreateNextObject()
// the format should be valid here, otherwise the client
// would have been removed by PurgeFrameClients
// check for a shape first
- SwDrawContact* const pContact = SwIterator<SwDrawContact,SwFormat>( *pFormat ).First();
- if (pContact)
+ if(pFormat->Which() == RES_DRAWFRMFMT)
{
- SdrObject* const pSdr = pContact->GetMaster();
- if (pSdr)
- m_xNextObject.set(pSdr->getUnoShape(), uno::UNO_QUERY);
+ SdrObject* pObject(nullptr);
+ pFormat->CallSwClientNotify(sw::FindSdrObjectHint(pObject));
+ if(pObject)
+ m_xNextObject.set(pObject->getUnoShape(), uno::UNO_QUERY);
}
else
{