diff options
Diffstat (limited to 'editeng/source/uno/unotext2.cxx')
-rw-r--r-- | editeng/source/uno/unotext2.cxx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx index 66f094a00e6a..54714027b388 100644 --- a/editeng/source/uno/unotext2.cxx +++ b/editeng/source/uno/unotext2.cxx @@ -34,7 +34,7 @@ using namespace ::com::sun::star; #define QUERYINT( xint ) \ if( rType == cppu::UnoType<xint>::get() ) \ - return uno::makeAny(uno::Reference< xint >(this)) + return uno::Any(uno::Reference< xint >(this)) // SvxUnoTextContentEnumeration @@ -47,6 +47,9 @@ SvxUnoTextContentEnumeration::SvxUnoTextContentEnumeration( const SvxUnoTextBase mpEditSource = rText.GetEditSource()->Clone(); mnNextParagraph = 0; + if (!mpEditSource) + return; + const SvxTextForwarder* pTextForwarder = rText.GetEditSource()->GetTextForwarder(); const sal_Int32 maxParaIndex = std::min( rSel.nEndPara + 1, pTextForwarder->GetParagraphCount() ); @@ -108,7 +111,7 @@ uno::Any SvxUnoTextContentEnumeration::nextElement() uno::Reference< text::XTextContent > xRef( maContents.at(mnNextParagraph) ); mnNextParagraph++; - return uno::makeAny( xRef ); + return uno::Any( xRef ); } @@ -236,7 +239,10 @@ void SAL_CALL SvxUnoTextContent::dispose() } if( mxParentText.is() ) + { mxParentText->removeTextContent( this ); + mxParentText.clear(); + } } void SAL_CALL SvxUnoTextContent::addEventListener( const uno::Reference< lang::XEventListener >& xListener ) @@ -429,7 +435,7 @@ uno::Any SAL_CALL SvxUnoTextRangeEnumeration::nextElement() uno::Reference< text::XTextRange > xRange = maPortions.at(mnNextPortion); mnNextPortion++; - return uno::makeAny( xRange ); + return uno::Any( xRange ); } SvxUnoTextCursor::SvxUnoTextCursor( const SvxUnoTextBase& rText ) noexcept @@ -457,7 +463,7 @@ SvxUnoTextCursor::~SvxUnoTextCursor() noexcept uno::Any SAL_CALL SvxUnoTextCursor::queryAggregation( const uno::Type & rType ) { if( rType == cppu::UnoType<text::XTextRange>::get()) - return uno::makeAny(uno::Reference< text::XTextRange >(static_cast<SvxUnoTextRangeBase *>(this))); + return uno::Any(uno::Reference< text::XTextRange >(static_cast<SvxUnoTextRangeBase *>(this))); else QUERYINT( text::XTextCursor ); else QUERYINT( beans::XMultiPropertyStates ); else QUERYINT( beans::XPropertySet ); |