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 /editeng/source | |
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 'editeng/source')
-rw-r--r-- | editeng/source/uno/unopracc.cxx | 64 | ||||
-rw-r--r-- | editeng/source/uno/unotext.cxx | 258 | ||||
-rw-r--r-- | editeng/source/uno/unotext2.cxx | 199 |
3 files changed, 40 insertions, 481 deletions
diff --git a/editeng/source/uno/unopracc.cxx b/editeng/source/uno/unopracc.cxx index 088cdbbc3ff7..71ba24cec2a5 100644 --- a/editeng/source/uno/unopracc.cxx +++ b/editeng/source/uno/unopracc.cxx @@ -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) { diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx index 680b0f9f27fe..627f94b38575 100644 --- a/editeng/source/uno/unotext.cxx +++ b/editeng/source/uno/unotext.cxx @@ -60,10 +60,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)) - const SvxItemPropertySet* ImplGetSvxUnoOutlinerTextCursorSvxPropertySet() { static SvxItemPropertySet aTextCursorSvxPropertySet( ImplGetSvxUnoOutlinerTextCursorPropertyMap(), EditEngine::GetGlobalItemPool() ); @@ -217,14 +213,7 @@ SvxUnoTextRangeBase::SvxUnoTextRangeBase( const SvxEditSource* pSource, const Sv } SvxUnoTextRangeBase::SvxUnoTextRangeBase( const SvxUnoTextRangeBase& rRange ) throw() -: text::XTextRange() -, beans::XPropertySet() -, beans::XMultiPropertySet() -, beans::XMultiPropertyStates() -, beans::XPropertyState() -, lang::XServiceInfo() -, text::XTextRangeCompare() -, lang::XUnoTunnel() +: SvxUnoTextRangeBase_Base() , mpPropSet(rRange.getPropertySet()) { SolarMutexGuard aGuard; @@ -1545,89 +1534,6 @@ SvxUnoTextRange::~SvxUnoTextRange() throw() { } -uno::Any SAL_CALL SvxUnoTextRange::queryAggregation( const uno::Type & rType ) - throw(uno::RuntimeException) -{ - QUERYINT( text::XTextRange ); - else if( rType == ::getCppuType((const uno::Reference< beans::XMultiPropertyStates >*)0) ) - return uno::makeAny(uno::Reference< beans::XMultiPropertyStates >(this)); - else if( rType == ::getCppuType((const uno::Reference< beans::XPropertySet >*)0) ) - return uno::makeAny(uno::Reference< beans::XPropertySet >(this)); - else QUERYINT( beans::XPropertyState ); - else QUERYINT( text::XTextRangeCompare ); - else if( rType == ::getCppuType((const uno::Reference< beans::XMultiPropertySet >*)0) ) - return uno::makeAny(uno::Reference< beans::XMultiPropertySet >(this)); - else QUERYINT( lang::XServiceInfo ); - else QUERYINT( lang::XTypeProvider ); - else QUERYINT( lang::XUnoTunnel ); - else - return OWeakAggObject::queryAggregation( rType ); -} - -uno::Any SAL_CALL SvxUnoTextRange::queryInterface( const uno::Type & rType ) - throw(uno::RuntimeException) -{ - return OWeakAggObject::queryInterface(rType); -} - -void SAL_CALL SvxUnoTextRange::acquire() - throw( ) -{ - OWeakAggObject::acquire(); -} - -void SAL_CALL SvxUnoTextRange::release() - throw( ) -{ - OWeakAggObject::release(); -} - -// XTypeProvider - -namespace -{ - struct theSvxUnoTextRangeTypes : - public rtl::StaticWithInit<uno::Sequence<uno::Type>, theSvxUnoTextRangeTypes> - { - uno::Sequence<uno::Type> operator () () - { - uno::Sequence< uno::Type > aTypeSequence; - - aTypeSequence.realloc( 9 ); // !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< lang::XServiceInfo >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< lang::XTypeProvider >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< lang::XUnoTunnel >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeCompare >*)0); - - return aTypeSequence; - } - }; -} - -uno::Sequence< uno::Type > SAL_CALL SvxUnoTextRange::getTypes() - throw (uno::RuntimeException) -{ - return theSvxUnoTextRangeTypes::get(); -} - -namespace -{ - class theSvxUnoTextRangeImplementationId : public rtl::Static< UnoTunnelIdInit, theSvxUnoTextRangeImplementationId > {}; -} - -uno::Sequence< sal_Int8 > SAL_CALL SvxUnoTextRange::getImplementationId() - throw (uno::RuntimeException) -{ - return theSvxUnoTextRangeImplementationId::get().getSeq(); -} - // XTextRange uno::Reference< text::XText > SAL_CALL SvxUnoTextRange::getText() throw(uno::RuntimeException) @@ -1646,19 +1552,36 @@ OUString SAL_CALL SvxUnoTextRange::getImplementationName() // class SvxUnoText // ==================================================================== +SvxUnoTextBase_Base::SvxUnoTextBase_Base(SvxUnoTextBase_Base const & base) + throw (): + SvxUnoTextBase_Base0(base) +{} + +SvxUnoTextBase_Base::SvxUnoTextBase_Base(SvxItemPropertySet const * set) + throw (): + SvxUnoTextBase_Base0(set) +{} + +SvxUnoTextBase_Base::SvxUnoTextBase_Base( + SvxEditSource const * source, SvxItemPropertySet const * set) throw (): + SvxUnoTextBase_Base0(source, set) +{} + +SvxUnoTextBase_Base::~SvxUnoTextBase_Base() throw () {} + SvxUnoTextBase::SvxUnoTextBase() throw() -: SvxUnoTextRangeBase( NULL ) +: SvxUnoTextBase_Base( static_cast< SvxItemPropertySet * >(NULL) ) { } SvxUnoTextBase::SvxUnoTextBase( const SvxItemPropertySet* _pSet ) throw() -: SvxUnoTextRangeBase( _pSet ) +: SvxUnoTextBase_Base( _pSet ) { } SvxUnoTextBase::SvxUnoTextBase( const SvxEditSource* pSource, const SvxItemPropertySet* _pSet ) throw() -: SvxUnoTextRangeBase( pSource, _pSet ) +: SvxUnoTextBase_Base( pSource, _pSet ) { ESelection aSelection; ::GetSelection( aSelection, GetEditSource()->GetTextForwarder() ); @@ -1666,7 +1589,7 @@ SvxUnoTextBase::SvxUnoTextBase( const SvxEditSource* pSource, const SvxItemPrope } SvxUnoTextBase::SvxUnoTextBase( const SvxEditSource* pSource, const SvxItemPropertySet* _pSet, uno::Reference < text::XText > xParent ) throw() -: SvxUnoTextRangeBase( pSource, _pSet ) +: SvxUnoTextBase_Base( pSource, _pSet ) { xParentText = xParent; ESelection aSelection; @@ -1675,12 +1598,7 @@ SvxUnoTextBase::SvxUnoTextBase( const SvxEditSource* pSource, const SvxItemPrope } SvxUnoTextBase::SvxUnoTextBase( const SvxUnoTextBase& rText ) throw() -: SvxUnoTextRangeBase( rText ) -, text::XTextAppend() -, text::XTextCopy() -, container::XEnumerationAccess() -, text::XTextRangeMover() -, lang::XTypeProvider() +: SvxUnoTextBase_Base( rText ) { xParentText = rText.xParentText; } @@ -1708,89 +1626,6 @@ ESelection SvxUnoTextBase::InsertField( const SvxFieldItem& rField ) throw() return GetSelection(); // Selection with the field } -// XInterface -uno::Any SAL_CALL SvxUnoTextBase::queryAggregation( const uno::Type & rType ) - throw(uno::RuntimeException) -{ - QUERYINT( text::XText ); - QUERYINT( text::XSimpleText ); - if( rType == ::getCppuType((const uno::Reference< text::XTextRange >*)0) ) - return uno::makeAny(uno::Reference< text::XTextRange >((text::XText*)(this))); - QUERYINT(container::XEnumerationAccess ); - QUERYINT( container::XElementAccess ); - QUERYINT( beans::XMultiPropertyStates ); - QUERYINT( beans::XPropertySet ); - QUERYINT( beans::XMultiPropertySet ); - QUERYINT( beans::XPropertyState ); - QUERYINT( text::XTextRangeCompare ); - QUERYINT( lang::XServiceInfo ); - QUERYINT( text::XTextRangeMover ); - QUERYINT( text::XTextCopy ); - QUERYINT( text::XTextAppend ); - QUERYINT( text::XParagraphAppend ); - QUERYINT( text::XTextPortionAppend ); - QUERYINT( lang::XTypeProvider ); - QUERYINT( lang::XUnoTunnel ); - - return uno::Any(); -} - -// XTypeProvider - -namespace -{ - struct theSvxUnoTextBaseTypes : - public rtl::StaticWithInit<uno::Sequence<uno::Type>, theSvxUnoTextBaseTypes> - { - uno::Sequence<uno::Type> operator () () - { - uno::Sequence< uno::Type > aTypeSequence; - - aTypeSequence.realloc( 15 ); // !DANGER! keep this updated - uno::Type* pTypes = aTypeSequence.getArray(); - - *pTypes++ = ::getCppuType(( const uno::Reference< text::XText >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< container::XEnumerationAccess >*)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::XTextRangeMover >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextAppend >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextCopy >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< text::XParagraphAppend >*)0); - *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextPortionAppend >*)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); - *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeCompare >*)0); - - return aTypeSequence; - } - }; -} -uno::Sequence< uno::Type > SAL_CALL SvxUnoTextBase::getStaticTypes() throw() -{ - return theSvxUnoTextBaseTypes::get(); -} - -uno::Sequence< uno::Type > SAL_CALL SvxUnoTextBase::getTypes() - throw (uno::RuntimeException) -{ - return getStaticTypes(); -} - -namespace -{ - class theSvxUnoTextBaseImplementationId : public rtl::Static< UnoTunnelIdInit, theSvxUnoTextBaseImplementationId > {}; -} - -uno::Sequence< sal_Int8 > SAL_CALL SvxUnoTextBase::getImplementationId() - throw (uno::RuntimeException) -{ - return theSvxUnoTextBaseImplementationId::get().getSeq(); -} - uno::Reference< text::XTextCursor > SvxUnoTextBase::createTextCursorBySelection( const ESelection& rSel ) { SvxUnoTextCursor* pCursor = new SvxUnoTextCursor( *this ); @@ -2343,7 +2178,6 @@ SvxUnoText::SvxUnoText( const SvxEditSource* pSource, const SvxItemPropertySet* SvxUnoText::SvxUnoText( const SvxUnoText& rText ) throw() : SvxUnoTextBase( rText ) -, cppu::OWeakAggObject() { } @@ -2351,52 +2185,6 @@ SvxUnoText::~SvxUnoText() throw() { } -uno::Sequence< uno::Type > SAL_CALL getStaticTypes() throw() -{ - return SvxUnoTextBase::getStaticTypes(); -} - -// uno::XInterface -uno::Any SAL_CALL SvxUnoText::queryAggregation( const uno::Type & rType ) throw( uno::RuntimeException ) -{ - uno::Any aAny( SvxUnoTextBase::queryAggregation( rType ) ); - if( !aAny.hasValue() ) - aAny = OWeakAggObject::queryAggregation( rType ); - - return aAny; -} - -uno::Any SAL_CALL SvxUnoText::queryInterface( const uno::Type & rType ) throw( uno::RuntimeException ) -{ - return OWeakAggObject::queryInterface( rType ); -} - -void SAL_CALL SvxUnoText::acquire() throw( ) -{ - OWeakAggObject::acquire(); -} - -void SAL_CALL SvxUnoText::release() throw( ) -{ - OWeakAggObject::release(); -} - -// lang::XTypeProvider -uno::Sequence< uno::Type > SAL_CALL SvxUnoText::getTypes( ) throw( uno::RuntimeException ) -{ - return SvxUnoTextBase::getTypes(); -} - -namespace -{ - class theSvxUnoTextImplementationId : public rtl::Static< UnoTunnelIdInit, theSvxUnoTextImplementationId > {}; -} - -uno::Sequence< sal_Int8 > SAL_CALL SvxUnoText::getImplementationId( ) throw( uno::RuntimeException ) -{ - return theSvxUnoTextImplementationId::get().getSeq(); -} - SvxUnoText* SvxUnoText::getImplementation( const uno::Reference< uno::XInterface >& xInt ) { uno::Reference< lang::XUnoTunnel > xUT( xInt, uno::UNO_QUERY ); diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx index 33fcf225eb2d..23f01936b693 100644 --- a/editeng/source/uno/unotext2.cxx +++ b/editeng/source/uno/unotext2.cxx @@ -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) |