[API CHANGE] Pass XAccessible to XAccessibleGroupPosition::getGroupPosition
Instead of passing an XAccessibleContext wrapped in a uno::Any, pass the XAccessible. This drops an extra level of wrapping/unwrapping. The same will be done for XAccessibleGroupPosition::getObjectLink in an upcoming commit. Since the XAccessibleGroupPosition interface (and the UNO a11y API in general) is unpublished and meant for internal use only, changing it should be unproblematic. Change-Id: I5db3a99bb8d78099e3b136cbcd402fe2ae49d49c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211216 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
@@ -128,8 +128,8 @@ public:
|
||||
/// Return this object's role.
|
||||
virtual sal_Int16 SAL_CALL getAccessibleRole() override;
|
||||
//===== XAccessibleGroupPosition =========================================
|
||||
virtual css::uno::Sequence< sal_Int32 > SAL_CALL
|
||||
getGroupPosition( const css::uno::Any& rAny ) override;
|
||||
virtual css::uno::Sequence<sal_Int32> SAL_CALL getGroupPosition(
|
||||
const css::uno::Reference<css::accessibility::XAccessible>& rxAccessible) override;
|
||||
virtual OUString SAL_CALL getObjectLink( const css::uno::Any& accoject ) override;
|
||||
/** The destructor releases its children manager and text engine if
|
||||
still existent. These are responsible to send appropriate events.
|
||||
|
||||
@@ -22,7 +22,7 @@ module com { module sun { module star { module accessibility {
|
||||
interface XAccessibleGroupPosition : ::com::sun::star::uno::XInterface
|
||||
{
|
||||
/* Returns the group position of the object */
|
||||
sequence<long> getGroupPosition( [in] any accoject ) raises (::com::sun::star::lang::IndexOutOfBoundsException);
|
||||
sequence<long> getGroupPosition( [in] XAccessible accObject ) raises (::com::sun::star::lang::IndexOutOfBoundsException);
|
||||
|
||||
/* Returns the hyperlink URL info of the object */
|
||||
string getObjectLink( [in] any accoject ) raises (::com::sun::star::lang::IndexOutOfBoundsException);
|
||||
|
||||
@@ -389,8 +389,8 @@ sal_Bool SAL_CALL AccessibleDrawDocumentView::supportsService(const OUString& rS
|
||||
}
|
||||
|
||||
//===== XAccessibleGroupPosition =========================================
|
||||
uno::Sequence< sal_Int32 > SAL_CALL
|
||||
AccessibleDrawDocumentView::getGroupPosition( const uno::Any& rAny )
|
||||
uno::Sequence<sal_Int32> SAL_CALL AccessibleDrawDocumentView::getGroupPosition(
|
||||
const css::uno::Reference<css::accessibility::XAccessible>& rxAccessible)
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
|
||||
@@ -400,13 +400,11 @@ uno::Sequence< sal_Int32 > SAL_CALL
|
||||
// [2] the position of the object in the group
|
||||
uno::Sequence< sal_Int32 > aRet( 3 );
|
||||
//get the xShape of the current selected drawing object
|
||||
uno::Reference<XAccessibleContext> xAccContent;
|
||||
rAny >>= xAccContent;
|
||||
if ( !xAccContent.is() )
|
||||
if (!rxAccessible.is())
|
||||
{
|
||||
return aRet;
|
||||
}
|
||||
AccessibleShape* pAcc = comphelper::getFromUnoTunnel<AccessibleShape>( xAccContent );
|
||||
AccessibleShape* pAcc = comphelper::getFromUnoTunnel<AccessibleShape>(rxAccessible);
|
||||
if ( !pAcc )
|
||||
{
|
||||
return aRet;
|
||||
|
||||
@@ -79,8 +79,8 @@ public:
|
||||
propertyChange (const css::beans::PropertyChangeEvent& rEventObject) override;
|
||||
|
||||
//===== XAccessibleGroupPosition =========================================
|
||||
virtual css::uno::Sequence< sal_Int32 > SAL_CALL
|
||||
getGroupPosition( const css::uno::Any& rAny ) override;
|
||||
virtual css::uno::Sequence<sal_Int32> SAL_CALL getGroupPosition(
|
||||
const css::uno::Reference<css::accessibility::XAccessible>& rxAccessible) override;
|
||||
virtual OUString SAL_CALL getObjectLink( const css::uno::Any& accoject ) override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -993,8 +993,8 @@ struct XShapePosCompareHelper
|
||||
//end of group position
|
||||
|
||||
// XAccessibleGroupPosition
|
||||
uno::Sequence< sal_Int32 > SAL_CALL
|
||||
AccessibleShape::getGroupPosition( const uno::Any& )
|
||||
uno::Sequence<sal_Int32> SAL_CALL
|
||||
AccessibleShape::getGroupPosition(const css::uno::Reference<css::accessibility::XAccessible>&)
|
||||
{
|
||||
// we will return the:
|
||||
// [0] group level
|
||||
@@ -1033,7 +1033,7 @@ AccessibleShape::getGroupPosition( const uno::Any& )
|
||||
Reference< XAccessibleGroupPosition > xGroupPosition( xParent,uno::UNO_QUERY );
|
||||
if ( xGroupPosition.is() )
|
||||
{
|
||||
aRet = xGroupPosition->getGroupPosition( uno::Any( getAccessibleContext() ) );
|
||||
aRet = xGroupPosition->getGroupPosition(this);
|
||||
}
|
||||
return aRet;
|
||||
}
|
||||
|
||||
@@ -1809,7 +1809,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_groupPosition(long __RPC_FAR
|
||||
Reference< XAccessibleGroupPosition > xGroupPosition( pRContext, UNO_QUERY );
|
||||
if ( xGroupPosition.is() )
|
||||
{
|
||||
Sequence< sal_Int32 > rSeq = xGroupPosition->getGroupPosition( Any( pRContext ) );
|
||||
Sequence<sal_Int32> rSeq = xGroupPosition->getGroupPosition(m_xAccessible);
|
||||
if (rSeq.getLength() >= 3)
|
||||
{
|
||||
*groupLevel = rSeq[0];
|
||||
|
||||
Reference in New Issue
Block a user