accessibility/source/extended/accessibleiconchoicectrl.cxx | 2 accessibility/source/extended/accessibletablistbox.cxx | 2 accessibility/source/extended/textwindowaccessibility.cxx | 30 ++++++------- accessibility/source/standard/vclxaccessiblebox.cxx | 2 avmedia/source/framework/soundhandler.cxx | 2 avmedia/source/gtk/gtkplayer.cxx | 4 - 6 files changed, 21 insertions(+), 21 deletions(-)
New commits: commit 1df99a2155751a1874f45b57a637ee9ecc4dc110 Author: Mike Kaganski <[email protected]> AuthorDate: Sun Apr 23 20:12:49 2023 +0300 Commit: Mike Kaganski <[email protected]> CommitDate: Sat Apr 29 21:35:24 2023 +0200 Use getXWeak in avmedia Change-Id: I1dc1e597c50b0081375b9216ac4e6436b84aaa0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150832 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> diff --git a/avmedia/source/framework/soundhandler.cxx b/avmedia/source/framework/soundhandler.cxx index 2392c3dd1ae1..14870c9ee9be 100644 --- a/avmedia/source/framework/soundhandler.cxx +++ b/avmedia/source/framework/soundhandler.cxx @@ -195,7 +195,7 @@ void SAL_CALL SoundHandler::dispatchWithNotification(const css::util::URL& m_xPlayer.set( avmedia::MediaWindow::createPlayer( aURL.Complete, aDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_REFERRER, OUString()) ), css::uno::UNO_SET_THROW ); // OK- we can start async playing ... // Count this request and initialize self-holder against dying by uno ref count ... - m_xSelfHold.set(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY); + m_xSelfHold.set(getXWeak()); m_xPlayer->start(); m_aUpdateIdle.SetPriority( TaskPriority::HIGH_IDLE ); m_aUpdateIdle.Start(); diff --git a/avmedia/source/gtk/gtkplayer.cxx b/avmedia/source/gtk/gtkplayer.cxx index 51978c3e5b45..47a57e3a4cd2 100644 --- a/avmedia/source/gtk/gtkplayer.cxx +++ b/avmedia/source/gtk/gtkplayer.cxx @@ -163,7 +163,7 @@ void GtkPlayer::notifyListeners() return; css::lang::EventObject aEvent; - aEvent.Source = static_cast<cppu::OWeakObject*>(this); + aEvent.Source = getXWeak(); comphelper::OInterfaceIteratorHelper2 pIterator(*pContainer); while (pIterator.hasMoreElements()) @@ -374,7 +374,7 @@ GtkPlayer::addPlayerListener(const css::uno::Reference<css::media::XPlayerListen if (gtk_media_stream_is_prepared(m_pStream)) { css::lang::EventObject aEvent; - aEvent.Source = static_cast<cppu::OWeakObject*>(this); + aEvent.Source = getXWeak(); rListener->preferredPlayerWindowSizeAvailable(aEvent); } else commit 32122e89310bd1d72aa796823965eadd766a84fc Author: Mike Kaganski <[email protected]> AuthorDate: Sun Apr 23 20:12:43 2023 +0300 Commit: Mike Kaganski <[email protected]> CommitDate: Sat Apr 29 21:35:10 2023 +0200 Use getXWeak in accessibility Change-Id: Ifd6d57bb4087e6934075ff9f0931260cb8d09328 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150830 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> diff --git a/accessibility/source/extended/accessibleiconchoicectrl.cxx b/accessibility/source/extended/accessibleiconchoicectrl.cxx index 1d0dbbe68a7d..032c9dae95bc 100644 --- a/accessibility/source/extended/accessibleiconchoicectrl.cxx +++ b/accessibility/source/extended/accessibleiconchoicectrl.cxx @@ -164,7 +164,7 @@ namespace accessibility if ( !pEntry ) throw RuntimeException("getAccessibleChild: Entry " + OUString::number(i) + " not found", - static_cast<OWeakObject*>(this)); + getXWeak()); return new AccessibleIconChoiceCtrlEntry( *pCtrl, i, this ); } diff --git a/accessibility/source/extended/accessibletablistbox.cxx b/accessibility/source/extended/accessibletablistbox.cxx index f4bffa6e7442..88bffdc1b4e5 100644 --- a/accessibility/source/extended/accessibletablistbox.cxx +++ b/accessibility/source/extended/accessibletablistbox.cxx @@ -100,7 +100,7 @@ namespace accessibility xRet = implGetTable(); if ( !xRet.is() ) - throw RuntimeException("getAccessibleChild called with NULL xRet",static_cast< cppu::OWeakObject * >(this)); + throw RuntimeException("getAccessibleChild called with NULL xRet",getXWeak()); return xRet; } diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx index 2e1cf87fa10f..eedf5e5eb393 100644 --- a/accessibility/source/extended/textwindowaccessibility.cxx +++ b/accessibility/source/extended/textwindowaccessibility.cxx @@ -118,7 +118,7 @@ void Paragraph::notifyEvent(::sal_Int16 nEventId, { if (m_nClientId) comphelper::AccessibleEventNotifier::addEvent( m_nClientId, css::accessibility::AccessibleEventObject( - static_cast< ::cppu::OWeakObject * >(this), + getXWeak(), nEventId, rNewValue, rOldValue) ); } @@ -145,7 +145,7 @@ Paragraph::getAccessibleChild(sal_Int64) throw css::lang::IndexOutOfBoundsException( "textwindowaccessibility.cxx:" " Paragraph::getAccessibleChild", - static_cast< css::uno::XWeak * >(this)); + getXWeak()); } // virtual @@ -558,7 +558,7 @@ css::accessibility::TextSegment SAL_CALL Paragraph::getTextAtLineWithCaret( ) throw css::lang::WrappedTargetRuntimeException( "textwindowaccessibility.cxx:" " Paragraph::getTextAtLineWithCaret", - static_cast< css::uno::XWeak * >( this ), anyEx ); + getXWeak(), anyEx ); } } @@ -583,7 +583,7 @@ void SAL_CALL Paragraph::addAccessibleEventListener( { aGuard.clear(); rListener->disposing(css::lang::EventObject( - static_cast< ::cppu::OWeakObject * >(this))); + getXWeak())); } else { @@ -697,7 +697,7 @@ void Paragraph::checkDisposed() if (!(rBHelper.bDisposed || rBHelper.bInDispose)) return; throw css::lang::DisposedException( - OUString(), static_cast< css::uno::XWeak * >(this)); + OUString(), getXWeak()); } Document::Document(::VCLXWindow * pVclXWindow, ::TextEngine & rEngine, @@ -863,7 +863,7 @@ Document::retrieveCharacterBounds(Paragraph const * pParagraph, throw css::lang::IndexOutOfBoundsException( "textwindowaccessibility.cxx:" " Document::retrieveCharacterAttributes", - static_cast< css::uno::XWeak * >(this)); + getXWeak()); css::awt::Rectangle aBounds( 0, 0, 0, 0 ); if ( nIndex == nLength ) { @@ -988,7 +988,7 @@ Document::retrieveCharacterAttributes( throw css::lang::IndexOutOfBoundsException( "textwindowaccessibility.cxx:" " Document::retrieveCharacterAttributes", - static_cast< css::uno::XWeak * >(this)); + getXWeak()); // retrieve run attributes @@ -1081,7 +1081,7 @@ Document::retrieveRunAttributes( throw css::lang::IndexOutOfBoundsException( "textwindowaccessibility.cxx:" " Document::retrieveRunAttributes", - static_cast< css::uno::XWeak * >( this ) ); + getXWeak() ); tPropValMap aRunAttrSeq; retrieveRunAttributesImpl( pParagraph, Index, RequestedAttributes, aRunAttrSeq ); @@ -1116,7 +1116,7 @@ void Document::changeParagraphText(Paragraph const * pParagraph, throw css::lang::IndexOutOfBoundsException( "textwindowaccessibility.cxx:" " Document::changeParagraphText", - static_cast< css::uno::XWeak * >(this)); + getXWeak()); changeParagraphText(nNumber, static_cast< ::sal_uInt16 >(nBegin), static_cast< ::sal_uInt16 >(nEnd), bCut, bPaste, rText); // XXX numeric overflow (2x) @@ -1136,7 +1136,7 @@ void Document::copyParagraphText(Paragraph const * pParagraph, throw css::lang::IndexOutOfBoundsException( "textwindowaccessibility.cxx:" " Document::copyParagraphText", - static_cast< css::uno::XWeak * >(this)); + getXWeak()); m_rView.SetSelection( ::TextSelection(::TextPaM(nNumber, nBegin), ::TextPaM(nNumber, nEnd))); @@ -1159,7 +1159,7 @@ void Document::changeParagraphAttributes( throw css::lang::IndexOutOfBoundsException( "textwindowaccessibility.cxx:" " Document::changeParagraphAttributes", - static_cast< css::uno::XWeak * >(this)); + getXWeak()); // FIXME The new attributes are added to any attributes already set, // they do not replace the old attributes as required by @@ -1191,7 +1191,7 @@ void Document::changeParagraphSelection(Paragraph const * pParagraph, throw css::lang::IndexOutOfBoundsException( "textwindowaccessibility.cxx:" " Document::changeParagraphSelection", - static_cast< css::uno::XWeak * >(this)); + getXWeak()); m_rView.SetSelection( ::TextSelection(::TextPaM(nNumber, nBegin), ::TextPaM(nNumber, nEnd))); @@ -1215,7 +1215,7 @@ Document::retrieveParagraphLineBoundary( Paragraph const * pParagraph, throw css::lang::IndexOutOfBoundsException( "textwindowaccessibility.cxx:" " Document::retrieveParagraphLineBoundary", - static_cast< css::uno::XWeak * >( this ) ); + getXWeak() ); ::sal_Int32 nLineStart = 0; ::sal_Int32 nLineEnd = 0; ::sal_uInt16 nLineCount = m_rEngine.GetLineCount( nNumber ); @@ -1253,7 +1253,7 @@ Document::retrieveParagraphBoundaryOfLine( Paragraph const * pParagraph, throw css::lang::IndexOutOfBoundsException( "textwindowaccessibility.cxx:" " Document::retrieveParagraphBoundaryOfLine", - static_cast< css::uno::XWeak * >( this ) ); + getXWeak() ); ::sal_Int32 nLineStart = 0; ::sal_Int32 nLineEnd = 0; for ( ::sal_Int32 nLine = 0; nLine <= nLineNo; ++nLine ) @@ -1326,7 +1326,7 @@ Document::getAccessibleChild(sal_Int64 i) throw css::lang::IndexOutOfBoundsException( "textwindowaccessibility.cxx:" " Document::getAccessibleChild", - static_cast< css::uno::XWeak * >(this)); + getXWeak()); return getAccessibleChild(m_aVisibleBegin + static_cast< Paragraphs::size_type >(i)); } diff --git a/accessibility/source/standard/vclxaccessiblebox.cxx b/accessibility/source/standard/vclxaccessiblebox.cxx index 9f7d4e505ba8..4f4972a04477 100644 --- a/accessibility/source/standard/vclxaccessiblebox.cxx +++ b/accessibility/source/standard/vclxaccessiblebox.cxx @@ -372,7 +372,7 @@ sal_Bool SAL_CALL VCLXAccessibleBox::doAccessibleAction (sal_Int32 nIndex) ("VCLXAccessibleBox::doAccessibleAction: index " + OUString::number(nIndex) + " not among 0.." + OUString::number(getAccessibleActionCount())), - static_cast<OWeakObject*>(this)); + getXWeak()); if (m_aBoxType == COMBOBOX) {
