diff options
12 files changed, 21 insertions, 74 deletions
diff --git a/toolkit/inc/controls/table/AccessibleGridControl.hxx b/toolkit/inc/controls/table/AccessibleGridControl.hxx index de28396fc402..ffeacebe43f4 100644 --- a/toolkit/inc/controls/table/AccessibleGridControl.hxx +++ b/toolkit/inc/controls/table/AccessibleGridControl.hxx @@ -107,9 +107,6 @@ private: // internal virtual methods ----------------------------------------------- /** @attention This method requires locked mutex's and a living object. - @return The bounding box (VCL rect.) relative to the parent window. */ - virtual tools::Rectangle implGetBoundingBox() override; - /** @attention This method requires locked mutex's and a living object. @return The bounding box (VCL rect.) in screen coordinates. */ virtual AbsoluteScreenPixelRectangle implGetBoundingBoxOnScreen() override; diff --git a/toolkit/inc/controls/table/AccessibleGridControlBase.hxx b/toolkit/inc/controls/table/AccessibleGridControlBase.hxx index a5b961f2c88a..92c78652f198 100644 --- a/toolkit/inc/controls/table/AccessibleGridControlBase.hxx +++ b/toolkit/inc/controls/table/AccessibleGridControlBase.hxx @@ -198,10 +198,12 @@ protected: @return TRUE, if the object is really showing. */ bool implIsShowing(); - /** Derived classes return the bounding box relative to the parent window. + /** Return the bounding box relative to the parent. @attention This method requires locked mutex's and a living object. - @return The bounding box (VCL rect.) relative to the parent window. */ - virtual tools::Rectangle implGetBoundingBox() = 0; + @return The bounding box (VCL rect.) relative to the parent. */ + tools::Rectangle implGetBoundingBox(); + + ///** Derived classes return the bounding box in screen coordinates. // @attention This method requires locked mutex's and a living object. // @return The bounding box (VCL rect.) in screen coordinates. */ diff --git a/toolkit/inc/controls/table/AccessibleGridControlHeader.hxx b/toolkit/inc/controls/table/AccessibleGridControlHeader.hxx index f6cd074a71d7..6f0dd179a015 100644 --- a/toolkit/inc/controls/table/AccessibleGridControlHeader.hxx +++ b/toolkit/inc/controls/table/AccessibleGridControlHeader.hxx @@ -121,9 +121,6 @@ private: @return The XAccessible interface of the specified column/row. */ css::uno::Reference< css::accessibility::XAccessible > implGetChild( sal_Int32 nRow, sal_uInt32 nColumnPos ); - /** @attention This method requires locked mutex's and a living object. - @return The bounding box (VCL rect.) relative to the parent window. */ - virtual tools::Rectangle implGetBoundingBox() override; /** @attention This method requires locked mutex's and a living object. @return The bounding box (VCL rect.) in screen coordinates. */ virtual AbsoluteScreenPixelRectangle implGetBoundingBoxOnScreen() override; diff --git a/toolkit/inc/controls/table/AccessibleGridControlHeaderCell.hxx b/toolkit/inc/controls/table/AccessibleGridControlHeaderCell.hxx index 20d71e381b45..57b348333fc1 100644 --- a/toolkit/inc/controls/table/AccessibleGridControlHeaderCell.hxx +++ b/toolkit/inc/controls/table/AccessibleGridControlHeaderCell.hxx @@ -70,8 +70,6 @@ namespace accessibility sal_Int64 implCreateStateSet() override; private: - virtual tools::Rectangle implGetBoundingBox() override; - virtual AbsoluteScreenPixelRectangle implGetBoundingBoxOnScreen() override; }; } diff --git a/toolkit/inc/controls/table/AccessibleGridControlTable.hxx b/toolkit/inc/controls/table/AccessibleGridControlTable.hxx index b4ebfa3b2f85..79031f56d74e 100644 --- a/toolkit/inc/controls/table/AccessibleGridControlTable.hxx +++ b/toolkit/inc/controls/table/AccessibleGridControlTable.hxx @@ -149,9 +149,6 @@ public: private: // internal virtual methods - /** @attention This method requires locked mutex's and a living object. - @return The bounding box (VCL rect.) relative to the parent window. */ - virtual tools::Rectangle implGetBoundingBox() override; ///** @attention This method requires locked mutex's and a living object. // @return The bounding box (VCL rect.) in screen coordinates. */ virtual AbsoluteScreenPixelRectangle implGetBoundingBoxOnScreen() override; diff --git a/toolkit/inc/controls/table/AccessibleGridControlTableCell.hxx b/toolkit/inc/controls/table/AccessibleGridControlTableCell.hxx index dbc62ff09796..58ed164e1dbc 100644 --- a/toolkit/inc/controls/table/AccessibleGridControlTableCell.hxx +++ b/toolkit/inc/controls/table/AccessibleGridControlTableCell.hxx @@ -75,7 +75,6 @@ namespace accessibility virtual OUString implGetText() override; virtual css::lang::Locale implGetLocale() override; virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override final; - virtual tools::Rectangle implGetBoundingBox() override; virtual AbsoluteScreenPixelRectangle implGetBoundingBoxOnScreen() override; public: 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(); |