diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2022-09-02 13:06:08 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2022-09-02 15:47:37 +0200 |
commit | 206543c7bef58fc559852553a3b2faba0b604259 (patch) | |
tree | 4fc3e0e57e6f9b50e276998fc04241035a2dffb6 /svx | |
parent | 38671e21d7dbcd5019912b9468305018de0c922e (diff) |
[API CHANGE] tdf#150683 a11y: Switch a11y child index to 64 bit
With 16k column support in Calc enabled by default in
commit 4c5f8ccf0a2320432b8fe91add1dcadf54d9fd58
Date: Tue Mar 8 12:44:49 2022 +0100
change default Calc number of columns to 16384 (tdf#50916)
, the number of Calc cells in a spreadsheet is larger than
SAL_MAX_INT32, meaning that a 32-bit a11y child index is no more
enough and using it resulted in integer overflows in
methods handling corresponding Calc cells in the a11y layer.
This e.g. had the effect of the Orca and NVDA screen readers
not announcing focused or selected cells properly when their
a11y child index was out of the 32-bit integer range.
Switch the internal a11y child indices to 64 bit to
be able to handle this properly internally.
Since the platform APIs (at least AT-SPI on Linux and
IAccessible2 on Windows; from what I can see LO's macOS
a11y bridge doesn't directly expose the child index)
are still restricted to 32 bit, larger child indices
still cannot be exposed via the platform APIs.
As a consequence, use of the the IAccessible2 and
AT-SPI methods that use the child index remains
problematic in those cases where the child index
is larger. However, as an alternative to using the
AT-SPI Table interface and the IAccessibleTable/
IAccessibleTable2 interfaces with the child index
to retrieve information about a specific cell,
both AT-SPI and IAccessible2 also provide interfaces
to retrieve that information directly
from the cell object (TableCell interface for AT-SPI,
IAccessibleTableCell for IAccessible2).
Those interfaces are already implemented/exposed
for winaccessibility (s. `CAccTable`) and the
qt5/qt6/kf5 VCL plugins (s. the `QAccessibleTableCellInterface`
methods implemented in `QtAccessibleInterface`).
With the switch to 64-bit internal a11y child indices,
these now behave correctly for cells with a child
index that doesn't fit into 32 bit as well.
NVDA on Windows already uses the IAccessibleTableCell
interface and thus announcing focused cells works fine
with this change in place.
Orca on Linux currently doesn't make use of the AT-SPI
TableCell interface yet, but with a suggested change to
do so [1], announcement of selected cells works
with the qt6 VCL plugin with a current qtbase dev branch
as well - when combined with the suggested changes
to implement support for the AT-SPI TableCell interface
in Qt [2] [3] and the LO change based on that [4] and
a fix for a nullptr dereference [5].
The gtk3 VCL plugin doesn't expose the AT-SPI
TableCell interface yet, but once it does so
(via `AtkTableCell`), it also works with the
suggested Orca change [1] in place.
(Adding that is planned for an upcoming change,
works with a local WIP patch.)
For handling return values that are larger than what
platform APIs support, the following approach has
been chosen for now:
1) When the return value is for the count of
(selected) children, the maximum value N
supported by the platform API is returned.
(This is what `ScAccessibleTableBase::getAccessibleChildCount`
did previously.)
The first N elements can be accessed by their
actual (selection) indices.
2) When the return value is the child/cell index,
-2 is returned for objects whose index is greater
than the maximum value supported by the platform
API.
Using a non-negative value would mean that the
index would refer to *another* actually existing
child. A child index of -1 on the other hand
tends to be interpreted as "child is invalid" or
"object isn't actually a child of its (previous)
parent any more)". For the Orca case, this would
result in objects with a child index of -1
not being announced, as they are considered
"zombies" [6].
What's still somewhat problematic is the case where
more than 2^31 children are *selected*, since access
to those children still happens by the index into
the selection in the platform APIs, and not all
selected items are accessible this way.
(Screen readers usually just retrieve
the first and last element from the selection and
announce those.)
Orca already seems to apply different handling for the
case for fully selected rows and columns, so
"All cells selected" or "Columns ... to ... selected"
is announced just fine even if more than 2^31
cells are selected.
(Side note: While Microsoft User Interface
Automation - UIA - also uses 32-bit indices, it also
has specific methods in the ISelectionProvider2
interface that allow to explicitly retrieve the
first and last selected item,
`ISelectionProvider2::get_FirstSelectedItem` and
`ISelectionProvider2::get_LastSelectedItem`, but
we currently don't support UIA on Windows.)
Bound checks at the beginning of the methods from the
`XAccessibleContext`, `XAccessibleSelection` and
`XAccessibleTable` interfaces that take a child index
(or in helper methods called by those) should generally
already prevent too large indices from being passed to
the methods in the lower layer code that take smaller
integer types. Such bound checking has been
been added in various places where it wasn't present yet.
If there any remaining issues of this
kind that show after this commit, they can probably be
solved in a similar way (s.e.g. the change to
`AccessibleBrowseBox::getAccessibleChild` in this
commit).
A few asserts were also added at
places where my understanding is that values shouldn't
be larger than what is supported by a called method
anyway.
A test case will be added in a following change.
[1] https://gitlab.gnome.org/GNOME/orca/-/merge_requests/131
[2] https://codereview.qt-project.org/c/qt/qtbase/+/428566
[3] https://codereview.qt-project.org/c/qt/qtbase/+/428567
[4] https://gerrit.libreoffice.org/c/core/+/138750
[5] https://codereview.qt-project.org/c/qt/qtbase/+/430157
[6] https://gitlab.gnome.org/GNOME/orca/-/blob/82c8542002e36e0d3d918088d583162d25136143/src/orca/script_utilities.py#L5155
Change-Id: I3af590c988b0e6754fc72545918412f39e8fea07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139258
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'svx')
21 files changed, 205 insertions, 184 deletions
diff --git a/svx/inc/AccessibleTableShape.hxx b/svx/inc/AccessibleTableShape.hxx index eee79cac6cdd..12d7756e924b 100644 --- a/svx/inc/AccessibleTableShape.hxx +++ b/svx/inc/AccessibleTableShape.hxx @@ -58,8 +58,8 @@ public: virtual void SAL_CALL release( ) noexcept override; // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) override; + virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override; virtual sal_Int16 SAL_CALL getAccessibleRole() override; // XAccessibleTable @@ -79,18 +79,18 @@ public: virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleCaption( ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleSummary( ) override; virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) override; - virtual sal_Int32 SAL_CALL getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) override; - virtual sal_Int32 SAL_CALL getAccessibleRow( sal_Int32 nChildIndex ) override; - virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int32 nChildIndex ) override; + virtual sal_Int64 SAL_CALL getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) override; + virtual sal_Int32 SAL_CALL getAccessibleRow( sal_Int64 nChildIndex ) override; + virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int64 nChildIndex ) override; // XAccessibleSelection - virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) override; - virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) override; + virtual void SAL_CALL selectAccessibleChild( sal_Int64 nChildIndex ) override; + virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int64 nChildIndex ) override; virtual void SAL_CALL clearAccessibleSelection( ) override; virtual void SAL_CALL selectAllAccessibleChildren( ) override; - virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) override; - virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nChildIndex ) override; + virtual sal_Int64 SAL_CALL getSelectedAccessibleChildCount( ) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int64 nSelectedChildIndex ) override; + virtual void SAL_CALL deselectAccessibleChild( sal_Int64 nChildIndex ) override; // XAccessibleTableSelection virtual sal_Bool SAL_CALL selectRow( sal_Int32 row ) override ; virtual sal_Bool SAL_CALL selectColumn( sal_Int32 column ) override ; @@ -112,7 +112,7 @@ public: friend class AccessibleTableHeaderShape; /// @throws css::lang::IndexOutOfBoundsException - void getColumnAndRow( sal_Int32 nChildIndex, sal_Int32& rnColumn, sal_Int32& rnRow ); + void getColumnAndRow( sal_Int64 nChildIndex, sal_Int32& rnColumn, sal_Int32& rnRow ); // overwrite the SetState & ResetState to do special operation for table cell's internal text virtual bool SetState (sal_Int64 aState) override; virtual bool ResetState (sal_Int64 aState) override; @@ -131,7 +131,7 @@ private: void checkCellPosition( sal_Int32 nCol, sal_Int32 nRow ); rtl::Reference< AccessibleTableShapeImpl > mxImpl; - sal_Int32 GetIndexOfSelectedChild( sal_Int32 nSelectedChildIndex ) const; + sal_Int64 GetIndexOfSelectedChild( sal_Int64 nSelectedChildIndex ) const; }; typedef ::cppu::WeakImplHelper< @@ -156,10 +156,10 @@ public: virtual css::uno::Reference< css::accessibility::XAccessibleContext> SAL_CALL getAccessibleContext( ) override; // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) override; + virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override; - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) override; + virtual sal_Int64 SAL_CALL getAccessibleIndexInParent( ) override; virtual sal_Int16 SAL_CALL getAccessibleRole( ) override; virtual OUString SAL_CALL getAccessibleDescription( ) override; virtual OUString SAL_CALL getAccessibleName( ) override; @@ -195,9 +195,9 @@ public: virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleCaption( ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleSummary( ) override; virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) override; - virtual sal_Int32 SAL_CALL getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) override; - virtual sal_Int32 SAL_CALL getAccessibleRow( sal_Int32 nChildIndex ) override; - virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int32 nChildIndex ) override; + virtual sal_Int64 SAL_CALL getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) override; + virtual sal_Int32 SAL_CALL getAccessibleRow( sal_Int64 nChildIndex ) override; + virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int64 nChildIndex ) override; // XAccessibleTableSelection virtual sal_Bool SAL_CALL selectRow( sal_Int32 row ) override ; diff --git a/svx/source/accessibility/AccessibleControlShape.cxx b/svx/source/accessibility/AccessibleControlShape.cxx index f8cdc3ce9029..bf085bb753a4 100644 --- a/svx/source/accessibility/AccessibleControlShape.cxx +++ b/svx/source/accessibility/AccessibleControlShape.cxx @@ -492,7 +492,7 @@ bool AccessibleControlShape::ensureListeningState( return _bNeedNewListening; } -sal_Int32 SAL_CALL AccessibleControlShape::getAccessibleChildCount( ) +sal_Int64 SAL_CALL AccessibleControlShape::getAccessibleChildCount( ) { if ( !m_xUnoControl.is() ) return 0; @@ -509,7 +509,7 @@ sal_Int32 SAL_CALL AccessibleControlShape::getAccessibleChildCount( ) } } -Reference< XAccessible > SAL_CALL AccessibleControlShape::getAccessibleChild( sal_Int32 i ) +Reference< XAccessible > SAL_CALL AccessibleControlShape::getAccessibleChild( sal_Int64 i ) { Reference< XAccessible > xChild; if ( !m_xUnoControl.is() ) @@ -527,7 +527,7 @@ Reference< XAccessible > SAL_CALL AccessibleControlShape::getAccessibleChild( sa // of the context of our UNO control Reference< XAccessibleContext > xControlContext( m_aControlContext ); - OSL_ENSURE( xControlContext.is(), "AccessibleControlShape::getAccessibleChildCount: control context already dead! How this!" ); + OSL_ENSURE( xControlContext.is(), "AccessibleControlShape::getAccessibleChild: control context already dead! How this!" ); if ( xControlContext.is() ) { Reference< XAccessible > xInnerChild( xControlContext->getAccessibleChild( i ) ); @@ -541,7 +541,7 @@ Reference< XAccessible > SAL_CALL AccessibleControlShape::getAccessibleChild( sa } #if OSL_DEBUG_LEVEL > 0 - sal_Int32 nChildIndex = -1; + sal_Int64 nChildIndex = -1; Reference< XAccessibleContext > xContext; if ( xChild.is() ) xContext = xChild->getAccessibleContext( ); diff --git a/svx/source/accessibility/AccessibleFrameSelector.cxx b/svx/source/accessibility/AccessibleFrameSelector.cxx index 9816c7c8d4dd..e7eb4f9a9a0b 100644 --- a/svx/source/accessibility/AccessibleFrameSelector.cxx +++ b/svx/source/accessibility/AccessibleFrameSelector.cxx @@ -20,6 +20,7 @@ #include <AccessibleFrameSelector.hxx> #include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <com/sun/star/accessibility/AccessibleRole.hpp> +#include <com/sun/star/lang/IndexOutOfBoundsException.hpp> #include <unotools/accessiblerelationsethelper.hxx> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> @@ -31,6 +32,7 @@ namespace svx::a11y { using ::com::sun::star::uno::Any; +using ::com::sun::star::lang::IndexOutOfBoundsException; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::RuntimeException; @@ -55,17 +57,21 @@ Reference< XAccessibleContext > AccFrameSelector::getAccessibleContext( ) return this; } -sal_Int32 AccFrameSelector::getAccessibleChildCount( ) +sal_Int64 AccFrameSelector::getAccessibleChildCount( ) { SolarMutexGuard aGuard; IsValid(); return mpFrameSel->GetEnabledBorderCount(); } -Reference< XAccessible > AccFrameSelector::getAccessibleChild( sal_Int32 i ) +Reference< XAccessible > AccFrameSelector::getAccessibleChild( sal_Int64 i ) { SolarMutexGuard aGuard; IsValid(); + + if (i < 0 || i >= getAccessibleChildCount()) + throw IndexOutOfBoundsException(); + Reference< XAccessible > xRet = mpFrameSel->GetChildAccessible( i ); if( !xRet.is() ) throw RuntimeException(); @@ -238,14 +244,14 @@ Reference< XAccessibleContext > AccFrameSelectorChild::getAccessibleContext( ) return this; } -sal_Int32 AccFrameSelectorChild::getAccessibleChildCount( ) +sal_Int64 AccFrameSelectorChild::getAccessibleChildCount( ) { SolarMutexGuard aGuard; IsValid(); return 0; } -Reference< XAccessible > AccFrameSelectorChild::getAccessibleChild( sal_Int32 ) +Reference< XAccessible > AccFrameSelectorChild::getAccessibleChild( sal_Int64 ) { throw RuntimeException(); } diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx index af39510e5faa..1c1f964f971a 100644 --- a/svx/source/accessibility/AccessibleShape.cxx +++ b/svx/source/accessibility/AccessibleShape.cxx @@ -297,7 +297,7 @@ OUString SAL_CALL AccessibleShape::getAccessibleDescription() /** The children of this shape come from two sources: The children from group or scene shapes and the paragraphs of text. */ -sal_Int32 SAL_CALL +sal_Int64 SAL_CALL AccessibleShape::getAccessibleChildCount () { if (IsDisposed()) @@ -305,7 +305,7 @@ sal_Int32 SAL_CALL return 0; } - sal_Int32 nChildCount = 0; + sal_Int64 nChildCount = 0; // Add the number of shapes that are children of this shape. if (mpChildrenManager != nullptr) @@ -322,7 +322,7 @@ sal_Int32 SAL_CALL an exception for a wrong index. */ uno::Reference<XAccessible> SAL_CALL - AccessibleShape::getAccessibleChild (sal_Int32 nIndex) + AccessibleShape::getAccessibleChild (sal_Int64 nIndex) { ThrowIfDisposed (); @@ -337,7 +337,7 @@ uno::Reference<XAccessible> SAL_CALL } else if (mpText != nullptr) { - sal_Int32 nI = nIndex; + sal_Int64 nI = nIndex; if (mpChildrenManager != nullptr) nI -= mpChildrenManager->GetChildCount(); xChild = mpText->GetChild (nI); @@ -437,8 +437,8 @@ uno::Reference<XAccessible > SAL_CALL { ::osl::MutexGuard aGuard (m_aMutex); - sal_Int32 nChildCount = getAccessibleChildCount (); - for (sal_Int32 i=0; i<nChildCount; ++i) + sal_Int64 nChildCount = getAccessibleChildCount (); + for (sal_Int64 i = 0; i < nChildCount; ++i) { Reference<XAccessible> xChild (getAccessibleChild (i)); if (xChild.is()) @@ -735,12 +735,12 @@ void SAL_CALL } // XAccessibleSelection -void SAL_CALL AccessibleShape::selectAccessibleChild( sal_Int32 ) +void SAL_CALL AccessibleShape::selectAccessibleChild( sal_Int64 ) { } -sal_Bool SAL_CALL AccessibleShape::isAccessibleChildSelected( sal_Int32 nChildIndex ) +sal_Bool SAL_CALL AccessibleShape::isAccessibleChildSelected( sal_Int64 nChildIndex ) { uno::Reference<XAccessible> xAcc = getAccessibleChild( nChildIndex ); uno::Reference<XAccessibleContext> xContext; @@ -782,23 +782,22 @@ void SAL_CALL AccessibleShape::selectAllAccessibleChildren( ) } -sal_Int32 SAL_CALL AccessibleShape::getSelectedAccessibleChildCount() +sal_Int64 SAL_CALL AccessibleShape::getSelectedAccessibleChildCount() { - sal_Int32 nCount = 0; - sal_Int32 TotalCount = getAccessibleChildCount(); - for( sal_Int32 i = 0; i < TotalCount; i++ ) + sal_Int64 nCount = 0; + sal_Int64 TotalCount = getAccessibleChildCount(); + for( sal_Int64 i = 0; i < TotalCount; i++ ) if( isAccessibleChildSelected(i) ) nCount++; return nCount; } -Reference<XAccessible> SAL_CALL AccessibleShape::getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) +Reference<XAccessible> SAL_CALL AccessibleShape::getSelectedAccessibleChild( sal_Int64 nSelectedChildIndex ) { if ( nSelectedChildIndex > getSelectedAccessibleChildCount() ) throw IndexOutOfBoundsException(); - sal_Int32 i1, i2; - for( i1 = 0, i2 = 0; i1 < getAccessibleChildCount(); i1++ ) + for (sal_Int64 i1 = 0, i2 = 0; i1 < getAccessibleChildCount(); i1++) if( isAccessibleChildSelected(i1) ) { if( i2 == nSelectedChildIndex ) @@ -809,7 +808,7 @@ Reference<XAccessible> SAL_CALL AccessibleShape::getSelectedAccessibleChild( sal } -void SAL_CALL AccessibleShape::deselectAccessibleChild( sal_Int32 ) +void SAL_CALL AccessibleShape::deselectAccessibleChild( sal_Int64 ) { } @@ -1018,13 +1017,13 @@ void AccessibleShape::disposing() AccessibleContextBase::dispose (); } -sal_Int32 SAL_CALL +sal_Int64 SAL_CALL AccessibleShape::getAccessibleIndexInParent() { ThrowIfDisposed (); // Use a simple but slow solution for now. Optimize later. - sal_Int32 nIndex = m_nIndexInParent; + sal_Int64 nIndex = m_nIndexInParent; if ( -1 == nIndex ) nIndex = AccessibleContextBase::getAccessibleIndexInParent(); return nIndex; diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx index edb644640433..27ad6747500b 100644 --- a/svx/source/accessibility/AccessibleTextHelper.cxx +++ b/svx/source/accessibility/AccessibleTextHelper.cxx @@ -87,8 +87,8 @@ namespace accessibility virtual ~AccessibleTextHelper_Impl() override; // XAccessibleContext child handling methods - sal_Int32 getAccessibleChildCount() const; - uno::Reference< XAccessible > getAccessibleChild( sal_Int32 i ); + sal_Int64 getAccessibleChildCount() const; + uno::Reference< XAccessible > getAccessibleChild( sal_Int64 i ); // XAccessibleEventBroadcaster child related methods void addAccessibleEventListener( const uno::Reference< XAccessibleEventListener >& xListener ); @@ -1429,12 +1429,12 @@ namespace accessibility } // XAccessibleContext - sal_Int32 AccessibleTextHelper_Impl::getAccessibleChildCount() const + sal_Int64 AccessibleTextHelper_Impl::getAccessibleChildCount() const { return mnLastVisibleChild - mnFirstVisibleChild + 1; } - uno::Reference< XAccessible > AccessibleTextHelper_Impl::getAccessibleChild( sal_Int32 i ) + uno::Reference< XAccessible > AccessibleTextHelper_Impl::getAccessibleChild( sal_Int64 i ) { i -= GetStartIndex(); @@ -1500,7 +1500,7 @@ namespace accessibility Point aLogPoint( GetViewForwarder().PixelToLogic( aPoint, rCacheTF.GetMapMode() ) ); // iterate over all visible children (including those not yet created) - sal_Int32 nChild; + sal_Int64 nChild; for( nChild=mnFirstVisibleChild; nChild <= mnLastVisibleChild; ++nChild ) { DBG_ASSERT(nChild >= 0, @@ -1696,14 +1696,14 @@ namespace accessibility } // XAccessibleContext - sal_Int32 AccessibleTextHelper::GetChildCount() const + sal_Int64 AccessibleTextHelper::GetChildCount() const { SolarMutexGuard aGuard; #ifdef DBG_UTIL mpImpl->CheckInvariants(); - sal_Int32 nRet = mpImpl->getAccessibleChildCount(); + sal_Int64 nRet = mpImpl->getAccessibleChildCount(); mpImpl->CheckInvariants(); @@ -1713,7 +1713,7 @@ namespace accessibility #endif } - uno::Reference< XAccessible > AccessibleTextHelper::GetChild( sal_Int32 i ) + uno::Reference< XAccessible > AccessibleTextHelper::GetChild( sal_Int64 i ) { SolarMutexGuard aGuard; diff --git a/svx/source/accessibility/ChildrenManager.cxx b/svx/source/accessibility/ChildrenManager.cxx index 8b08b930dc7b..2cac5153a5a4 100644 --- a/svx/source/accessibility/ChildrenManager.cxx +++ b/svx/source/accessibility/ChildrenManager.cxx @@ -49,17 +49,17 @@ ChildrenManager::~ChildrenManager() SAL_INFO("svx", "~ChildrenManager"); } -tools::Long ChildrenManager::GetChildCount() const noexcept +sal_Int64 ChildrenManager::GetChildCount() const noexcept { return mpImpl->GetChildCount(); } -css::uno::Reference<XAccessible> ChildrenManager::GetChild (tools::Long nIndex) +css::uno::Reference<XAccessible> ChildrenManager::GetChild (sal_Int64 nIndex) { return mpImpl->GetChild (nIndex); } -const css::uno::Reference<css::drawing::XShape>& ChildrenManager::GetChildShape(tools::Long nIndex) +const css::uno::Reference<css::drawing::XShape>& ChildrenManager::GetChildShape(sal_Int64 nIndex) { return mpImpl->GetChildShape(nIndex); } diff --git a/svx/source/accessibility/ChildrenManagerImpl.cxx b/svx/source/accessibility/ChildrenManagerImpl.cxx index 36fa9ffecdb9..36390c7a033b 100644 --- a/svx/source/accessibility/ChildrenManagerImpl.cxx +++ b/svx/source/accessibility/ChildrenManagerImpl.cxx @@ -108,13 +108,13 @@ void ChildrenManagerImpl::Init() } -tools::Long ChildrenManagerImpl::GetChildCount() const noexcept +sal_Int64 ChildrenManagerImpl::GetChildCount() const noexcept { return maVisibleChildren.size(); } -const css::uno::Reference<css::drawing::XShape>& ChildrenManagerImpl::GetChildShape(tools::Long nIndex) +const css::uno::Reference<css::drawing::XShape>& ChildrenManagerImpl::GetChildShape(sal_Int64 nIndex) { // Check whether the given index is valid. if (nIndex < 0 || o3tl::make_unsigned(nIndex) >= maVisibleChildren.size()) @@ -128,7 +128,7 @@ const css::uno::Reference<css::drawing::XShape>& ChildrenManagerImpl::GetChildSh yet in the cache. */ uno::Reference<XAccessible> - ChildrenManagerImpl::GetChild (tools::Long nIndex) + ChildrenManagerImpl::GetChild (sal_Int64 nIndex) { // Check whether the given index is valid. if (nIndex < 0 || o3tl::make_unsigned(nIndex) >= maVisibleChildren.size()) @@ -800,8 +800,8 @@ bool ChildrenManagerImpl::ReplaceChild ( // Add the impl method for IAccessibleParent interface AccessibleControlShape * ChildrenManagerImpl::GetAccControlShapeFromModel(css::beans::XPropertySet* pSet) { - sal_Int32 count = GetChildCount(); - for (sal_Int32 index=0;index<count;index++) + sal_Int64 count = GetChildCount(); + for (sal_Int64 index=0;index<count;index++) { AccessibleShape* pAccShape = maVisibleChildren[index].GetAccessibleShape(); if (pAccShape && ::accessibility::ShapeTypeHandler::Instance().GetTypeId(pAccShape->GetXShape()) == DRAWING_CONTROL) diff --git a/svx/source/accessibility/ChildrenManagerImpl.hxx b/svx/source/accessibility/ChildrenManagerImpl.hxx index 517530fa64e7..2de34e10da16 100644 --- a/svx/source/accessibility/ChildrenManagerImpl.hxx +++ b/svx/source/accessibility/ChildrenManagerImpl.hxx @@ -115,11 +115,11 @@ public: @return If there are no children a 0 is returned. */ - tools::Long GetChildCount() const noexcept; + sal_Int64 GetChildCount() const noexcept; /// @throws css::uno::RuntimeException /// @throws css::lang::IndexOutOfBoundsException - const css::uno::Reference<css::drawing::XShape>& GetChildShape(tools::Long nIndex); + const css::uno::Reference<css::drawing::XShape>& GetChildShape(sal_Int64 nIndex); /** Return the requested accessible child or throw and IndexOutOfBoundsException if the given index is invalid. @param nIndex @@ -134,7 +134,7 @@ public: Throws an IndexOutOfBoundsException if the index is not valid. */ css::uno::Reference<css::accessibility::XAccessible> - GetChild (tools::Long nIndex); + GetChild (sal_Int64 nIndex); /** Return the requested accessible child. @param aChildDescriptor diff --git a/svx/source/accessibility/GraphCtlAccessibleContext.cxx b/svx/source/accessibility/GraphCtlAccessibleContext.cxx index 66189cf80c40..5662e1fdffc6 100644 --- a/svx/source/accessibility/GraphCtlAccessibleContext.cxx +++ b/svx/source/accessibility/GraphCtlAccessibleContext.cxx @@ -269,7 +269,7 @@ awt::Size SAL_CALL SvxGraphCtrlAccessibleContext::getSize() } // XAccessibleContext -sal_Int32 SAL_CALL SvxGraphCtrlAccessibleContext::getAccessibleChildCount() +sal_Int64 SAL_CALL SvxGraphCtrlAccessibleContext::getAccessibleChildCount() { ::SolarMutexGuard aGuard; @@ -281,7 +281,7 @@ sal_Int32 SAL_CALL SvxGraphCtrlAccessibleContext::getAccessibleChildCount() /** returns the SdrObject at index nIndex from the model of this graph */ -SdrObject* SvxGraphCtrlAccessibleContext::getSdrObject( sal_Int32 nIndex ) +SdrObject* SvxGraphCtrlAccessibleContext::getSdrObject( sal_Int64 nIndex ) { ::SolarMutexGuard aGuard; @@ -311,7 +311,7 @@ void SvxGraphCtrlAccessibleContext::CommitChange ( comphelper::AccessibleEventNotifier::addEvent( mnClientId, aEvent ); } -Reference< XAccessible > SAL_CALL SvxGraphCtrlAccessibleContext::getAccessibleChild( sal_Int32 nIndex ) +Reference< XAccessible > SAL_CALL SvxGraphCtrlAccessibleContext::getAccessibleChild( sal_Int64 nIndex ) { ::SolarMutexGuard aGuard; @@ -328,7 +328,7 @@ Reference< XAccessible > SAL_CALL SvxGraphCtrlAccessibleContext::getAccessiblePa return mpControl->GetDrawingArea()->get_accessible_parent(); } -sal_Int32 SAL_CALL SvxGraphCtrlAccessibleContext::getAccessibleIndexInParent() +sal_Int64 SAL_CALL SvxGraphCtrlAccessibleContext::getAccessibleIndexInParent() { ::SolarMutexGuard aGuard; // Use a simple but slow solution for now. Optimize later. @@ -340,8 +340,8 @@ sal_Int32 SAL_CALL SvxGraphCtrlAccessibleContext::getAccessibleIndexInParent() Reference< XAccessibleContext > xParentContext( xParent->getAccessibleContext() ); if( xParentContext.is() ) { - sal_Int32 nChildCount = xParentContext->getAccessibleChildCount(); - for( sal_Int32 i = 0 ; i < nChildCount ; ++i ) + sal_Int64 nChildCount = xParentContext->getAccessibleChildCount(); + for( sal_Int64 i = 0 ; i < nChildCount ; ++i ) { Reference< XAccessible > xChild( xParentContext->getAccessibleChild( i ) ); if( xChild.is() ) @@ -515,13 +515,16 @@ OUString SvxGraphCtrlAccessibleContext::getServiceName() } // XAccessibleSelection -void SAL_CALL SvxGraphCtrlAccessibleContext::selectAccessibleChild( sal_Int32 nIndex ) +void SAL_CALL SvxGraphCtrlAccessibleContext::selectAccessibleChild( sal_Int64 nIndex ) { ::SolarMutexGuard aGuard; if( nullptr == mpView ) throw DisposedException(); + if (nIndex < 0 || nIndex >= getAccessibleChildCount()) + throw lang::IndexOutOfBoundsException(); + SdrObject* pObj = getSdrObject( nIndex ); if( pObj ) @@ -529,13 +532,16 @@ void SAL_CALL SvxGraphCtrlAccessibleContext::selectAccessibleChild( sal_Int32 nI } -sal_Bool SAL_CALL SvxGraphCtrlAccessibleContext::isAccessibleChildSelected( sal_Int32 nIndex ) +sal_Bool SAL_CALL SvxGraphCtrlAccessibleContext::isAccessibleChildSelected( sal_Int64 nIndex ) { ::SolarMutexGuard aGuard; if( nullptr == mpView ) throw DisposedException(); + if (nIndex < 0 || nIndex >= getAccessibleChildCount()) + throw lang::IndexOutOfBoundsException(); + return mpView->IsObjMarked( getSdrObject( nIndex ) ); } @@ -562,7 +568,7 @@ void SAL_CALL SvxGraphCtrlAccessibleContext::selectAllAccessibleChildren() } -sal_Int32 SAL_CALL SvxGraphCtrlAccessibleContext::getSelectedAccessibleChildCount() +sal_Int64 SAL_CALL SvxGraphCtrlAccessibleContext::getSelectedAccessibleChildCount() { ::SolarMutexGuard aGuard; @@ -570,11 +576,11 @@ sal_Int32 SAL_CALL SvxGraphCtrlAccessibleContext::getSelectedAccessibleChildCoun throw DisposedException(); const SdrMarkList& rList = mpView->GetMarkedObjectList(); - return static_cast<sal_Int32>(rList.GetMarkCount()); + return static_cast<sal_Int64>(rList.GetMarkCount()); } -Reference< XAccessible > SAL_CALL SvxGraphCtrlAccessibleContext::getSelectedAccessibleChild( sal_Int32 nIndex ) +Reference< XAccessible > SAL_CALL SvxGraphCtrlAccessibleContext::getSelectedAccessibleChild( sal_Int64 nIndex ) { ::SolarMutexGuard aGuard; @@ -591,7 +597,7 @@ Reference< XAccessible > SAL_CALL SvxGraphCtrlAccessibleContext::getSelectedAcce } -void SAL_CALL SvxGraphCtrlAccessibleContext::deselectAccessibleChild( sal_Int32 nIndex ) +void SAL_CALL SvxGraphCtrlAccessibleContext::deselectAccessibleChild( sal_Int64 nIndex ) { ::SolarMutexGuard aGuard; @@ -620,7 +626,7 @@ void SAL_CALL SvxGraphCtrlAccessibleContext::deselectAccessibleChild( sal_Int32 } // internals -void SvxGraphCtrlAccessibleContext::checkChildIndexOnSelection( tools::Long nIndex ) +void SvxGraphCtrlAccessibleContext::checkChildIndexOnSelection(sal_Int64 nIndex ) { if( nIndex < 0 || nIndex >= getSelectedAccessibleChildCount() ) throw lang::IndexOutOfBoundsException(); diff --git a/svx/source/accessibility/charmapacc.cxx b/svx/source/accessibility/charmapacc.cxx index adbda3a3957d..9896262d615e 100644 --- a/svx/source/accessibility/charmapacc.cxx +++ b/svx/source/accessibility/charmapacc.cxx @@ -94,15 +94,21 @@ void SAL_CALL SvxShowCharSetAcc::disposing() IMPLEMENT_FORWARD_XINTERFACE2( SvxShowCharSetAcc, OAccessibleSelectionHelper, OAccessibleHelper_Base ) IMPLEMENT_FORWARD_XTYPEPROVIDER2( SvxShowCharSetAcc, OAccessibleSelectionHelper, OAccessibleHelper_Base ) -bool SvxShowCharSetAcc::implIsSelected( sal_Int32 nAccessibleChildIndex ) +bool SvxShowCharSetAcc::implIsSelected( sal_Int64 nAccessibleChildIndex ) { + if (nAccessibleChildIndex < 0 || nAccessibleChildIndex >= getAccessibleChildCount()) + throw IndexOutOfBoundsException(); + return m_pParent && m_pParent->IsSelected( sal::static_int_cast<sal_uInt16>(nAccessibleChildIndex)); } // select the specified child => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx) -void SvxShowCharSetAcc::implSelect(sal_Int32 nAccessibleChildIndex, bool bSelect) +void SvxShowCharSetAcc::implSelect(sal_Int64 nAccessibleChildIndex, bool bSelect) { + if (nAccessibleChildIndex < 0 || nAccessibleChildIndex >= getAccessibleChildCount()) + throw IndexOutOfBoundsException(); + if ( m_pParent ) { if ( bSelect ) @@ -130,14 +136,14 @@ css::awt::Rectangle SvxShowCharSetAcc::implGetBounds() return aRet; } -sal_Int32 SAL_CALL SvxShowCharSetAcc::getAccessibleChildCount() +sal_Int64 SAL_CALL SvxShowCharSetAcc::getAccessibleChildCount() { OExternalLockGuard aGuard( this ); return m_pParent->getMaxCharCount(); } -uno::Reference< css::accessibility::XAccessible > SAL_CALL SvxShowCharSetAcc::getAccessibleChild( sal_Int32 i ) +uno::Reference< css::accessibility::XAccessible > SAL_CALL SvxShowCharSetAcc::getAccessibleChild( sal_Int64 i ) { OExternalLockGuard aGuard( this ); @@ -338,19 +344,19 @@ sal_Bool SAL_CALL SvxShowCharSetAcc::isAccessibleSelected( sal_Int32 nRow, sal_I return m_pParent->GetSelectIndexId() == getAccessibleIndex(nRow,nColumn); } -sal_Int32 SAL_CALL SvxShowCharSetAcc::getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) +sal_Int64 SAL_CALL SvxShowCharSetAcc::getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) { - return (nRow*COLUMN_COUNT) + nColumn; + return (static_cast<sal_Int64>(nRow) * COLUMN_COUNT) + nColumn; } -sal_Int32 SAL_CALL SvxShowCharSetAcc::getAccessibleRow( sal_Int32 nChildIndex ) +sal_Int32 SAL_CALL SvxShowCharSetAcc::getAccessibleRow( sal_Int64 nChildIndex ) { OExternalLockGuard aGuard( this ); return SvxShowCharSet::GetRowPos(sal::static_int_cast<sal_uInt16>(nChildIndex)); } -sal_Int32 SAL_CALL SvxShowCharSetAcc::getAccessibleColumn( sal_Int32 nChildIndex ) +sal_Int32 SAL_CALL SvxShowCharSetAcc::getAccessibleColumn( sal_Int64 nChildIndex ) { OExternalLockGuard aGuard( this ); @@ -383,13 +389,13 @@ void SvxShowCharSetItemAcc::ParentDestroyed() mpParent = nullptr; } -sal_Int32 SAL_CALL SvxShowCharSetItemAcc::getAccessibleChildCount() +sal_Int64 SAL_CALL SvxShowCharSetItemAcc::getAccessibleChildCount() { return 0; } -uno::Reference< css::accessibility::XAccessible > SAL_CALL SvxShowCharSetItemAcc::getAccessibleChild( sal_Int32 /*i*/ ) +uno::Reference< css::accessibility::XAccessible > SAL_CALL SvxShowCharSetItemAcc::getAccessibleChild( sal_Int64 /*i*/ ) { throw lang::IndexOutOfBoundsException(); } diff --git a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx index cd1e0a4d5263..d31af4062d49 100644 --- a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx +++ b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx @@ -57,12 +57,12 @@ uno::Reference< XAccessibleContext > SvxPixelCtlAccessible::getAccessibleContext return this; } -sal_Int32 SvxPixelCtlAccessible::getAccessibleChildCount( ) +sal_Int64 SvxPixelCtlAccessible::getAccessibleChildCount( ) { ::osl::MutexGuard aGuard( m_aMutex ); return SvxPixelCtl::GetSquares(); } -uno::Reference< XAccessible > SvxPixelCtlAccessible::getAccessibleChild( sal_Int32 i ) +uno::Reference< XAccessible > SvxPixelCtlAccessible::getAccessibleChild( sal_Int64 i ) { ::osl::MutexGuard aGuard( m_aMutex ); if ( i < 0 || i >= getAccessibleChildCount()) @@ -190,7 +190,7 @@ sal_Int32 SvxPixelCtlAccessible::getBackground( ) return sal_Int32(rStyles.GetDialogColor()); } -void SvxPixelCtlAccessible::implSelect(sal_Int32 nChildIndex, bool bSelect) +void SvxPixelCtlAccessible::implSelect(sal_Int64 nChildIndex, bool bSelect) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -204,7 +204,7 @@ void SvxPixelCtlAccessible::implSelect(sal_Int32 nChildIndex, bool bSelect) NotifyChild(nIndex, bSelect, false); } -bool SvxPixelCtlAccessible::implIsSelected(sal_Int32 nChildIndex) +bool SvxPixelCtlAccessible::implIsSelected(sal_Int64 nChildIndex) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -359,12 +359,12 @@ sal_Int32 SvxPixelCtlAccessibleChild::getBackground() } // XAccessibleContext -sal_Int32 SAL_CALL SvxPixelCtlAccessibleChild::getAccessibleChildCount() +sal_Int64 SAL_CALL SvxPixelCtlAccessibleChild::getAccessibleChildCount() { return 0; } -uno::Reference< XAccessible > SAL_CALL SvxPixelCtlAccessibleChild::getAccessibleChild( sal_Int32 ) +uno::Reference< XAccessible > SAL_CALL SvxPixelCtlAccessibleChild::getAccessibleChild( sal_Int64 ) { throw lang::IndexOutOfBoundsException(); } diff --git a/svx/source/accessibility/svxrectctaccessiblecontext.cxx b/svx/source/accessibility/svxrectctaccessiblecontext.cxx index 550ea079cdda..9586330127b5 100644 --- a/svx/source/accessibility/svxrectctaccessiblecontext.cxx +++ b/svx/source/accessibility/svxrectctaccessiblecontext.cxx @@ -130,14 +130,14 @@ Reference< XAccessible > SAL_CALL SvxRectCtlAccessibleContext::getAccessibleAtPo } // XAccessibleContext -sal_Int32 SAL_CALL SvxRectCtlAccessibleContext::getAccessibleChildCount() +sal_Int64 SAL_CALL SvxRectCtlAccessibleContext::getAccessibleChildCount() { ::osl::MutexGuard aGuard( m_aMutex ); return SvxRectCtl::NO_CHILDREN; } -Reference< XAccessible > SAL_CALL SvxRectCtlAccessibleContext::getAccessibleChild( sal_Int32 nIndex ) +Reference< XAccessible > SAL_CALL SvxRectCtlAccessibleContext::getAccessibleChild( sal_Int64 nIndex ) { checkChildIndex( nIndex ); @@ -262,7 +262,7 @@ sal_Int32 SvxRectCtlAccessibleContext::getBackground( ) } // XAccessibleSelection -void SvxRectCtlAccessibleContext::implSelect(sal_Int32 nIndex, bool bSelect) +void SvxRectCtlAccessibleContext::implSelect(sal_Int64 nIndex, bool bSelect) { ::SolarMutexGuard aSolarGuard; @@ -288,7 +288,7 @@ void SvxRectCtlAccessibleContext::implSelect(sal_Int32 nIndex, bool bSelect) } } -bool SvxRectCtlAccessibleContext::implIsSelected( sal_Int32 nIndex ) +bool SvxRectCtlAccessibleContext::implIsSelected( sal_Int64 nIndex ) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -298,7 +298,7 @@ bool SvxRectCtlAccessibleContext::implIsSelected( sal_Int32 nIndex ) } // internals -void SvxRectCtlAccessibleContext::checkChildIndex( tools::Long nIndex ) +void SvxRectCtlAccessibleContext::checkChildIndex( sal_Int64 nIndex ) { if( nIndex < 0 || nIndex >= getAccessibleChildCount() ) throw lang::IndexOutOfBoundsException(); @@ -449,12 +449,12 @@ sal_Int32 SvxRectCtlChildAccessibleContext::getBackground( ) } // XAccessibleContext -sal_Int32 SAL_CALL SvxRectCtlChildAccessibleContext::getAccessibleChildCount() +sal_Int64 SAL_CALL SvxRectCtlChildAccessibleContext::getAccessibleChildCount() { return 0; } -Reference< XAccessible > SAL_CALL SvxRectCtlChildAccessibleContext::getAccessibleChild( sal_Int32 /*nIndex*/ ) +Reference< XAccessible > SAL_CALL SvxRectCtlChildAccessibleContext::getAccessibleChild( sal_Int64 /*nIndex*/ ) { throw lang::IndexOutOfBoundsException(); } diff --git a/svx/source/dialog/weldeditview.cxx b/svx/source/dialog/weldeditview.cxx index 8b85ea1a53ed..3cfd53d707bb 100644 --- a/svx/source/dialog/weldeditview.cxx +++ b/svx/source/dialog/weldeditview.cxx @@ -666,7 +666,7 @@ public: } // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount() override + virtual sal_Int64 SAL_CALL getAccessibleChildCount() override { if (m_xTextHelper) return m_xTextHelper->GetChildCount(); @@ -674,7 +674,7 @@ public: } virtual css::uno::Reference<css::accessibility::XAccessible> - SAL_CALL getAccessibleChild(sal_Int32 i) override + SAL_CALL getAccessibleChild(sal_Int64 i) override { if (m_xTextHelper) return m_xTextHelper->GetChild(i); @@ -691,14 +691,14 @@ public: return m_pController->GetDrawingArea()->get_accessible_parent(); } - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() override + virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override { SolarMutexGuard aGuard; if (!m_pController) throw css::uno::RuntimeException(); // -1 for child not found/no parent (according to specification) - sal_Int32 nRet = -1; + sal_Int64 nRet = -1; css::uno::Reference<css::accessibility::XAccessible> xParent(getAccessibleParent()); if (!xParent) @@ -712,8 +712,8 @@ public: // iterate over parent's children and search for this object if (xParentContext.is()) { - sal_Int32 nChildCount = xParentContext->getAccessibleChildCount(); - for (sal_Int32 nChild = 0; (nChild < nChildCount) && (-1 == nRet); ++nChild) + sal_Int64 nChildCount = xParentContext->getAccessibleChildCount(); + for (sal_Int64 nChild = 0; (nChild < nChildCount) && (-1 == nRet); ++nChild) { css::uno::Reference<css::accessibility::XAccessible> xChild( xParentContext->getAccessibleChild(nChild)); diff --git a/svx/source/inc/AccessibleFrameSelector.hxx b/svx/source/inc/AccessibleFrameSelector.hxx index 46083e4aade5..7497b438398f 100644 --- a/svx/source/inc/AccessibleFrameSelector.hxx +++ b/svx/source/inc/AccessibleFrameSelector.hxx @@ -49,8 +49,8 @@ public: virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override; //XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) override; + virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override; virtual sal_Int16 SAL_CALL getAccessibleRole( ) override; virtual OUString SAL_CALL getAccessibleDescription( ) override; @@ -94,8 +94,8 @@ public: virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override; //XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) override; + virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override; virtual sal_Int16 SAL_CALL getAccessibleRole( ) override; virtual OUString SAL_CALL getAccessibleDescription( ) override; diff --git a/svx/source/inc/GraphCtlAccessibleContext.hxx b/svx/source/inc/GraphCtlAccessibleContext.hxx index 03bd43e1a09d..094d9bd18ba5 100644 --- a/svx/source/inc/GraphCtlAccessibleContext.hxx +++ b/svx/source/inc/GraphCtlAccessibleContext.hxx @@ -98,10 +98,10 @@ public: virtual sal_Int32 SAL_CALL getBackground() override; // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount() override; - virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL getAccessibleChild (sal_Int32 nIndex) override; + virtual sal_Int64 SAL_CALL getAccessibleChildCount() override; + virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL getAccessibleChild (sal_Int64 nIndex) override; virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL getAccessibleParent() override; - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() override; + virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override; virtual sal_Int16 SAL_CALL getAccessibleRole() override; virtual OUString SAL_CALL getAccessibleDescription() override; virtual OUString SAL_CALL getAccessibleName() override; @@ -125,13 +125,13 @@ public: virtual OUString SAL_CALL getServiceName() override; // XAccessibleSelection - virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) override; - virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) override; + virtual void SAL_CALL selectAccessibleChild( sal_Int64 nChildIndex ) override; + virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int64 nChildIndex ) override; virtual void SAL_CALL clearAccessibleSelection() override; virtual void SAL_CALL selectAllAccessibleChildren() override; - virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount() override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) override; - virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) override; + virtual sal_Int64 SAL_CALL getSelectedAccessibleChildCount() override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int64 nSelectedChildIndex ) override; + virtual void SAL_CALL deselectAccessibleChild( sal_Int64 nSelectedChildIndex ) override; // IAccessibleViewforwarder virtual tools::Rectangle GetVisibleArea() const override; @@ -146,13 +146,13 @@ public: private: virtual ~SvxGraphCtrlAccessibleContext() override; /// @throws css::lang::IndexOutOfBoundsException - void checkChildIndexOnSelection( tools::Long nIndexOfChild ); + void checkChildIndexOnSelection(sal_Int64 nIndexOfChild ); virtual void SAL_CALL disposing() final override; /// @throws css::uno::RuntimeException /// @throws css::lang::IndexOutOfBoundsException - SdrObject* getSdrObject( sal_Int32 nIndex ); + SdrObject* getSdrObject( sal_Int64 nIndex ); void CommitChange (sal_Int16 aEventId, const css::uno::Any& rNewValue, const css::uno::Any& rOldValue); diff --git a/svx/source/inc/charmapacc.hxx b/svx/source/inc/charmapacc.hxx index 013c1da1c57d..1924a77578a5 100644 --- a/svx/source/inc/charmapacc.hxx +++ b/svx/source/inc/charmapacc.hxx @@ -85,8 +85,8 @@ namespace svx //OAccessibleContextHelper // XAccessibleContext - still waiting to be overwritten - virtual sal_Int32 SAL_CALL getAccessibleChildCount() override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) override; + virtual sal_Int64 SAL_CALL getAccessibleChildCount() override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override; virtual sal_Int16 SAL_CALL getAccessibleRole( ) override; virtual OUString SAL_CALL getAccessibleDescription( ) override; @@ -115,9 +115,9 @@ namespace svx virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleCaption( ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleSummary( ) override; virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) override; - virtual sal_Int32 SAL_CALL getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) override; - virtual sal_Int32 SAL_CALL getAccessibleRow( sal_Int32 nChildIndex ) override; - virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int32 nChildIndex ) override; + virtual sal_Int64 SAL_CALL getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) override; + virtual sal_Int32 SAL_CALL getAccessibleRow( sal_Int64 nChildIndex ) override; + virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int64 nChildIndex ) override; void fireEvent( @@ -137,11 +137,11 @@ namespace svx // OCommonAccessibleSelection // return if the specified child is visible => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx) virtual bool - implIsSelected( sal_Int32 nAccessibleChildIndex ) override; + implIsSelected( sal_Int64 nAccessibleChildIndex ) override; // select the specified child => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx) virtual void - implSelect( sal_Int32 nAccessibleChildIndex, bool bSelect ) override; + implSelect( sal_Int64 nAccessibleChildIndex, bool bSelect ) override; // OCommonAccessibleComponent /// implements the calculation of the bounding rectangle - still waiting to be overwritten @@ -184,8 +184,8 @@ namespace svx //OAccessibleContextHelper // XAccessibleContext - still waiting to be overwritten - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) override; + virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override; virtual sal_Int16 SAL_CALL getAccessibleRole( ) override; virtual OUString SAL_CALL getAccessibleDescription( ) override; diff --git a/svx/source/inc/svxpixelctlaccessiblecontext.hxx b/svx/source/inc/svxpixelctlaccessiblecontext.hxx index b9c738605b11..20b9b9d0b251 100644 --- a/svx/source/inc/svxpixelctlaccessiblecontext.hxx +++ b/svx/source/inc/svxpixelctlaccessiblecontext.hxx @@ -59,8 +59,8 @@ public: virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override; //XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) override; + virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override; virtual sal_Int16 SAL_CALL getAccessibleRole( ) override; virtual OUString SAL_CALL getAccessibleDescription( ) override; @@ -111,8 +111,8 @@ public: //XAccessible //XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) override; + virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override; virtual sal_Int16 SAL_CALL getAccessibleRole( ) override; virtual OUString SAL_CALL getAccessibleDescription( ) override; @@ -132,10 +132,10 @@ private: // OCommonAccessibleSelection // return if the specified child is visible => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx) - virtual bool implIsSelected(sal_Int32 nAccessibleChildIndex) override; + virtual bool implIsSelected(sal_Int64 nAccessibleChildIndex) override; // select the specified child => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx) - virtual void implSelect(sal_Int32 nAccessibleChildIndex, bool bSelect) override; + virtual void implSelect(sal_Int64 nAccessibleChildIndex, bool bSelect) override; // OCommonAccessibleComponent virtual css::awt::Rectangle implGetBounds() override; diff --git a/svx/source/inc/svxrectctaccessiblecontext.hxx b/svx/source/inc/svxrectctaccessiblecontext.hxx index 66c9cc51ecbb..2d6967e22784 100644 --- a/svx/source/inc/svxrectctaccessiblecontext.hxx +++ b/svx/source/inc/svxrectctaccessiblecontext.hxx @@ -61,8 +61,8 @@ public: // XAccessible // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount() override; - virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL getAccessibleChild(sal_Int32 nIndex) override; + virtual sal_Int64 SAL_CALL getAccessibleChildCount() override; + virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL getAccessibleChild(sal_Int64 nIndex) override; virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL getAccessibleParent() override; virtual sal_Int16 SAL_CALL getAccessibleRole() override; virtual OUString SAL_CALL getAccessibleDescription() override; @@ -90,17 +90,17 @@ private: // OCommonAccessibleSelection // return if the specified child is visible => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx) - virtual bool implIsSelected(sal_Int32 nAccessibleChildIndex) override; + virtual bool implIsSelected(sal_Int64 nAccessibleChildIndex) override; // select the specified child => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx) - virtual void implSelect(sal_Int32 nAccessibleChildIndex, bool bSelect) override; + virtual void implSelect(sal_Int64 nAccessibleChildIndex, bool bSelect) override; // OCommonAccessibleComponent virtual css::awt::Rectangle implGetBounds() override; virtual void SAL_CALL disposing() override; - void checkChildIndex(tools::Long nIndex); + void checkChildIndex(sal_Int64 nIndex); /** Selects a new child by index. @@ -154,8 +154,8 @@ public: virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& rPoint ) override; // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount() override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 nIndex ) override; + virtual sal_Int64 SAL_CALL getAccessibleChildCount() override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 nIndex ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override; virtual sal_Int16 SAL_CALL getAccessibleRole() override; virtual OUString SAL_CALL getAccessibleDescription() override; diff --git a/svx/source/table/accessiblecell.cxx b/svx/source/table/accessiblecell.cxx index 1d6321084b22..98c83c48df86 100644 --- a/svx/source/table/accessiblecell.cxx +++ b/svx/source/table/accessiblecell.cxx @@ -151,7 +151,7 @@ void SAL_CALL AccessibleCell::release( ) noexcept /** The children of this cell come from the paragraphs of text. */ -sal_Int32 SAL_CALL AccessibleCell::getAccessibleChildCount() +sal_Int64 SAL_CALL AccessibleCell::getAccessibleChildCount() { SolarMutexGuard aSolarGuard; ThrowIfDisposed (); @@ -162,7 +162,7 @@ sal_Int32 SAL_CALL AccessibleCell::getAccessibleChildCount() /** Forward the request to the shape. Return the requested shape or throw an exception for a wrong index. */ -Reference<XAccessible> SAL_CALL AccessibleCell::getAccessibleChild (sal_Int32 nIndex) +Reference<XAccessible> SAL_CALL AccessibleCell::getAccessibleChild (sal_Int64 nIndex) { SolarMutexGuard aSolarGuard; ThrowIfDisposed (); @@ -249,8 +249,8 @@ Reference<XAccessible > SAL_CALL AccessibleCell::getAccessibleAtPoint ( const c SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard (m_aMutex); - sal_Int32 nChildCount = getAccessibleChildCount (); - for (sal_Int32 i=0; i<nChildCount; ++i) + sal_Int64 nChildCount = getAccessibleChildCount (); + for (sal_Int64 i = 0; i < nChildCount; ++i) { Reference<XAccessible> xChild (getAccessibleChild (i)); if (xChild.is()) @@ -496,7 +496,7 @@ void AccessibleCell::disposing() AccessibleContextBase::dispose (); } -sal_Int32 SAL_CALL AccessibleCell::getAccessibleIndexInParent() +sal_Int64 SAL_CALL AccessibleCell::getAccessibleIndexInParent() { ThrowIfDisposed (); return mnIndexInParent; diff --git a/svx/source/table/accessiblecell.hxx b/svx/source/table/accessiblecell.hxx index d926e0bec704..e57616f5789d 100644 --- a/svx/source/table/accessiblecell.hxx +++ b/svx/source/table/accessiblecell.hxx @@ -63,10 +63,10 @@ public: virtual void SAL_CALL release( ) noexcept override; // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount() override; - virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL getAccessibleChild(sal_Int32 nIndex) override; + virtual sal_Int64 SAL_CALL getAccessibleChildCount() override; + virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL getAccessibleChild(sal_Int64 nIndex) override; virtual sal_Int64 SAL_CALL getAccessibleStateSet() override; - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() override; + virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override; virtual OUString SAL_CALL getAccessibleName() override; const sdr::table::CellRef& getCellRef() const { return mxCell;} void UpdateChildren(); diff --git a/svx/source/table/accessibletableshape.cxx b/svx/source/table/accessibletableshape.cxx index 50d213fda3e9..24880596af69 100644 --- a/svx/source/table/accessibletableshape.cxx +++ b/svx/source/table/accessibletableshape.cxx @@ -67,9 +67,9 @@ public: /// @throws IndexOutOfBoundsException /// @throws RuntimeException - Reference< XAccessible > getAccessibleChild(sal_Int32 i); + Reference< XAccessible > getAccessibleChild(sal_Int64 i); /// @throws IndexOutOfBoundsException - void getColumnAndRow( sal_Int32 nChildIndex, sal_Int32& rnColumn, sal_Int32& rnRow ); + void getColumnAndRow( sal_Int64 nChildIndex, sal_Int32& rnColumn, sal_Int32& rnRow ); // XModifyListener virtual void SAL_CALL modified( const EventObject& aEvent ) override; @@ -170,7 +170,7 @@ rtl::Reference< AccessibleCell > AccessibleTableShapeImpl::getAccessibleCell (sa } -Reference< XAccessible > AccessibleTableShapeImpl::getAccessibleChild(sal_Int32 nChildIndex) +Reference< XAccessible > AccessibleTableShapeImpl::getAccessibleChild(sal_Int64 nChildIndex) { sal_Int32 nColumn = 0, nRow = 0; getColumnAndRow( nChildIndex, nColumn, nRow ); @@ -197,7 +197,7 @@ Reference< XAccessible > AccessibleTableShapeImpl::getAccessibleChild(sal_Int32 } -void AccessibleTableShapeImpl::getColumnAndRow( sal_Int32 nChildIndex, sal_Int32& rnColumn, sal_Int32& rnRow ) +void AccessibleTableShapeImpl::getColumnAndRow( sal_Int64 nChildIndex, sal_Int32& rnColumn, sal_Int32& rnRow ) { if( mxTable.is() ) { @@ -403,14 +403,14 @@ OUString AccessibleTableShape::CreateAccessibleBaseName() } -sal_Int32 SAL_CALL AccessibleTableShape::getAccessibleChildCount( ) +sal_Int64 SAL_CALL AccessibleTableShape::getAccessibleChildCount( ) { SolarMutexGuard aSolarGuard; - return mxImpl->mxTable.is() ? mxImpl->mxTable->getRowCount() * mxImpl->mxTable->getColumnCount() : 0; + return mxImpl->mxTable.is() ? static_cast<sal_Int64>(mxImpl->mxTable->getRowCount()) * static_cast<sal_Int64>(mxImpl->mxTable->getColumnCount()) : 0; } -Reference< XAccessible > SAL_CALL AccessibleTableShape::getAccessibleChild( sal_Int32 i ) +Reference< XAccessible > SAL_CALL AccessibleTableShape::getAccessibleChild( sal_Int64 i ) { SolarMutexGuard aSolarGuard; ThrowIfDisposed(); @@ -667,15 +667,15 @@ sal_Bool SAL_CALL AccessibleTableShape::isAccessibleSelected( sal_Int32 nRow, sa } -sal_Int32 SAL_CALL AccessibleTableShape::getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) +sal_Int64 SAL_CALL AccessibleTableShape::getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) { SolarMutexGuard aSolarGuard; checkCellPosition( nColumn, nRow ); - return mxImpl->mxTable.is() ? (nRow * mxImpl->mxTable->getColumnCount() + nColumn) : 0; + return mxImpl->mxTable.is() ? (static_cast<sal_Int64>(nRow) * static_cast<sal_Int64>(mxImpl->mxTable->getColumnCount()) + nColumn) : 0; } -sal_Int32 SAL_CALL AccessibleTableShape::getAccessibleRow( sal_Int32 nChildIndex ) +sal_Int32 SAL_CALL AccessibleTableShape::getAccessibleRow( sal_Int64 nChildIndex ) { SolarMutexGuard aSolarGuard; sal_Int32 nColumn = 0, nRow = 0; @@ -684,7 +684,7 @@ sal_Int32 SAL_CALL AccessibleTableShape::getAccessibleRow( sal_Int32 nChildIndex } -sal_Int32 SAL_CALL AccessibleTableShape::getAccessibleColumn( sal_Int32 nChildIndex ) +sal_Int32 SAL_CALL AccessibleTableShape::getAccessibleColumn( sal_Int64 nChildIndex ) { SolarMutexGuard aSolarGuard; sal_Int32 nColumn = 0, nRow = 0; @@ -696,7 +696,7 @@ sal_Int32 SAL_CALL AccessibleTableShape::getAccessibleColumn( sal_Int32 nChildIn // XAccessibleSelection -void SAL_CALL AccessibleTableShape::selectAccessibleChild( sal_Int32 nChildIndex ) +void SAL_CALL AccessibleTableShape::selectAccessibleChild( sal_Int64 nChildIndex ) { SolarMutexGuard aSolarGuard; CellPos aPos; @@ -721,9 +721,13 @@ void SAL_CALL AccessibleTableShape::selectAccessibleChild( sal_Int32 nChildIndex } -sal_Bool SAL_CALL AccessibleTableShape::isAccessibleChildSelected( sal_Int32 nChildIndex ) +sal_Bool SAL_CALL AccessibleTableShape::isAccessibleChildSelected( sal_Int64 nChildIndex ) { SolarMutexGuard aSolarGuard; + + if (nChildIndex < 0 || nChildIndex >= getAccessibleChildCount()) + throw IndexOutOfBoundsException(); + CellPos aPos; mxImpl->getColumnAndRow( nChildIndex, aPos.mnCol, aPos.mnRow ); @@ -752,7 +756,7 @@ void SAL_CALL AccessibleTableShape::selectAllAccessibleChildren() } -sal_Int32 SAL_CALL AccessibleTableShape::getSelectedAccessibleChildCount() +sal_Int64 SAL_CALL AccessibleTableShape::getSelectedAccessibleChildCount() { SolarMutexGuard aSolarGuard; @@ -764,21 +768,21 @@ sal_Int32 SAL_CALL AccessibleTableShape::getSelectedAccessibleChildCount() const sal_Int32 nSelectedColumns = std::max( sal_Int32(0), aLastPos.mnCol - aFirstPos.mnCol ) + 1; const sal_Int32 nSelectedRows = std::max( sal_Int32(0), aLastPos.mnRow - aFirstPos.mnRow ) + 1; - return nSelectedRows * nSelectedColumns; + return static_cast<sal_Int64>(nSelectedRows) * static_cast<sal_Int64>(nSelectedColumns); } return 0; } -Reference< XAccessible > SAL_CALL AccessibleTableShape::getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) +Reference< XAccessible > SAL_CALL AccessibleTableShape::getSelectedAccessibleChild( sal_Int64 nSelectedChildIndex ) { SolarMutexGuard aSolarGuard; if( nSelectedChildIndex < 0 ) throw IndexOutOfBoundsException(); - sal_Int32 nChildIndex = GetIndexOfSelectedChild( nSelectedChildIndex ); + sal_Int64 nChildIndex = GetIndexOfSelectedChild( nSelectedChildIndex ); if( nChildIndex < 0 ) throw IndexOutOfBoundsException(); @@ -792,7 +796,7 @@ Reference< XAccessible > SAL_CALL AccessibleTableShape::getSelectedAccessibleChi } -void SAL_CALL AccessibleTableShape::deselectAccessibleChild( sal_Int32 nChildIndex ) +void SAL_CALL AccessibleTableShape::deselectAccessibleChild( sal_Int64 nChildIndex ) { SolarMutexGuard aSolarGuard; CellPos aPos; @@ -856,15 +860,15 @@ sal_Bool SAL_CALL AccessibleTableShape::unselectColumn( sal_Int32 column ) return pController->deselectColumn( column ); } -sal_Int32 AccessibleTableShape::GetIndexOfSelectedChild( - sal_Int32 nSelectedChildIndex ) const +sal_Int64 AccessibleTableShape::GetIndexOfSelectedChild( + sal_Int64 nSelectedChildIndex ) const { - sal_Int32 nChildren = const_cast<AccessibleTableShape*>(this)->getAccessibleChildCount(); + sal_Int64 nChildren = const_cast<AccessibleTableShape*>(this)->getAccessibleChildCount(); if( nSelectedChildIndex >= nChildren ) return -1; - sal_Int32 n = 0; + sal_Int64 n = 0; while( n < nChildren ) { if( const_cast<AccessibleTableShape*>(this)->isAccessibleChildSelected( n ) ) @@ -879,7 +883,7 @@ sal_Int32 AccessibleTableShape::GetIndexOfSelectedChild( return n < nChildren ? n : -1; } -void AccessibleTableShape::getColumnAndRow( sal_Int32 nChildIndex, sal_Int32& rnColumn, sal_Int32& rnRow ) +void AccessibleTableShape::getColumnAndRow( sal_Int64 nChildIndex, sal_Int32& rnColumn, sal_Int32& rnRow ) { mxImpl->getColumnAndRow(nChildIndex, rnColumn, rnRow); } @@ -901,7 +905,7 @@ void SAL_CALL AccessibleTableShape::selectionChanged (const EventObject& rEvent if (!xAccCell.is()) return; - sal_Int32 nIndex = xAccCell->getAccessibleIndexInParent(), + sal_Int64 nIndex = xAccCell->getAccessibleIndexInParent(), nCount = getSelectedAccessibleChildCount(); bool bSelected = isAccessibleChildSelected(nIndex); if (mnPreviousSelectionCount == 0 && nCount > 0 && bSelected) @@ -1012,12 +1016,12 @@ Reference< XAccessibleContext > SAL_CALL AccessibleTableHeaderShape::getAccessib } // XAccessibleContext -sal_Int32 SAL_CALL AccessibleTableHeaderShape::getAccessibleChildCount( ) +sal_Int64 SAL_CALL AccessibleTableHeaderShape::getAccessibleChildCount( ) { - return getAccessibleRowCount() * getAccessibleColumnCount(); + return static_cast<sal_Int64>(getAccessibleRowCount()) * static_cast<sal_Int64>(getAccessibleColumnCount()); } -Reference< XAccessible > SAL_CALL AccessibleTableHeaderShape::getAccessibleChild( sal_Int32 i ) +Reference< XAccessible > SAL_CALL AccessibleTableHeaderShape::getAccessibleChild( sal_Int64 i ) { return mpTable->getAccessibleChild( i ); } @@ -1028,7 +1032,7 @@ Reference< XAccessible > SAL_CALL AccessibleTableHeaderShape::getAccessibleParen return XParent; } -sal_Int32 SAL_CALL AccessibleTableHeaderShape::getAccessibleIndexInParent() +sal_Int64 SAL_CALL AccessibleTableHeaderShape::getAccessibleIndexInParent() { return -1; } @@ -1251,17 +1255,17 @@ sal_Bool SAL_CALL AccessibleTableHeaderShape::isAccessibleSelected( sal_Int32 nR return mpTable->isAccessibleSelected( nRow, nColumn ); } -sal_Int32 SAL_CALL AccessibleTableHeaderShape::getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) +sal_Int64 SAL_CALL AccessibleTableHeaderShape::getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) { return mpTable->getAccessibleIndex( nRow, nColumn ); } -sal_Int32 SAL_CALL AccessibleTableHeaderShape::getAccessibleRow( sal_Int32 nChildIndex ) +sal_Int32 SAL_CALL AccessibleTableHeaderShape::getAccessibleRow( sal_Int64 nChildIndex ) { return mpTable->getAccessibleRow( nChildIndex ); } -sal_Int32 SAL_CALL AccessibleTableHeaderShape::getAccessibleColumn( sal_Int32 nChildIndex ) +sal_Int32 SAL_CALL AccessibleTableHeaderShape::getAccessibleColumn( sal_Int64 nChildIndex ) { return mpTable->getAccessibleColumn( nChildIndex ); } @@ -1274,7 +1278,7 @@ sal_Bool SAL_CALL AccessibleTableHeaderShape::selectRow( sal_Int32 row ) else { mpTable->clearAccessibleSelection(); - sal_Int32 nIndex = mpTable->getAccessibleIndex( row, 0 ); + sal_Int64 nIndex = mpTable->getAccessibleIndex( row, 0 ); mpTable->selectAccessibleChild( nIndex ); return true; } @@ -1287,7 +1291,7 @@ sal_Bool SAL_CALL AccessibleTableHeaderShape::selectColumn( sal_Int32 column ) else { mpTable->clearAccessibleSelection(); - sal_Int32 nIndex = mpTable->getAccessibleIndex( 0, column ); + sal_Int64 nIndex = mpTable->getAccessibleIndex( 0, column ); mpTable->selectAccessibleChild( nIndex ); return true; } @@ -1299,7 +1303,7 @@ sal_Bool SAL_CALL AccessibleTableHeaderShape::unselectRow( sal_Int32 row ) return mpTable->unselectRow( row ); else { - sal_Int32 nIndex = mpTable->getAccessibleIndex( row, 0 ); + sal_Int64 nIndex = mpTable->getAccessibleIndex( row, 0 ); mpTable->deselectAccessibleChild( nIndex ); return true; } @@ -1311,7 +1315,7 @@ sal_Bool SAL_CALL AccessibleTableHeaderShape::unselectColumn( sal_Int32 column ) return mpTable->unselectColumn( column ); else { - sal_Int32 nIndex = mpTable->getAccessibleIndex( 0, column ); + sal_Int64 nIndex = mpTable->getAccessibleIndex( 0, column ); mpTable->deselectAccessibleChild( nIndex ); return true; } |