diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2023-08-01 21:11:57 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2023-08-02 05:09:54 +0200 |
commit | e4ec702df16e04e66af42e2e35a607cb67d7d2c1 (patch) | |
tree | 450cf3f3385de8e869323ebe1b0712ef8a438755 /accessibility/source | |
parent | de9de202a6336f3ba8da0d2deeb8e1e34ac569ab (diff) |
a11y: Convert AccessibleTableControlObjType to enum class
Change-Id: I227ca242ae8fa22940b1bf302541f8d9b7b40eb7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155199
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'accessibility/source')
7 files changed, 45 insertions, 36 deletions
diff --git a/accessibility/source/extended/AccessibleGridControl.cxx b/accessibility/source/extended/AccessibleGridControl.cxx index 37d5013c8fa6..a9d946c9eea7 100644 --- a/accessibility/source/extended/AccessibleGridControl.cxx +++ b/accessibility/source/extended/AccessibleGridControl.cxx @@ -41,7 +41,7 @@ using namespace ::vcl::table; AccessibleGridControl::AccessibleGridControl( const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, const css::uno::Reference< css::accessibility::XAccessible >& _rxCreator, ::vcl::table::IAccessibleTable& _rTable ) - : AccessibleGridControlBase( _rxParent, _rTable, TCTYPE_GRIDCONTROL ), + : AccessibleGridControlBase(_rxParent, _rTable, AccessibleTableControlObjType::GRIDCONTROL), m_aCreator(_rxCreator) { } @@ -102,7 +102,8 @@ AccessibleGridControl::getAccessibleChild( sal_Int64 nChildIndex ) { if(!m_xColumnHeaderBar.is()) { - m_xColumnHeaderBar = new AccessibleGridControlHeader(m_aCreator, m_aTable, vcl::table::TCTYPE_COLUMNHEADERBAR); + m_xColumnHeaderBar = new AccessibleGridControlHeader(m_aCreator, m_aTable, + vcl::table::AccessibleTableControlObjType::COLUMNHEADERBAR); } xChild = m_xColumnHeaderBar.get(); } @@ -110,7 +111,8 @@ AccessibleGridControl::getAccessibleChild( sal_Int64 nChildIndex ) { if(!m_xRowHeaderBar.is()) { - m_xRowHeaderBar = new AccessibleGridControlHeader(m_aCreator, m_aTable, vcl::table::TCTYPE_ROWHEADERBAR); + m_xRowHeaderBar = new AccessibleGridControlHeader(m_aCreator, m_aTable, + vcl::table::AccessibleTableControlObjType::ROWHEADERBAR); } xChild = m_xRowHeaderBar.get(); } @@ -215,9 +217,9 @@ AccessibleGridControl::implGetHeaderBar( AccessibleTableControlObjType eObjType css::uno::Reference< css::accessibility::XAccessible > xRet; rtl::Reference< AccessibleGridControlHeader >* pxMember = nullptr; - if( eObjType == TCTYPE_ROWHEADERBAR ) + if (eObjType == AccessibleTableControlObjType::ROWHEADERBAR) pxMember = &m_xRowHeaderBar; - else if( eObjType == TCTYPE_COLUMNHEADERBAR ) + else if (eObjType == AccessibleTableControlObjType::COLUMNHEADERBAR) pxMember = &m_xColumnHeaderBar; if( pxMember ) @@ -240,11 +242,11 @@ AccessibleGridControl::implGetFixedChild( sal_Int64 nChildIndex ) { /** Child index of the column header bar (first row). */ case 0: - xRet = implGetHeaderBar( TCTYPE_COLUMNHEADERBAR ); + xRet = implGetHeaderBar(AccessibleTableControlObjType::COLUMNHEADERBAR); break; /** Child index of the row header bar ("handle column"). */ case 1: - xRet = implGetHeaderBar( TCTYPE_ROWHEADERBAR ); + xRet = implGetHeaderBar(AccessibleTableControlObjType::ROWHEADERBAR); break; /** Child index of the data table. */ case 2: diff --git a/accessibility/source/extended/AccessibleGridControlBase.cxx b/accessibility/source/extended/AccessibleGridControlBase.cxx index 4777b159f309..fe00a2aaf266 100644 --- a/accessibility/source/extended/AccessibleGridControlBase.cxx +++ b/accessibility/source/extended/AccessibleGridControlBase.cxx @@ -357,21 +357,21 @@ sal_Int16 SAL_CALL AccessibleGridControlBase::getAccessibleRole() sal_Int16 nRole = AccessibleRole::UNKNOWN; switch ( m_eObjType ) { - case TCTYPE_ROWHEADERCELL: + case AccessibleTableControlObjType::ROWHEADERCELL: nRole = AccessibleRole::ROW_HEADER; break; - case TCTYPE_COLUMNHEADERCELL: + case AccessibleTableControlObjType::COLUMNHEADERCELL: nRole = AccessibleRole::COLUMN_HEADER; break; - case TCTYPE_COLUMNHEADERBAR: - case TCTYPE_ROWHEADERBAR: - case TCTYPE_TABLE: + case AccessibleTableControlObjType::COLUMNHEADERBAR: + case AccessibleTableControlObjType::ROWHEADERBAR: + case AccessibleTableControlObjType::TABLE: nRole = AccessibleRole::TABLE; break; - case TCTYPE_TABLECELL: + case AccessibleTableControlObjType::TABLECELL: nRole = AccessibleRole::TABLE_CELL; break; - case TCTYPE_GRIDCONTROL: + case AccessibleTableControlObjType::GRIDCONTROL: nRole = AccessibleRole::PANEL; break; } diff --git a/accessibility/source/extended/AccessibleGridControlHeader.cxx b/accessibility/source/extended/AccessibleGridControlHeader.cxx index b3651f792790..20a91ceb7b7b 100644 --- a/accessibility/source/extended/AccessibleGridControlHeader.cxx +++ b/accessibility/source/extended/AccessibleGridControlHeader.cxx @@ -59,14 +59,16 @@ AccessibleGridControlHeader::getAccessibleChild( sal_Int64 nChildIndex ) throw IndexOutOfBoundsException(); ensureIsAlive(); Reference< XAccessible > xChild; - if(m_eObjType == vcl::table::TCTYPE_COLUMNHEADERBAR) + if (m_eObjType == vcl::table::AccessibleTableControlObjType::COLUMNHEADERBAR) { - rtl::Reference<AccessibleGridControlHeaderCell> pColHeaderCell = new AccessibleGridControlHeaderCell(nChildIndex, this, m_aTable, vcl::table::TCTYPE_COLUMNHEADERCELL); + rtl::Reference<AccessibleGridControlHeaderCell> pColHeaderCell = new AccessibleGridControlHeaderCell(nChildIndex, this, m_aTable, + vcl::table::AccessibleTableControlObjType::COLUMNHEADERCELL); xChild = pColHeaderCell; } - else if(m_eObjType == vcl::table::TCTYPE_ROWHEADERBAR) + else if (m_eObjType == vcl::table::AccessibleTableControlObjType::ROWHEADERBAR) { - rtl::Reference<AccessibleGridControlHeaderCell> pRowHeaderCell = new AccessibleGridControlHeaderCell(nChildIndex, this, m_aTable, vcl::table::TCTYPE_ROWHEADERCELL); + rtl::Reference<AccessibleGridControlHeaderCell> pRowHeaderCell = new AccessibleGridControlHeaderCell(nChildIndex, this, m_aTable, + vcl::table::AccessibleTableControlObjType::ROWHEADERCELL); xChild = pRowHeaderCell; } return xChild; @@ -77,7 +79,7 @@ sal_Int64 SAL_CALL AccessibleGridControlHeader::getAccessibleIndexInParent() SolarMutexGuard aSolarGuard; ensureIsAlive(); - if(m_eObjType == vcl::table::TCTYPE_ROWHEADERBAR && m_aTable.HasColHeader()) + if (m_eObjType == vcl::table::AccessibleTableControlObjType::ROWHEADERBAR && m_aTable.HasColHeader()) return 1; else return 0; @@ -213,14 +215,16 @@ Reference< XAccessible > AccessibleGridControlHeader::implGetChild( sal_Int32 nRow, sal_uInt32 nColumnPos ) { Reference< XAccessible > xChild; - if(m_eObjType == vcl::table::TCTYPE_COLUMNHEADERBAR) + if (m_eObjType == vcl::table::AccessibleTableControlObjType::COLUMNHEADERBAR) { - rtl::Reference<AccessibleGridControlHeaderCell> pColHeaderCell = new AccessibleGridControlHeaderCell(nColumnPos, this, m_aTable, vcl::table::TCTYPE_COLUMNHEADERCELL); + rtl::Reference<AccessibleGridControlHeaderCell> pColHeaderCell = new AccessibleGridControlHeaderCell(nColumnPos, this, m_aTable, + vcl::table::AccessibleTableControlObjType::COLUMNHEADERCELL); xChild = pColHeaderCell; } - else if(m_eObjType == vcl::table::TCTYPE_ROWHEADERBAR) + else if (m_eObjType == vcl::table::AccessibleTableControlObjType::ROWHEADERBAR) { - rtl::Reference<AccessibleGridControlHeaderCell> pRowHeaderCell = new AccessibleGridControlHeaderCell(nRow, this, m_aTable, vcl::table::TCTYPE_ROWHEADERCELL); + rtl::Reference<AccessibleGridControlHeaderCell> pRowHeaderCell = new AccessibleGridControlHeaderCell(nRow, this, m_aTable, + vcl::table::AccessibleTableControlObjType::ROWHEADERCELL); xChild = pRowHeaderCell; } return xChild; diff --git a/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx b/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx index 6e9e6014ee8e..7275934b4c65 100644 --- a/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx +++ b/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx @@ -128,7 +128,7 @@ tools::Rectangle AccessibleGridControlHeaderCell::implGetBoundingBox() tools::Rectangle aGridRect( m_aTable.GetWindowExtentsRelative( *pParent ) ); sal_Int32 nIndex = getAccessibleIndexInParent(); tools::Rectangle aCellRect; - if(m_eObjType == TCTYPE_COLUMNHEADERCELL) + if (m_eObjType == AccessibleTableControlObjType::COLUMNHEADERCELL) aCellRect = m_aTable.calcHeaderCellRect(true, nIndex); else aCellRect = m_aTable.calcHeaderCellRect(false, nIndex); @@ -141,7 +141,7 @@ tools::Rectangle AccessibleGridControlHeaderCell::implGetBoundingBoxOnScreen() tools::Rectangle aGridRect( m_aTable.GetWindowExtentsAbsolute() ); sal_Int32 nIndex = getAccessibleIndexInParent(); tools::Rectangle aCellRect; - if(m_eObjType == TCTYPE_COLUMNHEADERCELL) + if (m_eObjType == AccessibleTableControlObjType::COLUMNHEADERCELL) aCellRect = m_aTable.calcHeaderCellRect(true, nIndex); else aCellRect = m_aTable.calcHeaderCellRect(false, nIndex); diff --git a/accessibility/source/extended/AccessibleGridControlTable.cxx b/accessibility/source/extended/AccessibleGridControlTable.cxx index e0c1a9a1d27f..f2dd9bbba8ec 100644 --- a/accessibility/source/extended/AccessibleGridControlTable.cxx +++ b/accessibility/source/extended/AccessibleGridControlTable.cxx @@ -44,7 +44,7 @@ namespace accessibility { AccessibleGridControlTable::AccessibleGridControlTable( const Reference< XAccessible >& rxParent, IAccessibleTable& rTable) : - AccessibleGridControlTableBase( rxParent, rTable, TCTYPE_TABLE ) + AccessibleGridControlTableBase(rxParent, rTable, AccessibleTableControlObjType::TABLE) { } diff --git a/accessibility/source/extended/AccessibleGridControlTableBase.cxx b/accessibility/source/extended/AccessibleGridControlTableBase.cxx index cc600760cfe9..691568a6341a 100644 --- a/accessibility/source/extended/AccessibleGridControlTableBase.cxx +++ b/accessibility/source/extended/AccessibleGridControlTableBase.cxx @@ -53,11 +53,11 @@ sal_Int64 SAL_CALL AccessibleGridControlTableBase::getAccessibleChildCount() ensureIsAlive(); sal_Int64 nChildren = 0; - if(m_eObjType == TCTYPE_ROWHEADERBAR) + if (m_eObjType == AccessibleTableControlObjType::ROWHEADERBAR) nChildren = m_aTable.GetRowCount(); - else if(m_eObjType == TCTYPE_TABLE) + else if (m_eObjType == AccessibleTableControlObjType::TABLE) nChildren = static_cast<sal_Int64>(m_aTable.GetRowCount()) * static_cast<sal_Int64>(m_aTable.GetColumnCount()); - else if(m_eObjType == TCTYPE_COLUMNHEADERBAR) + else if (m_eObjType == AccessibleTableControlObjType::COLUMNHEADERBAR) nChildren = m_aTable.GetColumnCount(); return nChildren; } diff --git a/accessibility/source/extended/AccessibleGridControlTableCell.cxx b/accessibility/source/extended/AccessibleGridControlTableCell.cxx index fe59b7eab296..a81886977cba 100644 --- a/accessibility/source/extended/AccessibleGridControlTableCell.cxx +++ b/accessibility/source/extended/AccessibleGridControlTableCell.cxx @@ -74,12 +74,15 @@ namespace accessibility ensureIsAlive(); OUString sAccName; - if (m_eObjType == TCTYPE_TABLECELL) - sAccName = m_aTable.GetAccessibleObjectName(TCTYPE_TABLECELL, m_nRowPos, m_nColPos); - else if (m_eObjType == TCTYPE_ROWHEADERCELL) - sAccName = m_aTable.GetAccessibleObjectName(TCTYPE_ROWHEADERCELL, m_nRowPos, 0); - else if (m_eObjType == TCTYPE_COLUMNHEADERCELL) - sAccName = m_aTable.GetAccessibleObjectName(TCTYPE_COLUMNHEADERCELL, 0, m_nRowPos); + if (m_eObjType == AccessibleTableControlObjType::TABLECELL) + sAccName = m_aTable.GetAccessibleObjectName(AccessibleTableControlObjType::TABLECELL, + m_nRowPos, m_nColPos); + else if (m_eObjType == AccessibleTableControlObjType::ROWHEADERCELL) + sAccName = m_aTable.GetAccessibleObjectName(AccessibleTableControlObjType::ROWHEADERCELL, + m_nRowPos, 0); + else if (m_eObjType == AccessibleTableControlObjType::COLUMNHEADERCELL) + sAccName = m_aTable.GetAccessibleObjectName(AccessibleTableControlObjType::COLUMNHEADERCELL, + 0, m_nRowPos); else assert(false && "Unhandled table cell type"); return sAccName; @@ -108,7 +111,7 @@ namespace accessibility ::vcl::table::IAccessibleTable& _rTable, sal_Int32 _nRowPos, sal_uInt16 _nColPos) - :AccessibleGridControlCell( _rxParent, _rTable, _nRowPos, _nColPos, TCTYPE_TABLECELL ) + :AccessibleGridControlCell(_rxParent, _rTable, _nRowPos, _nColPos, AccessibleTableControlObjType::TABLECELL) { } |