summaryrefslogtreecommitdiff
path: root/accessibility
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2011-03-16 11:08:00 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2011-03-16 11:08:00 +0100
commit792fe06ae1d9ca29210f1aec26bd2bb28ed287cc (patch)
tree16cbcd60c490c52ec9da65c199ed1aec70a1f866 /accessibility
parent458ee2acf8d08b91be5bef7fe54fc4b04049c32e (diff)
gridfixes: copied #i112562#'s fix from CWS gridcontrol06 herein
Diffstat (limited to 'accessibility')
-rwxr-xr-xaccessibility/inc/accessibility/extended/AccessibleGridControl.hxx37
-rw-r--r--accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx1
-rw-r--r--accessibility/inc/accessibility/extended/AccessibleGridControlTable.hxx10
-rw-r--r--[-rwxr-xr-x]accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx8
-rwxr-xr-xaccessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx3
-rwxr-xr-xaccessibility/source/extended/AccessibleGridControl.cxx81
-rwxr-xr-xaccessibility/source/extended/AccessibleGridControlBase.cxx9
-rwxr-xr-xaccessibility/source/extended/AccessibleGridControlHeader.cxx16
-rwxr-xr-xaccessibility/source/extended/AccessibleGridControlHeaderCell.cxx19
-rwxr-xr-xaccessibility/source/extended/AccessibleGridControlTable.cxx61
-rwxr-xr-xaccessibility/source/extended/AccessibleGridControlTableCell.cxx18
11 files changed, 246 insertions, 17 deletions
diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx
index cb2c4f6628c8..5f8976b905a3 100755
--- a/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx
+++ b/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx
@@ -34,7 +34,6 @@
#include <cppuhelper/weakref.hxx>
#include <svtools/accessibletable.hxx>
-
#include <memory>
using namespace ::svt::table;
@@ -111,6 +110,28 @@ protected:
public:
// helper functions
+
+ /** commitCellEvent commit the event at all listeners of the table
+ @param nEventId
+ the event id
+ @param rNewValue
+ the new value
+ @param rOldValue
+ the old value
+ */
+ void commitCellEvent(sal_Int16 nEventId, const ::com::sun::star::uno::Any& rNewValue,
+ const ::com::sun::star::uno::Any& rOldValue);
+
+ /** commitTableEvent commit the event at all listeners of the table
+ @param nEventId
+ the event id
+ @param rNewValue
+ the new value
+ @param rOldValue
+ the old value
+ */
+ void commitTableEvent(sal_Int16 nEventId, const ::com::sun::star::uno::Any& rNewValue,
+ const ::com::sun::star::uno::Any& rOldValue);
/** returns the accessible object for the row or the column header bar
*/
inline ::com::sun::star::uno::Reference<
@@ -242,6 +263,20 @@ protected:
xAccessible = pContext->getTable();
return xAccessible;
}
+ virtual void commitCellEvent( sal_Int16 nEventId,
+ const ::com::sun::star::uno::Any& rNewValue, const ::com::sun::star::uno::Any& rOldValue )
+ {
+ AccessibleGridControl* pContext( getContext() );
+ if ( pContext )
+ pContext->commitCellEvent( nEventId, rNewValue, rOldValue );
+ }
+ virtual void commitTableEvent( sal_Int16 nEventId,
+ const ::com::sun::star::uno::Any& rNewValue, const ::com::sun::star::uno::Any& rOldValue )
+ {
+ AccessibleGridControl* pContext( getContext() );
+ if ( pContext )
+ pContext->commitTableEvent( nEventId, rNewValue, rOldValue );
+ }
virtual void commitEvent( sal_Int16 nEventId,
const ::com::sun::star::uno::Any& rNewValue, const ::com::sun::star::uno::Any& rOldValue )
{
diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx
index c6a26d8c4548..651a58e182ce 100644
--- a/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx
+++ b/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx
@@ -47,7 +47,6 @@
#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
-#include <com/sun/star/awt/XFocusListener.hpp>
#include <comphelper/accessibleeventnotifier.hxx>
#include <comphelper/uno3.hxx>
diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlTable.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlTable.hxx
index 8058594d2938..4c13df132968 100644
--- a/accessibility/inc/accessibility/extended/AccessibleGridControlTable.hxx
+++ b/accessibility/inc/accessibility/extended/AccessibleGridControlTable.hxx
@@ -32,6 +32,7 @@
#include "accessibility/extended/AccessibleGridControlTableBase.hxx"
#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
+#include <accessibility/extended/AccessibleGridControlTableCell.hxx>
// ============================================================================
@@ -55,7 +56,9 @@ public:
protected:
virtual ~AccessibleGridControlTable();
-
+private:
+ std::vector< AccessibleGridControlTableCell* > m_pCellVector;
+ std::vector< com::sun::star::uno::Reference< com::sun::star::accessibility::XAccessible> > m_pAccessCellVector;
public:
// XAccessibleContext -----------------------------------------------------
@@ -196,6 +199,11 @@ public:
virtual ::rtl::OUString SAL_CALL getImplementationName()
throw ( ::com::sun::star::uno::RuntimeException );
+ /**@return m_pCellVector*/
+ std::vector< AccessibleGridControlTableCell* >& getCellVector();
+ /**@return m_xAccessCellVector*/
+ std::vector< com::sun::star::uno::Reference< com::sun::star::accessibility::XAccessible > >& getAccessibleCellVector();
+
protected:
// internal virtual methods -----------------------------------------------
diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx
index bee42d85e2a2..4ea1b7826c2f 100755..100644
--- a/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx
+++ b/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx
@@ -173,6 +173,14 @@ public:
protected:
// internal helper methods ------------------------------------------------
+// /** @attention This method requires locked mutex's and a living object.
+// @param nColumn
+// the position of the column in the Accessible world
+// @return
+// the position of the column in VCL the Accessible world
+// */
+// sal_uInt16 implToVCLColumnPos( sal_Int32 nColumn ) const;
+
/** @attention This method requires locked mutex's and a living object.
@return The number of cells of the table. */
sal_Int32 implGetChildCount() const;
diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx
index dd44927d7fc1..f210e7dd01e6 100755
--- a/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx
+++ b/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx
@@ -73,9 +73,6 @@ namespace accessibility
,public AccessibleTextHelper_BASE
,public ::comphelper::OCommonAccessibleText
{
- private:
- sal_Int32 m_nOffset;
-
protected:
// OCommonAccessibleText
virtual ::rtl::OUString implGetText();
diff --git a/accessibility/source/extended/AccessibleGridControl.cxx b/accessibility/source/extended/AccessibleGridControl.cxx
index f0aa406b62bf..208be0b5c08b 100755
--- a/accessibility/source/extended/AccessibleGridControl.cxx
+++ b/accessibility/source/extended/AccessibleGridControl.cxx
@@ -30,6 +30,9 @@
#include "accessibility/extended/AccessibleGridControl.hxx"
#include "accessibility/extended/AccessibleGridControlTable.hxx"
#include "accessibility/extended/AccessibleGridControlHeader.hxx"
+#include <com/sun/star/accessibility/AccessibleEventId.hpp>
+#include <com/sun/star/accessibility/AccessibleTableModelChange.hpp>
+#include <com/sun/star/accessibility/AccessibleTableModelChangeType.hpp>
#include <svtools/accessibletable.hxx>
#include <comphelper/types.hxx>
#include <toolkit/helper/vclunohelper.hxx>
@@ -71,6 +74,11 @@ public:
Reference<
::com::sun::star::accessibility::XAccessible > m_xColumnHeaderBar;
AccessibleGridControlHeader* m_pColumnHeaderBar;
+
+ /** The table cell child. */
+ Reference<
+ ::com::sun::star::accessibility::XAccessible > m_xCell;
+ AccessibleGridControlTableCell* m_pCell;
};
DBG_NAME( AccessibleGridControl )
@@ -97,6 +105,7 @@ void SAL_CALL AccessibleGridControl::disposing()
m_pImpl->m_pTable = NULL;
m_pImpl->m_pColumnHeaderBar = NULL;
m_pImpl->m_pRowHeaderBar = NULL;
+ m_pImpl->m_pCell = NULL;
m_pImpl->m_aCreator = Reference< XAccessible >();
Reference< XAccessible > xTable = m_pImpl->m_xTable;
@@ -106,7 +115,16 @@ void SAL_CALL AccessibleGridControl::disposing()
{
xComp->dispose();
}
+ Reference< XAccessible > xCell = m_pImpl->m_xCell;
+
+ Reference< XComponent > xCellComp( m_pImpl->m_xCell, UNO_QUERY );
+ if ( xCellComp.is() )
+ {
+ xCellComp->dispose();
+ }
+ ::comphelper::disposeComponent(m_pImpl->m_xRowHeaderBar);
+ ::comphelper::disposeComponent(m_pImpl->m_xColumnHeaderBar);
AccessibleGridControlBase::disposing();
}
// -----------------------------------------------------------------------------
@@ -156,8 +174,12 @@ AccessibleGridControl::getAccessibleChild( sal_Int32 nChildIndex )
}
else
{
+ if(!m_pImpl->m_xTable.is())
+ {
AccessibleGridControlTable* pTable = new AccessibleGridControlTable(m_pImpl->m_aCreator, m_aTable, svt::table::TCTYPE_TABLE);
m_pImpl->m_xTable = pTable;
+ m_pImpl->m_pTable = pTable;
+ }
xChild = m_pImpl->m_xTable;
}
}
@@ -316,6 +338,65 @@ AccessibleGridControlTable* AccessibleGridControl::createAccessibleTable()
DBG_ASSERT( xCreator.is(), "accessibility/extended/AccessibleGirdControl::createAccessibleTable: my creator died - how this?" );
return new AccessibleGridControlTable( xCreator, m_aTable, TCTYPE_TABLE );
}
+// -----------------------------------------------------------------------------
+void AccessibleGridControl::commitCellEvent(sal_Int16 _nEventId,const Any& _rNewValue,const Any& _rOldValue)
+{
+ sal_Int32 nChildCount = getAccessibleChildCount();
+ if(nChildCount != 0)
+ {
+ for(sal_Int32 i=0;i<nChildCount;i++)
+ {
+ Reference< XAccessible > xAccessible = getAccessibleChild(i);
+ com::sun::star::uno::Reference< com::sun::star::accessibility::XAccessibleContext > xAccessibleChild = xAccessible->getAccessibleContext();
+ if(m_pImpl->m_xTable == xAccessible)
+ {
+ std::vector< AccessibleGridControlTableCell* > xCellCont = m_pImpl->m_pTable->getCellVector();
+ int nIndex = m_aTable.GetCurrentRow()*m_aTable.GetColumnCount()+m_aTable.GetCurrentColumn();
+ if(!xCellCont.empty() && xCellCont[nIndex])
+ {
+ m_pImpl->m_pCell = xCellCont[nIndex];
+ m_pImpl->m_pCell->commitEvent( _nEventId, _rNewValue, _rOldValue );
+ }
+ }
+ }
+ }
+ else
+ {
+ if ( m_pImpl->m_xTable.is() )
+ m_pImpl->m_pTable->commitEvent(_nEventId,_rNewValue,_rOldValue);
+ }
+}
+void AccessibleGridControl::commitTableEvent(sal_Int16 _nEventId,const Any& _rNewValue,const Any& _rOldValue)
+{
+ if ( m_pImpl->m_xTable.is() )
+ {
+ if(_nEventId == AccessibleEventId::ACTIVE_DESCENDANT_CHANGED)
+ {
+ Reference< XAccessible > xChild = m_pImpl->m_pTable->getAccessibleChild(m_aTable.GetCurrentRow()*m_aTable.GetColumnCount()+m_aTable.GetCurrentColumn());
+ m_pImpl->m_pTable->commitEvent(_nEventId, makeAny(xChild),_rOldValue);
+ }
+ else if(_nEventId == AccessibleEventId::TABLE_MODEL_CHANGED)
+ {
+ AccessibleTableModelChange aChange;
+ if(_rNewValue >>= aChange)
+ {
+ if(aChange.Type == AccessibleTableModelChangeType::DELETE)
+ {
+ std::vector< AccessibleGridControlTableCell* >::iterator m_pCell = m_pImpl->m_pTable->getCellVector().begin();
+ std::vector< Reference< XAccessible > >::iterator m_xAccessibleVector = m_pImpl->m_pTable->getAccessibleCellVector().begin();
+ int nColCount = m_aTable.GetColumnCount();
+ m_pImpl->m_pTable->getCellVector().erase(m_pCell+nColCount*aChange.FirstRow, m_pCell+nColCount*aChange.LastRow );
+ m_pImpl->m_pTable->getAccessibleCellVector().erase(m_xAccessibleVector+nColCount*aChange.FirstRow, m_xAccessibleVector+nColCount*aChange.LastRow);
+ m_pImpl->m_pTable->commitEvent(_nEventId,_rNewValue,_rOldValue);
+ }
+ else
+ m_pImpl->m_pTable->commitEvent(_nEventId,_rNewValue,_rOldValue);
+ }
+ }
+ else
+ m_pImpl->m_pTable->commitEvent(_nEventId,_rNewValue,_rOldValue);
+ }
+}
// ============================================================================
// = AccessibleGridControlAccess
// ============================================================================
diff --git a/accessibility/source/extended/AccessibleGridControlBase.cxx b/accessibility/source/extended/AccessibleGridControlBase.cxx
index ea81bd350426..2e000c68533d 100755
--- a/accessibility/source/extended/AccessibleGridControlBase.cxx
+++ b/accessibility/source/extended/AccessibleGridControlBase.cxx
@@ -86,7 +86,16 @@ AccessibleGridControlBase::~AccessibleGridControlBase()
void SAL_CALL AccessibleGridControlBase::disposing()
{
::osl::MutexGuard aGuard( getOslMutex() );
+
+ if ( getClientId( ) )
+ {
+ AccessibleEventNotifier::TClientId nId( getClientId( ) );
+ setClientId( 0 );
+ AccessibleEventNotifier::revokeClientNotifyDisposing( nId, *this );
+ }
+
m_xParent = NULL;
+ //m_aTable = NULL;
}
// XAccessibleContext ---------------------------------------------------------
diff --git a/accessibility/source/extended/AccessibleGridControlHeader.cxx b/accessibility/source/extended/AccessibleGridControlHeader.cxx
index 1870eebc8e3e..4b59a83906ab 100755
--- a/accessibility/source/extended/AccessibleGridControlHeader.cxx
+++ b/accessibility/source/extended/AccessibleGridControlHeader.cxx
@@ -239,12 +239,24 @@ Sequence< sal_Int8 > SAL_CALL AccessibleGridControlHeader::getImplementationId()
Rectangle AccessibleGridControlHeader::implGetBoundingBox()
{
- return m_aTable.calcHeaderRect(isColumnBar());
+ Window* pParent = m_aTable.GetAccessibleParentWindow();
+ Rectangle aGridRect( m_aTable.GetWindowExtentsRelative( pParent ) );
+ Rectangle aHeaderRect (m_aTable.calcHeaderRect(isColumnBar()));
+ if(isColumnBar())
+ return Rectangle(aGridRect.TopLeft(), Size(aGridRect.getWidth(),aHeaderRect.getHeight()));
+ else
+ return Rectangle(aGridRect.TopLeft(), Size(aHeaderRect.getWidth(),aGridRect.getHeight()));
+
}
Rectangle AccessibleGridControlHeader::implGetBoundingBoxOnScreen()
{
- return m_aTable.calcHeaderRect(isColumnBar());
+ Rectangle aGridRect( m_aTable.GetWindowExtentsRelative( NULL ) );
+ Rectangle aHeaderRect (m_aTable.calcHeaderRect(isColumnBar()));
+ if(isColumnBar())
+ return Rectangle(aGridRect.TopLeft(), Size(aGridRect.getWidth(),aHeaderRect.getHeight()));
+ else
+ return Rectangle(aGridRect.TopLeft(), Size(aHeaderRect.getWidth(),aGridRect.getHeight()));
}
sal_Int32 AccessibleGridControlHeader::implGetRowCount() const
diff --git a/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx b/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx
index 485c57c40ae1..f54379970206 100755
--- a/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx
+++ b/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx
@@ -146,13 +146,28 @@ void SAL_CALL AccessibleGridControlHeaderCell::grabFocus()
// -----------------------------------------------------------------------------
Rectangle AccessibleGridControlHeaderCell::implGetBoundingBox()
{
- return Rectangle(Point(0,0),Point(0,0));//To Do - return headercell rectangle
+ Window* pParent = m_aTable.GetAccessibleParentWindow();
+ Rectangle aGridRect( m_aTable.GetWindowExtentsRelative( pParent ) );
+ sal_Int32 nIndex = getAccessibleIndexInParent();
+ Rectangle aCellRect;
+ if(m_eObjType == TCTYPE_COLUMNHEADERCELL)
+ aCellRect = m_aTable.calcHeaderCellRect(true, nIndex);
+ else
+ aCellRect = m_aTable.calcHeaderCellRect(false, nIndex);
+ return Rectangle(Point(aGridRect.Left()+aCellRect.Left(),aGridRect.Top()+aCellRect.Top()), aCellRect.GetSize());
}
// -----------------------------------------------------------------------------
Rectangle AccessibleGridControlHeaderCell::implGetBoundingBoxOnScreen()
{
- return Rectangle(Point(0,0),Point(0,0));//To Do - return headercell rectangle
+ Rectangle aGridRect( m_aTable.GetWindowExtentsRelative( NULL ) );
+ sal_Int32 nIndex = getAccessibleIndexInParent();
+ Rectangle aCellRect;
+ if(m_eObjType == TCTYPE_COLUMNHEADERCELL)
+ aCellRect = m_aTable.calcHeaderCellRect(true, nIndex);
+ else
+ aCellRect = m_aTable.calcHeaderCellRect(false, nIndex);
+ return Rectangle(Point(aGridRect.Left()+aCellRect.Left(),aGridRect.Top()+aCellRect.Top()), aCellRect.GetSize());
}
// -----------------------------------------------------------------------------
sal_Int32 SAL_CALL AccessibleGridControlHeaderCell::getAccessibleIndexInParent()
diff --git a/accessibility/source/extended/AccessibleGridControlTable.cxx b/accessibility/source/extended/AccessibleGridControlTable.cxx
index 406baeb2973c..76e8a691c72f 100755
--- a/accessibility/source/extended/AccessibleGridControlTable.cxx
+++ b/accessibility/source/extended/AccessibleGridControlTable.cxx
@@ -58,6 +58,8 @@ AccessibleGridControlTable::AccessibleGridControlTable(
IAccessibleTable& rTable,
AccessibleTableControlObjType _eType) :
AccessibleGridControlTableBase( rxParent, rTable, _eType )
+ ,m_pCellVector( )
+ ,m_pAccessCellVector( )
{
}
@@ -75,7 +77,19 @@ AccessibleGridControlTable::getAccessibleChild( sal_Int32 nChildIndex )
::osl::MutexGuard aGuard( getOslMutex() );
ensureIsAlive();
ensureIsValidIndex( nChildIndex );
- return new AccessibleGridControlTableCell(this, m_aTable, nChildIndex/m_aTable.GetColumnCount(), nChildIndex%m_aTable.GetColumnCount(), TCTYPE_TABLECELL);
+ sal_Int32 nCount = getAccessibleChildCount();
+ if(m_pAccessCellVector.size() == 0 || m_pAccessCellVector.size() != (unsigned)nCount)
+ {
+ m_pAccessCellVector.resize(nCount);
+ m_pCellVector.resize(nCount);
+ }
+ if(!m_pAccessCellVector[nChildIndex].is())
+ {
+ AccessibleGridControlTableCell* pCell = new AccessibleGridControlTableCell(this, m_aTable, nChildIndex/m_aTable.GetColumnCount(), nChildIndex%m_aTable.GetColumnCount(), TCTYPE_TABLECELL);
+ m_pCellVector[nChildIndex] = pCell;
+ m_pAccessCellVector[nChildIndex] = pCell;
+ }
+ return m_pAccessCellVector[nChildIndex];
}
sal_Int32 SAL_CALL AccessibleGridControlTable::getAccessibleIndexInParent()
@@ -105,7 +119,6 @@ AccessibleGridControlTable::getAccessibleAtPoint( const awt::Point& rPoint )
sal_Int32 nColumnPos = 0;
if( m_aTable.ConvertPointToCellAddress( nRow, nColumnPos, VCLPoint( rPoint ) ) )
xChild = new AccessibleGridControlTableCell(this, m_aTable, nRow, nColumnPos, TCTYPE_TABLECELL);
-
return xChild;
}
@@ -221,7 +234,20 @@ Reference< XAccessible > SAL_CALL AccessibleGridControlTable::getAccessibleCellA
::osl::MutexGuard aGuard( getOslMutex() );
ensureIsAlive();
ensureIsValidAddress( nRow, nColumn );
- return new AccessibleGridControlTableCell(this, m_aTable, nRow, nColumn, TCTYPE_TABLECELL);
+ sal_Int32 nCount = getAccessibleChildCount();
+ sal_Int32 nChildIndex = nRow*m_aTable.GetColumnCount() + nColumn;
+ if(m_pAccessCellVector.size() == 0 || m_pAccessCellVector.size() != (unsigned)nCount)
+ {
+ m_pAccessCellVector.resize(nCount);
+ m_pCellVector.resize(nCount);
+ }
+ if(!m_pAccessCellVector[nChildIndex].is())
+ {
+ AccessibleGridControlTableCell* pCell = new AccessibleGridControlTableCell(this, m_aTable, nRow, nColumn, TCTYPE_TABLECELL);
+ m_pCellVector[nChildIndex] = pCell;
+ m_pAccessCellVector[nChildIndex] = pCell;
+ }
+ return m_pAccessCellVector[nChildIndex];
}
sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleSelected(
@@ -339,12 +365,28 @@ OUString SAL_CALL AccessibleGridControlTable::getImplementationName()
Rectangle AccessibleGridControlTable::implGetBoundingBox()
{
- return m_aTable.calcTableRect();
+ Window* pParent = m_aTable.GetAccessibleParentWindow();
+ DBG_ASSERT( pParent, "implGetBoundingBox - missing parent window" );
+ Rectangle aGridRect( m_aTable.GetWindowExtentsRelative( pParent ));
+ Rectangle aTableRect( m_aTable.calcTableRect() );
+ long nX = aGridRect.Left() + aTableRect.Left();
+ long nY = aGridRect.Top() + aTableRect.Top();
+ long nWidth = aGridRect.GetSize().Width()-aTableRect.Left();
+ long nHeight = aGridRect.GetSize().Height()-aTableRect.Top();
+ Rectangle aTable( Point( nX, nY ), Size( nWidth, nHeight ));
+ return aTable;
}
Rectangle AccessibleGridControlTable::implGetBoundingBoxOnScreen()
{
- return m_aTable.calcTableRect();
+ Rectangle aGridRect( m_aTable.GetWindowExtentsRelative( NULL ));
+ Rectangle aTableRect( m_aTable.calcTableRect() );
+ long nX = aGridRect.Left() + aTableRect.Left();
+ long nY = aGridRect.Top() + aTableRect.Top();
+ long nWidth = aGridRect.GetSize().Width()-aTableRect.Left();
+ long nHeight = aGridRect.GetSize().Height()-aTableRect.Top();
+ Rectangle aTable( Point( nX, nY ), Size( nWidth, nHeight ));
+ return aTable;
}
// internal helper methods ----------------------------------------------------
Reference< XAccessibleTable > AccessibleGridControlTable::implGetHeaderBar(
@@ -368,6 +410,15 @@ Reference< XAccessibleTable > AccessibleGridControlTable::implGetHeaderBar(
return Reference< XAccessibleTable >( xRet, uno::UNO_QUERY );
}
+std::vector< AccessibleGridControlTableCell* >& AccessibleGridControlTable::getCellVector()
+{
+ return m_pCellVector;
+}
+
+std::vector< Reference< XAccessible > >& AccessibleGridControlTable::getAccessibleCellVector()
+{
+ return m_pAccessCellVector;
+}
// ============================================================================
} // namespace accessibility
diff --git a/accessibility/source/extended/AccessibleGridControlTableCell.cxx b/accessibility/source/extended/AccessibleGridControlTableCell.cxx
index 43b9400e9050..1efc369dfbc3 100755
--- a/accessibility/source/extended/AccessibleGridControlTableCell.cxx
+++ b/accessibility/source/extended/AccessibleGridControlTableCell.cxx
@@ -360,11 +360,25 @@ namespace accessibility
Rectangle AccessibleGridControlTableCell::implGetBoundingBox()
{
- return Rectangle(Point(0,0),Point(0,0));//To Do - return headercell rectangle
+ Window* pParent = m_aTable.GetAccessibleParentWindow();
+ DBG_ASSERT( pParent, "implGetBoundingBox - missing parent window" );
+ Rectangle aGridRect = m_aTable.GetWindowExtentsRelative( pParent );
+ sal_Int32 nIndex = getAccessibleIndexInParent();
+ Rectangle aCellRect = m_aTable.calcCellRect(nIndex%m_aTable.GetColumnCount(), nIndex/m_aTable.GetColumnCount());
+ long nX = aGridRect.Left() + aCellRect.Left();
+ long nY = aGridRect.Top() + aCellRect.Top();
+ Rectangle aCell( Point( nX, nY ), aCellRect.GetSize());
+ return aCell;
}
// -----------------------------------------------------------------------------
Rectangle AccessibleGridControlTableCell::implGetBoundingBoxOnScreen()
{
- return Rectangle(Point(0,0),Point(0,0));//To Do - return headercell rectangle
+ Rectangle aGridRect = m_aTable.GetWindowExtentsRelative( NULL );
+ sal_Int32 nIndex = getAccessibleIndexInParent();
+ Rectangle aCellRect = m_aTable.calcCellRect(nIndex%m_aTable.GetColumnCount(), nIndex/m_aTable.GetColumnCount());
+ long nX = aGridRect.Left() + aCellRect.Left();
+ long nY = aGridRect.Top() + aCellRect.Top();
+ Rectangle aCell( Point( nX, nY ), aCellRect.GetSize());
+ return aCell;
}
}