Kaydet (Commit) 21d97438 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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
üst 34e5e5ec
......@@ -40,9 +40,7 @@ class SvxEditSource;
XMultiPropertySet interfaces. Just set the selection to the
required text range and return a reference to a XPropertySet.
*/
class SvxAccessibleTextPropertySet : public SvxUnoTextRangeBase,
public ::com::sun::star::lang::XTypeProvider,
public ::cppu::OWeakObject
class SvxAccessibleTextPropertySet : public SvxUnoTextRangeBase
{
public:
SvxAccessibleTextPropertySet( const SvxEditSource*, const SvxItemPropertySet* );
......@@ -51,21 +49,11 @@ public:
// XTextRange
virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText() throw (::com::sun::star::uno::RuntimeException);
// uno::XInterface
virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL acquire() throw();
virtual void SAL_CALL release() throw();
// lang::XServiceInfo
virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException);
// lang::XTypeProvider
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
// XServiceName
::rtl::OUString SAL_CALL getServiceName() throw (::com::sun::star::uno::RuntimeException);
};
......
This diff is collapsed.
......@@ -75,70 +75,6 @@ uno::Reference< text::XText > SAL_CALL SvxAccessibleTextPropertySet::getText() t
return uno::Reference< text::XText > ();
}
uno::Any SAL_CALL SvxAccessibleTextPropertySet::queryAggregation( const uno::Type & ) throw(uno::RuntimeException)
{
// TODO (empty?)
return uno::Any();
}
uno::Any SAL_CALL SvxAccessibleTextPropertySet::queryInterface( const uno::Type & rType )
throw(uno::RuntimeException)
{
return OWeakObject::queryInterface(rType);
}
void SAL_CALL SvxAccessibleTextPropertySet::acquire()
throw()
{
OWeakObject::acquire();
}
void SAL_CALL SvxAccessibleTextPropertySet::release()
throw()
{
OWeakObject::release();
}
// XTypeProvider
uno::Sequence< uno::Type > SAL_CALL SvxAccessibleTextPropertySet::getTypes() throw ( uno::RuntimeException )
{
static ::cppu::OTypeCollection* pTypeCollection = NULL ;
// double-checked locking pattern.
if ( pTypeCollection == NULL )
{
osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ;
// Control these pointer again ... it can be, that another instance will be faster then these!
if ( pTypeCollection == NULL )
{
// Create a static typecollection ...
static ::cppu::OTypeCollection aTypeCollection(
::getCppuType( static_cast< const uno::Reference< beans::XPropertySet >* > (0) ),
::getCppuType( static_cast< const uno::Reference< beans::XMultiPropertySet >* > (0) ),
::getCppuType( static_cast< const uno::Reference< beans::XPropertyState >* > (0) ),
::getCppuType( static_cast< const uno::Reference< lang::XServiceInfo >* > (0) ),
::getCppuType( static_cast< const uno::Reference< lang::XTypeProvider >* > (0) ) );
// ... and set his address to static pointer!
pTypeCollection = &aTypeCollection ;
}
}
return pTypeCollection->getTypes() ;
}
namespace
{
class theSvxAccessibleTextPropertySetImplementationId : public rtl::Static< UnoTunnelIdInit, theSvxAccessibleTextPropertySetImplementationId > {};
}
uno::Sequence< sal_Int8 > SAL_CALL SvxAccessibleTextPropertySet::getImplementationId()
throw (uno::RuntimeException)
{
return theSvxAccessibleTextPropertySetImplementationId::get().getSeq();
}
// XServiceInfo
::rtl::OUString SAL_CALL SAL_CALL SvxAccessibleTextPropertySet::getImplementationName (void) throw (uno::RuntimeException)
{
......
This diff is collapsed.
......@@ -43,10 +43,6 @@ using namespace ::rtl;
using namespace ::cppu;
using namespace ::com::sun::star;
#define QUERYINT( xint ) \
if( rType == ::getCppuType((const uno::Reference< xint >*)0) ) \
return uno::makeAny(uno::Reference< xint >(this))
// ====================================================================
// SvxUnoTextContentEnumeration
// ====================================================================
......@@ -119,7 +115,7 @@ static SvxUnoText* getDummyText() throw()
}
SvxUnoTextContent::SvxUnoTextContent() throw()
: SvxUnoTextRangeBase(*getDummyText())
: SvxUnoTextContent_Base(*getDummyText())
, mnParagraph(0)
, mrParentText(*getDummyText())
, maDisposeListeners(maDisposeContainerMutex)
......@@ -128,7 +124,7 @@ SvxUnoTextContent::SvxUnoTextContent() throw()
}
SvxUnoTextContent::SvxUnoTextContent( const SvxUnoTextBase& rText, sal_uInt16 nPara ) throw()
: SvxUnoTextRangeBase(rText)
: SvxUnoTextContent_Base(rText)
, mnParagraph(nPara)
, mrParentText(rText)
, maDisposeListeners(maDisposeContainerMutex)
......@@ -140,11 +136,7 @@ SvxUnoTextContent::SvxUnoTextContent( const SvxUnoTextBase& rText, sal_uInt16 nP
}
SvxUnoTextContent::SvxUnoTextContent( const SvxUnoTextContent& rContent ) throw()
: SvxUnoTextRangeBase(rContent)
, text::XTextContent()
, container::XEnumerationAccess()
, lang::XTypeProvider()
, cppu::OWeakAggObject()
: SvxUnoTextContent_Base(rContent)
, mrParentText(rContent.mrParentText)
, maDisposeListeners(maDisposeContainerMutex)
, mbDisposing( false )
......@@ -158,89 +150,6 @@ SvxUnoTextContent::~SvxUnoTextContent() throw()
{
}
// uno::XInterface
uno::Any SAL_CALL SvxUnoTextContent::queryAggregation( const uno::Type & rType ) throw( uno::RuntimeException )
{
QUERYINT( text::XTextRange );
else QUERYINT( beans::XMultiPropertyStates );
else QUERYINT( beans::XPropertySet );
else QUERYINT( beans::XMultiPropertySet );
else QUERYINT( beans::XPropertyState );
else QUERYINT( text::XTextContent );
else QUERYINT( text::XTextRangeCompare );
else QUERYINT( lang::XComponent );
else QUERYINT( container::XEnumerationAccess );
else QUERYINT( container::XElementAccess );
else QUERYINT( lang::XServiceInfo );
else QUERYINT( lang::XTypeProvider );
else QUERYINT( lang::XUnoTunnel );
else
return OWeakAggObject::queryAggregation( rType );
}
uno::Any SAL_CALL SvxUnoTextContent::queryInterface( const uno::Type & rType ) throw( uno::RuntimeException )
{
return OWeakAggObject::queryInterface(rType);
}
void SAL_CALL SvxUnoTextContent::acquire() throw( )
{
OWeakAggObject::acquire();
}
void SAL_CALL SvxUnoTextContent::release() throw( )
{
OWeakAggObject::release();
}
// XTypeProvider
namespace
{
struct theSvxUnoTextContentTypes :
public rtl::StaticWithInit<uno::Sequence<uno::Type>, theSvxUnoTextContentTypes>
{
uno::Sequence<uno::Type> operator () ()
{
uno::Sequence< uno::Type > aTypeSequence;
aTypeSequence.realloc( 11 ); // !DANGER! keep this updated
uno::Type* pTypes = aTypeSequence.getArray();
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRange >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertySet >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertySet >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertyStates >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertyState >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeCompare >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextContent >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< container::XEnumerationAccess >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XServiceInfo >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XTypeProvider >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XUnoTunnel >*)0);
return aTypeSequence;
}
};
}
uno::Sequence< uno::Type > SAL_CALL SvxUnoTextContent::getTypes()
throw (uno::RuntimeException)
{
return theSvxUnoTextContentTypes::get();
}
namespace
{
class theSvxUnoTextContentImplementationId : public rtl::Static< UnoTunnelIdInit, theSvxUnoTextContentImplementationId > {};
}
uno::Sequence< sal_Int8 > SAL_CALL SvxUnoTextContent::getImplementationId()
throw (uno::RuntimeException)
{
return theSvxUnoTextContentImplementationId::get().getSeq();
}
// text::XTextRange
uno::Reference< text::XText > SAL_CALL SvxUnoTextContent::getText()
......@@ -493,6 +402,18 @@ uno::Any SAL_CALL SvxUnoTextRangeEnumeration::nextElement()
// class SvxUnoTextCursor
// ====================================================================
SvxUnoTextCursor_Base::SvxUnoTextCursor_Base(SvxUnoTextCursor_Base const & base)
throw ():
SvxUnoTextCursor_Base0(base)
{}
SvxUnoTextCursor_Base::SvxUnoTextCursor_Base(SvxUnoTextRangeBase const & base)
throw ():
SvxUnoTextCursor_Base0(base)
{}
SvxUnoTextCursor_Base::~SvxUnoTextCursor_Base() throw () {}
uno::Reference< uno::XInterface > SvxUnoTextCursor_NewInstance()
{
SvxUnoText aText;
......@@ -502,16 +423,13 @@ uno::Reference< uno::XInterface > SvxUnoTextCursor_NewInstance()
}
SvxUnoTextCursor::SvxUnoTextCursor( const SvxUnoTextBase& rText ) throw()
: SvxUnoTextRangeBase(rText),
: SvxUnoTextCursor_Base(rText),
mxParentText( const_cast<SvxUnoTextBase*>(&rText) )
{
}
SvxUnoTextCursor::SvxUnoTextCursor( const SvxUnoTextCursor& rCursor ) throw()
: SvxUnoTextRangeBase(rCursor)
, text::XTextCursor()
, lang::XTypeProvider()
, cppu::OWeakAggObject()
: SvxUnoTextCursor_Base(rCursor)
, mxParentText(rCursor.mxParentText)
{
}
......@@ -520,89 +438,6 @@ SvxUnoTextCursor::~SvxUnoTextCursor() throw()
{
}
// Comment out automatically - [getIdlClass(es) or queryInterface]
// Please use the XTypeProvider!
//sal_Bool SvxUnoTextCursor::queryInterface( uno::Uik aUIK, Reference< uno::XInterface > & xRef)
uno::Any SAL_CALL SvxUnoTextCursor::queryAggregation( const uno::Type & rType )
throw(uno::RuntimeException)
{
if( rType == ::getCppuType((const uno::Reference< text::XTextRange >*)0) )
return uno::makeAny(uno::Reference< text::XTextRange >((text::XText*)(this)));
else QUERYINT( text::XTextCursor );
else QUERYINT( beans::XMultiPropertyStates );
else QUERYINT( beans::XPropertySet );
else QUERYINT( beans::XMultiPropertySet );
else QUERYINT( beans::XPropertyState );
else QUERYINT( text::XTextRangeCompare );
else QUERYINT( lang::XServiceInfo );
else QUERYINT( lang::XTypeProvider );
else QUERYINT( lang::XUnoTunnel );
else
return OWeakAggObject::queryAggregation( rType );
}
uno::Any SAL_CALL SvxUnoTextCursor::queryInterface( const uno::Type & rType )
throw(uno::RuntimeException)
{
return OWeakAggObject::queryInterface(rType);
}
void SAL_CALL SvxUnoTextCursor::acquire() throw ( )
{
OWeakAggObject::acquire();
}
void SAL_CALL SvxUnoTextCursor::release() throw ( )
{
OWeakAggObject::release();
}
namespace
{
struct theSvxUnoTextCursorTypes :
public rtl::StaticWithInit<uno::Sequence<uno::Type>, theSvxUnoTextCursorTypes>
{
uno::Sequence<uno::Type> operator () ()
{
uno::Sequence< uno::Type > aTypeSequence;
aTypeSequence.realloc( 10 ); // !DANGER! keep this updated
uno::Type* pTypes = aTypeSequence.getArray();
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRange >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextCursor >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertySet >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertySet >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertyStates >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertyState >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeCompare >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XServiceInfo >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XTypeProvider >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XUnoTunnel >*)0);
return aTypeSequence;
}
};
}
// XTypeProvider
uno::Sequence< uno::Type > SAL_CALL SvxUnoTextCursor::getTypes()
throw(uno::RuntimeException)
{
return theSvxUnoTextCursorTypes::get();
}
namespace
{
class theSvxUnoTextCursorImplementationId : public rtl::Static< UnoTunnelIdInit, theSvxUnoTextCursorImplementationId > {};
}
uno::Sequence< sal_Int8 > SAL_CALL SvxUnoTextCursor::getImplementationId()
throw (uno::RuntimeException)
{
return theSvxUnoTextCursorImplementationId::get().getSeq();
}
// text::XTextCursor
void SAL_CALL SvxUnoTextCursor::collapseToStart()
throw(uno::RuntimeException)
......
......@@ -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 )
......@@ -756,78 +756,6 @@ sdr::properties::TextProperties* Cell::CloneProperties( SdrObject& rNewObj, Cell
return CloneProperties(mpProperties,rNewObj,rNewCell);
}
// -----------------------------------------------------------------------------
// 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
// -----------------------------------------------------------------------------
......
......@@ -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);
......
......@@ -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
......
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