summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@libreoffice.org>2019-09-23 10:16:30 +0200
committerBjörn Michaelsen <bjoern.michaelsen@libreoffice.org>2019-09-23 15:51:25 +0200
commit9f1352381eb54d3fc822cd56060a69bd51f62a21 (patch)
tree3b654d5fadefdb8170a5f8bedb95cfb0e7ce813a
parent1d398fb983d8f8b53a78e7c47b588fc1f1e7f748 (diff)
UnoBaseClass: remove remaining leftover SwClient bits
Change-Id: Ic7bc826b2d08701eaf4914fd4d5e019fd407cfb8 Reviewed-on: https://gerrit.libreoffice.org/79390 Tested-by: Jenkins Reviewed-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org>
-rw-r--r--sw/inc/unobaseclass.hxx4
-rw-r--r--sw/source/core/inc/unoport.hxx8
-rw-r--r--sw/source/core/unocore/unoobj2.cxx19
-rw-r--r--sw/source/core/unocore/unoport.cxx17
4 files changed, 8 insertions, 40 deletions
diff --git a/sw/inc/unobaseclass.hxx b/sw/inc/unobaseclass.hxx
index 5ca6bd074873..289d5f0b7ee1 100644
--- a/sw/inc/unobaseclass.hxx
+++ b/sw/inc/unobaseclass.hxx
@@ -29,7 +29,6 @@
#include <vcl/svapp.hxx>
class SfxPoolItem;
-class SwClient;
class SwDoc;
class SwUnoTableCursor;
@@ -84,9 +83,6 @@ public:
~UnoActionRemoveContext() COVERITY_NOEXCEPT_FALSE;
};
-/// helper function for implementing SwClient::Modify
-void ClientModify(SwClient* pClient, const SfxPoolItem *pOld, const SfxPoolItem *pNew);
-
namespace sw {
template<typename T>
struct UnoImplPtrDeleter
diff --git a/sw/source/core/inc/unoport.hxx b/sw/source/core/inc/unoport.hxx
index afe00a0e81ee..5072f33c4ea7 100644
--- a/sw/source/core/inc/unoport.hxx
+++ b/sw/source/core/inc/unoport.hxx
@@ -35,9 +35,9 @@
#include <cppuhelper/implbase.hxx>
#include <svl/itemprop.hxx>
+#include <svl/listener.hxx>
#include <unocrsr.hxx>
-#include <calbck.hxx>
namespace com::sun::star::beans { struct PropertyValue; }
namespace com::sun::star::text { class XTextField; }
@@ -87,7 +87,7 @@ class SwXTextPortion : public cppu::WeakImplHelper
css::lang::XUnoTunnel,
css::lang::XServiceInfo
>,
- public SwClient
+ public SvtListener
{
private:
@@ -113,7 +113,6 @@ private:
std::unique_ptr< css::uno::Any > m_pRubyPosition;
sw::UnoCursorPointer m_pUnoCursor;
- sw::WriterMultiListener m_aDepends;
SwFrameFormat* m_pFrameFormat;
const SwTextPortionType m_ePortionType;
@@ -145,8 +144,7 @@ protected:
virtual ~SwXTextPortion() override;
- //SwClient
- virtual void SwClientNotify(const SwModify&, const SfxHint& rHint) override;
+ virtual void Notify(const SfxHint& rHint) override;
public:
SwXTextPortion(const SwUnoCursor* pPortionCursor, css::uno::Reference< css::text::XText > const& rParent, SwTextPortionType eType );
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index 004de650992d..502e2e74c2dd 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -293,25 +293,6 @@ UnoActionRemoveContext::~UnoActionRemoveContext() COVERITY_NOEXCEPT_FALSE
}
}
-void ClientModify(SwClient* pClient, const SfxPoolItem *pOld, const SfxPoolItem *pNew)
-{
- switch( pOld ? pOld->Which() : 0 )
- {
- case RES_REMOVE_UNO_OBJECT:
- case RES_OBJECTDYING:
- if( static_cast<void*>(pClient->GetRegisteredIn()) == static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject )
- pClient->EndListeningAll();
- break;
-
- case RES_FMT_CHG:
- // Is the move to the new one finished and will the old one be deleted?
- if( static_cast<const SwFormatChg*>(pNew)->pChangedFormat == pClient->GetRegisteredIn() &&
- static_cast<const SwFormatChg*>(pOld)->pChangedFormat->IsFormatInDTOR() )
- pClient->EndListeningAll();
- break;
- }
-}
-
void SwUnoCursorHelper::SetCursorAttr(SwPaM & rPam,
const SfxItemSet& rSet,
const SetAttrMode nAttrMode, const bool bTableMode)
diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx
index 3e580633b0ab..319f1c51dbd4 100644
--- a/sw/source/core/unocore/unoport.cxx
+++ b/sw/source/core/unocore/unoport.cxx
@@ -72,7 +72,6 @@ SwXTextPortion::SwXTextPortion(
? PROPERTY_MAP_REDLINE_PORTION
: PROPERTY_MAP_TEXTPORTION_EXTENSIONS))
, m_xParentText(rParent)
- , m_aDepends(*this)
, m_pFrameFormat(nullptr)
, m_ePortionType(eType)
, m_bIsCollapsed(false)
@@ -87,12 +86,11 @@ SwXTextPortion::SwXTextPortion(
: m_pPropSet(aSwMapProvider.GetPropertySet(
PROPERTY_MAP_TEXTPORTION_EXTENSIONS))
, m_xParentText(rParent)
- , m_aDepends(*this)
, m_pFrameFormat(&rFormat)
, m_ePortionType(PORTION_FRAME)
, m_bIsCollapsed(false)
{
- m_aDepends.StartListening(&rFormat);
+ StartListening(rFormat.GetNotifier());
init( pPortionCursor);
}
@@ -109,7 +107,6 @@ SwXTextPortion::SwXTextPortion(
, m_pRubyAdjust ( bIsEnd ? nullptr : new uno::Any )
, m_pRubyIsAbove( bIsEnd ? nullptr : new uno::Any )
, m_pRubyPosition( bIsEnd ? nullptr : new uno::Any )
- , m_aDepends(*this)
, m_pFrameFormat(nullptr)
, m_ePortionType( bIsEnd ? PORTION_RUBY_END : PORTION_RUBY_START )
, m_bIsCollapsed(false)
@@ -131,7 +128,7 @@ SwXTextPortion::~SwXTextPortion()
{
SolarMutexGuard aGuard;
m_pUnoCursor.reset(nullptr);
- m_aDepends.EndListeningAll();
+ EndListeningAll();
}
uno::Reference< text::XText > SwXTextPortion::getText()
@@ -820,14 +817,10 @@ uno::Sequence< OUString > SwXTextPortion::getSupportedServiceNames()
"com.sun.star.style.ParagraphPropertiesComplex" };
}
-void SwXTextPortion::SwClientNotify(const SwModify&, const SfxHint& rHint)
+void SwXTextPortion::Notify(const SfxHint& rHint)
{
- if (auto pLegacyHint = dynamic_cast<const sw::LegacyModifyHint*>(&rHint))
- {
- ClientModify(this, pLegacyHint->m_pOld, pLegacyHint->m_pNew);
- if(!m_aDepends.IsListeningTo(m_pFrameFormat))
- m_pFrameFormat = nullptr;
- }
+ if(rHint.GetId() == SfxHintId::Dying)
+ m_pFrameFormat = nullptr;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */