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

sw: use ImplInheritanceHelper for SwXTextGraphicObject

... and SwXTextEmbeddedObjectBaseClass, and get rid of pointless manual
overriding of XInterface and XTypeProvider.

Change-Id: I6695d825b5caba08aca9764eb3052eab77ee6fdb
üst b252bbf9
...@@ -237,14 +237,13 @@ public: ...@@ -237,14 +237,13 @@ public:
void SAL_CALL operator delete( void * ) throw(); void SAL_CALL operator delete( void * ) throw();
}; };
typedef cppu::WeakImplHelper typedef cppu::ImplInheritanceHelper
< < SwXFrame,
css::text::XTextContent, css::text::XTextContent,
css::document::XEventsSupplier css::document::XEventsSupplier
> >
SwXTextGraphicObjectBaseClass; SwXTextGraphicObjectBaseClass;
class SwXTextGraphicObject : public SwXTextGraphicObjectBaseClass, class SwXTextGraphicObject : public SwXTextGraphicObjectBaseClass
public SwXFrame
{ {
protected: protected:
friend class SwXFrame; // just for CreateXFrame friend class SwXFrame; // just for CreateXFrame
...@@ -259,14 +258,6 @@ public: ...@@ -259,14 +258,6 @@ public:
static css::uno::Reference<css::text::XTextContent> static css::uno::Reference<css::text::XTextContent>
CreateXTextGraphicObject(SwDoc & rDoc, SwFrameFormat * pFrameFormat); CreateXTextGraphicObject(SwDoc & rDoc, SwFrameFormat * pFrameFormat);
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw(css::uno::RuntimeException, std::exception) override;
virtual void SAL_CALL acquire( ) throw() override;
virtual void SAL_CALL release( ) throw() override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) throw(css::uno::RuntimeException, std::exception) override;
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(css::uno::RuntimeException, std::exception) override;
//XTextContent //XTextContent
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > & xTextRange) throw( css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception ) override; virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > & xTextRange) throw( css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception ) override;
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() throw( css::uno::RuntimeException, std::exception ) override; virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() throw( css::uno::RuntimeException, std::exception ) override;
...@@ -288,15 +279,14 @@ public: ...@@ -288,15 +279,14 @@ public:
}; };
class SwOLENode; class SwOLENode;
typedef cppu::WeakImplHelper typedef cppu::ImplInheritanceHelper
< < SwXFrame,
css::text::XTextContent, css::text::XTextContent,
css::document::XEmbeddedObjectSupplier2, css::document::XEmbeddedObjectSupplier2,
css::document::XEventsSupplier css::document::XEventsSupplier
>SwXTextEmbeddedObjectBaseClass; > SwXTextEmbeddedObjectBaseClass;
class SwXTextEmbeddedObject : public SwXTextEmbeddedObjectBaseClass, class SwXTextEmbeddedObject : public SwXTextEmbeddedObjectBaseClass
public SwXFrame
{ {
css::uno::Reference<css::util::XModifyListener> m_xOLEListener; css::uno::Reference<css::util::XModifyListener> m_xOLEListener;
protected: protected:
...@@ -312,14 +302,6 @@ public: ...@@ -312,14 +302,6 @@ public:
static css::uno::Reference<css::text::XTextContent> static css::uno::Reference<css::text::XTextContent>
CreateXTextEmbeddedObject(SwDoc & rDoc, SwFrameFormat * pFrameFormat); CreateXTextEmbeddedObject(SwDoc & rDoc, SwFrameFormat * pFrameFormat);
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw(css::uno::RuntimeException, std::exception) override;
virtual void SAL_CALL acquire( ) throw() override;
virtual void SAL_CALL release( ) throw() override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) throw(css::uno::RuntimeException, std::exception) override;
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(css::uno::RuntimeException, std::exception) override;
//XTextContent //XTextContent
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > & xTextRange) throw( css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception ) override; virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > & xTextRange) throw( css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception ) override;
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() throw( css::uno::RuntimeException, std::exception ) override; virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() throw( css::uno::RuntimeException, std::exception ) override;
......
...@@ -3400,20 +3400,20 @@ sal_Int64 SAL_CALL SwXTextFrame::getSomething( const uno::Sequence< sal_Int8 >& ...@@ -3400,20 +3400,20 @@ sal_Int64 SAL_CALL SwXTextFrame::getSomething( const uno::Sequence< sal_Int8 >&
return aRet; return aRet;
} }
SwXTextGraphicObject::SwXTextGraphicObject( SwDoc *pDoc ) : SwXTextGraphicObject::SwXTextGraphicObject( SwDoc *pDoc )
SwXFrame(FLYCNTTYPE_GRF, aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_GRAPHIC), pDoc) : SwXTextGraphicObjectBaseClass(FLYCNTTYPE_GRF,
aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_GRAPHIC), pDoc)
{ {
} }
SwXTextGraphicObject::SwXTextGraphicObject(SwFrameFormat& rFormat) : SwXTextGraphicObject::SwXTextGraphicObject(SwFrameFormat& rFormat)
SwXFrame(rFormat, FLYCNTTYPE_GRF, aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_GRAPHIC)) : SwXTextGraphicObjectBaseClass(rFormat, FLYCNTTYPE_GRF,
aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_GRAPHIC))
{ {
} }
SwXTextGraphicObject::~SwXTextGraphicObject() SwXTextGraphicObject::~SwXTextGraphicObject()
{ {
} }
uno::Reference<text::XTextContent> uno::Reference<text::XTextContent>
...@@ -3422,50 +3422,6 @@ SwXTextGraphicObject::CreateXTextGraphicObject(SwDoc & rDoc, SwFrameFormat *cons ...@@ -3422,50 +3422,6 @@ SwXTextGraphicObject::CreateXTextGraphicObject(SwDoc & rDoc, SwFrameFormat *cons
return CreateXFrame<text::XTextContent, SwXTextGraphicObject>(rDoc, pFrameFormat); return CreateXFrame<text::XTextContent, SwXTextGraphicObject>(rDoc, pFrameFormat);
} }
void SAL_CALL SwXTextGraphicObject::acquire( )throw()
{
SwXFrame::acquire();
}
void SAL_CALL SwXTextGraphicObject::release( )throw()
{
SwXFrame::release();
}
::uno::Any SAL_CALL SwXTextGraphicObject::queryInterface( const uno::Type& aType )
throw(uno::RuntimeException, std::exception)
{
::uno::Any aRet = SwXFrame::queryInterface(aType);
if(aRet.getValueType() == cppu::UnoType<void>::get())
aRet = SwXTextGraphicObjectBaseClass::queryInterface(aType);
return aRet;
}
uno::Sequence< uno::Type > SAL_CALL
SwXTextGraphicObject::getTypes( ) throw(uno::RuntimeException, std::exception)
{
uno::Sequence< uno::Type > aGraphicTypes = SwXTextGraphicObjectBaseClass::getTypes();
uno::Sequence< uno::Type > aFrameTypes = SwXFrame::getTypes();
long nIndex = aGraphicTypes.getLength();
aGraphicTypes.realloc(
aGraphicTypes.getLength() +
aFrameTypes.getLength());
uno::Type* pGraphicTypes = aGraphicTypes.getArray();
const uno::Type* pFrameTypes = aFrameTypes.getConstArray();
long nPos;
for(nPos = 0; nPos <aFrameTypes.getLength(); nPos++)
pGraphicTypes[nIndex++] = pFrameTypes[nPos];
return aGraphicTypes;
}
uno::Sequence< sal_Int8 > SAL_CALL SwXTextGraphicObject::getImplementationId( ) throw(uno::RuntimeException, std::exception)
{
return css::uno::Sequence<sal_Int8>();
}
void SwXTextGraphicObject::attach(const uno::Reference< text::XTextRange > & xTextRange) throw( lang::IllegalArgumentException, uno::RuntimeException, std::exception ) void SwXTextGraphicObject::attach(const uno::Reference< text::XTextRange > & xTextRange) throw( lang::IllegalArgumentException, uno::RuntimeException, std::exception )
{ {
SwXFrame::attach(xTextRange); SwXFrame::attach(xTextRange);
...@@ -3533,19 +3489,20 @@ uno::Reference<container::XNameReplace> SAL_CALL ...@@ -3533,19 +3489,20 @@ uno::Reference<container::XNameReplace> SAL_CALL
} }
SwXTextEmbeddedObject::SwXTextEmbeddedObject( SwDoc *pDoc ) SwXTextEmbeddedObject::SwXTextEmbeddedObject( SwDoc *pDoc )
: SwXFrame(FLYCNTTYPE_OLE, aSwMapProvider.GetPropertySet(PROPERTY_MAP_EMBEDDED_OBJECT), pDoc) : SwXTextEmbeddedObjectBaseClass(FLYCNTTYPE_OLE,
aSwMapProvider.GetPropertySet(PROPERTY_MAP_EMBEDDED_OBJECT), pDoc)
, m_xOLEListener(nullptr) , m_xOLEListener(nullptr)
{ }
SwXTextEmbeddedObject::SwXTextEmbeddedObject(SwFrameFormat& rFormat) :
SwXFrame(rFormat, FLYCNTTYPE_OLE, aSwMapProvider.GetPropertySet(PROPERTY_MAP_EMBEDDED_OBJECT))
{ {
}
SwXTextEmbeddedObject::SwXTextEmbeddedObject(SwFrameFormat& rFormat)
: SwXTextEmbeddedObjectBaseClass(rFormat, FLYCNTTYPE_OLE,
aSwMapProvider.GetPropertySet(PROPERTY_MAP_EMBEDDED_OBJECT))
{
} }
SwXTextEmbeddedObject::~SwXTextEmbeddedObject() SwXTextEmbeddedObject::~SwXTextEmbeddedObject()
{ {
} }
uno::Reference<text::XTextContent> uno::Reference<text::XTextContent>
...@@ -3554,50 +3511,6 @@ SwXTextEmbeddedObject::CreateXTextEmbeddedObject(SwDoc & rDoc, SwFrameFormat *co ...@@ -3554,50 +3511,6 @@ SwXTextEmbeddedObject::CreateXTextEmbeddedObject(SwDoc & rDoc, SwFrameFormat *co
return CreateXFrame<text::XTextContent, SwXTextEmbeddedObject>(rDoc, pFrameFormat); return CreateXFrame<text::XTextContent, SwXTextEmbeddedObject>(rDoc, pFrameFormat);
} }
void SAL_CALL SwXTextEmbeddedObject::acquire()throw()
{
SwXFrame::acquire();
}
void SAL_CALL SwXTextEmbeddedObject::release()throw()
{
SwXFrame::release();
}
::uno::Any SAL_CALL SwXTextEmbeddedObject::queryInterface( const uno::Type& aType )
throw( uno::RuntimeException, std::exception)
{
::uno::Any aRet = SwXFrame::queryInterface(aType);
if(aRet.getValueType() == cppu::UnoType<void>::get())
aRet = SwXTextEmbeddedObjectBaseClass::queryInterface(aType);
return aRet;
}
uno::Sequence< uno::Type > SAL_CALL SwXTextEmbeddedObject::getTypes( ) throw(uno::RuntimeException, std::exception)
{
uno::Sequence< uno::Type > aTextEmbeddedTypes = SwXTextEmbeddedObjectBaseClass::getTypes();
uno::Sequence< uno::Type > aFrameTypes = SwXFrame::getTypes();
long nIndex = aTextEmbeddedTypes.getLength();
aTextEmbeddedTypes.realloc(
aTextEmbeddedTypes.getLength() +
aFrameTypes.getLength());
uno::Type* pTextEmbeddedTypes = aTextEmbeddedTypes.getArray();
const uno::Type* pFrameTypes = aFrameTypes.getConstArray();
long nPos;
for(nPos = 0; nPos <aFrameTypes.getLength(); nPos++)
pTextEmbeddedTypes[nIndex++] = pFrameTypes[nPos];
return aTextEmbeddedTypes;
}
uno::Sequence< sal_Int8 > SAL_CALL SwXTextEmbeddedObject::getImplementationId( ) throw(uno::RuntimeException, std::exception)
{
return css::uno::Sequence<sal_Int8>();
}
void SwXTextEmbeddedObject::attach(const uno::Reference< text::XTextRange > & xTextRange) throw( lang::IllegalArgumentException, uno::RuntimeException, std::exception ) void SwXTextEmbeddedObject::attach(const uno::Reference< text::XTextRange > & xTextRange) throw( lang::IllegalArgumentException, uno::RuntimeException, std::exception )
{ {
SwXFrame::attach(xTextRange); SwXFrame::attach(xTextRange);
......
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