summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@libreoffice.org>2018-11-18 15:27:04 +0100
committerBjörn Michaelsen <bjoern.michaelsen@libreoffice.org>2018-11-19 22:45:08 +0100
commitb14d30f8bff4315fb7ce83a00026e3fa6fb83acf (patch)
tree37f83d69b1b7249440d72077bccc9145fcc3bbca /sw
parent295059082e46718526ab0cc296416447128ceb8c (diff)
no more SwClient/SwModify for SwTextTableRows
Change-Id: I267904c751c9b32b9b64b0cf1b7f9d922bc7e1f7 Reviewed-on: https://gerrit.libreoffice.org/63529 Tested-by: Jenkins Reviewed-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/unotbl.hxx23
-rw-r--r--sw/source/core/unocore/unotbl.cxx24
2 files changed, 22 insertions, 25 deletions
diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx
index 59a762a6f4f4..d96a969f333e 100644
--- a/sw/inc/unotbl.hxx
+++ b/sw/inc/unotbl.hxx
@@ -148,22 +148,17 @@ public:
css::uno::Any GetAny() const;
};
-class SwXTextTableRow final : public cppu::WeakImplHelper
-<
- css::beans::XPropertySet,
- css::lang::XServiceInfo
->,
- public SwClient
+class SwXTextTableRow final
+ : public cppu::WeakImplHelper<css::beans::XPropertySet, css::lang::XServiceInfo>
+ , public SvtListener
{
- const SfxItemPropertySet* m_pPropSet;
- SwTableLine* pLine;
+ SwFrameFormat* m_pFormat;
+ SwTableLine* pLine;
+ const SfxItemPropertySet* m_pPropSet;
- SwFrameFormat* GetFrameFormat() { return static_cast<SwFrameFormat*>(GetRegisteredIn()); }
- const SwFrameFormat* GetFrameFormat() const { return const_cast<SwXTextTableRow*>(this)->GetFrameFormat(); }
+ SwFrameFormat* GetFrameFormat() { return m_pFormat; }
+ const SwFrameFormat* GetFrameFormat() const { return m_pFormat; }
virtual ~SwXTextTableRow() override;
- //SwClient
- virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) override;
- virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
public:
SwXTextTableRow(SwFrameFormat* pFormat, SwTableLine* pLine);
@@ -184,6 +179,8 @@ public:
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
static SwTableLine* FindLine(SwTable* pTable, SwTableLine const * pLine);
+
+ void Notify(const SfxHint&) override;
};
typedef cppu::WeakImplHelper<
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index dd2161c24ef4..a66ee1d8631e 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -1300,10 +1300,12 @@ uno::Sequence< OUString > SwXTextTableRow::getSupportedServiceNames()
SwXTextTableRow::SwXTextTableRow(SwFrameFormat* pFormat, SwTableLine* pLn) :
- SwClient(pFormat),
- m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_TABLE_ROW)),
- pLine(pLn)
-{ }
+ m_pFormat(pFormat),
+ pLine(pLn),
+ m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_TABLE_ROW))
+{
+ StartListening(m_pFormat->GetNotifier());
+}
SwXTextTableRow::~SwXTextTableRow()
{
@@ -1452,18 +1454,16 @@ void SwXTextTableRow::addVetoableChangeListener(const OUString& /*rPropertyName*
void SwXTextTableRow::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/)
{ throw uno::RuntimeException("not implemented", static_cast<cppu::OWeakObject*>(this)); };
-void SwXTextTableRow::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
- { ClientModify(this, pOld, pNew); }
-
-void SwXTextTableRow::SwClientNotify(const SwModify& rModify, const SfxHint& rHint)
+void SwXTextTableRow::Notify(const SfxHint& rHint)
{
- if(auto pFindHint = dynamic_cast<const FindUnoInstanceHint<SwTableLine, SwXTextTableRow>*>(&rHint))
+ if(rHint.GetId() == SfxHintId::Dying)
+ {
+ m_pFormat = nullptr;
+ } else if(auto pFindHint = dynamic_cast<const FindUnoInstanceHint<SwTableLine, SwXTextTableRow>*>(&rHint))
{
if(!pFindHint->m_pCore && pFindHint->m_pCore == pLine)
pFindHint->m_pResult = this;
}
- else
- SwClient::SwClientNotify(rModify, rHint);
}
SwTableLine* SwXTextTableRow::FindLine(SwTable* pTable, SwTableLine const * pLine)
@@ -3961,7 +3961,7 @@ uno::Any SwXTableRows::getByIndex(sal_Int32 nIndex)
throw lang::IndexOutOfBoundsException();
SwTableLine* pLine = pTable->GetTabLines()[nIndex];
FindUnoInstanceHint<SwTableLine,SwXTextTableRow> aHint{pLine};
- pFrameFormat->CallSwClientNotify(aHint);
+ pFrameFormat->GetNotifier().Broadcast(aHint);
if(!aHint.m_pResult)
aHint.m_pResult = new SwXTextTableRow(pFrameFormat, pLine);
uno::Reference<beans::XPropertySet> xRet = static_cast<beans::XPropertySet*>(aHint.m_pResult);