[Libreoffice-commits] core.git: sw/source

Michael Stahl mstahl at redhat.com
Fri Mar 24 21:08:23 UTC 2017


 sw/source/core/access/acccell.cxx         |    6 +-
 sw/source/core/access/acccontext.cxx      |   26 ++++++--
 sw/source/core/access/acccontext.hxx      |   15 -----
 sw/source/core/access/accdoc.cxx          |    7 +-
 sw/source/core/access/accfootnote.cxx     |    2 
 sw/source/core/access/accheaderfooter.cxx |    2 
 sw/source/core/access/accnotextframe.cxx  |    9 +--
 sw/source/core/access/accpage.cxx         |    2 
 sw/source/core/access/accpara.cxx         |   90 ++++++++++++++++--------------
 sw/source/core/access/acctable.cxx        |   47 ++++++++-------
 sw/source/core/access/acctextframe.cxx    |    7 +-
 11 files changed, 116 insertions(+), 97 deletions(-)

New commits:
commit c7b74fd04e4020428217f0d9e6104c0a2b4ab790
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Mar 24 21:50:29 2017 +0100

    sw: remove CHECK_FOR_DEFUNC macros
    
    Change-Id: I317b5fcd6e5753b4f854930ed4f4ceea53a385c4

diff --git a/sw/source/core/access/acccell.cxx b/sw/source/core/access/acccell.cxx
index 85b733f74bcd..824169db9604 100644
--- a/sw/source/core/access/acccell.cxx
+++ b/sw/source/core/access/acccell.cxx
@@ -341,7 +341,8 @@ SwFrameFormat* SwAccessibleCell::GetTableBoxFormat() const
 uno::Any SwAccessibleCell::getCurrentValue( )
 {
     SolarMutexGuard aGuard;
-    CHECK_FOR_DEFUNC( XAccessibleValue );
+
+    ThrowIfDisposed();
 
     return uno::Any( GetTableBoxFormat()->GetTableBoxValue().GetValue() );
 }
@@ -349,7 +350,8 @@ uno::Any SwAccessibleCell::getCurrentValue( )
 sal_Bool SwAccessibleCell::setCurrentValue( const uno::Any& aNumber )
 {
     SolarMutexGuard aGuard;
-    CHECK_FOR_DEFUNC( XAccessibleValue );
+
+    ThrowIfDisposed();
 
     double fValue = 0;
     bool bValid = (aNumber >>= fValue);
diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx
index bedbb8c7a813..5bc41b44b0bf 100644
--- a/sw/source/core/access/acccontext.cxx
+++ b/sw/source/core/access/acccontext.cxx
@@ -530,6 +530,15 @@ bool SwAccessibleContext::IsEditableState()
     return bRet;
 }
 
+void SwAccessibleContext::ThrowIfDisposed()
+{
+    if (!(GetFrame() && GetMap()))
+    {
+        throw lang::DisposedException("object is nonfunctional",
+                static_cast<cppu::OWeakObject*>(this));
+    }
+}
+
 SwAccessibleContext::SwAccessibleContext(std::shared_ptr<SwAccessibleMap> const& pMap,
                                           sal_Int16 const nRole,
                                           const SwFrame *pF )
@@ -571,7 +580,8 @@ sal_Int32 SAL_CALL SwAccessibleContext::getAccessibleChildCount()
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleContext )
+    ThrowIfDisposed();
+
     //Notify the frame is a document
     if (m_nRole == AccessibleRole::DOCUMENT_TEXT)
         m_bIsAccDocUse = true;
@@ -584,7 +594,7 @@ uno::Reference< XAccessible> SAL_CALL
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleContext )
+    ThrowIfDisposed();
 
     //Notify the frame is a document
     if (m_nRole == AccessibleRole::DOCUMENT_TEXT)
@@ -631,7 +641,7 @@ uno::Reference< XAccessible> SAL_CALL SwAccessibleContext::getAccessibleParent()
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleContext )
+    ThrowIfDisposed();
 
     const SwFrame *pUpper = GetParent();
     OSL_ENSURE( pUpper != nullptr || m_isDisposing, "no upper found" );
