diff options
Diffstat (limited to 'svx/source/table')
-rw-r--r-- | svx/source/table/cell.cxx | 74 | ||||
-rw-r--r-- | svx/source/table/cell.hxx | 25 |
2 files changed, 88 insertions, 11 deletions
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index 9ffbd38e7ac4..7878426e1fe8 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -297,7 +297,7 @@ rtl::Reference< Cell > Cell::create( SdrTableObj& rTableObj, OutlinerParaObject* Cell::Cell( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject ) throw() : SdrText( rTableObj, pOutlinerParaObject ) -, Cell_Base( ImplGetSvxUnoOutlinerTextCursorSvxPropertySet() ) +, SvxUnoTextBase( ImplGetSvxUnoOutlinerTextCursorSvxPropertySet() ) , mpPropSet( ImplGetSvxCellPropertySet() ) , mpProperties( new sdr::properties::CellProperties( rTableObj, this ) ) , mnCellContentType( CellContentType_EMPTY ) @@ -744,6 +744,78 @@ sdr::properties::TextProperties* Cell::CloneProperties( SdrObject& rNewObj, Cell } // ----------------------------------------------------------------------------- +// XInterface +// ----------------------------------------------------------------------------- + +Any SAL_CALL Cell::queryInterface( const Type & rType ) throw(RuntimeException) +{ + if( rType == XMergeableCell::static_type() ) + return Any( Reference< XMergeableCell >( this ) ); + + if( rType == XCell::static_type() ) + return Any( Reference< XCell >( this ) ); + + if( rType == XLayoutConstrains::static_type() ) + return Any( Reference< XLayoutConstrains >( this ) ); + + if( rType == XEventListener::static_type() ) + return Any( Reference< XEventListener >( this ) ); + + Any aRet( SvxUnoTextBase::queryAggregation( rType ) ); + if( aRet.hasValue() ) + return aRet; + + return ::cppu::OWeakObject::queryInterface( rType ); +} + +// ----------------------------------------------------------------------------- + +void SAL_CALL Cell::acquire() throw () +{ + ::cppu::OWeakObject::acquire(); +} + +// ----------------------------------------------------------------------------- + +void SAL_CALL Cell::release() throw () +{ + ::cppu::OWeakObject::release(); +} + +// ----------------------------------------------------------------------------- +// XTypeProvider +// ----------------------------------------------------------------------------- + +Sequence< Type > SAL_CALL Cell::getTypes( ) throw (RuntimeException) +{ + Sequence< Type > aTypes( SvxUnoTextBase::getTypes() ); + + sal_Int32 nLen = aTypes.getLength(); + aTypes.realloc(nLen + 2); + aTypes[nLen++] = XMergeableCell::static_type(); + aTypes[nLen++] = XLayoutConstrains::static_type(); + + return aTypes; +} + +// ----------------------------------------------------------------------------- + +Sequence< sal_Int8 > SAL_CALL Cell::getImplementationId( ) throw (RuntimeException) +{ + static ::cppu::OImplementationId* pId = 0; + if (! pId) + { + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if (! pId) + { + static ::cppu::OImplementationId aId; + pId = &aId; + } + } + return pId->getImplementationId(); +} + +// ----------------------------------------------------------------------------- // XServiceInfo // ----------------------------------------------------------------------------- diff --git a/svx/source/table/cell.hxx b/svx/source/table/cell.hxx index e9573f45bcfd..cff8c2cdbeb6 100644 --- a/svx/source/table/cell.hxx +++ b/svx/source/table/cell.hxx @@ -34,7 +34,6 @@ #include <com/sun/star/beans/XMultiPropertyStates.hpp> #include <com/sun/star/lang/XEventListener.hpp> -#include <cppuhelper/implbase3.hxx> #include <rtl/ref.hxx> #include <svl/style.hxx> #include "svx/sdtaitm.hxx" @@ -58,15 +57,12 @@ namespace sdr { namespace table { // ----------------------------------------------------------------------------- -typedef - cppu::AggImplInheritanceHelper3< - SvxUnoTextBase, - ::com::sun::star::table::XMergeableCell, - ::com::sun::star::awt::XLayoutConstrains, - ::com::sun::star::lang::XEventListener > - Cell_Base; - -class SVX_DLLPUBLIC Cell : public SdrText, public Cell_Base +class SVX_DLLPUBLIC Cell : public SdrText, + public SvxUnoTextBase, + public ::com::sun::star::table::XMergeableCell, + public ::com::sun::star::awt::XLayoutConstrains, + public ::com::sun::star::lang::XEventListener, + public ::cppu::OWeakObject { friend class CellUndo; @@ -115,6 +111,15 @@ public: SVX_DLLPRIVATE void setMerged(); + // XInterface + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& Type ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL acquire() throw (); + SVX_DLLPRIVATE virtual void SAL_CALL release() throw (); + + // XTypeProvider + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::sal_Int8 > SAL_CALL getImplementationId( ) throw (::com::sun::star::uno::RuntimeException); + // XServiceInfo SVX_DLLPRIVATE virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); SVX_DLLPRIVATE virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); |