diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2011-09-09 14:03:27 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2011-09-09 17:46:37 +0200 |
commit | 21d97438e2944861e26e4984195f959a0cce1e41 (patch) | |
tree | 0a980fe781bae8aa564412165c17ebd6d4795749 /svx | |
parent | 34e5e5ecec9779bae3ee48f698d52318f0be5f89 (diff) |
sb140: #i117082# avoid unncessary static class data members (which are destroyed too late)
plus
sb140: #i117082# extra indirections to apeace MSC
sb140: #i117082# avoid warnings about not intializing boost::noncopyable base in copy ctors
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/table/cell.cxx | 74 | ||||
-rw-r--r-- | svx/source/table/cell.hxx | 25 | ||||
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 10 |
3 files changed, 16 insertions, 93 deletions
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index d0f8f1693af7..f9191f1b9d23 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -300,7 +300,7 @@ rtl::Reference< Cell > Cell::create( SdrTableObj& rTableObj, OutlinerParaObject* Cell::Cell( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject ) throw() : SdrText( rTableObj, pOutlinerParaObject ) -, SvxUnoTextBase( ImplGetSvxUnoOutlinerTextCursorSvxPropertySet() ) +, Cell_Base( ImplGetSvxUnoOutlinerTextCursorSvxPropertySet() ) , mpPropSet( ImplGetSvxCellPropertySet() ) , mpProperties( new sdr::properties::CellProperties( rTableObj, this ) ) , mnCellContentType( CellContentType_EMPTY ) @@ -757,78 +757,6 @@ 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 be22b33f1aad..689eea07769f 100644 --- a/svx/source/table/cell.hxx +++ b/svx/source/table/cell.hxx @@ -34,6 +34,7 @@ #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" @@ -57,12 +58,15 @@ namespace sdr { namespace table { // ----------------------------------------------------------------------------- -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 +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 { friend class CellUndo; @@ -112,15 +116,6 @@ 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); diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 7524b4ffc61a..d28c4dd62d8e 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -4021,7 +4021,7 @@ SvxShapeText::SvxShapeText( SdrObject* pObject ) throw () : SvxShape( pObject, getSvxMapProvider().GetMap(SVXMAP_TEXT), getSvxMapProvider().GetPropertySet(SVXMAP_TEXT, SdrObject::GetGlobalDrawObjectItemPool()) ), SvxUnoTextBase( ImplGetSvxUnoOutlinerTextCursorSvxPropertySet() ) { if( pObject && pObject->GetModel() ) - SetEditSource( new SvxTextEditSource( pObject, 0, static_cast< uno::XWeak * >( this ) ) ); + SetEditSource( new SvxTextEditSource( pObject, 0, static_cast< cppu::OWeakObject * >( static_cast< SvxShape * >( this ) ) ) ); } //---------------------------------------------------------------------- @@ -4029,7 +4029,7 @@ SvxShapeText::SvxShapeText( SdrObject* pObject, const SfxItemPropertyMapEntry* p : SvxShape( pObject, pPropertyMap, pPropertySet ), SvxUnoTextBase( ImplGetSvxUnoOutlinerTextCursorSvxPropertySet() ) { if( pObject && pObject->GetModel() ) - SetEditSource( new SvxTextEditSource( pObject, 0, static_cast< uno::XWeak * >( this ) ) ); + SetEditSource( new SvxTextEditSource( pObject, 0, static_cast< cppu::OWeakObject * >( static_cast< SvxShape * >( this ) ) ) ); } //---------------------------------------------------------------------- @@ -4043,7 +4043,7 @@ SvxShapeText::~SvxShapeText() throw () void SvxShapeText::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage ) { if( pNewObj && (NULL == GetEditSource())) - SetEditSource( new SvxTextEditSource( pNewObj, 0, static_cast< uno::XWeak* >(this) ) ); + SetEditSource( new SvxTextEditSource( pNewObj, 0, static_cast< cppu::OWeakObject * >( static_cast< SvxShape* >(this) ) ) ); SvxShape::Create( pNewObj, pNewPage ); } @@ -4277,12 +4277,12 @@ uno::Any SAL_CALL SvxShapeRect::queryAggregation( const uno::Type & rType ) thro void SAL_CALL SvxShapeRect::acquire() throw() { - OWeakAggObject::acquire(); + SvxShapeText::acquire(); } void SAL_CALL SvxShapeRect::release() throw() { - OWeakAggObject::release(); + SvxShapeText::release(); } //---------------------------------------------------------------------- // XServiceInfo |