@@ -655,7 +665,7 @@ sal_Int32 SAL_CALL SwAccessibleContext::getAccessibleIndexInParent()
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleContext )
+    ThrowIfDisposed();
 
     const SwFrame *pUpper = GetParent();
     OSL_ENSURE( pUpper != nullptr || m_isDisposing, "no upper found" );
@@ -696,7 +706,7 @@ uno::Reference<XAccessibleStateSet> SAL_CALL
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleContext )
+    ThrowIfDisposed();
 
     ::utl::AccessibleStateSetHelper *pStateSet =
         new ::utl::AccessibleStateSetHelper;
@@ -776,7 +786,7 @@ uno::Reference< XAccessible > SAL_CALL SwAccessibleContext::getAccessibleAtPoint
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleComponent )
+    ThrowIfDisposed();
 
     uno::Reference< XAccessible > xAcc;
 
@@ -834,7 +844,7 @@ awt::Rectangle SAL_CALL SwAccessibleContext::getBoundsImpl(bool bRelative)
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleComponent )
+    ThrowIfDisposed();
 
     const SwFrame *pParent = GetParent();
     OSL_ENSURE( pParent, "no Parent found" );
@@ -923,7 +933,7 @@ void SAL_CALL SwAccessibleContext::grabFocus()
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleContext );
+    ThrowIfDisposed();;
 
     if( GetFrame()->IsFlyFrame() )
     {
diff --git a/sw/source/core/access/acccontext.hxx b/sw/source/core/access/acccontext.hxx
index 1dc8b1972168..a316b7d0cad3 100644
--- a/sw/source/core/access/acccontext.hxx
+++ b/sw/source/core/access/acccontext.hxx
@@ -197,6 +197,8 @@ protected:
     }
     void RemoveFrameFromAccessibleMap();
 
+    void ThrowIfDisposed();
+
     virtual ~SwAccessibleContext() override;
 
 public:
@@ -351,19 +353,6 @@ public:
                                         const OUString *pArg2 = nullptr );
 };
 
