diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-04-07 23:43:33 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-04-08 12:12:25 +0200 |
commit | 44569082041d921e8eeb954efac082a02fa7a5a9 (patch) | |
tree | bb968c9a6f2c7f4654f2ef49eff390cc73ac9841 /sw | |
parent | d477ff4a81ecba8a77ead5ff1a33d3e3ceed622e (diff) |
SwXFlatParagraph: use ::cppu::ImplInheritanceHelper
... instead of manually overriding XInterface/XTypeInfo methods.
Requires replacing a non-const reference parameter by a pointer in
base class ctor.
Change-Id: I5847524752cc0bdb595f6ce675a856479f3f8507
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/inc/unoflatpara.hxx | 24 | ||||
-rw-r--r-- | sw/source/core/inc/unotextmarkup.hxx | 3 | ||||
-rw-r--r-- | sw/source/core/txtnode/txtedt.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/unoflatpara.cxx | 47 | ||||
-rw-r--r-- | sw/source/core/unocore/unotextmarkup.cxx | 6 |
5 files changed, 22 insertions, 62 deletions
diff --git a/sw/source/core/inc/unoflatpara.hxx b/sw/source/core/inc/unoflatpara.hxx index ceeff519dfaf..9d8b2a59e137 100644 --- a/sw/source/core/inc/unoflatpara.hxx +++ b/sw/source/core/inc/unoflatpara.hxx @@ -48,26 +48,20 @@ class SwDoc; * SwXFlatParagraph ******************************************************************************/ -class SwXFlatParagraph: - public ::cppu::WeakImplHelper3 - < - css::beans::XPropertySet, - css::text::XFlatParagraph, - css::lang::XUnoTunnel - >, - public SwXTextMarkup +typedef ::cppu::ImplInheritanceHelper3 +< SwXTextMarkup +, css::beans::XPropertySet +, css::text::XFlatParagraph +, css::lang::XUnoTunnel +> SwXFlatParagraph_Base; + +class SwXFlatParagraph + : public SwXFlatParagraph_Base { public: SwXFlatParagraph( SwTxtNode& rTxtNode, const OUString& aExpandText, const ModelToViewHelper& rConversionMap ); virtual ~SwXFlatParagraph(); - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - virtual void SAL_CALL acquire( ) throw() SAL_OVERRIDE; - virtual void SAL_CALL release( ) throw() SAL_OVERRIDE; - - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - // XPropertySet virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL diff --git a/sw/source/core/inc/unotextmarkup.hxx b/sw/source/core/inc/unotextmarkup.hxx index 59b1c3630115..2b22a958f033 100644 --- a/sw/source/core/inc/unotextmarkup.hxx +++ b/sw/source/core/inc/unotextmarkup.hxx @@ -51,7 +51,8 @@ class SwXTextMarkup: public SwClient { public: - SwXTextMarkup( SwTxtNode& rTxtNode, const ModelToViewHelper& rConversionMap ); + SwXTextMarkup(SwTxtNode *const rTxtNode, + const ModelToViewHelper& rConversionMap); virtual ~SwXTextMarkup(); // ::com::sun::star::text::XTextMarkup: diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 8929b0b23be7..5292369e02c2 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -1459,8 +1459,8 @@ SwRect SwTxtFrm::SmartTagScan( SwCntntNode* /*pActNode*/, sal_Int32 /*nActPos*/ OUString aExpandText = aConversionMap.getViewText(); // Ownership ov ConversionMap is passed to SwXTextMarkup object! - com::sun::star::uno::Reference< com::sun::star::text::XTextMarkup > xTextMarkup = - new SwXTextMarkup( *pNode, aConversionMap ); + uno::Reference<text::XTextMarkup> const xTextMarkup = + new SwXTextMarkup(pNode, aConversionMap); com::sun::star::uno::Reference< ::com::sun::star::frame::XController > xController = pNode->GetDoc()->GetDocShell()->GetController(); diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx index 69760910cb96..f495655e76a0 100644 --- a/sw/source/core/unocore/unoflatpara.cxx +++ b/sw/source/core/unocore/unoflatpara.cxx @@ -63,9 +63,9 @@ CreateFlatParagraphIterator(SwDoc & rDoc, sal_Int32 const nTextMarkupType, * SwXFlatParagraph ******************************************************************************/ -SwXFlatParagraph::SwXFlatParagraph( SwTxtNode& rTxtNode, const OUString& aExpandText, const ModelToViewHelper& rMap ) : - SwXTextMarkup( rTxtNode, rMap ), - maExpandText( aExpandText ) +SwXFlatParagraph::SwXFlatParagraph( SwTxtNode& rTxtNode, const OUString& aExpandText, const ModelToViewHelper& rMap ) + : SwXFlatParagraph_Base(& rTxtNode, rMap) + , maExpandText(aExpandText) { } @@ -73,43 +73,6 @@ SwXFlatParagraph::~SwXFlatParagraph() { } -uno::Sequence< uno::Type > SwXFlatParagraph::getTypes( ) throw(uno::RuntimeException, std::exception) -{ - uno::Sequence< uno::Type > aTypes = SwXTextMarkup::getTypes(); - aTypes.realloc( aTypes.getLength() + 1 ); - aTypes[aTypes.getLength()-1] = ::getCppuType((uno::Reference< text::XFlatParagraph >*)0); - return aTypes; -} - -uno::Sequence< sal_Int8 > SwXFlatParagraph::getImplementationId( ) throw(uno::RuntimeException, std::exception) -{ - return css::uno::Sequence<sal_Int8>(); -} - -uno::Any SAL_CALL SwXFlatParagraph::queryInterface( const uno::Type& rType ) throw(uno::RuntimeException, std::exception) -{ - if ( rType == ::getCppuType((uno::Reference< text::XFlatParagraph >*)0) ) - { - return uno::makeAny( uno::Reference < text::XFlatParagraph >(this) ); - } - else if (rType == ::getCppuType((uno::Reference< beans::XPropertySet>*)0)) - { - return uno::makeAny( uno::Reference<beans::XPropertySet>(this) ); - } - else - return SwXTextMarkup::queryInterface( rType ); -} - -void SAL_CALL SwXFlatParagraph::acquire() throw() -{ - SwXTextMarkup::acquire(); -} - -void SAL_CALL SwXFlatParagraph::release() throw() -{ - SwXTextMarkup::release(); -} - const SwTxtNode* SwXFlatParagraph::getTxtNode() const { return mpTxtNode; @@ -121,7 +84,7 @@ SwXFlatParagraph::getPropertySetInfo() throw (uno::RuntimeException, std::exception) { throw uno::RuntimeException("SwXFlatParagraph::getPropertySetInfo(): " - "not implemented", 0/*static_cast< ::cppu::OWeakObject*>(this)*/); + "not implemented", static_cast< ::cppu::OWeakObject*>(this)); } void SAL_CALL @@ -131,7 +94,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, uno::RuntimeException, std::exception) { throw lang::IllegalArgumentException("no values can be set", - 0/*static_cast< ::cppu::OWeakObject*>(this)*/, 0); + static_cast< ::cppu::OWeakObject*>(this), 0); } uno::Any SAL_CALL diff --git a/sw/source/core/unocore/unotextmarkup.cxx b/sw/source/core/unocore/unotextmarkup.cxx index de9a9878dc03..5df731f48686 100644 --- a/sw/source/core/unocore/unotextmarkup.cxx +++ b/sw/source/core/unocore/unotextmarkup.cxx @@ -43,8 +43,10 @@ using namespace ::com::sun::star; /* * SwXTextMarkup */ -SwXTextMarkup::SwXTextMarkup( SwTxtNode& rTxtNode, const ModelToViewHelper& rMap ) - : mpTxtNode( &rTxtNode ), maConversionMap( rMap ) +SwXTextMarkup::SwXTextMarkup( + SwTxtNode *const pTxtNode, const ModelToViewHelper& rMap) + : mpTxtNode(pTxtNode) + , maConversionMap(rMap) { // FME 2007-07-16 #i79641# SwXTextMarkup is allowed to be removed ... SetIsAllowedToBeRemovedInModifyCall(true); |