Modified: openoffice/branches/ia2/main/svx/source/dialog/frmsel.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/svx/source/dialog/frmsel.cxx?rev=1463840&r1=1463839&r2=1463840&view=diff
==============================================================================
--- openoffice/branches/ia2/main/svx/source/dialog/frmsel.cxx (original)
+++ openoffice/branches/ia2/main/svx/source/dialog/frmsel.cxx Wed Apr 3 07:04:20 2013
@@ -30,6 +30,12 @@
#include "frmselimpl.hxx"
#include "AccessibleFrameSelector.hxx"
#include <svx/dialmgr.hxx>
+//IAccessibility2 Implementation 2009-----
+#include <com/sun/star/accessibility/AccessibleEventId.hpp>
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLESTATETYPE_HDL_
+#include <com/sun/star/accessibility/AccessibleStateType.hpp>
+#endif
+//-----IAccessibility2 Implementation 2009
#ifndef _SVX_DIALOGS_HRC
#include <svx/dialogs.hrc>
@@ -43,8 +49,11 @@
namespace svx {
using ::com::sun::star::uno::Reference;
+//IAccessibility2 Implementation 2009-----
+using ::com::sun::star::uno::Any;
using ::com::sun::star::accessibility::XAccessible;
-
+using namespace ::com::sun::star::accessibility;
+//-----IAccessibility2 Implementation 2009
// ============================================================================
// global functions from framebordertype.hxx
@@ -696,10 +705,24 @@ void FrameSelectorImpl::DoInvalidate( bo
void FrameSelectorImpl::SetBorderState( FrameBorder& rBorder, FrameBorderState eState )
{
DBG_ASSERT( rBorder.IsEnabled(), "svx::FrameSelectorImpl::SetBorderState - access to disabled border" );
+ //IAccessibility2 Implementation 2009-----
+ Any aOld;
+ Any aNew;
+ Any& rMod = eState == FRAMESTATE_SHOW ? aNew : aOld;
+ rMod <<= AccessibleStateType::CHECKED;
+ Reference< XAccessible > xRet;
+ size_t nVecIdx = static_cast< size_t >( rBorder.GetType() );
+ if( GetBorder(rBorder.GetType()).IsEnabled() && (1 <= nVecIdx) && (nVecIdx <= maChildVec.size()) )
+ xRet = mxChildVec[ --nVecIdx ];
+ a11y::AccFrameSelector* pFrameSelector = static_cast<a11y::AccFrameSelector*>(xRet.get());
+
if( eState == FRAMESTATE_SHOW )
SetBorderCoreStyle( rBorder, &maCurrStyle );
else
rBorder.SetState( eState );
+ if (pFrameSelector)
+ pFrameSelector->NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOld, aNew );
+ //-----IAccessibility2 Implementation 2009
DoInvalidate( true );
}
@@ -914,9 +937,23 @@ bool FrameSelector::IsBorderSelected( Fr
return mxImpl->GetBorder( eBorder ).IsSelected();
}
-void FrameSelector::SelectBorder( FrameBorderType eBorder, bool bSelect )
+void FrameSelector::SelectBorder( FrameBorderType eBorder, bool bSelect /*, bool bFocus */ )
{
mxImpl->SelectBorder( mxImpl->GetBorderAccess( eBorder ), bSelect );
+ //IAccessibility2 Implementation 2009-----
+ // MT: bFireFox as API parameter is ugly...
+ // if (bFocus)
+ {
+ Reference< XAccessible > xRet = GetChildAccessible(eBorder);
+ a11y::AccFrameSelector* pFrameSelector = static_cast<a11y::AccFrameSelector*>(xRet.get());
+ if (pFrameSelector)
+ {
+ Any aOldValue, aNewValue;
+ aNewValue <<= AccessibleStateType::FOCUSED;
+ pFrameSelector->NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
+ }
+ }
+ //-----IAccessibility2 Implementation 2009
}
bool FrameSelector::IsAnyBorderSelected() const
@@ -1063,7 +1100,10 @@ void FrameSelector::MouseButtonDown( con
if( !(*aIt)->IsSelected() )
{
bNewSelected = true;
- mxImpl->SelectBorder( **aIt, true );
+ //IAccessibility2 Implementation 2009-----
+ //mxImpl->SelectBorder( **aIt, true );
+ SelectBorder((**aIt).GetType(), true);
+ //-----IAccessibility2 Implementation 2009
}
}
else
@@ -1160,6 +1200,31 @@ void FrameSelector::GetFocus()
mxImpl->DoInvalidate( false );
if( mxImpl->mxAccess.is() )
mxImpl->mpAccess->NotifyFocusListeners( sal_True );
+ //IAccessibility2 Implementation 2009-----
+ if (IsAnyBorderSelected())
+ {
+ FrameBorderType borderType = FRAMEBORDER_NONE;
+ if (mxImpl->maLeft.IsSelected())
+ borderType = FRAMEBORDER_LEFT;
+ else if (mxImpl->maRight.IsSelected())
+ borderType = FRAMEBORDER_RIGHT;
+ else if (mxImpl->maTop.IsSelected())
+ borderType = FRAMEBORDER_TOP;
+ else if (mxImpl->maBottom.IsSelected())
+ borderType = FRAMEBORDER_BOTTOM;
+ else if (mxImpl->maHor.IsSelected())
+ borderType = FRAMEBORDER_HOR;
+ else if (mxImpl->maVer.IsSelected())
+ borderType = FRAMEBORDER_VER;
+ else if (mxImpl->maTLBR.IsSelected())
+ borderType = FRAMEBORDER_TLBR;
+ else if (mxImpl->maBLTR.IsSelected())
+ borderType = FRAMEBORDER_BLTR;
+ SelectBorder(borderType);
+ }
+ for( SelFrameBorderIter aIt( mxImpl->maEnabBorders ); aIt.Is(); ++aIt )
+ mxImpl->SetBorderState( **aIt, FRAMESTATE_SHOW );
+ //-----IAccessibility2 Implementation 2009
Control::GetFocus();
}
Modified: openoffice/branches/ia2/main/svx/source/dialog/srchdlg.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/svx/source/dialog/srchdlg.cxx?rev=1463840&r1=1463839&r2=1463840&view=diff
==============================================================================
--- openoffice/branches/ia2/main/svx/source/dialog/srchdlg.cxx (original)
+++ openoffice/branches/ia2/main/svx/source/dialog/srchdlg.cxx Wed Apr 3 07:04:20 2013
@@ -70,6 +70,14 @@
#include <tools/resary.hxx>
#include <svx/svxdlg.hxx> //CHINA001
+//IAccessibility2 Impplementaton 2009-----
+#ifndef _ACCESSIBLESVXFINDREPLACEDIALOG_HXX_
+#include <svx/AccessibleSvxFindReplaceDialog.hxx>
+#endif
+using namespace com::sun::star::uno;
+using namespace com::sun::star::accessibility;
+//-----IAccessibility2 Impplementaton 2009
+
#include <sfx2/layout-pre.hxx>
using namespace com::sun::star::i18n;
@@ -293,6 +301,8 @@ void SearchAttrItemList::Remove( sal_uIn
#undef INI_LIST
#define INI_LIST() \
+ mpDocWin (NULL), \
+ mbSuccess (sal_False), \
aSearchText ( this, SVX_RES( FT_SEARCH ) ), \
aSearchLB ( this, SVX_RES( ED_SEARCH ) ), \
aSearchTmplLB ( this, SVX_RES( LB_SEARCH ) ), \
@@ -2506,6 +2516,23 @@ void SvxSearchDialog::SaveToModule_Impl(
rBindings.GetDispatcher()->Execute( SID_SEARCH_ITEM, SFX_CALLMODE_SLOT, ppArgs );
}
+//IAccessible2 Implementation 2009-----
+::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >
+ SvxSearchDialog::GetComponentInterface( sal_Bool bCreate )
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xPeer
+ (Window::GetComponentInterface(false));
+ if ( !xPeer.is() && bCreate )
+ {
+ ::com::sun::star::awt::XWindowPeer* mxPeer = new VCLXSvxFindReplaceDialog(this);
+ SetComponentInterface(mxPeer);
+ return mxPeer;
+ }
+ else
+ return xPeer;
+}
+//-----IAccessible2 Implementation 2009
+
// class SvxSearchDialogWrapper ------------------------------------------
SFX_IMPL_CHILDWINDOW(SvxSearchDialogWrapper, SID_SEARCH_DLG);
Modified: openoffice/branches/ia2/main/svx/source/inc/AccessibleFrameSelector.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/svx/source/inc/AccessibleFrameSelector.hxx?rev=1463840&r1=1463839&r2=1463840&view=diff
==============================================================================
--- openoffice/branches/ia2/main/svx/source/inc/AccessibleFrameSelector.hxx (original)
+++ openoffice/branches/ia2/main/svx/source/inc/AccessibleFrameSelector.hxx Wed Apr 3 07:04:20 2013
@@ -108,16 +108,13 @@ public:
void Invalidate();
void NotifyFocusListeners(sal_Bool bGetFocus);
+ void NotifyAccessibleEvent( const sal_Int16 _nEventId, const ::com::sun::star::uno::Any& _rOldValue, const ::com::sun::star::uno::Any& _rNewValue );
protected:
DECL_LINK( WindowEventListener, VclSimpleEvent* );
virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
- void NotifyAccessibleEvent( const sal_Int16 _nEventId,
- const ::com::sun::star::uno::Any& _rOldValue,
- const ::com::sun::star::uno::Any& _rNewValue );
-
private:
void IsValid() throw (::com::sun::star::uno::RuntimeException);
Modified: openoffice/branches/ia2/main/svx/source/inc/svxrectctaccessiblecontext.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/svx/source/inc/svxrectctaccessiblecontext.hxx?rev=1463840&r1=1463839&r2=1463840&view=diff
==============================================================================
--- openoffice/branches/ia2/main/svx/source/inc/svxrectctaccessiblecontext.hxx (original)
+++ openoffice/branches/ia2/main/svx/source/inc/svxrectctaccessiblecontext.hxx Wed Apr 3 07:04:20 2013
@@ -43,9 +43,14 @@
#include <vos/mutex.hxx>
#include <cppuhelper/interfacecontainer.h>
#include <cppuhelper/compbase6.hxx>
-//#ifndef _CPPUHELPER_COMPBASE7_HXX_
-//#include <cppuhelper/compbase7.hxx>
-//#endif
+//IAccessibility2 Implementation 2009-----
+#ifndef _CPPUHELPER_COMPBASE7_HXX_
+#include <cppuhelper/compbase7.hxx>
+#endif
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_ACTION_HPP_
+#include <com/sun/star/accessibility/XAccessibleAction.hpp>
+#endif
+//-----IAccessibility2 Implementation 2009
#include <comphelper/broadcasthelper.hxx>
#include <cppuhelper/implbase6.hxx>
#include <comphelper/servicehelper.hxx>
@@ -250,7 +255,10 @@ protected:
@param nIndexOfChild
Index of the new child which should be selected.
*/
- void selectChild( long nIndexOfChild );
+ // IAccessibility2 implementation 2009. ------
+ //void selectChild( long nIndexOfChild );
+ void selectChild( long nIndexOfChild, sal_Bool bFireFocus = sal_True);
+ // ------ IAccessibility2 implementation 2009.
public:
/** Selects a new child by point.
@@ -261,8 +269,13 @@ public:
@param eButton
Button which belongs to the child which should be selected.
*/
- void selectChild( RECT_POINT ePoint );
-
+ //void selectChild( RECT_POINT ePoint );
+ // IAccessibility2 implementation 2009. ------
+ void selectChild( RECT_POINT ePoint, sal_Bool bFireFocus = sal_True );
+ void FireChildFocus( RECT_POINT eButton );
+ //Solution: Add the event handling method
+ void FireAccessibleEvent (short nEventId, const ::com::sun::star::uno::Any& rOld, const ::com::sun::star::uno::Any& rNew);
+ // ------ IAccessibility2 implementation 2009.
/// Sets the name
void setName( const ::rtl::OUString& rName );
@@ -332,15 +345,17 @@ inline sal_Bool SvxRectCtlAccessibleCont
return rBHelper.bDisposed || rBHelper.bInDispose;
}
-
-typedef ::cppu::WeakAggComponentImplHelper6<
+//IAccessibility2 Implementation 2009-----
+typedef ::cppu::WeakAggComponentImplHelper7<
::com::sun::star::accessibility::XAccessible,
::com::sun::star::accessibility::XAccessibleComponent,
::com::sun::star::accessibility::XAccessibleContext,
::com::sun::star::accessibility::XAccessibleEventBroadcaster,
::com::sun::star::accessibility::XAccessibleValue,
+ ::com::sun::star::accessibility::XAccessibleAction,
::com::sun::star::lang::XServiceInfo >
SvxRectCtlChildAccessibleContext_Base;
+//-----IAccessibility2 Implementation 2009
class SvxRectCtlChildAccessibleContext : public SvxRectCtlChildAccessibleContext_Base
@@ -472,6 +487,13 @@ public:
virtual ::com::sun::star::uno::Any SAL_CALL
getMinimumValue() throw( ::com::sun::star::uno::RuntimeException );
+//IAccessibility2 Implementation 2009-----
+ // XAccessibleAction
+ virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+//-----IAccessibility2 Implementation 2009
//===== XServiceInfo ====================================================
virtual ::rtl::OUString SAL_CALL
@@ -492,8 +514,11 @@ public:
//===== internal ==========================================================
/// Sets the checked status
- void setStateChecked( sal_Bool bChecked );
-
+ //void setStateChecked( sal_Bool bChecked );
+ // IAccessibility2 implementation 2009. ------
+ void setStateChecked( sal_Bool bChecked, sal_Bool bFireFocus = sal_True);
+ void FireFocusEvent();
+ // ------ IAccessibility2 implementation 2009.
protected:
virtual Rectangle GetBoundingBoxOnScreen( void ) throw( ::com::sun::star::uno::RuntimeException );
Modified: openoffice/branches/ia2/main/svx/source/svdraw/svdoashp.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/svx/source/svdraw/svdoashp.cxx?rev=1463840&r1=1463839&r2=1463840&view=diff
==============================================================================
--- openoffice/branches/ia2/main/svx/source/svdraw/svdoashp.cxx (original)
+++ openoffice/branches/ia2/main/svx/source/svdraw/svdoashp.cxx Wed Apr 3 07:04:20 2013
@@ -3527,4 +3527,21 @@ void SdrObjCustomShape::InvalidateRender
mpLastShadowGeometry = 0L;
}
+//IAccessibility2 Implementation 2009-----
+::rtl::OUString SdrObjCustomShape::GetCustomShapeName()
+{
+ rtl::OUString sShapeName;
+ rtl::OUString aEngine( ( (SdrCustomShapeEngineItem&)( *this ).GetMergedItem( SDRATTR_CUSTOMSHAPE_ENGINE ) ).GetValue() );
+ if ( !aEngine.getLength() || aEngine.equalsAscii( "com.sun.star.drawing.EnhancedCustomShapeEngine" ) )
+ {
+ rtl::OUString sShapeType;
+ const rtl::OUString sType( RTL_CONSTASCII_USTRINGPARAM ( "Type" ) );
+ SdrCustomShapeGeometryItem& rGeometryItem( (SdrCustomShapeGeometryItem&)( *this ).GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+ Any* pAny = rGeometryItem.GetPropertyValueByName( sType );
+ if ( pAny && ( *pAny >>= sShapeType ) )
+ sShapeName = EnhancedCustomShapeTypeNames::GetAccName( sShapeType );
+ }
+ return sShapeName;
+}
+//-----IAccessibility2 Implementation 2009
// eof
Modified: openoffice/branches/ia2/main/svx/source/svdraw/svdobj.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/svx/source/svdraw/svdobj.cxx?rev=1463840&r1=1463839&r2=1463840&view=diff
==============================================================================
--- openoffice/branches/ia2/main/svx/source/svdraw/svdobj.cxx (original)
+++ openoffice/branches/ia2/main/svx/source/svdraw/svdobj.cxx Wed Apr 3 07:04:20 2013
@@ -3162,6 +3162,12 @@ void SdrObject::SetContextWritingMode( c
// this base class does not support different writing modes, so ignore the call
}
+//IAccessibility2 Implementation 2009-----
+const SdrObject* SdrObject::GetCaptionObj() const
+{
+ return pCaptionObj;
+}
+//-----IAccessibility2 Implementation 2009
////////////////////////////////////////////////////////////////////////////////////////////////////
//
// @@@@ @@@@@ @@@@@@ @@@@@ @@@@ @@@@ @@@@@@ @@@@ @@@@@ @@ @@
Modified: openoffice/branches/ia2/main/svx/source/svdraw/svdoole2.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/svx/source/svdraw/svdoole2.cxx?rev=1463840&r1=1463839&r2=1463840&view=diff
==============================================================================
--- openoffice/branches/ia2/main/svx/source/svdraw/svdoole2.cxx (original)
+++ openoffice/branches/ia2/main/svx/source/svdraw/svdoole2.cxx Wed Apr 3 07:04:20 2013
@@ -844,7 +844,19 @@ void SdrOle2Obj::Init()
}
// -----------------------------------------------------------------------------
+//IAccessibility2 Implementation 2009-----
+String SdrOle2Obj::GetStyleString()
+{
+ String strStyle;
+ if( xObjRef.is() && xObjRef.IsChart() )
+ {
+ strStyle = xObjRef.GetChartType();
+ }
+ return strStyle;
+}
+// -----------------------------------------------------------------------------
+//-----IAccessibility2 Implementation 2009
SdrOle2Obj::~SdrOle2Obj()
{
DBG_DTOR( SdrOle2Obj,NULL);
Modified: openoffice/branches/ia2/main/svx/source/table/accessiblecell.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/svx/source/table/accessiblecell.cxx?rev=1463840&r1=1463839&r2=1463840&view=diff
==============================================================================
--- openoffice/branches/ia2/main/svx/source/table/accessiblecell.cxx (original)
+++ openoffice/branches/ia2/main/svx/source/table/accessiblecell.cxx Wed Apr 3 07:04:20 2013
@@ -60,6 +60,8 @@ AccessibleCell::AccessibleCell( const ::
, mpText( NULL )
, mxCell( rCell )
{
+ //Init the pAccTable var
+ pAccTable = dynamic_cast <AccessibleTableShape *> (rxParent.get());
}
// --------------------------------------------------------------------
@@ -242,7 +244,41 @@ Reference<XAccessibleStateSet> SAL_CALL
else
pStateSet->RemoveState (AccessibleStateType::FOCUSED);
}
-
+ // Set the invisible state for merged cell
+ if (mxCell.is() && mxCell->isMerged())
+ pStateSet->RemoveState(AccessibleStateType::VISIBLE);
+ else
+ pStateSet->AddState(AccessibleStateType::VISIBLE);
+
+
+ //Sym2_6167, IAccessibility2 Implementation 2009-----
+ //Solution:Just when the parent table is not read-only,set states EDITABLE,RESIZABLE,MOVEABLE
+ ::com::sun::star::uno::Reference<XAccessible> xTempAcc = getAccessibleParent();
+ if( xTempAcc.is() )
+ {
+ ::com::sun::star::uno::Reference<XAccessibleContext>
+ xTempAccContext = xTempAcc->getAccessibleContext();
+ if( xTempAccContext.is() )
+ {
+ ::com::sun::star::uno::Reference<XAccessibleStateSet> rState =
+ xTempAccContext->getAccessibleStateSet();
+ if( rState.is() ) {
+ com::sun::star::uno::Sequence<short> pStates = rState->getStates();
+ int count = pStates.getLength();
+ for( int iIndex = 0;iIndex < count;iIndex++ )
+ {
+ if( pStates[iIndex] == AccessibleStateType::EDITABLE )
+ {
+ pStateSet->AddState (AccessibleStateType::EDITABLE);
+ pStateSet->AddState (AccessibleStateType::RESIZABLE);
+ pStateSet->AddState (AccessibleStateType::MOVEABLE);
+ break;
+ }
+ }
+ }
+ }
+ }
+ //-----IAccessibility2 Implementation 2009
// Create a copy of the state set that may be modified by the
// caller without affecting the current state set.
xStateSet = Reference<XAccessibleStateSet>(new ::utl::AccessibleStateSetHelper (*pStateSet));
@@ -566,6 +602,75 @@ sal_Int32 SAL_CALL AccessibleCell::getAc
return mnIndexInParent;
}
+// SD table ACC----, added by Steve Yin
+sdr::table::CellRef AccessibleCell::getCellRef()
+{
+ return mxCell;
+}
+::rtl::OUString AccessibleCell::getCellName( sal_Int32 nCol, sal_Int32 nRow )
+{
+ rtl::OUStringBuffer aBuf;
+
+ if (nCol < 26*26)
+ {
+ if (nCol < 26)
+ aBuf.append( static_cast<sal_Unicode>( 'A' +
+ static_cast<sal_uInt16>(nCol)));
+ else
+ {
+ aBuf.append( static_cast<sal_Unicode>( 'A' +
+ (static_cast<sal_uInt16>(nCol) / 26) - 1));
+ aBuf.append( static_cast<sal_Unicode>( 'A' +
+ (static_cast<sal_uInt16>(nCol) % 26)));
+ }
+ }
+ else
+ {
+ String aStr;
+ while (nCol >= 26)
+ {
+ sal_Int32 nC = nCol % 26;
+ aStr += static_cast<sal_Unicode>( 'A' +
+ static_cast<sal_uInt16>(nC));
+ nCol = nCol - nC;
+ nCol = nCol / 26 - 1;
+ }
+ aStr += static_cast<sal_Unicode>( 'A' +
+ static_cast<sal_uInt16>(nCol));
+ aStr.Reverse();
+ aBuf.append( aStr);
+ }
+ aBuf.append( OUString::valueOf(nRow+1) );
+ return aBuf.makeStringAndClear();
+}
+::rtl::OUString SAL_CALL AccessibleCell::getAccessibleName (void) throw (::com::sun::star::uno::RuntimeException)
+{
+ ThrowIfDisposed ();
+ ::vos::OGuard aSolarGuard (::Application::GetSolarMutex());
+
+ if( pAccTable )
+ try
+ {
+ sal_Int32 nRow = 0, nCol = 0;
+ pAccTable->getColumnAndRow(mnIndexInParent, nCol, nRow);
+ return getCellName( nCol, nRow );
+ }
+ catch( Exception& )
+ {
+ }
+
+ return AccessibleCellBase::getAccessibleName();
+}
+void AccessibleCell::UpdateChildren()
+{
+ if (mpText)
+ mpText->UpdateChildren();
+}
+// ----SD table ACC
+
+/* MT: Above getAccessibleName was introduced with IA2 CWS, while below was introduce in 3.3 meanwhile. Check which one is correct
+If this is correct, we also don't need sdr::table::CellRef getCellRef(), UpdateChildren(), getCellName( sal_Int32 nCol, sal_Int32 nRow ) above
+
::rtl::OUString SAL_CALL AccessibleCell::getAccessibleName (void) throw (::com::sun::star::uno::RuntimeException)
{
ThrowIfDisposed ();
@@ -576,5 +681,6 @@ sal_Int32 SAL_CALL AccessibleCell::getAc
return AccessibleCellBase::getAccessibleName();
}
+*/
} // end of namespace accessibility
Modified: openoffice/branches/ia2/main/svx/source/table/accessiblecell.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/svx/source/table/accessiblecell.hxx?rev=1463840&r1=1463839&r2=1463840&view=diff
==============================================================================
--- openoffice/branches/ia2/main/svx/source/table/accessiblecell.hxx (original)
+++ openoffice/branches/ia2/main/svx/source/table/accessiblecell.hxx Wed Apr 3 07:04:20 2013
@@ -43,6 +43,8 @@
#include <boost/noncopyable.hpp>
+#include <svx/AccessibleTableShape.hxx>
+
class SdrObject;
@@ -80,6 +82,9 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL getAccessibleStateSet(void) throw(::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getAccessibleIndexInParent(void) throw(::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getAccessibleName (void) throw (::com::sun::star::uno::RuntimeException);
+ sdr::table::CellRef getCellRef();
+ void UpdateChildren();
+ ::rtl::OUString getCellName( sal_Int32 nCol, sal_Int32 nRow );
// XAccessibleComponent
virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint) throw (::com::sun::star::uno::RuntimeException);
@@ -119,6 +124,8 @@ public:
*/
inline void setIndexInParent(sal_Int32 _nIndex) { mnIndexInParent = _nIndex; }
+ //Get the parent table
+ AccessibleTableShape* GetParentTable() { return pAccTable; }
protected:
/// Bundle of information passed to all shapes in a document tree.
AccessibleShapeTreeInfo maShapeTreeInfo;
@@ -134,6 +141,8 @@ protected:
/// This method is called from the component helper base class while disposing.
virtual void SAL_CALL disposing (void);
+ AccessibleTableShape *pAccTable;
+
private:
explicit AccessibleCell(void); // not implemented
explicit AccessibleCell(const AccessibleCell&); // not implemented
Modified: openoffice/branches/ia2/main/svx/source/table/accessibletableshape.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/svx/source/table/accessibletableshape.cxx?rev=1463840&r1=1463839&r2=1463840&view=diff
==============================================================================
--- openoffice/branches/ia2/main/svx/source/table/accessibletableshape.cxx (original)
+++ openoffice/branches/ia2/main/svx/source/table/accessibletableshape.cxx Wed Apr 3 07:04:20 2013
@@ -40,6 +40,11 @@
#include <algorithm>
#include <cppuhelper/implbase1.hxx>
+//IAccessibility2 Implementation 2009-----
+#include <svx/svdotable.hxx>
+#include <com/sun/star/accessibility/AccessibleStateType.hpp>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
+//-----IAccessibility2 Implementation 2009
using ::rtl::OUString;
@@ -94,12 +99,21 @@ public:
Reference< XTable > mxTable;
AccessibleCellMap maChildMap;
Reference< XAccessible> mxAccessible;
+ //IAccessibility2 Implementation 2009-----
+ sal_Int32 mRowCount, mColCount;
+ //get the cached AccessibleCell from XCell
+ Reference< AccessibleCell > getAccessibleCell (Reference< XCell > xCell);
+ //-----IAccessibility2 Implementation 2009
};
//-----------------------------------------------------------------------------
AccessibleTableShapeImpl::AccessibleTableShapeImpl( AccessibleShapeTreeInfo& rShapeTreeInfo )
: mrShapeTreeInfo( rShapeTreeInfo )
+//IAccessibility2 Implementation 2009-----
+, mRowCount(0)
+, mColCount(0)
+//-----IAccessibility2 Implementation 2009
{
}
@@ -114,6 +128,14 @@ void AccessibleTableShapeImpl::init( con
{
Reference< XModifyListener > xListener( this );
mxTable->addModifyListener( xListener );
+ //IAccessibility2 Implementation 2009-----
+ //register the listener with table model
+ Reference< ::com::sun::star::view::XSelectionSupplier > xSelSupplier(xTable, UNO_QUERY);
+ Reference< ::com::sun::star::view::XSelectionChangeListener > xSelListener( xAccessible, UNO_QUERY );
+ if (xSelSupplier.is())
+ xSelSupplier->addSelectionChangeListener(xSelListener);
+ mRowCount = mxTable->getRowCount();
+ mColCount = mxTable->getColumnCount();
}
}
@@ -123,6 +145,12 @@ void AccessibleTableShapeImpl::dispose()
{
if( mxTable.is() )
{
+ //IAccessibility2 Implementation 2009-----, remove all the cell's acc object in table's dispose.
+ for( AccessibleCellMap::iterator iter( maChildMap.begin() ); iter != maChildMap.end(); iter++ )
+ {
+ (*iter).second->dispose();
+ }
+ //-----IAccessibility2 Implementation 2009
Reference< XModifyListener > xListener( this );
mxTable->removeModifyListener( xListener );
mxTable.clear();
@@ -131,7 +159,21 @@ void AccessibleTableShapeImpl::dispose()
}
//-----------------------------------------------------------------------------
+//IAccessibility2 Implementation 2009-----, get the cached AccessibleCell from XCell
+Reference< AccessibleCell > AccessibleTableShapeImpl::getAccessibleCell (Reference< XCell > xCell)
+{
+ AccessibleCellMap::iterator iter( maChildMap.find( xCell ) );
+ if( iter != maChildMap.end() )
+ {
+ Reference< AccessibleCell > xChild( (*iter).second.get() );
+ return xChild;
+ }
+ return Reference< AccessibleCell >();
+}
+
+//-----------------------------------------------------------------------------
+//-----IAccessibility2 Implementation 2009
Reference< XAccessible > AccessibleTableShapeImpl::getAccessibleChild( sal_Int32 nChildIndex ) throw(IndexOutOfBoundsException)
{
sal_Int32 nColumn = 0, nRow = 0;
@@ -151,6 +193,9 @@ Reference< XAccessible > AccessibleTable
rtl::Reference< AccessibleCell > xAccessibleCell( new AccessibleCell( mxAccessible, xCellRef, nChildIndex, mrShapeTreeInfo ) );
+ //IAccessibility2 Implementation 2009-----
+ xAccessibleCell->Init();
+ //-----IAccessibility2 Implementation 2009
maChildMap[xCell] = xAccessibleCell;
xAccessibleCell->Init();
@@ -197,6 +242,15 @@ void SAL_CALL AccessibleTableShapeImpl::
const sal_Int32 nRowCount = mxTable->getRowCount();
const sal_Int32 nColCount = mxTable->getColumnCount();
+ //IAccessibility2 Implementation 2009-----
+ sal_Bool bRowOrColumnChanged = sal_False;
+ if (mRowCount != nRowCount || mColCount != nColCount )
+ {
+ bRowOrColumnChanged = sal_True;
+ mRowCount = nRowCount;
+ mColCount = nColCount;
+ }
+ //-----IAccessibility2 Implementation 2009
sal_Int32 nChildIndex = 0;
for( sal_Int32 nRow = 0; nRow < nRowCount; ++nRow )
@@ -210,12 +264,49 @@ void SAL_CALL AccessibleTableShapeImpl::
{
rtl::Reference< AccessibleCell > xAccessibleCell( (*iter).second );
xAccessibleCell->setIndexInParent( nChildIndex );
- xAccessibleCell->CommitChange(AccessibleEventId::VISIBLE_DATA_CHANGED, Any(), Any());
+ //IAccessibility2 Implementation 2009-----, the children may need to updated
+ //xAccessibleCell->CommitChange(AccessibleEventId::VISIBLE_DATA_CHANGED, Any(), Any());
+ xAccessibleCell->UpdateChildren();
+ // If row or column count is changed, there is split or merge, so all cell's acc name should be updated
+ if (bRowOrColumnChanged)
+ {
+ xAccessibleCell->SetAccessibleName(xAccessibleCell->getAccessibleName(), AccessibleContextBase::ManuallySet);
+ }
+ // For merged cell, add invisible & disabled state.
+ Reference< XMergeableCell > xMergedCell( mxTable->getCellByPosition( nCol, nRow ), UNO_QUERY );
+ if (xMergedCell.is() && xMergedCell->isMerged())
+ {
+ xAccessibleCell->ResetState(AccessibleStateType::VISIBLE);
+ xAccessibleCell->ResetState(AccessibleStateType::ENABLED);
+ // IA2 CWS. MT: OFFSCREEN == !SHOWING, should stay consistent
+ // xAccessibleCell->SetState(AccessibleStateType::OFFSCREEN);
+ xAccessibleCell->ResetState(AccessibleStateType::SHOWING);
+ }
+ else
+ {
+ xAccessibleCell->SetState(AccessibleStateType::VISIBLE);
+ xAccessibleCell->SetState(AccessibleStateType::ENABLED);
+ // IA2 CWS. MT: OFFSCREEN == !SHOWING, should stay consistent
+ // xAccessibleCell->ResetState(AccessibleStateType::OFFSCREEN);
+ xAccessibleCell->SetState(AccessibleStateType::SHOWING);
+ }
+ //-----IAccessibility2 Implementation 2009
// move still existing cell from temporary child map to our child map
maChildMap[xCell] = xAccessibleCell;
aTempChildMap.erase( iter );
}
+ //IAccessibility2 Implementation 2009-----, need to add the new added cell on demand
+ else
+ {
+ CellRef xCellRef( dynamic_cast< Cell* >( xCell.get() ) );
+
+ rtl::Reference< AccessibleCell > xAccessibleCell( new AccessibleCell( mxAccessible, xCellRef, nChildIndex, mrShapeTreeInfo ) );
+
+ xAccessibleCell->Init();
+ maChildMap[xCell] = xAccessibleCell;
+ }
+ //-----IAccessibility2 Implementation 2009
++nChildIndex;
}
@@ -228,6 +319,10 @@ void SAL_CALL AccessibleTableShapeImpl::
{
(*iter).second->dispose();
}
+ //IAccessibility2 Implementation 2009-----, notify bridge to update the acc cache.
+ AccessibleTableShape *pAccTable = dynamic_cast <AccessibleTableShape *> (mxAccessible.get());
+ pAccTable->CommitChange(AccessibleEventId::INVALIDATE_ALL_CHILDREN, Any(), Any());
+ //-----IAccessibility2 Implementation 2009
}
catch( Exception& )
{
@@ -264,7 +359,7 @@ void AccessibleTableShape::Init()
{
try
{
-
+ mnPreviousSelectionCount = 0;
Reference< XPropertySet > xSet( mxShape, UNO_QUERY_THROW );
Reference< XTable > xTable( xSet->getPropertyValue(C2U("Model")), UNO_QUERY_THROW );
@@ -295,6 +390,16 @@ SvxTableController* AccessibleTableShape
Any SAL_CALL AccessibleTableShape::queryInterface( const Type& aType ) throw (RuntimeException)
{
+ //IAccessibility2 Implementation 2009-----
+ if ( aType == ::getCppuType((Reference<XAccessibleTableSelection> *)0) )
+ {
+ Reference<XAccessibleTableSelection> xThis( this );
+ Any aRet;
+ aRet <<= xThis;
+ return aRet;
+ }
+ else
+ //-----IAccessibility2 Implementation 2009
return AccessibleTableShape_Base::queryInterface( aType );
}
@@ -331,7 +436,7 @@ OUString SAL_CALL AccessibleTableShape::
OUString AccessibleTableShape::CreateAccessibleBaseName(void) throw (RuntimeException)
{
- return OUString (RTL_CONSTASCII_USTRINGPARAM("TableShape"));;
+ return OUString (RTL_CONSTASCII_USTRINGPARAM("TableShape"));
}
//--------------------------------------------------------------------
@@ -443,7 +548,19 @@ sal_Int32 SAL_CALL AccessibleTableShape:
Reference< XAccessibleTable > SAL_CALL AccessibleTableShape::getAccessibleRowHeaders( ) throw (RuntimeException)
{
- Reference< XAccessibleTable > xRet( this ); // todo
+ //IAccessibility2 Implementation 2009-----
+ //Reference< XAccessibleTable > xRet( this ); // todo
+ Reference< XAccessibleTable > xRet;
+ SvxTableController* pController = getTableController();
+ if( pController )
+ {
+ if( pController->isRowHeader() )
+ {
+ AccessibleTableHeaderShape* pTableHeader = new AccessibleTableHeaderShape( this, sal_True );
+ xRet.set( pTableHeader );
+ }
+ }
+ //-----IAccessibility2 Implementation 2009
return xRet;
}
@@ -451,7 +568,19 @@ Reference< XAccessibleTable > SAL_CALL A
Reference< XAccessibleTable > SAL_CALL AccessibleTableShape::getAccessibleColumnHeaders( ) throw (RuntimeException)
{
- Reference< XAccessibleTable > xRet( this ); // todo
+ //IAccessibility2 Implementation 2009-----
+ //Reference< XAccessibleTable > xRet( this ); // todo
+ Reference< XAccessibleTable > xRet;
+ SvxTableController* pController = getTableController();
+ if( pController )
+ {
+ if( pController->isColumnHeader() )
+ {
+ AccessibleTableHeaderShape* pTableHeader = new AccessibleTableHeaderShape( this, sal_False );
+ xRet.set( pTableHeader );
+ }
+ }
+ //-----IAccessibility2 Implementation 2009
return xRet;
}
@@ -459,16 +588,80 @@ Reference< XAccessibleTable > SAL_CALL A
Sequence< sal_Int32 > SAL_CALL AccessibleTableShape::getSelectedAccessibleRows( ) throw (RuntimeException)
{
- Sequence< sal_Int32 > aRet;
+ //IAccessibility2 Implementation 2009-----
+ /*Sequence< sal_Int32 > aRet;*/
+ sal_Int32 nRow = getAccessibleRowCount();
+ ::std::vector< sal_Bool > aSelected( nRow, sal_True );
+ sal_Int32 nCount = nRow;
+ for( sal_Int32 i = 0; i < nRow; i++ )
+ {
+ try
+ {
+ aSelected[i] = isAccessibleRowSelected( i );
+ }
+ catch( ... )
+ {
+ return Sequence< sal_Int32 >();
+ }
+
+ if( !aSelected[i] )
+ nCount--;
+ }
+ Sequence < sal_Int32 > aRet( nCount );
+ sal_Int32 *pRet = aRet.getArray();
+ sal_Int32 nPos = 0;
+ size_t nSize = aSelected.size();
+ for( size_t i=0; i < nSize && nPos < nCount; i++ )
+ {
+ if( aSelected[i] )
+ {
+ *pRet++ = i;
+ nPos++;
+ }
+ }
+
return aRet;
+ //-----IAccessibility2 Implementation 2009
}
//--------------------------------------------------------------------
Sequence< sal_Int32 > SAL_CALL AccessibleTableShape::getSelectedAccessibleColumns( ) throw (RuntimeException)
{
- Sequence< sal_Int32 > aRet;
+ //IAccessibility2 Implementation 2009-----
+ /*Sequence< sal_Int32 > aRet;*/
+ sal_Int32 nColumn = getAccessibleColumnCount();
+ ::std::vector< sal_Bool > aSelected( nColumn, sal_True );
+ sal_Int32 nCount = nColumn;
+ for( sal_Int32 i = 0; i < nColumn; i++ )
+ {
+ try
+ {
+ aSelected[i] = isAccessibleColumnSelected( i );
+ }
+ catch( ... )
+ {
+ return Sequence< sal_Int32 >();
+ }
+
+ if( !aSelected[i] )
+ nCount--;
+ }
+ Sequence < sal_Int32 > aRet( nCount );
+ sal_Int32 *pRet = aRet.getArray();
+ sal_Int32 nPos = 0;
+ size_t nSize = aSelected.size();
+ for( size_t i=0; i < nSize && nPos < nCount; i++ )
+ {
+ if( aSelected[i] )
+ {
+ *pRet++ = i;
+ nPos++;
+ }
+ }
+
return aRet;
+ //-----IAccessibility2 Implementation 2009
}
//--------------------------------------------------------------------
@@ -477,6 +670,13 @@ sal_Bool SAL_CALL AccessibleTableShape::
{
::vos::OGuard aSolarGuard (::Application::GetSolarMutex());
checkCellPosition( 0, nRow );
+ //IAccessibility2 Implementation 2009-----
+ SvxTableController* pController = getTableController();
+ if( pController )
+ {
+ return pController->isRowSelected( nRow );
+ }
+ //-----IAccessibility2 Implementation 2009
return sal_False;
}
@@ -486,6 +686,13 @@ sal_Bool SAL_CALL AccessibleTableShape::
{
::vos::OGuard aSolarGuard (::Application::GetSolarMutex());
checkCellPosition( nColumn, 0 );
+ //IAccessibility2 Implementation 2009-----
+ SvxTableController* pController = getTableController();
+ if( pController )
+ {
+ return pController->isColumnSelected( nColumn );
+ }
+ //-----IAccessibility2 Implementation 2009
return sal_False;
}
@@ -564,7 +771,10 @@ sal_Int32 SAL_CALL AccessibleTableShape:
::vos::OGuard aSolarGuard (::Application::GetSolarMutex());
sal_Int32 nColumn = 0, nRow = 0;
mxImpl->getColumnAndRow( nChildIndex, nColumn, nRow );
- return nChildIndex;
+ //IAccessibility2 Implementation 2009-----
+ //return nChildIndex;
+ return nColumn;
+ //-----IAccessibility2 Implementation 2009
}
//--------------------------------------------------------------------
@@ -603,7 +813,11 @@ sal_Bool SAL_CALL AccessibleTableShape::
CellPos aPos;
mxImpl->getColumnAndRow( nChildIndex, aPos.mnCol, aPos.mnRow );
- return isAccessibleSelected(aPos.mnCol, aPos.mnRow);
+ //IAccessibility2 Implementation 2009-----
+ // Para order is not correct
+ //return isAccessibleSelected(aPos.mnCol, aPos.mnRow);
+ return isAccessibleSelected(aPos.mnRow, aPos.mnCol);
+ //-----IAccessibility2 Implementation 2009
}
//--------------------------------------------------------------------
@@ -654,7 +868,8 @@ Reference< XAccessible > SAL_CALL Access
{
::vos::OGuard aSolarGuard (::Application::GetSolarMutex());
- SvxTableController* pController = getTableController();
+ //IAccessibility2 Implementation 2009-----
+ /*SvxTableController* pController = getTableController();
if( pController && pController->hasSelectedCells() )
{
CellPos aFirstPos, aLastPos;
@@ -675,6 +890,22 @@ Reference< XAccessible > SAL_CALL Access
}
throw IndexOutOfBoundsException();
+ */
+ if( nSelectedChildIndex < 0 )
+ throw IndexOutOfBoundsException();
+
+ sal_Int32 nChildIndex = GetIndexOfSelectedChild( nSelectedChildIndex );
+
+ if( nChildIndex < 0 )
+ throw IndexOutOfBoundsException();
+
+ if ( nChildIndex >= getAccessibleChildCount() )
+ {
+ throw IndexOutOfBoundsException();
+ }
+
+ return getAccessibleChild( nChildIndex );
+ //-----IAccessibility2 Implementation 2009
}
//--------------------------------------------------------------------
@@ -705,9 +936,180 @@ void SAL_CALL AccessibleTableShape::dese
pController->setSelectedCells( aFirstPos, aLastPos );
}
}
-
//--------------------------------------------------------------------
+//IAccessibility2 Implementation 2009-----
+//===== XAccessibleTableSelection ============================================
+sal_Bool SAL_CALL AccessibleTableShape::selectRow( sal_Int32 row )
+throw (IndexOutOfBoundsException, RuntimeException)
+{
+ ::vos::OGuard aSolarGuard (::Application::GetSolarMutex());
+ SvxTableController* pController = getTableController();
+ if( !pController )
+ return sal_False;
+ return pController->selectRow( row );
+}
+sal_Bool SAL_CALL AccessibleTableShape::selectColumn( sal_Int32 column )
+throw (IndexOutOfBoundsException, RuntimeException)
+{
+ ::vos::OGuard aSolarGuard (::Application::GetSolarMutex());
+ SvxTableController* pController = getTableController();
+ if( !pController )
+ return sal_False;
+ return pController->selectColumn( column );
+}
+sal_Bool SAL_CALL AccessibleTableShape::unselectRow( sal_Int32 row )
+throw (IndexOutOfBoundsException, RuntimeException)
+{
+ ::vos::OGuard aSolarGuard (::Application::GetSolarMutex());
+ SvxTableController* pController = getTableController();
+ if( !pController )
+ return sal_False;
+ return pController->deselectRow( row );
+}
+sal_Bool SAL_CALL AccessibleTableShape::unselectColumn( sal_Int32 column )
+throw (IndexOutOfBoundsException, RuntimeException)
+{
+ ::vos::OGuard aSolarGuard (::Application::GetSolarMutex());
+ SvxTableController* pController = getTableController();
+ if( !pController )
+ return sal_False;
+ return pController->deselectColumn( column );
+}
+sal_Int32 AccessibleTableShape::GetIndexOfSelectedChild(
+ sal_Int32 nSelectedChildIndex ) const
+{
+ sal_Int32 nChildren = const_cast<AccessibleTableShape*>(this)->getAccessibleChildCount();
+
+ if( nSelectedChildIndex >= nChildren )
+ return -1L;
+
+ sal_Int32 n = 0;
+ while( n < nChildren )
+ {
+ if( const_cast<AccessibleTableShape*>(this)->isAccessibleChildSelected( n ) )
+ {
+ if( 0 == nSelectedChildIndex )
+ break;
+ else
+ --nSelectedChildIndex;
+ }
+ ++n;
+ }
+
+ return n < nChildren ? n : -1L;
+}
+void AccessibleTableShape::getColumnAndRow( sal_Int32 nChildIndex, sal_Int32& rnColumn, sal_Int32& rnRow ) throw (IndexOutOfBoundsException )
+{
+ mxImpl->getColumnAndRow(nChildIndex, rnColumn, rnRow);
+}
+//--------------------------------------------------------------------
+// XSelectionChangeListener
+void SAL_CALL
+ AccessibleTableShape::disposing (const EventObject& aEvent)
+ throw (RuntimeException)
+{
+ AccessibleShape::disposing(aEvent);
+}
+void SAL_CALL AccessibleTableShape::selectionChanged (const EventObject& rEvent)
+ throw (RuntimeException)
+{
+ //::sdr::table::CellRef xCellRef = static_cast< ::sdr::table::CellRef > (rEvent.Source);
+ Reference< XCell > xCell(rEvent.Source, UNO_QUERY);
+ if (xCell.is())
+ {
+ Reference< AccessibleCell > xAccCell = mxImpl->getAccessibleCell( xCell );
+ if (xAccCell.is())
+ {
+ sal_Int32 nIndex = xAccCell->getAccessibleIndexInParent(),
+ nCount = getSelectedAccessibleChildCount();
+ sal_Bool bSelected = isAccessibleChildSelected(nIndex);
+ if (mnPreviousSelectionCount == 0 && nCount > 0 && bSelected)
+ {
+ xAccCell->SetState(AccessibleStateType::SELECTED);
+ xAccCell->CommitChange(AccessibleEventId::SELECTION_CHANGED, Any(), Any());
+ }
+ else if (bSelected)
+ {
+ xAccCell->SetState(AccessibleStateType::SELECTED);
+ xAccCell->CommitChange(AccessibleEventId::SELECTION_CHANGED_ADD, Any(), Any());
+ }
+ else
+ {
+ xAccCell->ResetState(AccessibleStateType::SELECTED);
+ xAccCell->CommitChange(AccessibleEventId::SELECTION_CHANGED_REMOVE, Any(), Any());
+ }
+ mnPreviousSelectionCount = nCount;
+ }
+ }
+}
+// Get the currently active cell which is text editing
+AccessibleCell* AccessibleTableShape::GetActiveAccessibleCell()
+{
+ sal_Bool bCellEditing = sal_False;
+ Reference< AccessibleCell > xAccCell;
+ AccessibleCell* pAccCell = NULL;
+ SvxTableController* pController = getTableController();
+ if (pController)
+ {
+ ::sdr::table::SdrTableObj* pTableObj = pController->GetTableObj();
+ if ( pTableObj )
+ {
+ ::sdr::table::CellRef xCellRef (pTableObj->getActiveCell());
+ if ( xCellRef.is() )
+ {
+ bCellEditing = xCellRef->IsTextEditActive();
+ if (bCellEditing)
+ {
+ //Reference< XCell > xCell(xCellRef.get(), UNO_QUERY);
+ xAccCell = mxImpl->getAccessibleCell(Reference< XCell >( xCellRef.get() ));
+ if (xAccCell.is())
+ pAccCell = xAccCell.get();
+ }
+ }
+ }
+ }
+ return pAccCell;
+}
+//--------------------------------------------------------------------
+//If current active cell is in editing, the focus state should be set to internal text
+sal_Bool AccessibleTableShape::SetState (sal_Int16 aState)
+{
+ AccessibleCell* pActiveAccessibleCell = GetActiveAccessibleCell();
+ sal_Bool bStateHasChanged = sal_False;
+ if (aState == AccessibleStateType::FOCUSED && pActiveAccessibleCell != NULL)
+ {
+ return pActiveAccessibleCell->SetState(aState);
+ }
+ else
+ bStateHasChanged = AccessibleShape::SetState (aState);
+ return bStateHasChanged;
+}
+//--------------------------------------------------------------------
+//If current active cell is in editing, the focus state should be reset to internal text
+sal_Bool AccessibleTableShape::ResetState (sal_Int16 aState)
+{
+ AccessibleCell* pActiveAccessibleCell = GetActiveAccessibleCell();
+ sal_Bool bStateHasChanged = sal_False;
+ if (aState == AccessibleStateType::FOCUSED && pActiveAccessibleCell != NULL)
+ {
+ return pActiveAccessibleCell->ResetState(aState);
+ }
+ else
+ bStateHasChanged = AccessibleShape::ResetState (aState);
+ return bStateHasChanged;
+}
+//--------------------------------------------------------------------
+sal_Bool AccessibleTableShape::SetStateDirectly (sal_Int16 aState)
+{
+ return AccessibleContextBase::SetState (aState);
+}
+//--------------------------------------------------------------------
+sal_Bool AccessibleTableShape::ResetStateDirectly (sal_Int16 aState)
+{
+ return AccessibleContextBase::ResetState (aState);
+}
+//-----IAccessibility2 Implementation 2009
void AccessibleTableShape::checkCellPosition( sal_Int32 nCol, sal_Int32 nRow ) throw ( IndexOutOfBoundsException )
{
if( (nCol >= 0) && (nRow >= 0) && mxImpl->mxTable.is() && (nCol < mxImpl->mxTable->getColumnCount()) && (nRow < mxImpl->mxTable->getRowCount()) )
@@ -716,4 +1118,333 @@ void AccessibleTableShape::checkCellPosi
throw IndexOutOfBoundsException();
}
+//IAccessibility2 Implementation 2009-----
+AccessibleTableHeaderShape::AccessibleTableHeaderShape( AccessibleTableShape* pTable, sal_Bool bRow )
+{
+ mpTable = pTable;
+ mbRow = bRow;
+}
+
+AccessibleTableHeaderShape::~AccessibleTableHeaderShape (void)
+{
+ mpTable = NULL;
+}
+
+// XAccessible
+Reference< XAccessibleContext > SAL_CALL AccessibleTableHeaderShape::getAccessibleContext(void) throw (RuntimeException)
+{
+ return this;
+}
+
+// XAccessibleContext
+sal_Int32 SAL_CALL AccessibleTableHeaderShape::getAccessibleChildCount( ) throw(RuntimeException)
+{
+ return getAccessibleRowCount() * getAccessibleColumnCount();
+}
+
+Reference< XAccessible > SAL_CALL AccessibleTableHeaderShape::getAccessibleChild( sal_Int32 i ) throw(IndexOutOfBoundsException, RuntimeException)
+{
+ return mpTable->getAccessibleChild( i );
+}
+
+Reference< XAccessible > SAL_CALL AccessibleTableHeaderShape::getAccessibleParent (void) throw (RuntimeException)
+{
+ Reference< XAccessible > XParent;
+ return XParent;
+}
+
+sal_Int32 SAL_CALL AccessibleTableHeaderShape::getAccessibleIndexInParent (void) throw (RuntimeException)
+{
+ return -1;
+}
+
+sal_Int16 SAL_CALL AccessibleTableHeaderShape::getAccessibleRole (void) throw (RuntimeException)
+{
+ return mpTable->getAccessibleRole();
+}
+
+OUString SAL_CALL AccessibleTableHeaderShape::getAccessibleDescription (void) throw (RuntimeException)
+{
+ return mpTable->getAccessibleDescription();
+}
+
+OUString SAL_CALL AccessibleTableHeaderShape::getAccessibleName (void) throw (RuntimeException)
+{
+ return mpTable->getAccessibleName();
+}
+
+Reference< XAccessibleStateSet > SAL_CALL AccessibleTableHeaderShape::getAccessibleStateSet (void) throw (RuntimeException)
+{
+ return mpTable->getAccessibleStateSet();
+}
+
+Reference< XAccessibleRelationSet > SAL_CALL AccessibleTableHeaderShape::getAccessibleRelationSet (void) throw (RuntimeException)
+{
+ return mpTable->getAccessibleRelationSet();
+}
+
+Locale SAL_CALL AccessibleTableHeaderShape::getLocale (void) throw (IllegalAccessibleComponentStateException, RuntimeException)
+{
+ return mpTable->getLocale();
+}
+
+//XAccessibleComponent
+sal_Bool SAL_CALL AccessibleTableHeaderShape::containsPoint ( const ::com::sun::star::awt::Point& aPoint ) throw (RuntimeException)
+{
+ return mpTable->containsPoint( aPoint );
+}
+
+Reference< XAccessible > SAL_CALL AccessibleTableHeaderShape::getAccessibleAtPoint ( const ::com::sun::star::awt::Point& aPoint) throw (RuntimeException)
+{
+ return mpTable->getAccessibleAtPoint( aPoint );
+}
+
+::com::sun::star::awt::Rectangle SAL_CALL AccessibleTableHeaderShape::getBounds (void) throw (RuntimeException)
+{
+ return mpTable->getBounds();
+}
+
+::com::sun::star::awt::Point SAL_CALL AccessibleTableHeaderShape::getLocation (void) throw (RuntimeException)
+{
+ return mpTable->getLocation();
+}
+
+::com::sun::star::awt::Point SAL_CALL AccessibleTableHeaderShape::getLocationOnScreen (void) throw (RuntimeException)
+{
+ return mpTable->getLocationOnScreen();
+}
+
+::com::sun::star::awt::Size SAL_CALL AccessibleTableHeaderShape::getSize (void) throw (RuntimeException)
+{
+ return mpTable->getSize();
+}
+
+sal_Int32 SAL_CALL AccessibleTableHeaderShape::getForeground (void) throw (RuntimeException)
+{
+ return mpTable->getForeground();
+}
+
+sal_Int32 SAL_CALL AccessibleTableHeaderShape::getBackground (void) throw (RuntimeException)
+{
+ return mpTable->getBackground();
+}
+
+void SAL_CALL AccessibleTableHeaderShape::grabFocus (void) throw (RuntimeException)
+{
+ mpTable->grabFocus();
+}
+//===== XAccessibleTable ============================================
+
+sal_Int32 SAL_CALL AccessibleTableHeaderShape::getAccessibleRowCount() throw (RuntimeException)
+{
+ return mbRow ? 1 : mpTable->getAccessibleRowCount();
+}
+
+sal_Int32 SAL_CALL AccessibleTableHeaderShape::getAccessibleColumnCount() throw (RuntimeException)
+{
+ return !mbRow ? 1 : mpTable->getAccessibleColumnCount();
+}
+
+OUString SAL_CALL AccessibleTableHeaderShape::getAccessibleRowDescription( sal_Int32 nRow ) throw (IndexOutOfBoundsException, RuntimeException)
+{
+ return mpTable->getAccessibleRowDescription( nRow );
+}
+
+OUString SAL_CALL AccessibleTableHeaderShape::getAccessibleColumnDescription( sal_Int32 nColumn ) throw (IndexOutOfBoundsException, RuntimeException)
+{
+ return mpTable->getAccessibleColumnDescription( nColumn );
+}
+
+sal_Int32 SAL_CALL AccessibleTableHeaderShape::getAccessibleRowExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) throw (IndexOutOfBoundsException, RuntimeException)
+{
+ return mpTable->getAccessibleRowExtentAt( nRow, nColumn );
+}
+
+sal_Int32 SAL_CALL AccessibleTableHeaderShape::getAccessibleColumnExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) throw (IndexOutOfBoundsException, RuntimeException)
+{
+ return mpTable->getAccessibleColumnExtentAt( nRow, nColumn );
+}
+
+Reference< XAccessibleTable > SAL_CALL AccessibleTableHeaderShape::getAccessibleRowHeaders( ) throw (RuntimeException)
+{
+ Reference< XAccessibleTable > xRet;
+ return xRet;
+}
+
+Reference< XAccessibleTable > SAL_CALL AccessibleTableHeaderShape::getAccessibleColumnHeaders( ) throw (RuntimeException)
+{
+ Reference< XAccessibleTable > xRet;
+ return xRet;
+}
+
+Sequence< sal_Int32 > SAL_CALL AccessibleTableHeaderShape::getSelectedAccessibleRows( ) throw (RuntimeException)
+{
+ sal_Int32 nRow = getAccessibleRowCount();
+ ::std::vector< sal_Bool > aSelected( nRow, sal_True );
+ sal_Int32 nCount = nRow;
+ for( sal_Int32 i = 0; i < nRow; i++ )
+ {
+ try
+ {
+ aSelected[i] = isAccessibleRowSelected( i );
+ }
+ catch( ... )
+ {
+ return Sequence< sal_Int32 >();
+ }
+
+ if( !aSelected[i] )
+ nCount--;
+ }
+ Sequence < sal_Int32 > aRet( nCount );
+ sal_Int32 *pRet = aRet.getArray();
+ sal_Int32 nPos = 0;
+ size_t nSize = aSelected.size();
+ for( size_t i=0; i < nSize && nPos < nCount; i++ )
+ {
+ if( aSelected[i] )
+ {
+ *pRet++ = i;
+ nPos++;
+ }
+ }
+
+ return aRet;
+}
+
+Sequence< sal_Int32 > SAL_CALL AccessibleTableHeaderShape::getSelectedAccessibleColumns( ) throw (RuntimeException)
+{
+ sal_Int32 nColumn = getAccessibleColumnCount();
+ ::std::vector< sal_Bool > aSelected( nColumn, sal_True );
+ sal_Int32 nCount = nColumn;
+ for( sal_Int32 i = 0; i < nColumn; i++ )
+ {
+ try
+ {
+ aSelected[i] = isAccessibleColumnSelected( i );
+ }
+ catch( ... )
+ {
+ return Sequence< sal_Int32 >();
+ }
+
+ if( !aSelected[i] )
+ nCount--;
+ }
+ Sequence < sal_Int32 > aRet( nCount );
+ sal_Int32 *pRet = aRet.getArray();
+ sal_Int32 nPos = 0;
+ size_t nSize = aSelected.size();
+ for( size_t i=0; i < nSize && nPos < nCount; i++ )
+ {
+ if( aSelected[i] )
+ {
+ *pRet++ = i;
+ nPos++;
+ }
+ }
+
+ return aRet;
+}
+
+sal_Bool SAL_CALL AccessibleTableHeaderShape::isAccessibleRowSelected( sal_Int32 nRow ) throw (IndexOutOfBoundsException, RuntimeException)
+{
+ return mpTable->isAccessibleRowSelected( nRow );
+}
+
+sal_Bool SAL_CALL AccessibleTableHeaderShape::isAccessibleColumnSelected( sal_Int32 nColumn ) throw (IndexOutOfBoundsException, RuntimeException)
+{
+ return mpTable->isAccessibleColumnSelected( nColumn );
+}
+
+Reference< XAccessible > SAL_CALL AccessibleTableHeaderShape::getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) throw (IndexOutOfBoundsException, RuntimeException)
+{
+ return mpTable->getAccessibleCellAt( nRow, nColumn );
+}
+
+Reference< XAccessible > SAL_CALL AccessibleTableHeaderShape::getAccessibleCaption( ) throw (RuntimeException)
+{
+ return mpTable->getAccessibleCaption();
+}
+
+Reference< XAccessible > SAL_CALL AccessibleTableHeaderShape::getAccessibleSummary( ) throw (RuntimeException)
+{
+ return mpTable->getAccessibleSummary();
+}
+
+sal_Bool SAL_CALL AccessibleTableHeaderShape::isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) throw (IndexOutOfBoundsException, RuntimeException)
+{
+ return mpTable->isAccessibleSelected( nRow, nColumn );
+}
+
+sal_Int32 SAL_CALL AccessibleTableHeaderShape::getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) throw (IndexOutOfBoundsException, RuntimeException)
+{
+ return mpTable->getAccessibleIndex( nRow, nColumn );
+}
+
+sal_Int32 SAL_CALL AccessibleTableHeaderShape::getAccessibleRow( sal_Int32 nChildIndex ) throw (IndexOutOfBoundsException, RuntimeException)
+{
+ return mpTable->getAccessibleRow( nChildIndex );
+}
+
+sal_Int32 SAL_CALL AccessibleTableHeaderShape::getAccessibleColumn( sal_Int32 nChildIndex ) throw (IndexOutOfBoundsException, RuntimeException)
+{
+ return mpTable->getAccessibleColumn( nChildIndex );
+}
+
+//===== XAccessibleTableSelection ============================================
+sal_Bool SAL_CALL AccessibleTableHeaderShape::selectRow( sal_Int32 row )
+throw (IndexOutOfBoundsException, RuntimeException)
+{
+ if( mbRow )
+ return mpTable->selectRow( row );
+ else
+ {
+ mpTable->clearAccessibleSelection();
+ sal_Int32 nIndex = mpTable->getAccessibleIndex( row, 0 );
+ mpTable->selectAccessibleChild( nIndex );
+ return sal_True;
+ }
+}
+
+sal_Bool SAL_CALL AccessibleTableHeaderShape::selectColumn( sal_Int32 column )
+throw (IndexOutOfBoundsException, RuntimeException)
+{
+ if( !mbRow )
+ return mpTable->selectColumn( column );
+ else
+ {
+ mpTable->clearAccessibleSelection();
+ sal_Int32 nIndex = mpTable->getAccessibleIndex( 0, column );
+ mpTable->selectAccessibleChild( nIndex );
+ return sal_True;
+ }
+}
+
+sal_Bool SAL_CALL AccessibleTableHeaderShape::unselectRow( sal_Int32 row )
+throw (IndexOutOfBoundsException, RuntimeException)
+{
+ if( mbRow )
+ return mpTable->unselectRow( row );
+ else
+ {
+ sal_Int32 nIndex = mpTable->getAccessibleIndex( row, 0 );
+ mpTable->deselectAccessibleChild( nIndex );
+ return sal_True;
+ }
+}
+
+sal_Bool SAL_CALL AccessibleTableHeaderShape::unselectColumn( sal_Int32 column )
+throw (IndexOutOfBoundsException, RuntimeException)
+{
+ if( !mbRow )
+ return mpTable->unselectColumn( column );
+ else
+ {
+ sal_Int32 nIndex = mpTable->getAccessibleIndex( 0, column );
+ mpTable->deselectAccessibleChild( nIndex );
+ return sal_True;
+ }
+}
+//-----IAccessibility2 Implementation 2009
}
Modified: openoffice/branches/ia2/main/svx/source/table/tablecontroller.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/svx/source/table/tablecontroller.cxx?rev=1463840&r1=1463839&r2=1463840&view=diff
==============================================================================
--- openoffice/branches/ia2/main/svx/source/table/tablecontroller.cxx (original)
+++ openoffice/branches/ia2/main/svx/source/table/tablecontroller.cxx Wed Apr 3 07:04:20 2013
@@ -2611,4 +2611,90 @@ IMPL_LINK( SvxTableController, UpdateHdl
return 0;
}
+//IAccessibility2 Implementation 2009-----
+sal_Bool SvxTableController::selectRow( sal_Int32 row )
+{
+ if( !mxTable.is() )
+ return sal_False;
+ CellPos aStart( 0, row ), aEnd( mxTable->getColumnCount() - 1, row );
+ StartSelection( aEnd );
+ gotoCell( aStart, true, 0 );
+ return sal_True;
+}
+sal_Bool SvxTableController::selectColumn( sal_Int32 column )
+{
+ if( !mxTable.is() )
+ return sal_False;
+ CellPos aStart( column, 0 ), aEnd( column, mxTable->getRowCount() - 1 );
+ StartSelection( aEnd );
+ gotoCell( aStart, true, 0 );
+ return sal_True;
+}
+sal_Bool SvxTableController::deselectRow( sal_Int32 row )
+{
+ if( !mxTable.is() )
+ return sal_False;
+ CellPos aStart( 0, row ), aEnd( mxTable->getColumnCount() - 1, row );
+ StartSelection( aEnd );
+ gotoCell( aStart, false, 0 );
+ return sal_True;
+}
+sal_Bool SvxTableController::deselectColumn( sal_Int32 column )
+{
+ if( !mxTable.is() )
+ return sal_False;
+ CellPos aStart( column, 0 ), aEnd( column, mxTable->getRowCount() - 1 );
+ StartSelection( aEnd );
+ gotoCell( aStart, false, 0 );
+ return sal_True;
+}
+sal_Bool SvxTableController::isRowSelected( sal_Int32 nRow )
+{
+ if( hasSelectedCells() )
+ {
+ CellPos aFirstPos, aLastPos;
+ getSelectedCells( aFirstPos, aLastPos );
+ if( (aFirstPos.mnCol == 0) && (nRow >= aFirstPos.mnRow && nRow <= aLastPos.mnRow) && (mxTable->getColumnCount() - 1 == aLastPos.mnCol) )
+ return sal_True;
+ }
+ return sal_False;
+}
+sal_Bool SvxTableController::isColumnSelected( sal_Int32 nColumn )
+{
+ if( hasSelectedCells() )
+ {
+ CellPos aFirstPos, aLastPos;
+ getSelectedCells( aFirstPos, aLastPos );
+ if( (aFirstPos.mnRow == 0) && (nColumn >= aFirstPos.mnCol && nColumn <= aLastPos.mnCol) && (mxTable->getRowCount() - 1 == aLastPos.mnRow) )
+ return sal_True;
+ }
+ return sal_False;
+}
+
+sal_Bool SvxTableController::isRowHeader()
+{
+ SdrTableObj* pTableObj = dynamic_cast< ::sdr::table::SdrTableObj* >( mxTableObj.get() );
+ SdrModel* pModel = pTableObj ? pTableObj->GetModel() : 0;
+
+ if( !pTableObj || !pModel )
+ return sal_False;
+
+ TableStyleSettings aSettings( pTableObj->getTableStyleSettings() );
+
+ return aSettings.mbUseFirstRow;
+}
+
+sal_Bool SvxTableController::isColumnHeader()
+{
+ SdrTableObj* pTableObj = dynamic_cast< ::sdr::table::SdrTableObj* >( mxTableObj.get() );
+ SdrModel* pModel = pTableObj ? pTableObj->GetModel() : 0;
+
+ if( !pTableObj || !pModel )
+ return sal_False;
+
+ TableStyleSettings aSettings( pTableObj->getTableStyleSettings() );
+
+ return aSettings.mbUseFirstColumn;
+}
+//-----IAccessibility2 Implementation 2009
} }
Modified: openoffice/branches/ia2/main/svx/source/table/tablecontroller.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/svx/source/table/tablecontroller.hxx?rev=1463840&r1=1463839&r2=1463840&view=diff
==============================================================================
--- openoffice/branches/ia2/main/svx/source/table/tablecontroller.hxx (original)
+++ openoffice/branches/ia2/main/svx/source/table/tablecontroller.hxx Wed Apr 3 07:04:20 2013
@@ -100,6 +100,19 @@ public:
SVX_DLLPRIVATE void onTableModified();
+//IAccessibility2 Implementation 2009-----
+ sal_Bool selectRow( sal_Int32 row );
+ sal_Bool selectColumn( sal_Int32 column );
+ sal_Bool deselectRow( sal_Int32 row );
+ sal_Bool deselectColumn( sal_Int32 column );
+ sal_Bool isRowSelected( sal_Int32 nRow );
+ sal_Bool isColumnSelected( sal_Int32 nColumn );
+ sal_Bool isRowHeader();
+ sal_Bool isColumnHeader();
+ ::sdr::table::SdrTableObj* GetTableObj() { return dynamic_cast< ::sdr::table::SdrTableObj* >( mxTableObj.get() ); }
+ //Sym2_6158, declare event notification method
+ void NotifySelection( const CellPos& firstPos, const CellPos& lastPos, const CellPos& newPos );
+//-----IAccessibility2 Implementation 2009
private:
SvxTableController(SvxTableController &); // not defined
void operator =(SvxTableController &); // not defined
@@ -142,7 +155,10 @@ private:
DECL_LINK( UpdateHdl, void * );
- TableModelRef mxTable;
+ //IAccessibility2 Implementation 2009-----
+ //TableModelRef mxTable;
+ rtl::Reference< TableModel > mxTable;
+ //-----IAccessibility2 Implementation 2009
CellPos maCursorFirstPos;
CellPos maCursorLastPos;
Modified: openoffice/branches/ia2/main/svx/source/unodraw/unoprov.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/svx/source/unodraw/unoprov.cxx?rev=1463840&r1=1463839&r2=1463840&view=diff
==============================================================================
--- openoffice/branches/ia2/main/svx/source/unodraw/unoprov.cxx (original)
+++ openoffice/branches/ia2/main/svx/source/unodraw/unoprov.cxx Wed Apr 3 07:04:20 2013
@@ -776,6 +776,9 @@ SfxItemPropertyMapEntry* ImplGetSvxTable
{ MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_MOVEPROTECT), SDRATTR_OBJMOVEPROTECT, &::getBooleanCppuType(),0, 0},
{ MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_SIZEPROTECT), SDRATTR_OBJSIZEPROTECT, &::getBooleanCppuType(),0, 0},
{ MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_BOUNDRECT), OWN_ATTR_BOUNDRECT, &::getCppuType((const ::com::sun::star::awt::Rectangle*)0), ::com::sun::star::beans::PropertyAttribute::READONLY, 0},
+ //IAccessibility2 Implementation 2009-----, the name property of table should also be exported.
+ { MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_NAME), SDRATTR_OBJECTNAME , &::getCppuType((const ::rtl::OUString*)0), 0, 0},
+ //-----IAccessibility2 Implementation 2009
{ MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_TITLE), OWN_ATTR_MISC_OBJ_TITLE , &::getCppuType((const ::rtl::OUString*)0), 0, 0},
{ MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_DESCRIPTION), OWN_ATTR_MISC_OBJ_DESCRIPTION , &::getCppuType((const ::rtl::OUString*)0), 0, 0},
{ MAP_CHAR_LEN("Model"), OWN_ATTR_OLEMODEL , &::com::sun::star::table::XTable::static_type(), ::com::sun::star::beans::PropertyAttribute::READONLY, 0},
Modified: openoffice/branches/ia2/main/svx/source/unodraw/unoshtxt.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/svx/source/unodraw/unoshtxt.cxx?rev=1463840&r1=1463839&r2=1463840&view=diff
==============================================================================
--- openoffice/branches/ia2/main/svx/source/unodraw/unoshtxt.cxx (original)
+++ openoffice/branches/ia2/main/svx/source/unodraw/unoshtxt.cxx Wed Apr 3 07:04:20 2013
@@ -51,6 +51,12 @@
#include <com/sun/star/linguistic2/XLinguServiceManager.hpp>
#include <comphelper/processfactory.hxx>
#include <vos/mutex.hxx>
+
+//IAccessibility2 Implementation 2009-----
+#include <svx/svdotable.hxx>
+#include <../table/cell.hxx>
+//-----IAccessibility2 Implementation 2009
+
#include <svx/sdrpaintwindow.hxx>
using namespace ::osl;
@@ -385,6 +391,29 @@ void SvxTextEditSourceImpl::Notify( SfxB
case HINT_BEGEDIT:
if( mpObject == pSdrHint->GetObject() )
{
+ //IAccessibility2 Implementation 2009-----, one EditSource object is created for each AccessibleCell, and it will monitor the hint.
+ // Once HINT_BEGEDIT is broadcast, each EditSource of AccessibleCell will handle it here and
+ // call below: mpView->GetTextEditOutliner()->SetNotifyHdl(), which will replace the Notifer for current
+ // editable cell. It is totally wrong. So add check here to avoid the incorrect replacement of notifer.
+ // To be safe, add accessibility check here because currently it only happen on the editsource of AccessibleCell
+ if (Application::IsAccessibilityEnabled())
+ {
+ if (mpObject && mpText)
+ {
+ sdr::table::SdrTableObj* pTableObj = PTR_CAST( sdr::table::SdrTableObj, mpObject );
+ if(pTableObj)
+ {
+ sdr::table::CellRef xCell = pTableObj->getActiveCell();
+ if (xCell.is())
+ {
+ sdr::table::Cell* pCellObj = dynamic_cast< sdr::table::Cell* >( mpText );
+ if (pCellObj && xCell.get() != pCellObj)
+ break;
+ }
+ }
+ }
+ }
+ //-----IAccessibility2 Implementation 2009
// invalidate old forwarder
if( !mbForwarderIsEditMode )
{
|