diff options
Diffstat (limited to 'sw/inc/unodraw.hxx')
-rw-r--r-- | sw/inc/unodraw.hxx | 84 |
1 files changed, 35 insertions, 49 deletions
diff --git a/sw/inc/unodraw.hxx b/sw/inc/unodraw.hxx index 22ddffda5881..98f322bdf647 100644 --- a/sw/inc/unodraw.hxx +++ b/sw/inc/unodraw.hxx @@ -21,7 +21,7 @@ #include <svl/itemprop.hxx> #include <svl/listener.hxx> -#include <svx/fmdpage.hxx> +#include <svx/unopage.hxx> #include "frmfmt.hxx" #include <com/sun/star/text/XTextContent.hpp> #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp> @@ -30,23 +30,33 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertyState.hpp> #include <com/sun/star/drawing/XShapes.hpp> -#include <cppuhelper/implbase4.hxx> -#include <cppuhelper/implbase6.hxx> #include <com/sun/star/container/XEnumerationAccess.hpp> #include <com/sun/star/drawing/HomogenMatrix3.hpp> +#include <com/sun/star/uno/XAggregation.hpp> +#include <cppuhelper/implbase.hxx> class SdrMarkList; class SdrView; class SwDoc; class SwXShape; -class SwFmDrawPage final : public SvxFmDrawPage +typedef cppu::ImplInheritanceHelper +< + SvxDrawPage, + css::container::XEnumerationAccess, + css::beans::XPropertySet> + SwFmDrawPage_Base; + +class SwFmDrawPage final : public SwFmDrawPage_Base { + SwDoc* m_pDoc; SdrPageView* m_pPageView; - std::vector<SwXShape*> m_vShapes; + std::vector<rtl::Reference<SwXShape>> m_vShapes; + const SfxItemPropertySet* m_pPropertySet; + public: - SwFmDrawPage( SdrPage* pPage ); - virtual ~SwFmDrawPage() throw () override; + SwFmDrawPage( SwDoc* pDoc, SdrPage* pPage ); + virtual ~SwFmDrawPage() noexcept override; const SdrMarkList& PreGroup(const css::uno::Reference< css::drawing::XShapes >& rShapes); void PreUnGroup(const css::uno::Reference< css::drawing::XShapeGroup >& rShapeGroup); @@ -67,31 +77,10 @@ public: if(ppShape != m_vShapes.end()) m_vShapes.erase(ppShape); }; -}; - -typedef cppu::WeakAggImplHelper4 -< - css::container::XEnumerationAccess, - css::drawing::XDrawPage, - css::lang::XServiceInfo, - css::drawing::XShapeGrouper -> -SwXDrawPageBaseClass; -class SwXDrawPage final : public SwXDrawPageBaseClass -{ - SwDoc* m_pDoc; - css::uno::Reference< css::uno::XAggregation > m_xPageAgg; - SwFmDrawPage* m_pDrawPage; -public: - SwXDrawPage(SwDoc* pDoc); - virtual ~SwXDrawPage() override; //XEnumerationAccess virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override; - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override; - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; - //XIndexAccess virtual sal_Int32 SAL_CALL getCount() override; virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override; @@ -113,14 +102,22 @@ public: virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - SwFmDrawPage* GetSvxPage(); + //XPropertySet + virtual css::uno::Reference<css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() override; + virtual void SAL_CALL setPropertyValue(const OUString& aPropertyName, const css::uno::Any& aValue) override; + virtual css::uno::Any SAL_CALL getPropertyValue(const OUString& PropertyName) override; + virtual void SAL_CALL addPropertyChangeListener(const OUString& aPropertyName, const css::uno::Reference<css::beans::XPropertyChangeListener>& xListener) override; + virtual void SAL_CALL removePropertyChangeListener(const OUString& aPropertyName, const css::uno::Reference<css::beans::XPropertyChangeListener>& aListener) override; + virtual void SAL_CALL addVetoableChangeListener(const OUString& PropertyName, const css::uno::Reference<css::beans::XVetoableChangeListener>& aListener) override; + virtual void SAL_CALL removeVetoableChangeListener(const OUString& PropertyName, const css::uno::Reference<css::beans::XVetoableChangeListener>& aListener) override; + // renamed and outlined to detect where it's called void InvalidateSwDoc(); // {pDoc = 0;} }; class SwShapeDescriptor_Impl; typedef -cppu::WeakAggImplHelper6 +cppu::WeakImplHelper < css::beans::XPropertySet, css::beans::XPropertyState, @@ -130,13 +127,11 @@ cppu::WeakAggImplHelper6 css::drawing::XShape > SwXShapeBaseClass; -class SwXShape : public SwXShapeBaseClass, public SvtListener +class SwXShape : public SwXShapeBaseClass { friend class SwXGroupShape; - friend class SwXDrawPage; friend class SwFmDrawPage; const SwFmDrawPage* m_pPage; - SwFrameFormat* m_pFormat; css::uno::Reference< css::uno::XAggregation > m_xShapeAgg; // reference to <XShape>, determined in the @@ -144,14 +139,13 @@ class SwXShape : public SwXShapeBaseClass, public SvtListener css::uno::Reference< css::drawing::XShape > mxShape; const SfxItemPropertySet* m_pPropSet; - const SfxItemPropertyMapEntry* m_pPropertyMapEntries; + std::span<const SfxItemPropertyMapEntry> m_pPropertyMapEntries; + css::uno::Reference< css::beans::XPropertySetInfo > mxPropertySetInfo; std::unique_ptr<SwShapeDescriptor_Impl> m_pImpl; bool m_bDescriptor; - SvxShape* GetSvxShape(); - /** method to determine top group object */ SdrObject* GetTopGroupObj( SvxShape* _pSvxShape = nullptr ); @@ -198,19 +192,12 @@ class SwXShape : public SwXShapeBaseClass, public SvtListener @throws css::uno::RuntimeException */ css::uno::Any _getPropAtAggrObj( const OUString& _rPropertyName ); - void SetFrameFormat(SwFrameFormat* pFormat) - { - EndListeningAll(); - StartListening(pFormat->GetNotifier()); - m_pFormat = pFormat; - } protected: virtual ~SwXShape() override; public: SwXShape(css::uno::Reference<css::uno::XInterface> & xShape, SwDoc const*const pDoc); - virtual void Notify(const SfxHint&) override; static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId(); virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override; virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; @@ -255,25 +242,24 @@ public: virtual OUString SAL_CALL getShapeType( ) override; SwShapeDescriptor_Impl* GetDescImpl() {return m_pImpl.get();} - SwFrameFormat* GetFrameFormat() const { return m_pFormat; } - const css::uno::Reference< css::uno::XAggregation >& GetAggregationInterface() const {return m_xShapeAgg;} + SwFrameFormat* GetFrameFormat() const; + SvxShape* GetSvxShape(); // helper static void AddExistingShapeToFormat( SdrObject const & _rObj ); }; -class SwXGroupShape : +class SwXGroupShape final : public SwXShape, public css::drawing::XShapes { -protected: virtual ~SwXGroupShape() override; public: SwXGroupShape(css::uno::Reference<css::uno::XInterface> & xShape, SwDoc const* pDoc); virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override; - virtual void SAL_CALL acquire( ) throw() override; - virtual void SAL_CALL release( ) throw() override; + virtual void SAL_CALL acquire( ) noexcept override; + virtual void SAL_CALL release( ) noexcept override; //XShapes virtual void SAL_CALL add( const css::uno::Reference< css::drawing::XShape >& xShape ) override; |