-#define CHECK_FOR_DEFUNC_THIS( ifc, ths )                \
-    if( !(GetFrame() && GetMap()) )                        \
-    {                                                    \
-        css::uno::Reference < ifc > xThis( ths );        \
-        css::lang::DisposedException aExcept(            \
-            "object is nonfunctional",        \
-            xThis );                                     \
-        throw aExcept;                                   \
-    }
-
-#define CHECK_FOR_DEFUNC( ifc )                                             \
-    CHECK_FOR_DEFUNC_THIS( ifc, this )
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx
index 9b5558f295c6..d91b0c9835b8 100644
--- a/sw/source/core/access/accdoc.cxx
+++ b/sw/source/core/access/accdoc.cxx
@@ -137,7 +137,7 @@ sal_Int32 SAL_CALL SwAccessibleDocumentBase::getAccessibleChildCount()
 {
     SolarMutexGuard aGuard;
 
-    // CHECK_FOR_DEFUNC is called by parent
+    // ThrowIfDisposed is called by parent
 
     sal_Int32 nChildren = SwAccessibleContext::getAccessibleChildCount();
     if( !IsDisposing() && mpChildWin )
@@ -153,7 +153,8 @@ uno::Reference< XAccessible> SAL_CALL
 
     if( mpChildWin  )
     {
-        CHECK_FOR_DEFUNC( XAccessibleContext )
+        ThrowIfDisposed();
+
         if ( nIndex == GetChildCount( *(GetMap()) ) )
         {
             return mpChildWin->GetAccessible();
@@ -320,7 +321,7 @@ uno::Reference< XAccessible > SAL_CALL SwAccessibleDocumentBase::getAccessibleAt
 
     if( mpChildWin  )
     {
-        CHECK_FOR_DEFUNC( XAccessibleComponent )
+        ThrowIfDisposed();
 
         vcl::Window *pWin = GetWindow();
         if (!pWin)
diff --git a/sw/source/core/access/accfootnote.cxx b/sw/source/core/access/accfootnote.cxx
index f28fef02dd46..9f402a787c05 100644
--- a/sw/source/core/access/accfootnote.cxx
+++ b/sw/source/core/access/accfootnote.cxx
@@ -70,7 +70,7 @@ OUString SAL_CALL SwAccessibleFootnote::getAccessibleDescription()
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleContext )
+    ThrowIfDisposed();
 
     sal_uInt16 nResId = AccessibleRole::END_NOTE == GetRole()
         ? STR_ACCESS_ENDNOTE_DESC
diff --git a/sw/source/core/access/accheaderfooter.cxx b/sw/source/core/access/accheaderfooter.cxx
index 683c02bf93dd..4960bd10b1b3 100644
--- a/sw/source/core/access/accheaderfooter.cxx
+++ b/sw/source/core/access/accheaderfooter.cxx
@@ -61,7 +61,7 @@ OUString SAL_CALL SwAccessibleHeaderFooter::getAccessibleDescription()
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleContext )
+    ThrowIfDisposed();
 
     sal_uInt16 nResId = AccessibleRole::HEADER == GetRole()
         ? STR_ACCESS_HEADER_DESC
diff --git a/sw/source/core/access/accnotextframe.cxx b/sw/source/core/access/accnotextframe.cxx
index 2ec43e900df7..0c988ba85492 100644
--- a/sw/source/core/access/accnotextframe.cxx
+++ b/sw/source/core/access/accnotextframe.cxx
@@ -176,7 +176,7 @@ OUString SAL_CALL SwAccessibleNoTextFrame::getAccessibleName()
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleContext )
+    ThrowIfDisposed();
 
     if ( !msTitle.isEmpty() )
     {
@@ -190,7 +190,7 @@ OUString SAL_CALL SwAccessibleNoTextFrame::getAccessibleDescription()
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleContext )
+    ThrowIfDisposed();
 
     return msDesc;
 }
@@ -294,7 +294,7 @@ sal_Int32 SAL_CALL SwAccessibleNoTextFrame::getHyperLinkCount()
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleHypertext );
+    ThrowIfDisposed();
 
     sal_Int32 nCount = 0;
     SwFormatURL aURL( static_cast<const SwLayoutFrame*>(GetFrame())->GetFormat()->GetURL() );
