Kaydet (Commit) 44569082 authored tarafından Michael Stahl's avatar Michael Stahl

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
üst d477ff4a
...@@ -48,26 +48,20 @@ class SwDoc; ...@@ -48,26 +48,20 @@ class SwDoc;
* SwXFlatParagraph * SwXFlatParagraph
******************************************************************************/ ******************************************************************************/
class SwXFlatParagraph: typedef ::cppu::ImplInheritanceHelper3
public ::cppu::WeakImplHelper3 < SwXTextMarkup
< , css::beans::XPropertySet
css::beans::XPropertySet, , css::text::XFlatParagraph
css::text::XFlatParagraph, , css::lang::XUnoTunnel
css::lang::XUnoTunnel > SwXFlatParagraph_Base;
>,
public SwXTextMarkup class SwXFlatParagraph
: public SwXFlatParagraph_Base
{ {
public: public:
SwXFlatParagraph( SwTxtNode& rTxtNode, const OUString& aExpandText, const ModelToViewHelper& rConversionMap ); SwXFlatParagraph( SwTxtNode& rTxtNode, const OUString& aExpandText, const ModelToViewHelper& rConversionMap );
virtual ~SwXFlatParagraph(); 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 // XPropertySet
virtual ::com::sun::star::uno::Reference< virtual ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySetInfo > SAL_CALL ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
......
...@@ -51,7 +51,8 @@ class SwXTextMarkup: ...@@ -51,7 +51,8 @@ class SwXTextMarkup:
public SwClient public SwClient
{ {
public: public:
SwXTextMarkup( SwTxtNode& rTxtNode, const ModelToViewHelper& rConversionMap ); SwXTextMarkup(SwTxtNode *const rTxtNode,
const ModelToViewHelper& rConversionMap);
virtual ~SwXTextMarkup(); virtual ~SwXTextMarkup();
// ::com::sun::star::text::XTextMarkup: // ::com::sun::star::text::XTextMarkup:
......
...@@ -1459,8 +1459,8 @@ SwRect SwTxtFrm::SmartTagScan( SwCntntNode* /*pActNode*/, sal_Int32 /*nActPos*/ ...@@ -1459,8 +1459,8 @@ SwRect SwTxtFrm::SmartTagScan( SwCntntNode* /*pActNode*/, sal_Int32 /*nActPos*/
OUString aExpandText = aConversionMap.getViewText(); OUString aExpandText = aConversionMap.getViewText();
// Ownership ov ConversionMap is passed to SwXTextMarkup object! // Ownership ov ConversionMap is passed to SwXTextMarkup object!
com::sun::star::uno::Reference< com::sun::star::text::XTextMarkup > xTextMarkup = uno::Reference<text::XTextMarkup> const xTextMarkup =
new SwXTextMarkup( *pNode, aConversionMap ); new SwXTextMarkup(pNode, aConversionMap);
com::sun::star::uno::Reference< ::com::sun::star::frame::XController > xController = pNode->GetDoc()->GetDocShell()->GetController(); com::sun::star::uno::Reference< ::com::sun::star::frame::XController > xController = pNode->GetDoc()->GetDocShell()->GetController();
......
...@@ -63,9 +63,9 @@ CreateFlatParagraphIterator(SwDoc & rDoc, sal_Int32 const nTextMarkupType, ...@@ -63,9 +63,9 @@ CreateFlatParagraphIterator(SwDoc & rDoc, sal_Int32 const nTextMarkupType,
* SwXFlatParagraph * SwXFlatParagraph
******************************************************************************/ ******************************************************************************/
SwXFlatParagraph::SwXFlatParagraph( SwTxtNode& rTxtNode, const OUString& aExpandText, const ModelToViewHelper& rMap ) : SwXFlatParagraph::SwXFlatParagraph( SwTxtNode& rTxtNode, const OUString& aExpandText, const ModelToViewHelper& rMap )
SwXTextMarkup( rTxtNode, rMap ), : SwXFlatParagraph_Base(& rTxtNode, rMap)
maExpandText( aExpandText ) , maExpandText(aExpandText)
{ {
} }
...@@ -73,43 +73,6 @@ SwXFlatParagraph::~SwXFlatParagraph() ...@@ -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 const SwTxtNode* SwXFlatParagraph::getTxtNode() const
{ {
return mpTxtNode; return mpTxtNode;
...@@ -121,7 +84,7 @@ SwXFlatParagraph::getPropertySetInfo() ...@@ -121,7 +84,7 @@ SwXFlatParagraph::getPropertySetInfo()
throw (uno::RuntimeException, std::exception) throw (uno::RuntimeException, std::exception)
{ {
throw uno::RuntimeException("SwXFlatParagraph::getPropertySetInfo(): " throw uno::RuntimeException("SwXFlatParagraph::getPropertySetInfo(): "
"not implemented", 0/*static_cast< ::cppu::OWeakObject*>(this)*/); "not implemented", static_cast< ::cppu::OWeakObject*>(this));
} }
void SAL_CALL void SAL_CALL
...@@ -131,7 +94,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, ...@@ -131,7 +94,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
uno::RuntimeException, std::exception) uno::RuntimeException, std::exception)
{ {
throw lang::IllegalArgumentException("no values can be set", 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 uno::Any SAL_CALL
......
...@@ -43,8 +43,10 @@ using namespace ::com::sun::star; ...@@ -43,8 +43,10 @@ using namespace ::com::sun::star;
/* /*
* SwXTextMarkup * SwXTextMarkup
*/ */
SwXTextMarkup::SwXTextMarkup( SwTxtNode& rTxtNode, const ModelToViewHelper& rMap ) SwXTextMarkup::SwXTextMarkup(
: mpTxtNode( &rTxtNode ), maConversionMap( rMap ) SwTxtNode *const pTxtNode, const ModelToViewHelper& rMap)
: mpTxtNode(pTxtNode)
, maConversionMap(rMap)
{ {
// FME 2007-07-16 #i79641# SwXTextMarkup is allowed to be removed ... // FME 2007-07-16 #i79641# SwXTextMarkup is allowed to be removed ...
SetIsAllowedToBeRemovedInModifyCall(true); SetIsAllowedToBeRemovedInModifyCall(true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment