@@ -67,6 +67,7 @@ AccessibleHandler::AccessibleHandler(IUnknown* aOuter, HRESULT* aResult)
67
67
, mIA2PassThru (nullptr )
68
68
, mServProvPassThru (nullptr )
69
69
, mIAHyperlinkPassThru (nullptr )
70
+ , mIATableCellPassThru (nullptr )
70
71
, mCachedData ()
71
72
, mCacheGen (0 )
72
73
{
@@ -134,6 +135,29 @@ AccessibleHandler::ResolveIAHyperlink()
134
135
return hr;
135
136
}
136
137
138
+ HRESULT
139
+ AccessibleHandler::ResolveIATableCell ()
140
+ {
141
+ if (mIATableCellPassThru ) {
142
+ return S_OK;
143
+ }
144
+
145
+ RefPtr<IUnknown> proxy (GetProxy ());
146
+ if (!proxy) {
147
+ return E_UNEXPECTED;
148
+ }
149
+
150
+ HRESULT hr = proxy->QueryInterface (IID_IAccessibleTableCell,
151
+ reinterpret_cast <void **>(&mIATableCellPassThru ));
152
+ if (SUCCEEDED (hr)) {
153
+
154
+
155
+ mIATableCellPassThru ->Release ();
156
+ }
157
+
158
+ return hr;
159
+ }
160
+
137
161
HRESULT
138
162
AccessibleHandler::MaybeUpdateCachedData ()
139
163
{
@@ -247,6 +271,13 @@ AccessibleHandler::QueryHandlerInterface(IUnknown* aProxyUnknown, REFIID aIid,
247
271
return S_OK;
248
272
}
249
273
274
+ if (aIid == IID_IAccessibleTableCell) {
275
+ RefPtr<IAccessibleTableCell> iaCell (
276
+ static_cast <IAccessibleTableCell*>(this ));
277
+ iaCell.forget (aOutInterface);
278
+ return S_OK;
279
+ }
280
+
250
281
if (aIid == IID_IAccessibleText || aIid == IID_IAccessibleHypertext ||
251
282
aIid == IID_IAccessibleHypertext2) {
252
283
RefPtr<IAccessibleHypertext2> textTearoff (new AccessibleTextTearoff (this ));
@@ -1318,6 +1349,172 @@ AccessibleHandler::get_valid(boolean* valid)
1318
1349
return mIAHyperlinkPassThru ->get_valid (valid);
1319
1350
}
1320
1351
1352
+
1353
+
1354
+ HRESULT
1355
+ AccessibleHandler::get_columnExtent (long * nColumnsSpanned)
1356
+ {
1357
+ if (!nColumnsSpanned) {
1358
+ return E_INVALIDARG;
1359
+ }
1360
+
1361
+ if (!HasPayload ()) {
1362
+ HRESULT hr = ResolveIATableCell ();
1363
+ if (FAILED (hr)) {
1364
+ return hr;
1365
+ }
1366
+ return mIATableCellPassThru ->get_columnExtent (nColumnsSpanned);
1367
+ }
1368
+
1369
+ BEGIN_CACHE_ACCESS;
1370
+ GET_FIELD (mColumnExtent , *nColumnsSpanned);
1371
+ return S_OK;
1372
+ }
1373
+
1374
+ HRESULT
1375
+ AccessibleHandler::get_columnHeaderCells (IUnknown*** cellAccessibles,
1376
+ long * nColumnHeaderCells)
1377
+ {
1378
+ HRESULT hr = ResolveIATableCell ();
1379
+ if (FAILED (hr)) {
1380
+ return hr;
1381
+ }
1382
+
1383
+ return mIATableCellPassThru ->get_columnHeaderCells (cellAccessibles,
1384
+ nColumnHeaderCells);
1385
+ }
1386
+
1387
+ HRESULT
1388
+ AccessibleHandler::get_columnIndex (long * columnIndex)
1389
+ {
1390
+ if (!columnIndex) {
1391
+ return E_INVALIDARG;
1392
+ }
1393
+
1394
+ if (!HasPayload ()) {
1395
+ HRESULT hr = ResolveIATableCell ();
1396
+ if (FAILED (hr)) {
1397
+ return hr;
1398
+ }
1399
+ return mIATableCellPassThru ->get_columnIndex (columnIndex);
1400
+ }
1401
+
1402
+ BEGIN_CACHE_ACCESS;
1403
+ GET_FIELD (mColumnIndex , *columnIndex);
1404
+ return S_OK;
1405
+ }
1406
+
1407
+ HRESULT
1408
+ AccessibleHandler::get_rowExtent (long * nRowsSpanned)
1409
+ {
1410
+ if (!nRowsSpanned) {
1411
+ return E_INVALIDARG;
1412
+ }
1413
+
1414
+ if (!HasPayload ()) {
1415
+ HRESULT hr = ResolveIATableCell ();
1416
+ if (FAILED (hr)) {
1417
+ return hr;
1418
+ }
1419
+ return mIATableCellPassThru ->get_rowExtent (nRowsSpanned);
1420
+ }
1421
+
1422
+ BEGIN_CACHE_ACCESS;
1423
+ GET_FIELD (mRowExtent , *nRowsSpanned);
1424
+ return S_OK;
1425
+ }
1426
+
1427
+ HRESULT
1428
+ AccessibleHandler::get_rowHeaderCells (IUnknown*** cellAccessibles,
1429
+ long * nRowHeaderCells)
1430
+ {
1431
+ HRESULT hr = ResolveIATableCell ();
1432
+ if (FAILED (hr)) {
1433
+ return hr;
1434
+ }
1435
+
1436
+ return mIATableCellPassThru ->get_rowHeaderCells (cellAccessibles,
1437
+ nRowHeaderCells);
1438
+ }
1439
+
1440
+ HRESULT
1441
+ AccessibleHandler::get_rowIndex (long * rowIndex)
1442
+ {
1443
+ if (!rowIndex) {
1444
+ return E_INVALIDARG;
1445
+ }
1446
+
1447
+ if (!HasPayload ()) {
1448
+ HRESULT hr = ResolveIATableCell ();
1449
+ if (FAILED (hr)) {
1450
+ return hr;
1451
+ }
1452
+ return mIATableCellPassThru ->get_rowIndex (rowIndex);
1453
+ }
1454
+
1455
+ BEGIN_CACHE_ACCESS;
1456
+ GET_FIELD (mRowIndex , *rowIndex);
1457
+ return S_OK;
1458
+ }
1459
+
1460
+ HRESULT
1461
+ AccessibleHandler::get_isSelected (boolean* isSelected)
1462
+ {
1463
+ if (!isSelected) {
1464
+ return E_INVALIDARG;
1465
+ }
1466
+
1467
+ if (!HasPayload ()) {
1468
+ HRESULT hr = ResolveIATableCell ();
1469
+ if (FAILED (hr)) {
1470
+ return hr;
1471
+ }
1472
+ return mIATableCellPassThru ->get_isSelected (isSelected);
1473
+ }
1474
+
1475
+ BEGIN_CACHE_ACCESS;
1476
+ GET_FIELD (mCellIsSelected , *isSelected);
1477
+ return S_OK;
1478
+ }
1479
+
1480
+ HRESULT
1481
+ AccessibleHandler::get_rowColumnExtents (long * row, long * column,
1482
+ long * rowExtents, long * columnExtents,
1483
+ boolean* isSelected)
1484
+ {
1485
+ if (!row || !column || !rowExtents || !columnExtents || !isSelected) {
1486
+ return E_INVALIDARG;
1487
+ }
1488
+
1489
+ if (!HasPayload ()) {
1490
+ HRESULT hr = ResolveIATableCell ();
1491
+ if (FAILED (hr)) {
1492
+ return hr;
1493
+ }
1494
+ return mIATableCellPassThru ->get_rowColumnExtents (row, column, rowExtents,
1495
+ columnExtents, isSelected);
1496
+ }
1497
+
1498
+ BEGIN_CACHE_ACCESS;
1499
+ GET_FIELD (mRowIndex , *row);
1500
+ GET_FIELD (mColumnIndex , *column);
1501
+ GET_FIELD (mRowExtent , *rowExtents);
1502
+ GET_FIELD (mColumnExtent , *columnExtents);
1503
+ GET_FIELD (mCellIsSelected , *isSelected);
1504
+ return S_OK;
1505
+ }
1506
+
1507
+ HRESULT
1508
+ AccessibleHandler::get_table (IUnknown** table)
1509
+ {
1510
+ HRESULT hr = ResolveIATableCell ();
1511
+ if (FAILED (hr)) {
1512
+ return hr;
1513
+ }
1514
+
1515
+ return mIATableCellPassThru ->get_table (table);
1516
+ }
1517
+
1321
1518
}
1322
1519
}
1323
1520
0 commit comments