@@ -309,7 +309,8 @@ uno::Reference< XAccessibleHyperlink > SAL_CALL
     SwAccessibleNoTextFrame::getHyperLink( sal_Int32 nLinkIndex )
 {
     SolarMutexGuard aGuard;
-    CHECK_FOR_DEFUNC( XAccessibleHypertext );
+
+    ThrowIfDisposed();
 
     uno::Reference< XAccessibleHyperlink > xRet;
 
diff --git a/sw/source/core/access/accpage.cxx b/sw/source/core/access/accpage.cxx
index 68908380ed7b..c53078f23359 100644
--- a/sw/source/core/access/accpage.cxx
+++ b/sw/source/core/access/accpage.cxx
@@ -158,7 +158,7 @@ Sequence< sal_Int8 > SAL_CALL SwAccessiblePage::getImplementationId()
 
 OUString SwAccessiblePage::getAccessibleDescription( )
 {
-    CHECK_FOR_DEFUNC( css::accessibility::XAccessibleContext );
+    ThrowIfDisposed();
 
     OUString sArg( GetFormattedPageNumber() );
     return GetResource( STR_ACCESS_PAGE_DESC, &sArg );
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index 449e9a910b78..f6a577ebf4c0 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -922,7 +922,7 @@ OUString SAL_CALL SwAccessibleParagraph::getAccessibleDescription()
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleContext );
+    ThrowIfDisposed();
 
     osl::MutexGuard aGuard2( m_Mutex );
     if( sDesc.isEmpty() )
@@ -951,7 +951,8 @@ lang::Locale SAL_CALL SwAccessibleParagraph::getLocale()
 uno::Reference<XAccessibleRelationSet> SAL_CALL SwAccessibleParagraph::getAccessibleRelationSet()
 {
     SolarMutexGuard aGuard;
-    CHECK_FOR_DEFUNC( XAccessibleContext );
+
+    ThrowIfDisposed();
 
     utl::AccessibleRelationSetHelper* pHelper = new utl::AccessibleRelationSetHelper();
 
@@ -986,7 +987,7 @@ void SAL_CALL SwAccessibleParagraph::grabFocus()
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleContext );
+    ThrowIfDisposed();
 
     // get cursor shell
     SwCursorShell *pCursorSh = GetCursorShell();
@@ -1263,7 +1264,7 @@ sal_Int32 SwAccessibleParagraph::getCaretPosition()
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+    ThrowIfDisposed();
 
     sal_Int32 nRet = GetCaretPos();
     {
@@ -1284,7 +1285,7 @@ sal_Bool SAL_CALL SwAccessibleParagraph::setCaretPosition( sal_Int32 nIndex )
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+    ThrowIfDisposed();
 
     // parameter checking
     sal_Int32 nLength = GetString().getLength();
@@ -1316,7 +1317,7 @@ sal_Unicode SwAccessibleParagraph::getCharacter( sal_Int32 nIndex )
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+    ThrowIfDisposed();
 
     OUString sText( GetString() );
 
@@ -1333,7 +1334,7 @@ css::uno::Sequence< css::style::TabStop > SwAccessibleParagraph::GetCurrentTabSt
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+    ThrowIfDisposed();
 
     /*  #i12332# The position after the string needs special treatment.
         IsValidChar -> IsValidPosition
@@ -1594,7 +1595,8 @@ uno::Sequence<PropertyValue> SwAccessibleParagraph::getCharacterAttributes(
 {
 
     SolarMutexGuard aGuard;
-    CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+
+    ThrowIfDisposed();
 
     const OUString& rText = GetString();
 
@@ -1862,7 +1864,8 @@ uno::Sequence< PropertyValue > SwAccessibleParagraph::getDefaultAttributes(
         const uno::Sequence< OUString >& aRequestedAttributes )
 {
     SolarMutexGuard aGuard;
-    CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+
+    ThrowIfDisposed();
 
     tAccParaPropValMap aDefAttrSeq;
     _getDefaultAttributesImpl( aRequestedAttributes, aDefAttrSeq );
@@ -2028,7 +2031,8 @@ uno::Sequence< PropertyValue > SwAccessibleParagraph::getRunAttributes(
         const uno::Sequence< OUString >& aRequestedAttributes )
 {
     SolarMutexGuard aGuard;
-    CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+
+    ThrowIfDisposed();
 
     {
         const OUString& rText = GetString();
@@ -2327,7 +2331,7 @@ awt::Rectangle SwAccessibleParagraph::getCharacterBounds(
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+    ThrowIfDisposed();
 
     // #i12332# The position after the string needs special treatment.
     // IsValidChar -> IsValidPosition
@@ -2384,7 +2388,7 @@ sal_Int32 SwAccessibleParagraph::getCharacterCount()
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+    ThrowIfDisposed();
 
     return GetString().getLength();
 }
@@ -2393,7 +2397,7 @@ sal_Int32 SwAccessibleParagraph::getIndexAtPoint( const awt::Point& rPoint )
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+    ThrowIfDisposed();
 
     // construct SwPosition (where GetCursorOfst() will put the result into)
     SwTextNode* pNode = const_cast<SwTextNode*>( GetTextNode() );
@@ -2471,7 +2475,7 @@ OUString SwAccessibleParagraph::getSelectedText()
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+    ThrowIfDisposed();
 
     sal_Int32 nStart, nEnd;
     bool bSelected = GetSelection( nStart, nEnd );
@@ -2484,7 +2488,7 @@ sal_Int32 SwAccessibleParagraph::getSelectionStart()
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+    ThrowIfDisposed();
 
     sal_Int32 nStart, nEnd;
     GetSelection( nStart, nEnd );
@@ -2495,7 +2499,7 @@ sal_Int32 SwAccessibleParagraph::getSelectionEnd()
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+    ThrowIfDisposed();
 
     sal_Int32 nStart, nEnd;
     GetSelection( nStart, nEnd );
@@ -2506,7 +2510,7 @@ sal_Bool SwAccessibleParagraph::setSelection( sal_Int32 nStartIndex, sal_Int32 n
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+    ThrowIfDisposed();
 
     // parameter checking
     sal_Int32 nLength = GetString().getLength();
@@ -2541,7 +2545,7 @@ OUString SwAccessibleParagraph::getText()
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+    ThrowIfDisposed();
 
     return GetString();
 }
@@ -2551,7 +2555,7 @@ OUString SwAccessibleParagraph::getTextRange(
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+    ThrowIfDisposed();
 
     OUString sText( GetString() );
 
@@ -2568,7 +2572,7 @@ OUString SwAccessibleParagraph::getTextRange(
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+    ThrowIfDisposed();
 
     /*accessibility::*/TextSegment aResult;
     aResult.SegmentStart = -1;
@@ -2604,7 +2608,7 @@ OUString SwAccessibleParagraph::getTextRange(
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+    ThrowIfDisposed();
 
     const OUString rText = GetString();
 
@@ -2675,7 +2679,7 @@ OUString SwAccessibleParagraph::getTextRange(
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+    ThrowIfDisposed();
 
     /*accessibility::*/TextSegment aResult;
     aResult.SegmentStart = -1;
@@ -2770,9 +2774,10 @@ OUString SwAccessibleParagraph::getTextRange(
 
 sal_Bool SwAccessibleParagraph::copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
 {
-    CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
     SolarMutexGuard aGuard;
 
+    ThrowIfDisposed();
+
     // select and copy (through dispatch mechanism)
     setSelection( nStartIndex, nEndIndex );
     ExecuteAtViewShell( SID_COPY );
@@ -2783,9 +2788,10 @@ sal_Bool SwAccessibleParagraph::copyText( sal_Int32 nStartIndex, sal_Int32 nEndI
 
 sal_Bool SwAccessibleParagraph::cutText( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
 {
-    CHECK_FOR_DEFUNC( XAccessibleEditableText );
     SolarMutexGuard aGuard;
 
+    ThrowIfDisposed();
+
     if( !IsEditableState() )
         return false;
 
@@ -2797,9 +2803,10 @@ sal_Bool SwAccessibleParagraph::cutText( sal_Int32 nStartIndex, sal_Int32 nEndIn
 
 sal_Bool SwAccessibleParagraph::pasteText( sal_Int32 nIndex )
 {
-    CHECK_FOR_DEFUNC( XAccessibleEditableText );
     SolarMutexGuard aGuard;
 
+    ThrowIfDisposed();
+
     if( !IsEditableState() )
         return false;
 
@@ -2825,7 +2832,7 @@ sal_Bool SwAccessibleParagraph::replaceText(
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleEditableText );
+    ThrowIfDisposed();
 
     const OUString& rText = GetString();
 
@@ -2875,7 +2882,8 @@ sal_Bool SwAccessibleParagraph::setAttributes(
     const uno::Sequence<PropertyValue>& rAttributeSet )
 {
     SolarMutexGuard aGuard;
-    CHECK_FOR_DEFUNC( XAccessibleEditableText );
+
+    ThrowIfDisposed();
 
     const OUString& rText = GetString();
 
@@ -2937,7 +2945,7 @@ sal_Bool SwAccessibleParagraph::setText( const OUString& sText )
 void SwAccessibleParagraph::selectAccessibleChild(
     sal_Int32 nChildIndex )
 {
-    CHECK_FOR_DEFUNC( XAccessibleSelection );
+    ThrowIfDisposed();
 
     aSelectionHelper.selectAccessibleChild(nChildIndex);
 }
@@ -2945,26 +2953,26 @@ void SwAccessibleParagraph::selectAccessibleChild(
 sal_Bool SwAccessibleParagraph::isAccessibleChildSelected(
     sal_Int32 nChildIndex )
 {
-    CHECK_FOR_DEFUNC( XAccessibleSelection );
+    ThrowIfDisposed();
 
     return aSelectionHelper.isAccessibleChildSelected(nChildIndex);
 }
 
 void SwAccessibleParagraph::clearAccessibleSelection(  )
 {
-    CHECK_FOR_DEFUNC( XAccessibleSelection );
+    ThrowIfDisposed();
 }
 
 void SwAccessibleParagraph::selectAllAccessibleChildren(  )
 {
-    CHECK_FOR_DEFUNC( XAccessibleSelection );
+    ThrowIfDisposed();
 
     aSelectionHelper.selectAllAccessibleChildren();
 }
 
 sal_Int32 SwAccessibleParagraph::getSelectedAccessibleChildCount(  )
 {
-    CHECK_FOR_DEFUNC( XAccessibleSelection );
+    ThrowIfDisposed();
 
     return aSelectionHelper.getSelectedAccessibleChildCount();
 }
@@ -2972,7 +2980,7 @@ sal_Int32 SwAccessibleParagraph::getSelectedAccessibleChildCount(  )
 uno::Reference<XAccessible> SwAccessibleParagraph::getSelectedAccessibleChild(
     sal_Int32 nSelectedChildIndex )
 {
-    CHECK_FOR_DEFUNC( XAccessibleSelection );
+    ThrowIfDisposed();
 
     return aSelectionHelper.getSelectedAccessibleChild(nSelectedChildIndex);
 }
@@ -2981,7 +2989,7 @@ uno::Reference<XAccessible> SwAccessibleParagraph::getSelectedAccessibleChild(
 void SwAccessibleParagraph::deselectAccessibleChild(
     sal_Int32 nChildIndex )
 {
-    CHECK_FOR_DEFUNC( XAccessibleSelection );
+    ThrowIfDisposed();
 
     aSelectionHelper.deselectAccessibleChild( nChildIndex );
 }
@@ -3043,7 +3051,7 @@ sal_Int32 SAL_CALL SwAccessibleParagraph::getHyperLinkCount()
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleHypertext );
+    ThrowIfDisposed();
 
     sal_Int32 nCount = 0;
     // #i77108# - provide hyperlinks also in editable documents.
@@ -3060,7 +3068,8 @@ uno::Reference< XAccessibleHyperlink > SAL_CALL
     SwAccessibleParagraph::getHyperLink( sal_Int32 nLinkIndex )
 {
     SolarMutexGuard aGuard;
-    CHECK_FOR_DEFUNC( XAccessibleHypertext );
+
+    ThrowIfDisposed();
 
     uno::Reference< XAccessibleHyperlink > xRet;
 
@@ -3148,7 +3157,8 @@ uno::Reference< XAccessibleHyperlink > SAL_CALL
 sal_Int32 SAL_CALL SwAccessibleParagraph::getHyperLinkIndex( sal_Int32 nCharIndex )
 {
     SolarMutexGuard aGuard;
-    CHECK_FOR_DEFUNC( XAccessibleHypertext );
+
+    ThrowIfDisposed();
 
     // parameter checking
     sal_Int32 nLength = GetString().getLength();
@@ -3256,7 +3266,7 @@ sal_Int32 SAL_CALL SwAccessibleParagraph::getSeletedPositionStart( sal_Int32 nSe
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+    ThrowIfDisposed();
 
     sal_Int32 nStart, nEnd;
     /*sal_Bool bSelected = */GetSelectionAtIndex(nSelectedPortionIndex, nStart, nEnd );
@@ -3267,7 +3277,7 @@ sal_Int32 SAL_CALL SwAccessibleParagraph::getSeletedPositionEnd( sal_Int32 nSele
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+    ThrowIfDisposed();
 
     sal_Int32 nStart, nEnd;
     /*sal_Bool bSelected = */GetSelectionAtIndex(nSelectedPortionIndex, nStart, nEnd );
@@ -3333,7 +3343,7 @@ sal_Int32 SAL_CALL SwAccessibleParagraph::addSelection( sal_Int32, sal_Int32 sta
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+    ThrowIfDisposed();
 
     // parameter checking
     sal_Int32 nLength = GetString().getLength();
diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx
index 6e324781367e..342d8c9615b1 100644
--- a/sw/source/core/access/acctable.cxx
+++ b/sw/source/core/access/acctable.cxx
@@ -909,7 +909,7 @@ OUString SAL_CALL SwAccessibleTable::getAccessibleDescription()
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleContext )
+    ThrowIfDisposed();
 
     return m_sDesc;
 }
@@ -918,7 +918,7 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleRowCount()
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleTable )
+    ThrowIfDisposed();
 
     return  GetTableData().GetRowCount();
 }
@@ -927,7 +927,7 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleColumnCount(  )
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleTable )
+    ThrowIfDisposed();
 
     return GetTableData().GetColumnCount();
 }
@@ -1005,7 +1005,7 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleRowExtentAt(
 
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleTable )
+    ThrowIfDisposed();
 
     UpdateTableData();
     GetTableData().CheckRowAndCol( nRow, nColumn, this );
@@ -1035,7 +1035,7 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleColumnExtentAt(
 
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleTable )
+    ThrowIfDisposed();
     UpdateTableData();
 
     GetTableData().CheckRowAndCol( nRow, nColumn, this );
@@ -1088,7 +1088,7 @@ uno::Sequence< sal_Int32 > SAL_CALL SwAccessibleTable::getSelectedAccessibleRows
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleTable )
+    ThrowIfDisposed();
 
     const SwSelBoxes *pSelBoxes = GetSelBoxes();
     if( pSelBoxes )
@@ -1111,7 +1111,7 @@ uno::Sequence< sal_Int32 > SAL_CALL SwAccessibleTable::getSelectedAccessibleColu
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleTable )
+    ThrowIfDisposed();
 
     const SwSelBoxes *pSelBoxes = GetSelBoxes();
     if( pSelBoxes )
@@ -1133,7 +1133,7 @@ sal_Bool SAL_CALL SwAccessibleTable::isAccessibleRowSelected( sal_Int32 nRow )
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleTable )
+    ThrowIfDisposed();
 
     GetTableData().CheckRowAndCol( nRow, 0, this );
 
@@ -1159,7 +1159,7 @@ sal_Bool SAL_CALL SwAccessibleTable::isAccessibleColumnSelected(
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleTable )
+    ThrowIfDisposed();
 
     GetTableData().CheckRowAndCol( 0, nColumn, this );
 
@@ -1188,7 +1188,7 @@ uno::Reference< XAccessible > SAL_CALL SwAccessibleTable::getAccessibleCellAt(
 
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleTable )
+    ThrowIfDisposed();
 
     const SwFrame *pCellFrame =
                     GetTableData().GetCell( nRow, nColumn, this );
@@ -1217,7 +1217,7 @@ sal_Bool SAL_CALL SwAccessibleTable::isAccessibleSelected(
 
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleTable )
+    ThrowIfDisposed();
 
     const SwFrame *pFrame =
                     GetTableData().GetCell( nRow, nColumn, this );
@@ -1243,7 +1243,7 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleIndex(
 
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleTable )
+    ThrowIfDisposed();
 
     SwAccessibleChild aCell( GetTableData().GetCell( nRow, nColumn, this ));
     if ( aCell.IsValid() )
@@ -1260,7 +1260,7 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleRow( sal_Int32 nChildIndex )
 
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleTable )
+    ThrowIfDisposed();
 
     // #i77106#
     if ( ( nChildIndex < 0 ) ||
@@ -1297,7 +1297,7 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleColumn(
 
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleTable )
+    ThrowIfDisposed();
 
     // #i77106#
     if ( ( nChildIndex < 0 ) ||
@@ -1461,7 +1461,8 @@ void SAL_CALL SwAccessibleTable::selectAccessibleChild(
     sal_Int32 nChildIndex )
 {
     SolarMutexGuard aGuard;
-    CHECK_FOR_DEFUNC( XAccessibleTable );
+
+    ThrowIfDisposed();
 
     if( (nChildIndex < 0) || (nChildIndex >= getAccessibleChildCount()) ) // #i77106#
         throw lang::IndexOutOfBoundsException();
@@ -1539,7 +1540,8 @@ sal_Bool SAL_CALL SwAccessibleTable::isAccessibleChildSelected(
     sal_Int32 nChildIndex )
 {
     SolarMutexGuard aGuard;
-    CHECK_FOR_DEFUNC( XAccessibleTable );
+
+    ThrowIfDisposed();
 
     if( (nChildIndex < 0) || (nChildIndex >= getAccessibleChildCount()) ) // #i77106#
         throw lang::IndexOutOfBoundsException();
@@ -1551,7 +1553,7 @@ void SAL_CALL SwAccessibleTable::clearAccessibleSelection(  )
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleTable );
+    ThrowIfDisposed();
 
     SwCursorShell* pCursorShell = GetCursorShell();
     if( pCursorShell != nullptr )
@@ -1573,7 +1575,8 @@ void SAL_CALL SwAccessibleTable::selectAllAccessibleChildren(  )
 sal_Int32 SAL_CALL SwAccessibleTable::getSelectedAccessibleChildCount(  )
 {
     SolarMutexGuard aGuard;
-    CHECK_FOR_DEFUNC( XAccessibleTable );
+
+    ThrowIfDisposed();
 
     // iterate over all children and count isAccessibleChildSelected()
     sal_Int32 nCount = 0;
@@ -1590,7 +1593,8 @@ uno::Reference<XAccessible> SAL_CALL SwAccessibleTable::getSelectedAccessibleChi
     sal_Int32 nSelectedChildIndex )
 {
     SolarMutexGuard aGuard;
-    CHECK_FOR_DEFUNC( XAccessibleTable );
+
+    ThrowIfDisposed();
 
     // parameter checking (part 1): index lower 0
     if( nSelectedChildIndex < 0 )
@@ -1616,7 +1620,8 @@ void SAL_CALL SwAccessibleTable::deselectAccessibleChild(
     sal_Int32 nChildIndex )
 {
     SolarMutexGuard aGuard;
-    CHECK_FOR_DEFUNC( XAccessibleTable );
+
+    ThrowIfDisposed();
 
     SwCursorShell* pCursorShell = GetCursorShell();
 
@@ -1850,7 +1855,7 @@ sal_Int32 SAL_CALL SwAccessibleTableColHeaders::getAccessibleChildCount()
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleContext )
+    ThrowIfDisposed();
 
     sal_Int32 nCount = 0;
 
diff --git a/sw/source/core/access/acctextframe.cxx b/sw/source/core/access/acctextframe.cxx
index dac7b2baeefc..be9177dd47a4 100644
--- a/sw/source/core/access/acctextframe.cxx
+++ b/sw/source/core/access/acctextframe.cxx
@@ -244,7 +244,7 @@ OUString SAL_CALL SwAccessibleTextFrame::getAccessibleName()
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleContext )
+    ThrowIfDisposed();
 
     if ( !msTitle.isEmpty() )
     {
@@ -258,7 +258,7 @@ OUString SAL_CALL SwAccessibleTextFrame::getAccessibleDescription()
 {
     SolarMutexGuard aGuard;
 
-    CHECK_FOR_DEFUNC( XAccessibleContext )
+    ThrowIfDisposed();
 
     return msDesc;
 
@@ -313,7 +313,8 @@ AccessibleRelation SwAccessibleTextFrame::makeRelation( sal_Int16 nType, const S
 uno::Reference<XAccessibleRelationSet> SAL_CALL SwAccessibleTextFrame::getAccessibleRelationSet( )
 {
     SolarMutexGuard aGuard;
-    CHECK_FOR_DEFUNC( XAccessibleContext );
+
+    ThrowIfDisposed();
 
     // get the frame, and insert prev/next relations into helper
 


More information about the Libreoffice-commits mailing list