summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2012-12-18 13:29:03 +0000
committerMichael Meeks <michael.meeks@suse.com>2012-12-18 16:47:14 +0000
commit1211bf4682b7e8454d86d5a812df421abf68f662 (patch)
tree75567540196c20c64b2d563b7758d0cc74d1bff1 /sc
parent28549ae77dee063da50a56eb3cdf9114365a6afd (diff)
fdo#56937 - mac a11y hang related to traversing vast, broken hierarchies.
Change-Id: Iff0537a69b2c6ae929da6a05f26c0d55415d6d8a Signed-off-by: Tor Lillqvist <tml@iki.fi>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx2
-rw-r--r--sc/source/ui/Accessibility/AccessibleTableBase.cxx20
2 files changed, 17 insertions, 5 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index 0408458f9704..cf29eaecce39 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -55,6 +55,8 @@ using namespace ::com::sun::star::accessibility;
//===== internal ============================================================
+// FIXME: really unclear why we have an ScAccessibleTableBase with
+// only this single sub-class
ScAccessibleSpreadsheet::ScAccessibleSpreadsheet(
ScAccessibleDocument* pAccDoc,
ScTabViewShell* pViewShell,
diff --git a/sc/source/ui/Accessibility/AccessibleTableBase.cxx b/sc/source/ui/Accessibility/AccessibleTableBase.cxx
index c1408dbd005d..82203391f674 100644
--- a/sc/source/ui/Accessibility/AccessibleTableBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleTableBase.cxx
@@ -272,7 +272,7 @@ sal_Bool SAL_CALL ScAccessibleTableBase::isAccessibleSelected( sal_Int32 /* nRow
return false;
}
- //===== XAccessibleExtendedTable ========================================
+// ===== XAccessibleExtendedTable ========================================
sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn )
throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
@@ -315,7 +315,7 @@ sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleColumn( sal_Int32 nChildI
return nChildIndex % static_cast<sal_Int32>(maRange.aEnd.Col() - maRange.aStart.Col() + 1);
}
- //===== XAccessibleContext ==============================================
+// ===== XAccessibleContext ==============================================
sal_Int32 SAL_CALL
ScAccessibleTableBase::getAccessibleChildCount(void)
@@ -323,9 +323,16 @@ sal_Int32 SAL_CALL
{
SolarMutexGuard aGuard;
IsObjectValid();
- return static_cast<sal_Int32>(maRange.aEnd.Row() - maRange.aStart.Row() + 1) *
- (maRange.aEnd.Col() - maRange.aStart.Col() + 1);
-// return 1;
+
+ // FIXME: representing rows & columns this way is a plain and simple madness.
+ // this needs a radical re-think.
+ sal_Int64 nMax = ((sal_Int64)(maRange.aEnd.Row() - maRange.aStart.Row() + 1) *
+ (sal_Int64)(maRange.aEnd.Col() - maRange.aStart.Col() + 1));
+ if (nMax > SAL_MAX_INT32)
+ nMax = SAL_MAX_INT32;
+ if (nMax < 0)
+ return 0;
+ return static_cast<sal_Int32>(nMax);
}
uno::Reference< XAccessible > SAL_CALL
@@ -339,6 +346,9 @@ uno::Reference< XAccessible > SAL_CALL
if (nIndex >= getAccessibleChildCount() || nIndex < 0)
throw lang::IndexOutOfBoundsException();
+ // FIXME: representing rows & columns this way is a plain and simple madness.
+ // this needs a radical re-think.
+
sal_Int32 nRow(0);
sal_Int32 nColumn(0);
sal_Int32 nTemp(maRange.aEnd.Col() - maRange.aStart.Col() + 1);