diff options
Diffstat (limited to 'toolkit/source')
6 files changed, 16 insertions, 59 deletions
diff --git a/toolkit/source/controls/table/AccessibleGridControl.cxx b/toolkit/source/controls/table/AccessibleGridControl.cxx index ebfbd809b5a7..277929ca56ac 100644 --- a/toolkit/source/controls/table/AccessibleGridControl.cxx +++ b/toolkit/source/controls/table/AccessibleGridControl.cxx @@ -185,13 +185,6 @@ OUString SAL_CALL AccessibleGridControl::getImplementationName() // internal virtual methods --------------------------------------------------- -tools::Rectangle AccessibleGridControl::implGetBoundingBox() -{ - vcl::Window* pParent = m_aTable.GetAccessibleParentWindow(); - assert(pParent && "implGetBoundingBox - missing parent window"); - return m_aTable.GetWindowExtentsRelative( *pParent ); -} - AbsoluteScreenPixelRectangle AccessibleGridControl::implGetBoundingBoxOnScreen() { return m_aTable.GetWindowExtentsAbsolute(); diff --git a/toolkit/source/controls/table/AccessibleGridControlBase.cxx b/toolkit/source/controls/table/AccessibleGridControlBase.cxx index 9fc195a0b68c..e62a7b9ea907 100644 --- a/toolkit/source/controls/table/AccessibleGridControlBase.cxx +++ b/toolkit/source/controls/table/AccessibleGridControlBase.cxx @@ -280,6 +280,22 @@ bool AccessibleGridControlBase::implIsShowing() return bShowing; } +tools::Rectangle AccessibleGridControlBase::implGetBoundingBox() +{ + // calculate parent-relative position from own and parent's absolute position + tools::Rectangle aBound(implGetBoundingBoxOnScreen()); + if (!m_xParent.is()) + return aBound; + + uno::Reference<css::accessibility::XAccessibleComponent> xParentComponent(m_xParent->getAccessibleContext(), uno::UNO_QUERY); + if (!xParentComponent.is()) + return aBound; + + awt::Point aParentPos = xParentComponent->getLocationOnScreen(); + aBound.Move(-aParentPos.X, -aParentPos.Y); + return aBound; +} + sal_Int64 AccessibleGridControlBase::implCreateStateSet() { sal_Int64 nStateSet = 0; diff --git a/toolkit/source/controls/table/AccessibleGridControlHeader.cxx b/toolkit/source/controls/table/AccessibleGridControlHeader.cxx index 6bee8e8b99ac..ea1c71b138eb 100644 --- a/toolkit/source/controls/table/AccessibleGridControlHeader.cxx +++ b/toolkit/source/controls/table/AccessibleGridControlHeader.cxx @@ -194,18 +194,6 @@ Sequence< sal_Int8 > SAL_CALL AccessibleGridControlHeader::getImplementationId() // internal virtual methods --------------------------------------------------- -tools::Rectangle AccessibleGridControlHeader::implGetBoundingBox() -{ - vcl::Window* pParent = m_aTable.GetAccessibleParentWindow(); - tools::Rectangle aGridRect( m_aTable.GetWindowExtentsRelative( *pParent ) ); - tools::Rectangle aHeaderRect (m_aTable.calcHeaderRect(isColumnBar())); - if(isColumnBar()) - return tools::Rectangle(aGridRect.TopLeft(), Size(aGridRect.getOpenWidth(),aHeaderRect.getOpenHeight())); - else - return tools::Rectangle(aGridRect.TopLeft(), Size(aHeaderRect.getOpenWidth(),aGridRect.getOpenHeight())); - -} - AbsoluteScreenPixelRectangle AccessibleGridControlHeader::implGetBoundingBoxOnScreen() { AbsoluteScreenPixelRectangle aGridRect( m_aTable.GetWindowExtentsAbsolute() ); diff --git a/toolkit/source/controls/table/AccessibleGridControlHeaderCell.cxx b/toolkit/source/controls/table/AccessibleGridControlHeaderCell.cxx index f0b50675a00a..4bf68ec3a047 100644 --- a/toolkit/source/controls/table/AccessibleGridControlHeaderCell.cxx +++ b/toolkit/source/controls/table/AccessibleGridControlHeaderCell.cxx @@ -126,20 +126,6 @@ OUString SAL_CALL AccessibleGridControlHeaderCell::getImplementationName() return u"com.sun.star.accessibility.AccessibleGridControlHeaderCell"_ustr; } -tools::Rectangle AccessibleGridControlHeaderCell::implGetBoundingBox() -{ - vcl::Window* pParent = m_aTable.GetAccessibleParentWindow(); - tools::Rectangle aGridRect( m_aTable.GetWindowExtentsRelative( *pParent ) ); - sal_Int32 nIndex = getAccessibleIndexInParent(); - tools::Rectangle aCellRect; - if (m_eObjType == AccessibleTableControlObjType::COLUMNHEADERCELL) - aCellRect = m_aTable.calcHeaderCellRect(true, nIndex); - else - aCellRect = m_aTable.calcHeaderCellRect(false, nIndex); - return tools::Rectangle(Point(aGridRect.Left()+aCellRect.Left(),aGridRect.Top()+aCellRect.Top()), aCellRect.GetSize()); -} - - AbsoluteScreenPixelRectangle AccessibleGridControlHeaderCell::implGetBoundingBoxOnScreen() { AbsoluteScreenPixelRectangle aGridRect( m_aTable.GetWindowExtentsAbsolute() ); diff --git a/toolkit/source/controls/table/AccessibleGridControlTable.cxx b/toolkit/source/controls/table/AccessibleGridControlTable.cxx index 2e5bd46797f7..d9c9e5fd2853 100644 --- a/toolkit/source/controls/table/AccessibleGridControlTable.cxx +++ b/toolkit/source/controls/table/AccessibleGridControlTable.cxx @@ -342,20 +342,6 @@ void AccessibleGridControlTable::commitEvent(sal_Int16 nEventId, const css::uno: // internal virtual methods --------------------------------------------------- -tools::Rectangle AccessibleGridControlTable::implGetBoundingBox() -{ - vcl::Window* pParent = m_aTable.GetAccessibleParentWindow(); - assert(pParent && "implGetBoundingBox - missing parent window"); - tools::Rectangle aGridRect( m_aTable.GetWindowExtentsRelative( *pParent )); - tools::Rectangle aTableRect( m_aTable.calcTableRect() ); - tools::Long nX = aGridRect.Left() + aTableRect.Left(); - tools::Long nY = aGridRect.Top() + aTableRect.Top(); - tools::Long nWidth = aGridRect.GetSize().Width()-aTableRect.Left(); - tools::Long nHeight = aGridRect.GetSize().Height()-aTableRect.Top(); - tools::Rectangle aTable( Point( nX, nY ), Size( nWidth, nHeight )); - return aTable; -} - AbsoluteScreenPixelRectangle AccessibleGridControlTable::implGetBoundingBoxOnScreen() { tools::Rectangle aGridRect( m_aTable.GetWindowExtentsAbsolute()); diff --git a/toolkit/source/controls/table/AccessibleGridControlTableCell.cxx b/toolkit/source/controls/table/AccessibleGridControlTableCell.cxx index 7b134fe46a36..151972ab7535 100644 --- a/toolkit/source/controls/table/AccessibleGridControlTableCell.cxx +++ b/toolkit/source/controls/table/AccessibleGridControlTableCell.cxx @@ -318,18 +318,6 @@ namespace accessibility return false; } - tools::Rectangle AccessibleGridControlTableCell::implGetBoundingBox() - { - vcl::Window* pParent = m_aTable.GetAccessibleParentWindow(); - assert(pParent && "implGetBoundingBox - missing parent window"); - tools::Rectangle aGridRect = m_aTable.GetWindowExtentsRelative( *pParent ); - tools::Rectangle aCellRect = m_aTable.calcCellRect(getRowPos(), getColumnPos()); - tools::Long nX = aGridRect.Left() + aCellRect.Left(); - tools::Long nY = aGridRect.Top() + aCellRect.Top(); - tools::Rectangle aCell( Point( nX, nY ), aCellRect.GetSize()); - return aCell; - } - AbsoluteScreenPixelRectangle AccessibleGridControlTableCell::implGetBoundingBoxOnScreen() { AbsoluteScreenPixelRectangle aGridRect = m_aTable.GetWindowExtentsAbsolute(); |