1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 * AccTable.cpp : Implementation of CAccTable.
27 #include <sal/log.hxx>
28 #include <vcl/svapp.hxx>
29 #include <o3tl/char16_t2wchar_t.hxx>
31 #include <com/sun/star/accessibility/XAccessible.hpp>
32 #include "MAccessible.h"
34 #include <com/sun/star/accessibility/XAccessibleTableSelection.hpp>
36 using namespace com::sun::star::accessibility
;
37 using namespace com::sun::star::uno
;
39 * Gets accessible table cell.
41 * @param row the row of the specified cell.
42 * @param column the column of the specified cell.
43 * @param accessible the accessible object of the cell.
46 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_accessibleAt(long row
, long column
, IUnknown
* * accessible
)
53 if(accessible
== nullptr)
59 Reference
<XAccessible
> pRAcc
= pRXTable
->getAccessibleCellAt(row
, column
);
63 *accessible
= nullptr;
67 IAccessible
* pRet
= nullptr;
69 bool isTRUE
= CMAccessible::get_IAccessibleFromXAccessible(pRAcc
.get(), &pRet
);
78 Reference
<XAccessible
> pxTable(pRXTable
, UNO_QUERY
);
80 CMAccessible::g_pAgent
->InsertAccObj(pRAcc
.get(),pxTable
.get());
81 isTRUE
= CMAccessible::get_IAccessibleFromXAccessible(pRAcc
.get(), &pRet
);
92 } catch(...) { return E_FAIL
; }
95 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_cellAt(long row
, long column
, IUnknown
* * cell
)
97 return get_accessibleAt(row
, column
, cell
);
101 * Gets accessible table caption.
103 * @param accessible the accessible object of table caption.
105 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_caption(IUnknown
* *)
111 * Gets accessible column description (as string).
113 * @param column the column index.
114 * @param description the description of the specified column.
116 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_columnDescription(long column
, BSTR
* description
)
123 if(description
== nullptr)
126 // #CHECK XInterface#
130 const OUString
& ouStr
= pRXTable
->getAccessibleColumnDescription(column
);
133 SysFreeString(*description
);
134 *description
= SysAllocString(o3tl::toW(ouStr
.getStr()));
135 if (*description
==nullptr)
139 } catch(...) { return E_FAIL
; }
143 * Gets number of columns spanned by table cell.
145 * @param row the row of the specified cell.
146 * @param column the column of the specified cell.
147 * @param spanColumns the column span of the specified cell.
149 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_columnExtentAt(long row
, long column
, long * nColumnsSpanned
)
156 if(nColumnsSpanned
== nullptr)
162 *nColumnsSpanned
= pRXTable
->getAccessibleColumnExtentAt(row
, column
);
165 } catch(...) { return E_FAIL
; }
169 * Gets accessible column header.
171 * @param column the column index.
172 * @param accessible the accessible object of the specified column.
174 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_columnHeader(IAccessibleTable __RPC_FAR
*__RPC_FAR
*accessibleTable
, long *startingRowIndex
)
181 if(accessibleTable
== nullptr || startingRowIndex
== nullptr)
184 // #CHECK XInterface#
188 Reference
<XAccessibleTable
> pRColumnHeaderTable
= pRXTable
->getAccessibleColumnHeaders();
189 if(!pRColumnHeaderTable
.is())
191 *accessibleTable
= nullptr;
195 Reference
<XAccessible
> pRXColumnHeader(pRColumnHeaderTable
,UNO_QUERY
);
197 if(!pRXColumnHeader
.is())
199 *accessibleTable
= nullptr;
202 *startingRowIndex
= 0 ;
204 IMAccessible
* pIMacc
= nullptr;
205 HRESULT hr
= createInstance
<CMAccessible
>(IID_IMAccessible
, &pIMacc
);
210 pIMacc
->SetXAccessible(
211 reinterpret_cast<hyper
>(pRXColumnHeader
.get()));
212 pIMacc
->QueryInterface(IID_IAccessibleTable
,reinterpret_cast<void **>(accessibleTable
));
216 } catch(...) { return E_FAIL
; }
220 * Gets total number of columns in table.
222 * @param columnCount the number of columns in table.
224 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_nColumns(long * columnCount
)
231 if(columnCount
== nullptr)
234 // #CHECK XInterface#
238 *columnCount
= pRXTable
->getAccessibleColumnCount();
241 } catch(...) { return E_FAIL
; }
245 * Gets total number of rows in table.
247 * @param rowCount the number of rows in table.
249 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_nRows(long * rowCount
)
256 if(rowCount
== nullptr)
259 // #CHECK XInterface#
263 *rowCount
= pRXTable
->getAccessibleRowCount();
266 } catch(...) { return E_FAIL
; }
270 * Gets total number of selected columns.
272 * @param columnCount the number of selected columns.
274 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_nSelectedColumns(long * columnCount
)
281 if(columnCount
== nullptr)
284 // #CHECK XInterface#
288 Sequence
<long> pSelected
= pRXTable
->getSelectedAccessibleColumns();
289 *columnCount
= pSelected
.getLength();
292 } catch(...) { return E_FAIL
; }
296 * Gets total number of selected rows.
298 * @param rowCount the number of selected rows.
300 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_nSelectedRows(long * rowCount
)
307 if(rowCount
== nullptr)
310 // #CHECK XInterface#
314 Sequence
<long> pSelected
= pRXTable
->getSelectedAccessibleRows();
315 *rowCount
= pSelected
.getLength();
318 } catch(...) { return E_FAIL
; }
322 * Gets accessible row description (as string).
324 * @param row the row index.
325 * @param description the description of the specified row.
327 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_rowDescription(long row
, BSTR
* description
)
334 if(description
== nullptr)
337 // #CHECK XInterface#
341 const OUString
& ouStr
= pRXTable
->getAccessibleRowDescription(row
);
344 SysFreeString(*description
);
345 *description
= SysAllocString(o3tl::toW(ouStr
.getStr()));
346 if (*description
==nullptr)
350 } catch(...) { return E_FAIL
; }
354 * Gets number of rows spanned by a table cell.
356 * @param row the row of the specified cell.
357 * @param column the column of the specified cell.
358 * @param spanRows the row span of the specified cell.
360 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_rowExtentAt(long row
, long column
, long * nRowsSpanned
)
367 if(nRowsSpanned
== nullptr)
373 *nRowsSpanned
= pRXTable
->getAccessibleRowExtentAt(row
, column
);
377 } catch(...) { return E_FAIL
; }
381 * Gets accessible row header.
383 * @param row the row index.
384 * @param accessible the accessible object of the row header.
386 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_rowHeader(IAccessibleTable __RPC_FAR
*__RPC_FAR
*accessibleTable
, long *startingColumnIndex
)
393 if(accessibleTable
== nullptr || startingColumnIndex
== nullptr)
396 // #CHECK XInterface#
400 Reference
<XAccessibleTable
> pRRowHeaderTable
= pRXTable
->getAccessibleRowHeaders();
401 if(!pRRowHeaderTable
.is())
403 *accessibleTable
= nullptr;
407 Reference
<XAccessible
> pRXRowHeader(pRRowHeaderTable
,UNO_QUERY
);
409 if(!pRXRowHeader
.is())
411 *accessibleTable
= nullptr;
414 *startingColumnIndex
= 0 ;
416 IMAccessible
* pIMacc
= nullptr;
417 HRESULT hr
= createInstance
<CMAccessible
>(IID_IMAccessible
, &pIMacc
);
422 pIMacc
->SetXAccessible(
423 reinterpret_cast<hyper
>(pRXRowHeader
.get()));
424 pIMacc
->QueryInterface(IID_IAccessibleTable
,reinterpret_cast<void **>(accessibleTable
));
428 } catch(...) { return E_FAIL
; }
432 * Gets list of row indexes currently selected (0-based).
434 * @param accessible the accessible object array of the selected rows.
435 * @param nRows the actual size of the accessible object array.
437 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_selectedRows(long** rows
, long* nRows
)
444 if(rows
== nullptr || nRows
== nullptr)
447 // #CHECK XInterface#
451 Sequence
<long> pSelected
= pRXTable
->getSelectedAccessibleRows();
452 long count
= pSelected
.getLength() ;
455 *rows
= static_cast<long*>(CoTaskMemAlloc(count
* sizeof(long)));
456 // #CHECK Memory Allocation#
461 for(int i
=0; i
<count
; i
++)
462 (*rows
)[i
] = pSelected
[i
];
466 } catch(...) { return E_FAIL
; }
470 * Gets list of row indexes currently selected (0-based).
472 * @param maxRows This parameter is ignored.
473 * @param accessible the accessible object array of the selected rows.
474 * @param nRows the actual size of the accessible object array.
476 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_selectedRows(long, long ** rows
, long * nRows
)
478 return get_selectedRows(rows
, nRows
);
482 * Gets list of column indexes currently selected (0-based).
484 * @param accessible the accessible object array of the selected columns.
485 * @param numColumns the actual size of accessible object array.
487 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_selectedColumns(long ** columns
, long * numColumns
)
494 if(columns
== nullptr || numColumns
== nullptr)
497 // #CHECK XInterface#
501 Sequence
<long> pSelected
= pRXTable
->getSelectedAccessibleColumns();
502 long count
= pSelected
.getLength() ;
505 *columns
= static_cast<long*>(CoTaskMemAlloc(count
* sizeof(long)));
506 // #CHECK Memory Allocation#
507 if(*columns
== nullptr)
511 for(int i
=0; i
<count
; i
++)
512 (*columns
)[i
] = pSelected
[i
];
516 } catch(...) { return E_FAIL
; }
520 * Gets list of column indexes currently selected (0-based).
522 * @param maxColumns This parameter is ignored
523 * @param accessible the accessible object array of the selected columns.
524 * @param numColumns the actual size of accessible object array.
526 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_selectedColumns(long, long ** columns
, long * numColumns
)
528 return get_selectedColumns(columns
, numColumns
);
532 * Gets accessible table summary.
534 * @param accessible the accessible object of the summary.
536 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_summary(IUnknown
* * accessible
)
543 if(accessible
== nullptr)
546 // #CHECK XInterface#
550 Reference
<XAccessible
> pRAcc
= pRXTable
->getAccessibleSummary();
552 IAccessible
* pRet
= nullptr;
553 CMAccessible::get_IAccessibleFromXAccessible(pRAcc
.get(), &pRet
);
564 } catch(...) { return E_FAIL
; }
568 * Determines if table column is selected.
570 * @param column the column index.
571 * @param isSelected the result.
573 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_isColumnSelected(long column
, boolean
* isSelected
)
580 if(isSelected
== nullptr)
583 // #CHECK XInterface#
587 *isSelected
= pRXTable
->isAccessibleColumnSelected(column
);
590 } catch(...) { return E_FAIL
; }
594 * Determines if table row is selected.
596 * @param row the row index.
597 * @param isSelected the result.
599 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_isRowSelected(long row
, boolean
* isSelected
)
606 if(isSelected
== nullptr)
609 // #CHECK XInterface#
613 *isSelected
= pRXTable
->isAccessibleRowSelected(row
);
616 } catch(...) { return E_FAIL
; }
620 * Determines if table cell is selected.
622 * @param row the row index.
623 * @param column the column index.
624 * @param isSelected the result.
626 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_isSelected(long row
, long column
, boolean
* isSelected
)
633 if(isSelected
== nullptr)
636 // #CHECK XInterface#
640 *isSelected
= pRXTable
->isAccessibleSelected(row
, column
);
643 } catch(...) { return E_FAIL
; }
647 * Selects a row and unselect all previously selected rows.
649 * @param row the row index.
650 * @param success the result.
652 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::selectRow(long row
)
658 // Check XAccessibleTable reference.
662 Reference
<XAccessibleTableSelection
> pRTableExtent(pRXTable
, UNO_QUERY
);
663 if(pRTableExtent
.is())
665 pRTableExtent
->selectRow(row
);
670 // Get XAccessibleSelection.
671 Reference
<XAccessibleSelection
> pRSelection(pRXTable
, UNO_QUERY
);
672 if(!pRSelection
.is())
676 long lCol
, lColumnCount
;
677 lColumnCount
= pRXTable
->getAccessibleColumnCount();
678 for(lCol
= 0; lCol
< lColumnCount
; lCol
++)
680 sal_Int64 nChildIndex
= pRXTable
->getAccessibleIndex(row
, lCol
);
681 pRSelection
->selectAccessibleChild(nChildIndex
);
687 } catch(...) { return E_FAIL
; }
691 * Selects a column and unselect all previously selected columns.
693 * @param column the column index.
694 * @param success the result.
696 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::selectColumn(long column
)
702 // Check XAccessibleTable reference.
706 Reference
<XAccessibleTableSelection
> pRTableExtent(pRXTable
, UNO_QUERY
);
707 if(pRTableExtent
.is())
709 pRTableExtent
->selectColumn(column
);
714 // Get XAccessibleSelection.
715 Reference
<XAccessibleSelection
> pRSelection(pRXTable
, UNO_QUERY
);
716 if(!pRSelection
.is())
720 long lRow
, lRowCount
;
721 lRowCount
= pRXTable
->getAccessibleRowCount();
722 for(lRow
= 0; lRow
< lRowCount
; lRow
++)
724 sal_Int64 nChildIndex
= pRXTable
->getAccessibleIndex(lRow
, column
);
725 pRSelection
->selectAccessibleChild(nChildIndex
);
732 } catch(...) { return E_FAIL
; }
736 * Unselects one row, leaving other selected rows selected (if any).
738 * @param row the row index.
739 * @param success the result.
741 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::unselectRow(long row
)
747 // Check XAccessibleTable reference.
751 Reference
<XAccessibleTableSelection
> pRTableExtent(pRXTable
, UNO_QUERY
);
752 if(pRTableExtent
.is())
754 if(pRTableExtent
->unselectRow(row
))
761 // Get XAccessibleSelection.
762 Reference
<XAccessibleSelection
> pRSelection(pRXTable
, UNO_QUERY
);
763 if(!pRSelection
.is())
767 long lColumn
, lColumnCount
;
768 lColumnCount
= pRXTable
->getAccessibleColumnCount();
769 for(lColumn
= 0; lColumn
< lColumnCount
; lColumn
++)
771 sal_Int64 nChildIndex
= pRXTable
->getAccessibleIndex(row
, lColumn
);
772 pRSelection
->deselectAccessibleChild(nChildIndex
);
779 } catch(...) { return E_FAIL
; }
783 * Unselects one column, leaving other selected columns selected (if any).
785 * @param column the column index.
786 * @param success the result.
788 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::unselectColumn(long column
)
794 // Check XAccessibleTable reference.
798 Reference
<XAccessibleTableSelection
> pRTableExtent(pRXTable
, UNO_QUERY
);
799 if(pRTableExtent
.is())
801 if(pRTableExtent
->unselectColumn(column
))
808 // Get XAccessibleSelection.
809 Reference
<XAccessibleSelection
> pRSelection(pRXTable
, UNO_QUERY
);
810 if(!pRSelection
.is())
814 long lRow
, lRowCount
;
815 lRowCount
= pRXTable
->getAccessibleRowCount();
817 for(lRow
= 0; lRow
< lRowCount
; lRow
++)
819 sal_Int64 nChildIndex
= pRXTable
->getAccessibleIndex(lRow
, column
);
820 pRSelection
->deselectAccessibleChild(nChildIndex
);
825 } catch(...) { return E_FAIL
; }
829 * Override of IUNOXWrapper.
831 * @param pXInterface the pointer of UNO interface.
833 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::put_XInterface(hyper pXInterface
)
835 // internal IUNOXWrapper - no mutex meeded
839 CUNOXWrapper::put_XInterface(pXInterface
);
841 if(pUNOInterface
== nullptr)
844 Reference
<XAccessibleContext
> pRContext
= pUNOInterface
->getAccessibleContext();
845 if( !pRContext
.is() )
848 Reference
<XAccessibleTable
> pRXI(pRContext
,UNO_QUERY
);
852 pRXTable
= pRXI
.get();
855 } catch(...) { return E_FAIL
; }
860 * Gets columnIndex of childIndex.
862 * @param childIndex childIndex
864 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_columnIndex(long childIndex
, long * columnIndex
)
871 if(columnIndex
== nullptr)
874 // #CHECK XInterface#
878 *columnIndex
= pRXTable
->getAccessibleColumn(childIndex
);
881 } catch(...) { return E_FAIL
; }
884 * Gets rowIndex of childIndex.
886 * @param childIndex childIndex
888 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_rowIndex(long childIndex
, long * rowIndex
)
895 if(rowIndex
== nullptr)
898 // #CHECK XInterface#
902 *rowIndex
= pRXTable
->getAccessibleRow(childIndex
);
905 } catch(...) { return E_FAIL
; }
909 * Gets childIndex of childIndex.
911 * @param childIndex childIndex
913 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_childIndex(long RowIndex
, long columnIndex
, long * childIndex
)
920 if(childIndex
== nullptr)
923 // #CHECK XInterface#
927 sal_Int64 nIndex
= pRXTable
->getAccessibleIndex(RowIndex
, columnIndex
);
928 if (nIndex
> std::numeric_limits
<long>::max())
930 // use -2 when the child index is too large to fit into 32 bit to neither use the
931 // valid index of another child nor -1, which is more commonly used to indicate that
932 // a child is no more inside of a parent or invalid otherwise
933 SAL_WARN("vcl.qt", "CAccTable::get_childIndex: Child index exceeds maximum long value, "
937 *childIndex
= nIndex
;
940 } catch(...) { return E_FAIL
; }
943 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_rowColumnExtentsAtIndex(long,
953 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_modelChange(IA2TableModelChange
*)
958 // @brief Returns the total number of selected children
959 // @param [out] childCount
960 // Number of children currently selected
961 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_nSelectedChildren(long *childCount
)
968 if(childCount
== nullptr)
971 // #CHECK XInterface#
975 Reference
<XAccessibleSelection
> pRSelection(pRXTable
, UNO_QUERY
);
976 if(!pRSelection
.is())
979 sal_Int64 nSelected
= pRSelection
->getSelectedAccessibleChildCount();
980 if (nSelected
> std::numeric_limits
<long>::max())
982 SAL_WARN("iacc2", "CAccTable::get_nSelectedChildren: Selected item count exceeds maximum long value, "
984 nSelected
= std::numeric_limits
<long>::max();
986 *childCount
= nSelected
;
989 } catch(...) { return E_FAIL
; }
994 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_nSelectedCells(long *cellCount
)
996 return get_nSelectedChildren(cellCount
);
999 // @brief Returns a list of child indexes currently selected (0-based).
1000 // @param [in] maxChildren
1001 // Max children requested (possibly from IAccessibleTable::nSelectedChildren)
1002 // @param [out] children
1003 // array of indexes of selected children (each index is 0-based)
1004 // @param [out] nChildren
1005 // Length of array (not more than maxChildren)
1006 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_selectedChildren(long, long **children
, long *nChildren
)
1013 if(children
== nullptr || nChildren
== nullptr)
1014 return E_INVALIDARG
;
1016 // #CHECK XInterface#
1020 Reference
<XAccessibleSelection
> pRSelection(pRXTable
, UNO_QUERY
);
1021 if(!pRSelection
.is())
1024 sal_Int64 nChildCount
= pRSelection
->getSelectedAccessibleChildCount();
1025 if (nChildCount
> std::numeric_limits
<long>::max())
1027 SAL_WARN("iacc2", "CAccTable::get_selectedChildren: Selected child count exceeds maximum long value, "
1029 nChildCount
= std::numeric_limits
<long>::max();
1032 *nChildren
= nChildCount
;
1033 *children
= static_cast<long*>(CoTaskMemAlloc(nChildCount
* sizeof(long)));
1035 for( sal_Int64 i
= 0; i
< nChildCount
; i
++)
1037 Reference
<XAccessible
> pRAcc
= pRSelection
->getSelectedAccessibleChild(i
);
1040 Reference
<XAccessibleContext
> pRContext(pRAcc
, UNO_QUERY
);
1041 if( !pRContext
.is() )
1045 sal_Int64 nChildIndex
= pRContext
->getAccessibleIndexInParent();
1046 if (nChildIndex
> std::numeric_limits
<long>::max())
1048 SAL_WARN("iacc2", "CAccTable::get_selectedChildren: Child index exceeds maximum long value, "
1050 nChildIndex
= std::numeric_limits
<long>::max();
1052 (*children
)[i
] = nChildIndex
;
1058 } catch(...) { return E_FAIL
; }
1063 * @brief Returns a list of accessibles currently selected.
1064 * @param cells Pointer to an array of references to selected accessibles.
1065 * The array is allocated by the server with CoTaskMemAlloc and
1066 * freed by the client with CoTaskMemFree.
1067 * @param nSelectedCells The number of accessibles returned; the size of the returned array.
1068 * @return S_FALSE if there are none, [out] values are NULL and 0 respectively, otherwise S_OK
1070 COM_DECLSPEC_NOTHROW STDMETHODIMP
CAccTable::get_selectedCells(IUnknown
* * * cells
, long *nSelectedCells
)
1076 if (cells
== nullptr || nSelectedCells
== nullptr)
1077 return E_INVALIDARG
;
1082 Reference
<XAccessibleSelection
> xSelection(pRXTable
, UNO_QUERY
);
1083 if (!xSelection
.is())
1086 sal_Int64 nSelected
= xSelection
->getSelectedAccessibleChildCount();
1087 if (nSelected
> std::numeric_limits
<long>::max())
1089 SAL_WARN("iacc2", "CAccTable::get_selectedCells: Selected cell count exceeds maximum long value, "
1091 nSelected
= std::numeric_limits
<long>::max();
1093 *nSelectedCells
= nSelected
;
1095 *cells
= static_cast<IUnknown
**>(CoTaskMemAlloc(nSelected
* sizeof(IUnknown
*)));
1097 for (sal_Int64 i
= 0; i
< nSelected
; i
++)
1099 Reference
<XAccessible
> xAcc
= xSelection
->getSelectedAccessibleChild(i
);
1102 IAccessible
* pIAccessible
;
1103 bool bOK
= CMAccessible::get_IAccessibleFromXAccessible(xAcc
.get(), &pIAccessible
);
1107 Reference
<XAccessible
> xTable(pRXTable
, UNO_QUERY
);
1108 CMAccessible::g_pAgent
->InsertAccObj(xAcc
.get(), xTable
.get());
1109 bOK
= CMAccessible::get_IAccessibleFromXAccessible(xAcc
.get(), &pIAccessible
);
1112 assert(bOK
&& "Couldn't retrieve IAccessible object");
1114 pIAccessible
->AddRef();
1115 (*cells
)[i
] = pIAccessible
;
1120 } catch(...) { return E_FAIL
; }
1123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */