summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-09-06 14:49:19 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-09-06 16:11:40 +0200
commitde42529ca9107b24b6367b40801300416d4a51a1 (patch)
treec8795037968bbb4911ddc7076baabe72f2d23487
parent25664e5da6b5196f5969188bce06e85730ceeaf2 (diff)
replace svx::PropertyValueProvider with simpler implementation
it was not actually doing much besides managing the listener list, so just use a regular listener list implementation. Registering was unnecessary as well, we can use getPropertyValue() to retrieve the current value. Change-Id: I53ae496e07ff028b12646668b134ffcab18484aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156619 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--include/svx/shapepropertynotifier.hxx142
-rw-r--r--include/svx/svdobj.hxx6
-rw-r--r--include/svx/unoshape.hxx3
-rw-r--r--svx/Library_svxcore.mk1
-rw-r--r--svx/source/svdraw/svdobj.cxx17
-rw-r--r--svx/source/unodraw/shapepropertynotifier.cxx142
-rw-r--r--svx/source/unodraw/unoshape.cxx79
-rw-r--r--sw/source/core/draw/dcontact.cxx3
-rw-r--r--sw/source/core/unocore/unodraw.cxx27
9 files changed, 32 insertions, 388 deletions
diff --git a/include/svx/shapepropertynotifier.hxx b/include/svx/shapepropertynotifier.hxx
deleted file mode 100644
index c34f536408f2..000000000000
--- a/include/svx/shapepropertynotifier.hxx
+++ /dev/null
@@ -1,142 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_SVX_SHAPEPROPERTYNOTIFIER_HXX
-#define INCLUDED_SVX_SHAPEPROPERTYNOTIFIER_HXX
-
-#include <svx/svxdllapi.h>
-#include <comphelper/multiinterfacecontainer4.hxx>
-#include <rtl/ustring.hxx>
-#include <o3tl/enumarray.hxx>
-
-#include <memory>
-#include <unordered_map>
-
-namespace com::sun::star::beans { class XPropertyChangeListener; }
-namespace com::sun::star::uno { class Any; }
-namespace com::sun::star::uno { template <typename > class Reference; }
-namespace osl { class Mutex; }
-
-namespace cppu
-{
- class OWeakObject;
-}
-
-
-namespace svx
-{
-
- //= ShapeProperty
-
- enum class ShapePropertyProviderId
- {
- // generic (UNO) shape properties
- Position,
- Size,
- // text doc shape properties
- TextDocAnchor,
- LAST = TextDocAnchor
- };
-
- //= PropertyValueProvider
-
- /** Default provider for a property value
-
- This default implementation queries the object which it is constructed with for the XPropertySet interface,
- and calls the getPropertyValue method.
- */
- class SVXCORE_DLLPUBLIC PropertyValueProvider
- {
- public:
- PropertyValueProvider( ::cppu::OWeakObject& _rContext, OUString _aPropertyName )
- :m_rContext( _rContext )
- ,m_sPropertyName( std::move( _aPropertyName ) )
- {
- }
- virtual ~PropertyValueProvider();
-
- /** returns the name of the property which this provider is responsible for
- */
- const OUString & getPropertyName() const;
- /** returns the current value of the property which the provider is responsible for
- */
- virtual void getCurrentValue( css::uno::Any& _out_rValue ) const;
-
- protected:
- ::cppu::OWeakObject& getContext() const { return m_rContext; }
- PropertyValueProvider(const PropertyValueProvider&) = delete;
- PropertyValueProvider& operator=(const PropertyValueProvider&) = delete;
-
- private:
- ::cppu::OWeakObject& m_rContext;
- const OUString m_sPropertyName;
- };
-
-
- /** helper class for notifying XPropertyChangeListeners
-
- The class is intended to be held as member of the class which does the property change broadcasting.
- */
- class SVXCORE_DLLPUBLIC PropertyChangeNotifier
- {
- public:
- /** constructs a notifier instance
-
- @param _rOwner
- the owner instance of the notifier. Will be used as css.lang.EventObject.Source when
- notifying events.
- */
- PropertyChangeNotifier( ::cppu::OWeakObject& _rOwner );
- ~PropertyChangeNotifier();
-
- // listener maintenance
- void addPropertyChangeListener( std::unique_lock<std::mutex>& rGuard, const OUString& _rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& _rxListener );
- void removePropertyChangeListener( std::unique_lock<std::mutex>& rGuard, const OUString& _rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& _rxListener );
-
- /** registers an PropertyValueProvider
- */
- void registerProvider( const ShapePropertyProviderId _eProperty, std::unique_ptr<PropertyValueProvider> _rProvider );
-
- /** notifies changes in the given property to all registered listeners
-
- If no property value provider for the given property ID is registered, this is worth an assertion in a
- non-product build, and otherwise ignored.
- */
- void notifyPropertyChange( std::unique_lock<std::mutex>& rGuard, const ShapePropertyProviderId _eProperty ) const;
-
- /** is called to dispose the instance
- */
- void disposing(std::unique_lock<std::mutex>& rGuard);
-
- private:
- PropertyChangeNotifier(const PropertyChangeNotifier&) = delete;
- PropertyChangeNotifier& operator=(const PropertyChangeNotifier&) = delete;
-
- ::cppu::OWeakObject& m_rContext;
- o3tl::enumarray<ShapePropertyProviderId, std::unique_ptr<PropertyValueProvider>> m_aProviders;
- comphelper::OMultiTypeInterfaceContainerHelperVar4<OUString, css::beans::XPropertyChangeListener> m_aPropertyChangeListeners;
- };
-
-
-}
-
-
-#endif // INCLUDED_SVX_SHAPEPROPERTYNOTIFIER_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index 35f6a47bd6e2..9c02d7e0bd64 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -78,8 +78,6 @@ class Fraction;
enum class PointerStyle;
class Graphic;
class SvxShape;
-namespace svx { enum class ShapePropertyProviderId; }
-namespace svx { class PropertyValueProvider; }
namespace basegfx
{
class B2DPoint;
@@ -787,9 +785,7 @@ public:
// This method is equivalent to calling getShapePropertyChangeNotifier().notifyPropertyChange( _eProperty ),
// exception that it is allowed to be called when there does not yet exist an associated SvxShape - in which
// case the method will silently return without doing anything.
- void notifyShapePropertyChange( const svx::ShapePropertyProviderId _eProperty ) const;
-
- void registerProvider( const svx::ShapePropertyProviderId _eProperty, std::unique_ptr<svx::PropertyValueProvider> propProvider );
+ void notifyShapePropertyChange( const OUString& rPropName ) const;
// transformation interface for StarOfficeAPI. This implements support for
// homogen 3x3 matrices containing the transformation of the SdrObject. At the
diff --git a/include/svx/unoshape.hxx b/include/svx/unoshape.hxx
index bbdb8bdd65de..964156f1a60f 100644
--- a/include/svx/unoshape.hxx
+++ b/include/svx/unoshape.hxx
@@ -176,8 +176,7 @@ public:
/// @throws css::uno::RuntimeException
css::uno::Any GetBitmap( bool bMetaFile = false ) const;
- void notifyPropertyChange(svx::ShapePropertyProviderId eProp);
- void registerProvider(svx::ShapePropertyProviderId eProp, std::unique_ptr<svx::PropertyValueProvider> provider);
+ void notifyPropertyChange(const OUString& rPropName);
void setShapeKind( SdrObjKind nKind );
SdrObjKind getShapeKind() const;
diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk
index 6e7466541427..c4ba58048f4b 100644
--- a/svx/Library_svxcore.mk
+++ b/svx/Library_svxcore.mk
@@ -441,7 +441,6 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\
svx/source/toolbars/fontworkbar \
svx/source/uitest/sdrobject \
svx/source/unodraw/gluepts \
- svx/source/unodraw/shapepropertynotifier \
svx/source/unodraw/SvxXTextColumns \
svx/source/unodraw/tableshape \
svx/source/unodraw/unobrushitemhelper \
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index dc9e36a008ce..c0d4c15d0096 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -51,7 +51,6 @@
#include <vcl/ptrstyle.hxx>
#include <vector>
-#include <svx/shapepropertynotifier.hxx>
#include <svx/svdotable.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
@@ -2810,10 +2809,10 @@ void SdrObject::SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle&
switch ( eUserCall )
{
case SdrUserCallType::Resize:
- notifyShapePropertyChange( svx::ShapePropertyProviderId::Size );
+ notifyShapePropertyChange( "Size" );
[[fallthrough]]; // RESIZE might also imply a change of the position
case SdrUserCallType::MoveOnly:
- notifyShapePropertyChange( svx::ShapePropertyProviderId::Position );
+ notifyShapePropertyChange( "Position" );
break;
default:
// not interested in
@@ -2953,21 +2952,13 @@ css::uno::Reference< css::drawing::XShape > SdrObject::getUnoShape()
return xShape;
}
-void SdrObject::notifyShapePropertyChange( const svx::ShapePropertyProviderId _eProperty ) const
+void SdrObject::notifyShapePropertyChange( const OUString& rPropName ) const
{
DBG_TESTSOLARMUTEX();
SvxShape* pSvxShape = const_cast< SdrObject* >( this )->getSvxShape();
if ( pSvxShape )
- return pSvxShape->notifyPropertyChange( _eProperty );
-}
-
-void SdrObject::registerProvider( const svx::ShapePropertyProviderId _eProperty, std::unique_ptr<svx::PropertyValueProvider> provider )
-{
- DBG_TESTSOLARMUTEX();
-
- SvxShape* pSvxShape = getSvxShape();
- return pSvxShape->registerProvider( _eProperty, std::move(provider) );
+ return pSvxShape->notifyPropertyChange( rPropName );
}
// transformation interface for StarOfficeAPI. This implements support for
diff --git a/svx/source/unodraw/shapepropertynotifier.cxx b/svx/source/unodraw/shapepropertynotifier.cxx
deleted file mode 100644
index a1b1ad07a626..000000000000
--- a/svx/source/unodraw/shapepropertynotifier.cxx
+++ /dev/null
@@ -1,142 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-
-#include <svx/shapepropertynotifier.hxx>
-
-#include <com/sun/star/beans/XPropertySet.hpp>
-
-#include <cppuhelper/weak.hxx>
-#include <comphelper/diagnose_ex.hxx>
-
-namespace
-{
-
-}
-
-
-namespace svx
-{
-
-
- using ::com::sun::star::uno::Reference;
- using ::com::sun::star::uno::UNO_QUERY_THROW;
- using ::com::sun::star::uno::Exception;
- using ::com::sun::star::uno::Any;
- using ::com::sun::star::beans::PropertyChangeEvent;
- using ::com::sun::star::beans::XPropertyChangeListener;
- using ::com::sun::star::lang::EventObject;
- using ::com::sun::star::beans::XPropertySet;
-
- PropertyValueProvider::~PropertyValueProvider()
- {
- }
-
- //= PropertyValueProvider
-
-
- const OUString & PropertyValueProvider::getPropertyName() const
- {
- return m_sPropertyName;
- }
-
-
- void PropertyValueProvider::getCurrentValue( Any& _out_rValue ) const
- {
- Reference< XPropertySet > xContextProps( const_cast< PropertyValueProvider* >( this )->m_rContext, UNO_QUERY_THROW );
- _out_rValue = xContextProps->getPropertyValue( getPropertyName() );
- }
-
- PropertyChangeNotifier::PropertyChangeNotifier( ::cppu::OWeakObject& _rOwner )
- :m_rContext( _rOwner )
- {
- }
-
- PropertyChangeNotifier::~PropertyChangeNotifier()
- {
- }
-
- void PropertyChangeNotifier::registerProvider(const ShapePropertyProviderId _eProperty, std::unique_ptr<PropertyValueProvider> _rProvider)
- {
- assert( _rProvider && "NULL factory not allowed." );
-
- assert( ! m_aProviders[_eProperty] &&
- "PropertyChangeNotifier::registerProvider: factory for this ID already present!" );
-
- m_aProviders[ _eProperty ] = std::move(_rProvider);
- }
-
- void PropertyChangeNotifier::notifyPropertyChange( std::unique_lock<std::mutex>& rGuard, const ShapePropertyProviderId _eProperty ) const
- {
- auto & provPos = m_aProviders[ _eProperty ];
- OSL_ENSURE( provPos, "PropertyChangeNotifier::notifyPropertyChange: no factory!" );
- if (!provPos)
- return;
-
- const OUString & sPropertyName( provPos->getPropertyName() );
-
- ::comphelper::OInterfaceContainerHelper4<XPropertyChangeListener>* pPropListeners = m_aPropertyChangeListeners.getContainer( rGuard, sPropertyName );
- ::comphelper::OInterfaceContainerHelper4<XPropertyChangeListener>* pAllListeners = m_aPropertyChangeListeners.getContainer( rGuard, OUString() );
- if ( !pPropListeners && !pAllListeners )
- return;
-
- try
- {
- PropertyChangeEvent aEvent;
- aEvent.Source = m_rContext;
- // Handle/OldValue not supported
- aEvent.PropertyName = provPos->getPropertyName();
- provPos->getCurrentValue( aEvent.NewValue );
-
- if ( pPropListeners )
- pPropListeners->notifyEach( rGuard, &XPropertyChangeListener::propertyChange, aEvent );
- if ( pAllListeners )
- pAllListeners->notifyEach( rGuard, &XPropertyChangeListener::propertyChange, aEvent );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION("svx");
- }
- }
-
-
- void PropertyChangeNotifier::addPropertyChangeListener( std::unique_lock<std::mutex>& rGuard, const OUString& _rPropertyName, const Reference< XPropertyChangeListener >& _rxListener )
- {
- m_aPropertyChangeListeners.addInterface( rGuard, _rPropertyName, _rxListener );
- }
-
-
- void PropertyChangeNotifier::removePropertyChangeListener( std::unique_lock<std::mutex>& rGuard, const OUString& _rPropertyName, const Reference< XPropertyChangeListener >& _rxListener )
- {
- m_aPropertyChangeListeners.removeInterface( rGuard, _rPropertyName, _rxListener );
- }
-
-
- void PropertyChangeNotifier::disposing(std::unique_lock<std::mutex>& rGuard)
- {
- EventObject aEvent;
- aEvent.Source = m_rContext;
- m_aPropertyChangeListeners.disposeAndClear( rGuard, aEvent );
- }
-
-
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 6bd355391301..8b3155ad2382 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -29,10 +29,10 @@
#include <editeng/unotext.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdoole2.hxx>
-#include <svx/shapepropertynotifier.hxx>
#include <comphelper/interfacecontainer3.hxx>
#include <comphelper/scopeguard.hxx>
#include <comphelper/servicehelper.hxx>
+#include <comphelper/multiinterfacecontainer4.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/gfxlink.hxx>
#include <vcl/virdev.hxx>
@@ -106,7 +106,6 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::container;
-using svx::PropertyValueProvider;
class GDIMetaFile;
@@ -126,51 +125,18 @@ struct SvxShapeImpl
// for xComponent
::comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> maDisposeListeners;
- svx::PropertyChangeNotifier maPropertyNotifier;
+ ::comphelper::OMultiTypeInterfaceContainerHelperVar4<OUString, css::beans::XPropertyChangeListener> maPropertyChangeListeners;
- SvxShapeImpl( SvxShape& _rAntiImpl )
+ SvxShapeImpl()
:mnObjId( SdrObjKind::NONE )
,mpMaster( nullptr )
,mbDisposing( false )
- ,maPropertyNotifier( _rAntiImpl )
{
}
};
namespace {
-class ShapePositionProvider : public PropertyValueProvider
-{
-public:
- static constexpr OUStringLiteral sPosition = u"Position";
- explicit ShapePositionProvider( SvxShape& _shape )
- :PropertyValueProvider( _shape, sPosition )
- {
- }
-
-protected:
- virtual void getCurrentValue( Any& _out_rCurrentValue ) const override
- {
- _out_rCurrentValue <<= static_cast< SvxShape& >( getContext() ).getPosition();
- }
-};
-
-
-class ShapeSizeProvider : public PropertyValueProvider
-{
-public:
- static constexpr OUStringLiteral sSize = u"Size";
- explicit ShapeSizeProvider( SvxShape& _shape )
- :PropertyValueProvider( _shape, sSize )
- {
- }
-
-protected:
- virtual void getCurrentValue( Any& _out_rCurrentValue ) const override
- {
- _out_rCurrentValue <<= static_cast< SvxShape& >( getContext() ).getSize();
- }
-};
/// Calculates what scaling factor will be used for autofit text scaling of this shape.
double GetTextFitToSizeScale(SdrObject* pObject)
@@ -194,7 +160,7 @@ double GetTextFitToSizeScale(SdrObject* pObject)
SvxShape::SvxShape( SdrObject* pObject )
: maSize(100,100)
-, mpImpl( new SvxShapeImpl( *this ) )
+, mpImpl( new SvxShapeImpl )
, mbIsMultiPropertyCall(false)
, mpPropSet(getSvxMapProvider().GetPropertySet(SVXMAP_SHAPE, SdrObject::GetGlobalDrawObjectItemPool()))
, maPropMapEntries(getSvxMapProvider().GetMap(SVXMAP_SHAPE))
@@ -207,7 +173,7 @@ SvxShape::SvxShape( SdrObject* pObject )
SvxShape::SvxShape( SdrObject* pObject, o3tl::span<const SfxItemPropertyMapEntry> pEntries, const SvxItemPropertySet* pPropertySet )
: maSize(100,100)
-, mpImpl( new SvxShapeImpl( *this ) )
+, mpImpl( new SvxShapeImpl )
, mbIsMultiPropertyCall(false)
, mpPropSet(pPropertySet)
, maPropMapEntries(pEntries)
@@ -289,24 +255,29 @@ sal_Int64 SAL_CALL SvxShape::getSomething( const css::uno::Sequence< sal_Int8 >&
}
-void SvxShape::notifyPropertyChange(svx::ShapePropertyProviderId eProp)
+void SvxShape::notifyPropertyChange(const OUString& rPropName)
{
std::unique_lock g(m_aMutex);
- mpImpl->maPropertyNotifier.notifyPropertyChange(g, eProp);
-}
-
-void SvxShape::registerProvider(svx::ShapePropertyProviderId eProp, std::unique_ptr<svx::PropertyValueProvider> provider)
-{
- mpImpl->maPropertyNotifier.registerProvider(eProp, std::move(provider));
+ comphelper::OInterfaceContainerHelper4<beans::XPropertyChangeListener>* pPropListeners =
+ mpImpl->maPropertyChangeListeners.getContainer( g, rPropName );
+ comphelper::OInterfaceContainerHelper4<beans::XPropertyChangeListener>* pAllListeners =
+ mpImpl->maPropertyChangeListeners.getContainer( g, OUString() );
+ if (pPropListeners || pAllListeners)
+ {
+ // Handle/OldValue not supported
+ beans::PropertyChangeEvent aEvt;
+ aEvt.Source = static_cast<cppu::OWeakObject*>(this);
+ aEvt.PropertyName = rPropName;
+ aEvt.NewValue = getPropertyValue(rPropName);
+ if (pPropListeners)
+ pPropListeners->notifyEach( g, &beans::XPropertyChangeListener::propertyChange, aEvt );
+ if (pAllListeners)
+ pAllListeners->notifyEach( g, &beans::XPropertyChangeListener::propertyChange, aEvt );
+ }
}
void SvxShape::impl_construct()
{
- mpImpl->maPropertyNotifier.registerProvider( svx::ShapePropertyProviderId::Position,
- std::make_unique<ShapePositionProvider>( *this ) );
- mpImpl->maPropertyNotifier.registerProvider( svx::ShapePropertyProviderId::Size,
- std::make_unique<ShapeSizeProvider>( *this ) );
-
if ( HasSdrObject() )
{
StartListening(GetSdrObject()->getSdrModelFromSdrObject());
@@ -1209,7 +1180,7 @@ void SAL_CALL SvxShape::dispose()
lang::EventObject aEvt;
aEvt.Source = *static_cast<OWeakAggObject*>(this);
mpImpl->maDisposeListeners.disposeAndClear(g, aEvt);
- mpImpl->maPropertyNotifier.disposing(g);
+ mpImpl->maPropertyChangeListeners.disposeAndClear(g, aEvt);
rtl::Reference<SdrObject> pObject = mxSdrObject;
if (!pObject)
@@ -1276,14 +1247,14 @@ Reference< beans::XPropertySetInfo > const &
void SAL_CALL SvxShape::addPropertyChangeListener( const OUString& _propertyName, const Reference< beans::XPropertyChangeListener >& _listener )
{
std::unique_lock g(m_aMutex);
- mpImpl->maPropertyNotifier.addPropertyChangeListener( g, _propertyName, _listener );
+ mpImpl->maPropertyChangeListeners.addInterface( g, _propertyName, _listener );
}
void SAL_CALL SvxShape::removePropertyChangeListener( const OUString& _propertyName, const Reference< beans::XPropertyChangeListener >& _listener )
{
std::unique_lock g(m_aMutex);
- mpImpl->maPropertyNotifier.removePropertyChangeListener( g, _propertyName, _listener );
+ mpImpl->maPropertyChangeListeners.removeInterface( g, _propertyName, _listener );
}
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 2de9544640f3..da79a66b6739 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -28,7 +28,6 @@
#include <svx/svdview.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
#include <svx/sdr/contact/objectcontact.hxx>
-#include <svx/shapepropertynotifier.hxx>
#include <drawdoc.hxx>
#include <fmtornt.hxx>
#include <viewimp.hxx>
@@ -1459,7 +1458,7 @@ void SwDrawContact::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
{
// --> #i102752#
// assure that a ShapePropertyChangeNotifier exists
- maAnchoredDrawObj.DrawObj()->notifyShapePropertyChange(svx::ShapePropertyProviderId::TextDocAnchor);
+ maAnchoredDrawObj.DrawObj()->notifyShapePropertyChange("AnchorType");
}
else
SAL_WARN("sw.core", "SwDrawContact::Modify: no draw object here?");
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 5ab0fea55215..145de10a9674 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -60,7 +60,6 @@
#include <editeng/ulspitem.hxx>
#include <o3tl/any.hxx>
#include <o3tl/safeint.hxx>
-#include <svx/shapepropertynotifier.hxx>
#include <crstate.hxx>
#include <comphelper/extract.hxx>
#include <comphelper/profilezone.hxx>
@@ -103,9 +102,6 @@ class SwShapeDescriptor_Impl
SwShapeDescriptor_Impl& operator=(const SwShapeDescriptor_Impl&) = delete;
public:
- bool m_bInitializedPropertyNotifier;
-
-public:
SwShapeDescriptor_Impl(SwDoc const*const pDoc)
: m_isInReading(pDoc && pDoc->IsInReading())
// #i32349# - no defaults, in order to determine on
@@ -118,7 +114,6 @@ public:
text::WrapInfluenceOnPosition::ONCE_CONCURRENT) )
// #i28749#
, mnPositionLayoutDir(text::PositionLayoutDir::PositionInLayoutDirOfAnchor)
- , m_bInitializedPropertyNotifier(false)
{}
SwFormatAnchor* GetAnchor(bool bCreate = false)
@@ -903,14 +898,6 @@ sal_Int64 SAL_CALL SwXShape::getSomething( const uno::Sequence< sal_Int8 >& rId
}
return 0;
}
-namespace
-{
- void lcl_addShapePropertyEventFactories( SdrObject& _rObj, SwXShape& _rShape )
- {
- auto pProvider = std::make_unique<svx::PropertyValueProvider>( _rShape, "AnchorType" );
- _rObj.registerProvider( svx::ShapePropertyProviderId::TextDocAnchor, std::move(pProvider) );
- }
-}
SwXShape::SwXShape(
uno::Reference<uno::XInterface> & xShape,
@@ -942,14 +929,6 @@ SwXShape::SwXShape(
if( m_xShapeAgg.is() )
m_xShapeAgg->setDelegator( static_cast<cppu::OWeakObject*>(this) );
osl_atomic_decrement(&m_refCount);
-
- SdrObject* pObj = SdrObject::getSdrObjectFromXShape(m_xShapeAgg);
- if(pObj)
- {
- lcl_addShapePropertyEventFactories( *pObj, *this );
- m_pImpl->m_bInitializedPropertyNotifier = true;
- }
-
}
SwFrameFormat* SwXShape::GetFrameFormat() const
@@ -975,12 +954,6 @@ void SwXShape::AddExistingShapeToFormat( SdrObject const & _rObj )
{
if ( pSwShape->m_bDescriptor )
pSwShape->m_bDescriptor = false;
-
- if ( !pSwShape->m_pImpl->m_bInitializedPropertyNotifier )
- {
- lcl_addShapePropertyEventFactories( *pCurrent, *pSwShape );
- pSwShape->m_pImpl->m_bInitializedPropertyNotifier = true;
- }
}
}
}