openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1543609 [10/32] - in /openoffice/branches/l10n40/main: ./ accessibility/inc/accessibility/extended/ accessibility/inc/accessibility/helper/ accessibility/inc/accessibility/standard/ accessibility/source/extended/ accessibility/source/helpe...
Date Tue, 19 Nov 2013 22:39:57 GMT
Modified: openoffice/branches/l10n40/main/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx (original)
+++ openoffice/branches/l10n40/main/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx Tue Nov 19 22:39:40 2013
@@ -50,12 +50,212 @@
 #include <tools/debug.hxx>
 #include <tools/gen.hxx>
 #include <svtools/colorcfg.hxx>
-
+//IAccessibility2 Implementation 2009-----
+#include "scresid.hxx"
+#include "sc.hrc"
+//-----IAccessibility2 Implementation 2009
 #include <algorithm>
 
 using namespace	::com::sun::star;
 using namespace	::com::sun::star::accessibility;
 
+//IAccessibility2 Implementation 2009-----
+bool CompMinCol(const std::pair<sal_uInt16,sal_uInt16> & pc1,const std::pair<sal_uInt16,sal_uInt16>  &pc2)
+{
+    return pc1.first < pc2.first;
+}
+ScMyAddress ScAccessibleSpreadsheet::CalcScAddressFromRangeList(ScRangeList *pMarkedRanges,sal_Int32 nSelectedChildIndex)
+{
+    if (pMarkedRanges->Count() <= 1)
+    {
+        ScRange* pRange = pMarkedRanges->First();
+        if (pRange)
+        {
+			// MT IA2: Not used.
+            // const int nRowNum = pRange->aEnd.Row() - pRange->aStart.Row() + 1;
+            const int nColNum = pRange->aEnd.Col() - pRange->aStart.Col() + 1;
+            const int nCurCol = nSelectedChildIndex % nColNum;
+            const int nCurRow = (nSelectedChildIndex - nCurCol)/nColNum;
+            return ScMyAddress(static_cast<SCCOL>(pRange->aStart.Col() + nCurCol), pRange->aStart.Row() + nCurRow, maActiveCell.Tab());
+        }
+    }
+    else
+    {
+        sal_Int32 nMinRow = MAXROW;
+        sal_Int32 nMaxRow = 0;
+        m_vecTempRange.clear();
+        ScRange* pRange = pMarkedRanges->First();
+        while (pRange)
+        {
+            if (pRange->aStart.Tab() != pRange->aEnd.Tab())
+            {
+                if ((maActiveCell.Tab() >= pRange->aStart.Tab()) ||
+                    maActiveCell.Tab() <= pRange->aEnd.Tab())
+                {
+                    m_vecTempRange.push_back(pRange);
+                    nMinRow = std::min(pRange->aStart.Row(),nMinRow);
+                    nMaxRow = std::max(pRange->aEnd.Row(),nMaxRow);
+                }
+                else
+                    DBG_ERROR("Range of wrong table");
+            }
+            else if(pRange->aStart.Tab() == maActiveCell.Tab())
+            {
+                m_vecTempRange.push_back(pRange);
+                nMinRow = std::min(pRange->aStart.Row(),nMinRow);
+                nMaxRow = std::max(pRange->aEnd.Row(),nMaxRow);
+            }
+            else
+                DBG_ERROR("Range of wrong table");
+            pRange = pMarkedRanges->Next();
+        }
+        int nCurrentIndex = 0 ;
+        for(sal_Int32 row = nMinRow ; row <= nMaxRow ; ++row)
+        {
+            m_vecTempCol.clear();
+            {
+                VEC_RANGE::const_iterator vi = m_vecTempRange.begin();
+                for (; vi < m_vecTempRange.end(); ++vi)
+                {
+                    ScRange *p = *vi;
+                    if ( row >= p->aStart.Row() && row <= p->aEnd.Row())
+                    {
+                        m_vecTempCol.push_back(std::make_pair(p->aStart.Col(),p->aEnd.Col()));
+                    }
+                }
+            }
+            std::sort(m_vecTempCol.begin(),m_vecTempCol.end(),CompMinCol);
+            {
+                VEC_COL::const_iterator vic = m_vecTempCol.begin();
+                for(; vic != m_vecTempCol.end(); ++vic)
+                {
+                    const PAIR_COL &pariCol = *vic;
+                    sal_uInt16 nCol = pariCol.second - pariCol.first + 1;
+                    if (nCol + nCurrentIndex > nSelectedChildIndex)
+                    {
+                        return ScMyAddress(static_cast<SCCOL>(pariCol.first + nSelectedChildIndex - nCurrentIndex), row, maActiveCell.Tab());
+                    }
+                    nCurrentIndex += nCol;
+                }
+            }
+        }
+    }
+    return ScMyAddress(0,0,maActiveCell.Tab());
+}
+sal_Bool ScAccessibleSpreadsheet::CalcScRangeDifferenceMax(ScRange *pSrc,ScRange *pDest,int nMax,VEC_MYADDR &vecRet,int &nSize)
+{
+    //Src Must be :Src > Dest
+    if (pDest->In(*pSrc))
+    {//Here is Src In Dest,Src <= Dest
+        return sal_False;
+    }
+	if (!pDest->Intersects(*pSrc))
+	{
+		int nCellCount = sal_uInt32(pDest->aEnd.Col() - pDest->aStart.Col() + 1)
+			* sal_uInt32(pDest->aEnd.Row() - pDest->aStart.Row() + 1)
+			* sal_uInt32(pDest->aEnd.Tab() - pDest->aStart.Tab() + 1);
+		if (nCellCount + nSize > nMax)
+		{
+			return sal_True;
+		}
+		else if(nCellCount > 0)
+		{
+			nCellCount +=nSize;
+			for (sal_Int32 row = pDest->aStart.Row(); row <=  pDest->aEnd.Row();++row)
+			{
+				for (sal_uInt16 col = pDest->aStart.Col(); col <=  pDest->aEnd.Col();++col)
+				{
+					vecRet.push_back(ScMyAddress(col,row,pDest->aStart.Tab()));
+				}
+			}
+		}
+		return sal_False;
+	}
+	sal_Int32 nMinRow = pSrc->aStart.Row(); 
+	sal_Int32 nMaxRow = pSrc->aEnd.Row();
+	for (; nMinRow <= nMaxRow ; ++nMinRow,--nMaxRow)
+	{
+		for (sal_uInt16 col = pSrc->aStart.Col(); col <=  pSrc->aEnd.Col();++col)
+		{
+			if (nSize > nMax)
+			{
+				return sal_True;
+			}
+			ScMyAddress cell(col,nMinRow,pSrc->aStart.Tab());
+			if(!pDest->In(cell))
+			{//In Src ,Not In Dest
+				vecRet.push_back(cell);
+				++nSize;
+			}
+		}
+		if (nMinRow != nMaxRow)
+		{
+			for (sal_uInt16 col = pSrc->aStart.Col(); col <=  pSrc->aEnd.Col();++col)
+			{
+				if (nSize > nMax)
+				{
+					return sal_True;
+				}
+				ScMyAddress cell(col,nMaxRow,pSrc->aStart.Tab());
+				if(!pDest->In(cell))
+				{//In Src ,Not In Dest
+					vecRet.push_back(cell);
+					++nSize;
+				}
+			}
+		}
+	}
+    return sal_False;
+}
+//In Src , Not in Dest
+sal_Bool ScAccessibleSpreadsheet::CalcScRangeListDifferenceMax(ScRangeList *pSrc,ScRangeList *pDest,int nMax,VEC_MYADDR &vecRet)
+{
+    if (pSrc == NULL || pDest == NULL)
+    {
+        return sal_False;
+    }
+    int nSize =0;
+    if (pDest->GetCellCount() == 0)//if the Dest Rang List is empty
+    {
+        if (pSrc->GetCellCount() > sal_uInt32(nMax))//if the Src Cell count is greater then  nMax
+        {
+            return sal_True;
+        }
+        //now the cell count is less then nMax
+        vecRet.reserve(10);
+        ScRange* pRange = pSrc->First();
+        while (pRange)
+        {
+            for (sal_Int32 row = pRange->aStart.Row(); row <=  pRange->aEnd.Row();++row)
+            {
+                for (sal_uInt16 col = pRange->aStart.Col(); col <=  pRange->aEnd.Col();++col)
+                {
+                    vecRet.push_back(ScMyAddress(col,row,pRange->aStart.Tab()));
+                }
+            }
+            pRange = pSrc->Next();
+        }
+        return sal_False;
+    }
+    //the Dest Rang List is not empty
+    vecRet.reserve(10);
+    ScRange* pRange = pSrc->First();
+    while (pRange)
+    {
+        ScRange* pRangeDest = pDest->First();
+        while (pRangeDest)
+        {   
+            if (CalcScRangeDifferenceMax(pRange,pRangeDest,nMax,vecRet,nSize))
+            {
+                return sal_True;
+            }
+            pRangeDest = pDest->Next();
+        }
+        pRange = pSrc->Next();
+    }
+    return sal_False;
+}
+//-----IAccessibility2 Implementation 2009
 //=====  internal  ============================================================
 
 ScAccessibleSpreadsheet::ScAccessibleSpreadsheet(
@@ -66,7 +266,13 @@ ScAccessibleSpreadsheet::ScAccessibleSpr
 	:
 	ScAccessibleTableBase (pAccDoc, GetDocument(pViewShell),
         ScRange(ScAddress(0, 0, nTab),ScAddress(MAXCOL, MAXROW, nTab))),
-    mbIsSpreadsheet( sal_True )
+    mbIsSpreadsheet( sal_True ),
+//IAccessibility2 Implementation 2009-----
+	m_bFormulaMode(sal_False),
+	m_bFormulaLastMode(sal_False),
+	m_pAccFormulaCell(NULL),
+	m_nMinX(0),m_nMaxX(0),m_nMinY(0),m_nMaxY(0)
+//-----IAccessibility2 Implementation 2009
 {
     ConstructScAccessibleSpreadsheet( pAccDoc, pViewShell, nTab, eSplitPos );
 }
@@ -83,8 +289,10 @@ ScAccessibleSpreadsheet::~ScAccessibleSp
 {
 	if (mpMarkedRanges)
 		delete mpMarkedRanges;
-	if (mpSortedMarkedCells)
-		delete mpSortedMarkedCells;
+//IAccessibility2 Implementation 2009-----
+	//if (mpSortedMarkedCells)
+	//	delete mpSortedMarkedCells;
+//-----IAccessibility2 Implementation 2009
 	if (mpViewShell)
 		mpViewShell->RemoveAccessibilityObject(*this);
 }
@@ -118,7 +326,14 @@ void ScAccessibleSpreadsheet::ConstructS
         mpAccCell = GetAccessibleCellAt(maActiveCell.Row(), maActiveCell.Col());
         mpAccCell->acquire();
         mpAccCell->Init();
-    }
+		//IAccessibility2 Implementation 2009-----
+		ScDocument* pScDoc= GetDocument(mpViewShell);
+		if (pScDoc)
+		{
+			pScDoc->GetName( maActiveCell.Tab(), m_strOldTabName );
+		}
+		//-----IAccessibility2 Implementation 2009
+    }	
 }
 
 void SAL_CALL ScAccessibleSpreadsheet::disposing()
@@ -140,11 +355,18 @@ void SAL_CALL ScAccessibleSpreadsheet::d
 
 void ScAccessibleSpreadsheet::CompleteSelectionChanged(sal_Bool bNewState)
 {
+//IAccessibility2 Implementation 2009-----
+	if (IsFormulaMode())
+	{
+		return ;
+	}
+//-----IAccessibility2 Implementation 2009
 	if (mpMarkedRanges)
 		DELETEZ(mpMarkedRanges);
-	if (mpSortedMarkedCells)
-		DELETEZ(mpSortedMarkedCells);
-
+//IAccessibility2 Implementation 2009-----
+	//if (mpSortedMarkedCells)
+	//	DELETEZ(mpSortedMarkedCells);
+//-----IAccessibility2 Implementation 2009
 	mbHasSelection = bNewState;
 
     AccessibleEventObject aEvent;
@@ -173,12 +395,46 @@ void ScAccessibleSpreadsheet::LostFocus(
 
 void ScAccessibleSpreadsheet::GotFocus()
 {
-    CommitFocusGained();
-
+//IAccessibility2 Implementation 2009-----
+    //CommitFocusGained();
+//-----IAccessibility2 Implementation 2009
 	AccessibleEventObject aEvent;
 	aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED;
 	aEvent.Source = uno::Reference< XAccessibleContext >(this);
-    uno::Reference< XAccessible > xNew = mpAccCell;
+//IAccessibility2 Implementation 2009-----
+    //uno::Reference< XAccessible > xNew = mpAccCell;
+    uno::Reference< XAccessible > xNew;
+	if (IsFormulaMode())
+	{
+		if (!m_pAccFormulaCell || !m_bFormulaLastMode)
+		{
+			ScAddress aFormulaAddr;
+			if(!GetFormulaCurrentFocusCell(aFormulaAddr))
+			{
+				return;
+			}
+			m_pAccFormulaCell = GetAccessibleCellAt(aFormulaAddr.Row(),aFormulaAddr.Col());
+
+			m_pAccFormulaCell->acquire();
+			m_pAccFormulaCell->Init();
+
+
+		}
+	    xNew = m_pAccFormulaCell;
+	}
+	else
+	{
+		if(mpAccCell->GetCellAddress() == maActiveCell)
+		{
+			xNew = mpAccCell;
+		}
+		else
+		{
+			CommitFocusCell(maActiveCell);
+			return ;
+		}		
+	}
+//-----IAccessibility2 Implementation 2009
 	aEvent.NewValue <<= xNew;
 
 	CommitChange(aEvent);
@@ -210,58 +466,247 @@ void ScAccessibleSpreadsheet::Notify( Sf
 	{
 		const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint;
 		// only notify if child exist, otherwise it is not necessary
+//IAccessibility2 Implementation 2009-----		
+		//if ((rRef.GetId() == SC_HINT_ACC_CURSORCHANGED))
+		//{
+		//	if (mpViewShell)
+		//	{
+		//		ScAddress aNewCell = mpViewShell->GetViewData()->GetCurPos();
+		//		sal_Bool bNewMarked(mpViewShell->GetViewData()->GetMarkData().GetTableSelect(aNewCell.Tab()) &&
+		//			(mpViewShell->GetViewData()->GetMarkData().IsMarked() ||
+		//			mpViewShell->GetViewData()->GetMarkData().IsMultiMarked()));
+		//		sal_Bool bNewCellSelected(isAccessibleSelected(aNewCell.Row(), aNewCell.Col()));
+		//		if ((bNewMarked != mbHasSelection) ||
+		//			(!bNewCellSelected && bNewMarked) ||
+		//			(bNewCellSelected && mbHasSelection))
+		//		{
+		//			if (mpMarkedRanges)
+		//				DELETEZ(mpMarkedRanges);
+		//			if (mpSortedMarkedCells)
+		//				DELETEZ(mpSortedMarkedCells);
+		//			AccessibleEventObject aEvent;
+		//			aEvent.EventId = AccessibleEventId::SELECTION_CHANGED;
+		//			aEvent.Source = uno::Reference< XAccessibleContext >(this);
+
+		//			mbHasSelection = bNewMarked;
+
+		//			CommitChange(aEvent);
+		//		}
+
+  //              // active descendant changed event (new cell selected)
+  //              bool bFireActiveDescChanged = (aNewCell != maActiveCell) &&
+  //                  (aNewCell.Tab() == maActiveCell.Tab()) && IsFocused();
+
+  //              /*  Remember old active cell and set new active cell.
+  //                  #i82409# always update the class members mpAccCell and
+  //                  maActiveCell, even if the sheet is not focused, e.g. when
+  //                  using the name box in the toolbar. */
+  //              uno::Reference< XAccessible > xOld = mpAccCell;
+  //              mpAccCell->release();
+  //              mpAccCell = GetAccessibleCellAt(aNewCell.Row(), aNewCell.Col());
+  //              mpAccCell->acquire();
+  //              mpAccCell->Init();
+  //              uno::Reference< XAccessible > xNew = mpAccCell;
+  //              maActiveCell = aNewCell;
+
+  //              // #i14108# fire event only if sheet is focused
+  //              if( bFireActiveDescChanged )
+  //              {
+  //                  AccessibleEventObject aEvent;
+  //                  aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED;
+  //                  aEvent.Source = uno::Reference< XAccessibleContext >(this);
+  //                  aEvent.OldValue <<= xOld;
+  //                  aEvent.NewValue <<= xNew;
+		//			CommitChange(aEvent);
+  //              }
+		//	}
+		//}
+		//else if ((rRef.GetId() == SC_HINT_DATACHANGED))
+		//{
+		//	if (!mbDelIns)
+		//		CommitTableModelChange(maRange.aStart.Row(), maRange.aStart.Col(), maRange.aEnd.Row(), maRange.aEnd.Col(), AccessibleTableModelChangeType::UPDATE);
+		//	else
+		//		mbDelIns = sal_False;
+		//}
 		if ((rRef.GetId() == SC_HINT_ACC_CURSORCHANGED))
 		{
 			if (mpViewShell)
 			{
-				ScAddress aNewCell = mpViewShell->GetViewData()->GetCurPos();
-				sal_Bool bNewMarked(mpViewShell->GetViewData()->GetMarkData().GetTableSelect(aNewCell.Tab()) &&
-					(mpViewShell->GetViewData()->GetMarkData().IsMarked() ||
-					mpViewShell->GetViewData()->GetMarkData().IsMultiMarked()));
-				sal_Bool bNewCellSelected(isAccessibleSelected(aNewCell.Row(), aNewCell.Col()));
-				if ((bNewMarked != mbHasSelection) ||
-					(!bNewCellSelected && bNewMarked) ||
-					(bNewCellSelected && mbHasSelection))
-				{
-					if (mpMarkedRanges)
-						DELETEZ(mpMarkedRanges);
-					if (mpSortedMarkedCells)
-						DELETEZ(mpSortedMarkedCells);
-					AccessibleEventObject aEvent;
-					aEvent.EventId = AccessibleEventId::SELECTION_CHANGED;
-					aEvent.Source = uno::Reference< XAccessibleContext >(this);
+				ScViewData *pViewData = mpViewShell->GetViewData();
 
-					mbHasSelection = bNewMarked;
+				m_bFormulaMode = pViewData->IsRefMode() || SC_MOD()->IsFormulaMode();
+				if ( m_bFormulaMode )
+				{
+					NotifyRefMode();
+					m_bFormulaLastMode = true;
+					return ;
+				}
+				if (m_bFormulaLastMode)
+				{//Last Notify Mode  Is Formula Mode.
+					m_vecFormulaLastMyAddr.clear();
+					RemoveFormulaSelection(sal_True);
+					if(m_pAccFormulaCell)
+					{
+						m_pAccFormulaCell->release();
+						m_pAccFormulaCell =NULL;
+					}
+					//Remove All Selection
+				}
+				m_bFormulaLastMode = m_bFormulaMode;
 
+				AccessibleEventObject aEvent;
+				aEvent.Source = uno::Reference< XAccessible >(this);
+				ScAddress aNewCell = pViewData->GetCurPos();
+				if(aNewCell.Tab() != maActiveCell.Tab())
+				{
+					aEvent.EventId = AccessibleEventId::PAGE_CHANGED;
+					ScAccessibleDocument *pAccDoc = 
+						static_cast<ScAccessibleDocument*>(getAccessibleParent().get());
+					if(pAccDoc)
+					{
+						pAccDoc->CommitChange(aEvent);
+					}
+				}
+				sal_Bool bNewPosCell = (aNewCell != maActiveCell);
+				sal_Bool bNewPosCellFocus=sal_False;
+				if ( bNewPosCell && IsFocused() && aNewCell.Tab() == maActiveCell.Tab() )
+				{//single Focus
+					bNewPosCellFocus=sal_True;
+				}
+				ScMarkData &refScMarkData = pViewData->GetMarkData();
+				// MT IA2: Not used
+				// int nSelCount = refScMarkData.GetSelectCount();
+				sal_Bool bIsMark =refScMarkData.IsMarked();
+				sal_Bool bIsMultMark = refScMarkData.IsMultiMarked();
+				sal_Bool bNewMarked = refScMarkData.GetTableSelect(aNewCell.Tab()) && ( bIsMark || bIsMultMark );				
+//				sal_Bool bNewCellSelected = isAccessibleSelected(aNewCell.Row(), aNewCell.Col());
+				sal_uInt16 nTab = pViewData->GetTabNo();
+				ScRange aMarkRange;
+				refScMarkData.GetMarkArea(aMarkRange);
+				aEvent.OldValue <<= ::com::sun::star::uno::Any();
+				//Mark All
+				if ( !bNewPosCellFocus && 
+					(bNewMarked || bIsMark || bIsMultMark ) &&
+					aMarkRange == ScRange( 0,0,nTab, MAXCOL,MAXROW,nTab ) )
+				{
+					aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_WITHIN;
+					aEvent.NewValue <<= ::com::sun::star::uno::Any();
 					CommitChange(aEvent);
+					return ;
+				}					
+				if (!mpMarkedRanges)
+				{
+					mpMarkedRanges = new ScRangeList();
+				}				
+				refScMarkData.FillRangeListWithMarks(mpMarkedRanges, sal_True);
+	
+				//For Whole Col Row  
+				sal_Bool bWholeRow = ::labs(aMarkRange.aStart.Row() - aMarkRange.aEnd.Row()) == MAXROW ;
+				sal_Bool bWholeCol = ::abs(aMarkRange.aStart.Col() - aMarkRange.aEnd.Col()) == MAXCOL ;
+				if ((bNewMarked || bIsMark || bIsMultMark ) && (bWholeCol || bWholeRow))
+				{
+					if ( aMarkRange != m_aLastWithInMarkRange )
+					{
+						RemoveSelection(refScMarkData);						
+						if(bNewPosCell)
+						{
+							CommitFocusCell(aNewCell);
+						}
+						sal_Bool bLastIsWholeColRow = 
+						::labs(m_aLastWithInMarkRange.aStart.Row() - m_aLastWithInMarkRange.aEnd.Row()) == MAXROW && bWholeRow || 
+						::abs(m_aLastWithInMarkRange.aStart.Col() - m_aLastWithInMarkRange.aEnd.Col()) == MAXCOL && bWholeCol ;
+						sal_Bool bSelSmaller= 
+							bLastIsWholeColRow && 
+							!aMarkRange.In(m_aLastWithInMarkRange) && 
+							aMarkRange.Intersects(m_aLastWithInMarkRange);
+						if( !bSelSmaller )
+						{
+							aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_WITHIN;
+							aEvent.NewValue <<= ::com::sun::star::uno::Any();
+							CommitChange(aEvent);
+						}
+						m_aLastWithInMarkRange = aMarkRange;
+					}
+					return ;
 				}
-
-                // active descendant changed event (new cell selected)
-                bool bFireActiveDescChanged = (aNewCell != maActiveCell) &&
-                    (aNewCell.Tab() == maActiveCell.Tab()) && IsFocused();
-
-                /*  Remember old active cell and set new active cell.
-                    #i82409# always update the class members mpAccCell and
-                    maActiveCell, even if the sheet is not focused, e.g. when
-                    using the name box in the toolbar. */
-                uno::Reference< XAccessible > xOld = mpAccCell;
-                mpAccCell->release();
-                mpAccCell = GetAccessibleCellAt(aNewCell.Row(), aNewCell.Col());
-                mpAccCell->acquire();
-                mpAccCell->Init();
-                uno::Reference< XAccessible > xNew = mpAccCell;
-                maActiveCell = aNewCell;
-
-                // #i14108# fire event only if sheet is focused
-                if( bFireActiveDescChanged )
-                {
-                    AccessibleEventObject aEvent;
-                    aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED;
-                    aEvent.Source = uno::Reference< XAccessibleContext >(this);
-                    aEvent.OldValue <<= xOld;
-                    aEvent.NewValue <<= xNew;
+				m_aLastWithInMarkRange = aMarkRange;
+				int nNewMarkCount = mpMarkedRanges->GetCellCount();
+				sal_Bool bSendSingle= (0 == nNewMarkCount) && bNewPosCell;
+				if (bSendSingle)
+				{
+					RemoveSelection(refScMarkData);
+					if(bNewPosCellFocus)
+					{
+						CommitFocusCell(aNewCell);
+					}
+					uno::Reference< XAccessible > xChild ;
+					if (bNewPosCellFocus)
+					{
+						xChild = mpAccCell;
+					}
+					else
+					{
+						xChild = getAccessibleCellAt(aNewCell.Row(),aNewCell.Col());
+						
+						maActiveCell = aNewCell;
+						aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED_NOFOCUS;							
+						aEvent.NewValue <<= xChild;
+						aEvent.OldValue <<= uno::Reference< XAccessible >();
+						CommitChange(aEvent);
+					}
+					aEvent.EventId = AccessibleEventId::SELECTION_CHANGED;
+					aEvent.NewValue <<= xChild;
 					CommitChange(aEvent);
-                }
+					OSL_ASSERT(m_mapSelectionSend.count(aNewCell) == 0 );
+					m_mapSelectionSend.insert(MAP_ADDR_XACC::value_type(aNewCell,xChild));
+					
+				}
+				else
+				{
+					ScRange aDelRange;
+					sal_Bool bIsDel = pViewData->GetDelMark( aDelRange );
+					if ( (!bIsDel || (bIsDel && aMarkRange != aDelRange)) && 
+						bNewMarked && 
+						nNewMarkCount > 0 && 
+						!IsSameMarkCell() )
+					{
+						RemoveSelection(refScMarkData);						
+						if(bNewPosCellFocus)
+						{
+							CommitFocusCell(aNewCell);
+						}
+						VEC_MYADDR vecNew;
+                        if(CalcScRangeListDifferenceMax(mpMarkedRanges,&m_LastMarkedRanges,10,vecNew))
+						{
+							aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_WITHIN;
+							aEvent.NewValue <<= ::com::sun::star::uno::Any();
+							CommitChange(aEvent);
+						}
+						else
+						{
+							VEC_MYADDR::iterator viAddr = vecNew.begin(); 
+							for(; viAddr < vecNew.end() ; ++viAddr )
+							{
+								uno::Reference< XAccessible > xChild = getAccessibleCellAt(viAddr->Row(),viAddr->Col());
+								if (!(bNewPosCellFocus && *viAddr == aNewCell) )
+								{
+									aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED_NOFOCUS;							
+									aEvent.NewValue <<= xChild;							
+									CommitChange(aEvent);
+								}
+								aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_ADD;
+								aEvent.NewValue <<= xChild;
+								CommitChange(aEvent);
+								m_mapSelectionSend.insert(MAP_ADDR_XACC::value_type(*viAddr,xChild));
+							}
+						}	
+					}
+				}
+				if (bNewPosCellFocus && maActiveCell != aNewCell)
+				{
+					CommitFocusCell(aNewCell);
+				}
+                m_LastMarkedRanges = *mpMarkedRanges;		
 			}
 		}
 		else if ((rRef.GetId() == SC_HINT_DATACHANGED))
@@ -270,7 +715,41 @@ void ScAccessibleSpreadsheet::Notify( Sf
 				CommitTableModelChange(maRange.aStart.Row(), maRange.aStart.Col(), maRange.aEnd.Row(), maRange.aEnd.Col(), AccessibleTableModelChangeType::UPDATE);
 			else
 				mbDelIns = sal_False;
-		}
+            ScViewData *pViewData = mpViewShell->GetViewData();
+            ScAddress aNewCell = pViewData->GetCurPos();
+            if( maActiveCell == aNewCell)
+            {
+                ScDocument* pScDoc= GetDocument(mpViewShell);
+                if (pScDoc)
+                {
+                    String valStr;
+                    pScDoc->GetString(aNewCell.Col(),aNewCell.Row(),aNewCell.Tab(), valStr);
+                    if(m_strCurCellValue != valStr)
+                    {
+                        AccessibleEventObject aEvent;
+                        aEvent.EventId = AccessibleEventId::VALUE_CHANGED;
+                        mpAccCell->CommitChange(aEvent);
+                        m_strCurCellValue=valStr;
+                    }
+					String tabName;
+					pScDoc->GetName( maActiveCell.Tab(), tabName );
+					if( m_strOldTabName != tabName )
+					{
+						AccessibleEventObject aEvent;
+                        aEvent.EventId = AccessibleEventId::NAME_CHANGED;
+						String sOldName(ScResId(STR_ACC_TABLE_NAME));
+						sOldName.SearchAndReplaceAscii("%1", m_strOldTabName);
+						aEvent.OldValue <<= ::rtl::OUString( sOldName );
+						String sNewName(ScResId(STR_ACC_TABLE_NAME));
+						sNewName.SearchAndReplaceAscii("%1", tabName);
+						aEvent.NewValue <<= ::rtl::OUString( sNewName );
+						CommitChange( aEvent );
+						m_strOldTabName = tabName;
+					}
+                }
+            }
+        }
+//-----IAccessibility2 Implementation 2009
         // no longer needed, because the document calls the VisAreaChanged method
 /*		else if (rRef.GetId() == SC_HINT_ACC_VISAREACHANGED)
 		{
@@ -371,7 +850,62 @@ void ScAccessibleSpreadsheet::Notify( Sf
 
 	ScAccessibleTableBase::Notify(rBC, rHint);
 }
-
+//IAccessibility2 Implementation 2009-----
+void ScAccessibleSpreadsheet::RemoveSelection(ScMarkData &refScMarkData)
+{
+	AccessibleEventObject aEvent;
+	aEvent.Source = uno::Reference< XAccessible >(this);
+	aEvent.OldValue <<= ::com::sun::star::uno::Any();
+	MAP_ADDR_XACC::iterator miRemove = m_mapSelectionSend.begin();
+	for(;  miRemove != m_mapSelectionSend.end() ;)
+	{
+		if (refScMarkData.IsCellMarked(miRemove->first.Col(),miRemove->first.Row(),sal_True) ||
+			refScMarkData.IsCellMarked(miRemove->first.Col(),miRemove->first.Row(),sal_False) )
+		{
+			++miRemove;
+			continue;
+		}
+		aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_REMOVE;
+		aEvent.NewValue <<= miRemove->second;							
+		CommitChange(aEvent);
+		MAP_ADDR_XACC::iterator miNext = miRemove;
+		++miNext;
+		m_mapSelectionSend.erase(miRemove);
+		miRemove = miNext;
+	}
+}
+void ScAccessibleSpreadsheet::CommitFocusCell(const ScAddress &aNewCell)
+{
+	OSL_ASSERT(!IsFormulaMode());
+	if(IsFormulaMode())
+	{
+		return ;
+	}
+	AccessibleEventObject aEvent;
+	aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED;
+	aEvent.Source = uno::Reference< XAccessible >(this);
+	uno::Reference< XAccessible > xOld = mpAccCell;
+	mpAccCell->release();
+	mpAccCell=NULL;
+	aEvent.OldValue <<= xOld;
+	mpAccCell = GetAccessibleCellAt(aNewCell.Row(), aNewCell.Col());
+	mpAccCell->acquire();
+	mpAccCell->Init();
+	uno::Reference< XAccessible > xNew = mpAccCell;
+	aEvent.NewValue <<= xNew;
+	maActiveCell = aNewCell;
+    ScDocument* pScDoc= GetDocument(mpViewShell);
+    if (pScDoc)
+    {
+        pScDoc->GetString(maActiveCell.Col(),maActiveCell.Row(),maActiveCell.Tab(), m_strCurCellValue);
+    }
+	CommitChange(aEvent);
+}
+sal_Bool ScAccessibleSpreadsheet::IsSameMarkCell()
+{
+    return m_LastMarkedRanges == *mpMarkedRanges;
+}
+//-----IAccessibility2 Implementation 2009
 	//=====  XAccessibleTable  ================================================
 
 uno::Reference< XAccessibleTable > SAL_CALL ScAccessibleSpreadsheet::getAccessibleRowHeaders(  )
@@ -418,6 +952,12 @@ uno::Sequence< sal_Int32 > SAL_CALL ScAc
 	ScUnoGuard aGuard;
     IsObjectValid();
 	uno::Sequence<sal_Int32> aSequence;
+//IAccessibility2 Implementation 2009-----
+	if (IsFormulaMode())
+	{
+		return aSequence;
+	}
+//-----IAccessibility2 Implementation 2009
 	if (mpViewShell && mpViewShell->GetViewData())
 	{
 		aSequence.realloc(maRange.aEnd.Row() - maRange.aStart.Row() + 1);
@@ -445,6 +985,12 @@ uno::Sequence< sal_Int32 > SAL_CALL ScAc
 	ScUnoGuard aGuard;
     IsObjectValid();
 	uno::Sequence<sal_Int32> aSequence;
+//IAccessibility2 Implementation 2009-----
+	if (IsFormulaMode())
+	{
+		return aSequence;
+	}
+//-----IAccessibility2 Implementation 2009
 	if (mpViewShell && mpViewShell->GetViewData())
 	{
 		aSequence.realloc(maRange.aEnd.Col() - maRange.aStart.Col() + 1);
@@ -471,6 +1017,12 @@ sal_Bool SAL_CALL ScAccessibleSpreadshee
 {
 	ScUnoGuard aGuard;
     IsObjectValid();
+//IAccessibility2 Implementation 2009-----
+	if (IsFormulaMode())
+	{
+		return sal_False;
+	}
+//-----IAccessibility2 Implementation 2009
 
     if ((nRow > (maRange.aEnd.Row() - maRange.aStart.Row())) || (nRow < 0))
         throw lang::IndexOutOfBoundsException();
@@ -490,6 +1042,12 @@ sal_Bool SAL_CALL ScAccessibleSpreadshee
 	ScUnoGuard aGuard;
     IsObjectValid();
 
+//IAccessibility2 Implementation 2009-----
+	if (IsFormulaMode())
+	{
+		return sal_False;
+	}
+//-----IAccessibility2 Implementation 2009
     if ((nColumn > (maRange.aEnd.Col() - maRange.aStart.Col())) || (nColumn < 0))
         throw lang::IndexOutOfBoundsException();
 
@@ -505,6 +1063,20 @@ sal_Bool SAL_CALL ScAccessibleSpreadshee
 ScAccessibleCell* ScAccessibleSpreadsheet::GetAccessibleCellAt(sal_Int32 nRow, sal_Int32 nColumn)
 {
     ScAccessibleCell* pAccessibleCell = NULL;
+//IAccessibility2 Implementation 2009-----
+	if (IsFormulaMode())
+	{
+		ScAddress aCellAddress(static_cast<SCCOL>(nColumn), nRow, mpViewShell->GetViewData()->GetTabNo());
+		if ((aCellAddress == m_aFormulaActiveCell) && m_pAccFormulaCell)
+		{
+			pAccessibleCell = m_pAccFormulaCell;
+		}
+		else
+			pAccessibleCell = new ScAccessibleCell(this, mpViewShell, aCellAddress, GetAccessibleIndexFormula(nRow, nColumn), meSplitPos, mpAccDoc);
+	}
+	else
+	{
+//-----IAccessibility2 Implementation 2009
 	ScAddress aCellAddress(static_cast<SCCOL>(maRange.aStart.Col() + nColumn),
 		static_cast<SCROW>(maRange.aStart.Row() + nRow), maRange.aStart.Tab());
     if ((aCellAddress == maActiveCell) && mpAccCell)
@@ -513,6 +1085,7 @@ ScAccessibleCell* ScAccessibleSpreadshee
     }
     else
 	    pAccessibleCell = new ScAccessibleCell(this, mpViewShell, aCellAddress, getAccessibleIndex(nRow, nColumn), meSplitPos, mpAccDoc);
+	}
 
     return pAccessibleCell;
 }
@@ -522,12 +1095,16 @@ uno::Reference< XAccessible > SAL_CALL S
 {
 	ScUnoGuard aGuard;
     IsObjectValid();
+//IAccessibility2 Implementation 2009-----
+	if (!IsFormulaMode())
+	{
     if (nRow > (maRange.aEnd.Row() - maRange.aStart.Row()) ||
         nRow < 0 ||
         nColumn > (maRange.aEnd.Col() - maRange.aStart.Col()) ||
         nColumn < 0)
         throw lang::IndexOutOfBoundsException();
-
+	}
+//-----IAccessibility2 Implementation 2009
     uno::Reference<XAccessible> xAccessible;
     ScAccessibleCell* pAccessibleCell = GetAccessibleCellAt(nRow, nColumn);
     xAccessible = pAccessibleCell;
@@ -541,6 +1118,13 @@ sal_Bool SAL_CALL ScAccessibleSpreadshee
 	ScUnoGuard aGuard;
     IsObjectValid();
 
+//IAccessibility2 Implementation 2009-----
+	if (IsFormulaMode())
+	{
+		ScAddress addr(static_cast<SCCOL>(nColumn), nRow, 0);
+		return IsScAddrFormulaSel(addr);
+	}
+//-----IAccessibility2 Implementation 2009
     if ((nColumn > (maRange.aEnd.Col() - maRange.aStart.Col())) || (nColumn < 0) ||
         (nRow > (maRange.aEnd.Row() - maRange.aStart.Row())) || (nRow < 0))
         throw lang::IndexOutOfBoundsException();
@@ -570,7 +1154,15 @@ uno::Reference< XAccessible > SAL_CALL S
 		    SCsCOL nX;
             SCsROW nY;
 		    mpViewShell->GetViewData()->GetPosFromPixel( rPoint.X, rPoint.Y, meSplitPos, nX, nY);
+//IAccessibility2 Implementation 2009-----
+			try{
 		    xAccessible = getAccessibleCellAt(nY, nX);
+			}
+			catch( ::com::sun::star::lang::IndexOutOfBoundsException e)
+			{
+				return NULL;
+			}
+//-----IAccessibility2 Implementation 2009
 	    }
     }
 	return xAccessible;
@@ -678,6 +1270,9 @@ void SAL_CALL
     IsObjectValid();
 	if (mpViewShell)
 	{
+//IAccessibility2 Implementation 2009-----
+		if (!IsFormulaMode())
+//-----IAccessibility2 Implementation 2009
 		mpViewShell->Unmark();
 	}
 }
@@ -690,6 +1285,17 @@ void SAL_CALL
     IsObjectValid();
 	if (mpViewShell)
 	{
+//IAccessibility2 Implementation 2009-----
+		if (IsFormulaMode())
+		{
+			ScViewData *pViewData = mpViewShell->GetViewData();		
+			mpViewShell->InitRefMode( 0, 0, pViewData->GetTabNo(), SC_REFTYPE_REF );
+			pViewData->SetRefStart(0,0,pViewData->GetTabNo());
+			pViewData->SetRefStart(MAXCOL,MAXROW,pViewData->GetTabNo());
+			mpViewShell->UpdateRef(MAXCOL, MAXROW, pViewData->GetTabNo());
+		}
+		else
+//-----IAccessibility2 Implementation 2009
 		mpViewShell->SelectAll();
 	}
 }
@@ -703,16 +1309,27 @@ sal_Int32 SAL_CALL
 	sal_Int32 nResult(0);
 	if (mpViewShell)
 	{
+//IAccessibility2 Implementation 2009-----
+		if (IsFormulaMode())
+		{
+			nResult =  GetRowAll() * GetColAll() ;
+		}
+		else
+		{		
+//-----IAccessibility2 Implementation 2009
 		if (!mpMarkedRanges)
 		{
 			mpMarkedRanges = new ScRangeList();
             ScMarkData aMarkData(mpViewShell->GetViewData()->GetMarkData());
-            aMarkData.MarkToMulti();
+//IAccessibility2 Implementation 2009-----
+            //aMarkData.MarkToMulti();
+//-----IAccessibility2 Implementation 2009
 			aMarkData.FillRangeListWithMarks(mpMarkedRanges, sal_False);
 		}
 		// is possible, because there shouldn't be overlapped ranges in it
 		if (mpMarkedRanges)
 			nResult = mpMarkedRanges->GetCellCount();
+		}
 	}
 	return nResult;
 }
@@ -724,6 +1341,17 @@ uno::Reference<XAccessible > SAL_CALL
 	ScUnoGuard aGuard;
     IsObjectValid();
 	uno::Reference < XAccessible > xAccessible;
+//IAccessibility2 Implementation 2009-----
+	if (IsFormulaMode())
+	{
+		if(CheckChildIndex(nSelectedChildIndex))
+		{
+			ScAddress addr = GetChildIndexAddress(nSelectedChildIndex);
+			xAccessible = getAccessibleCellAt(addr.Row(), addr.Col());
+		}
+		return xAccessible;
+	}
+//-----IAccessibility2 Implementation 2009
 	if (mpViewShell)
 	{
 		if (!mpMarkedRanges)
@@ -733,16 +1361,27 @@ uno::Reference<XAccessible > SAL_CALL
 		}
 		if (mpMarkedRanges)
 		{
-			if (!mpSortedMarkedCells)
-				CreateSortedMarkedCells();
-			if (mpSortedMarkedCells)
-			{
-				if ((nSelectedChildIndex < 0) ||
-					(mpSortedMarkedCells->size() <= static_cast<sal_uInt32>(nSelectedChildIndex)))
-					throw lang::IndexOutOfBoundsException();
-				else
-					xAccessible = getAccessibleCellAt((*mpSortedMarkedCells)[nSelectedChildIndex].Row(), (*mpSortedMarkedCells)[nSelectedChildIndex].Col());
+//IAccessibility2 Implementation 2009-----
+			//if (!mpSortedMarkedCells)
+			//	CreateSortedMarkedCells();
+			//if (mpSortedMarkedCells)
+			//{
+			//	if ((nSelectedChildIndex < 0) ||
+			//		(mpSortedMarkedCells->size() <= static_cast<sal_uInt32>(nSelectedChildIndex)))
+			//		throw lang::IndexOutOfBoundsException();
+			//	else
+			//		xAccessible = getAccessibleCellAt((*mpSortedMarkedCells)[nSelectedChildIndex].Row(), (*mpSortedMarkedCells)[nSelectedChildIndex].Col());
+			if ((nSelectedChildIndex < 0) ||
+					(mpMarkedRanges->GetCellCount() <= static_cast<sal_uInt32>(nSelectedChildIndex)))
+			{
+				throw lang::IndexOutOfBoundsException();
 			}
+			ScMyAddress addr = CalcScAddressFromRangeList(mpMarkedRanges,nSelectedChildIndex);
+			if( m_mapSelectionSend.find(addr) != m_mapSelectionSend.end() )
+				xAccessible = m_mapSelectionSend[addr];
+			else			
+				xAccessible = getAccessibleCellAt(addr.Row(), addr.Col());
+//-----IAccessibility2 Implementation 2009
 		}
 	}
 	return xAccessible;
@@ -763,6 +1402,18 @@ void SAL_CALL
 		sal_Int32 nCol(getAccessibleColumn(nChildIndex));
 		sal_Int32 nRow(getAccessibleRow(nChildIndex));
 
+//IAccessibility2 Implementation 2009-----
+		if (IsFormulaMode())
+		{
+			if(IsScAddrFormulaSel(
+				ScAddress(static_cast<SCCOL>(nCol), nRow,mpViewShell->GetViewData()->GetTabNo()))
+				)
+			{
+				SelectCell(nRow, nCol, sal_True);
+			}
+			return ;
+		}
+//-----IAccessibility2 Implementation 2009
 		if (mpViewShell->GetViewData()->GetMarkData().IsCellMarked(static_cast<SCCOL>(nCol), static_cast<SCROW>(nRow)))
 			SelectCell(nRow, nCol, sal_True);
 	}
@@ -770,6 +1421,23 @@ void SAL_CALL
 
 void ScAccessibleSpreadsheet::SelectCell(sal_Int32 nRow, sal_Int32 nCol, sal_Bool bDeselect)
 {
+//IAccessibility2 Implementation 2009-----
+	if (IsFormulaMode())
+	{
+		if (bDeselect)
+		{//??
+			return ;
+		}
+		else
+		{
+			ScViewData *pViewData = mpViewShell->GetViewData();
+
+			mpViewShell->InitRefMode( static_cast<SCCOL>(nCol), nRow, pViewData->GetTabNo(), SC_REFTYPE_REF );
+			mpViewShell->UpdateRef(static_cast<SCCOL>(nCol), nRow, pViewData->GetTabNo());
+		}
+		return ;
+	}
+//-----IAccessibility2 Implementation 2009
 	mpViewShell->SetTabNo( maRange.aStart.Tab() );
 
 	mpViewShell->DoneBlockMode( sal_True ); // continue selecting
@@ -777,41 +1445,41 @@ void ScAccessibleSpreadsheet::SelectCell
 
 	mpViewShell->SelectionChanged();
 }
+//IAccessibility2 Implementation 2009-----
+//void ScAccessibleSpreadsheet::CreateSortedMarkedCells()
+//{
+//	mpSortedMarkedCells = new std::vector<ScMyAddress>();
+//	mpSortedMarkedCells->reserve(mpMarkedRanges->GetCellCount());
+//	ScRange* pRange = mpMarkedRanges->First();
+//	while (pRange)
+//	{
+//		if (pRange->aStart.Tab() != pRange->aEnd.Tab())
+//		{
+//			if ((maActiveCell.Tab() >= pRange->aStart.Tab()) ||
+//				maActiveCell.Tab() <= pRange->aEnd.Tab())
+//			{
+//				ScRange aRange(*pRange);
+//				aRange.aStart.SetTab(maActiveCell.Tab());
+//				aRange.aEnd.SetTab(maActiveCell.Tab());
+//				AddMarkedRange(aRange);
+//			}
+//			else
+//			{
+//				DBG_ERROR("Range of wrong table");
+//			}
+//		}
+//		else if(pRange->aStart.Tab() == maActiveCell.Tab())
+//			AddMarkedRange(*pRange);
+//		else
+//		{
+//			DBG_ERROR("Range of wrong table");
+//		}
+//		pRange = mpMarkedRanges->Next();
+//	}
+//	std::sort(mpSortedMarkedCells->begin(), mpSortedMarkedCells->end());
+//}
 
-void ScAccessibleSpreadsheet::CreateSortedMarkedCells()
-{
-	mpSortedMarkedCells = new std::vector<ScMyAddress>();
-	mpSortedMarkedCells->reserve(mpMarkedRanges->GetCellCount());
-	ScRange* pRange = mpMarkedRanges->First();
-	while (pRange)
-	{
-		if (pRange->aStart.Tab() != pRange->aEnd.Tab())
-		{
-			if ((maActiveCell.Tab() >= pRange->aStart.Tab()) ||
-				maActiveCell.Tab() <= pRange->aEnd.Tab())
-			{
-				ScRange aRange(*pRange);
-				aRange.aStart.SetTab(maActiveCell.Tab());
-				aRange.aEnd.SetTab(maActiveCell.Tab());
-				AddMarkedRange(aRange);
-			}
-			else
-			{
-				DBG_ERROR("Range of wrong table");
-			}
-		}
-		else if(pRange->aStart.Tab() == maActiveCell.Tab())
-			AddMarkedRange(*pRange);
-		else
-		{
-			DBG_ERROR("Range of wrong table");
-		}
-		pRange = mpMarkedRanges->Next();
-	}
-	std::sort(mpSortedMarkedCells->begin(), mpSortedMarkedCells->end());
-}
-
-void ScAccessibleSpreadsheet::AddMarkedRange(const ScRange& rRange)
+/*void ScAccessibleSpreadsheet::AddMarkedRange(const ScRange& rRange)
 {
 	for (SCROW nRow = rRange.aStart.Row(); nRow <= rRange.aEnd.Row(); ++nRow)
 	{
@@ -821,7 +1489,8 @@ void ScAccessibleSpreadsheet::AddMarkedR
 			mpSortedMarkedCells->push_back(aCell);
 		}
 	}
-}
+}*/
+//-----IAccessibility2 Implementation 2009
 
 	//=====  XServiceInfo  ====================================================
 
@@ -871,7 +1540,8 @@ void SAL_CALL ScAccessibleSpreadsheet::a
     IsObjectValid();
     ScAccessibleTableBase::addEventListener(xListener);
 
-    if (!mbIsFocusSend)
+//IAccessibility2 Implementation 2009-----
+/*    if (!mbIsFocusSend)
     {
         mbIsFocusSend = sal_True;
         CommitFocusGained();
@@ -883,6 +1553,8 @@ void SAL_CALL ScAccessibleSpreadsheet::a
 
 		CommitChange(aEvent);
     }
+*/
+//-----IAccessibility2 Implementation 2009
 }
 
 	//====  internal  =========================================================
@@ -924,6 +1596,12 @@ sal_Bool ScAccessibleSpreadsheet::IsDefu
 sal_Bool ScAccessibleSpreadsheet::IsEditable(
     const uno::Reference<XAccessibleStateSet>& /* rxParentStates */)
 {
+//IAccessibility2 Implementation 2009-----
+	if (IsFormulaMode())
+	{
+		return sal_False;
+	}
+//-----IAccessibility2 Implementation 2009
 	sal_Bool bProtected(sal_False);
 	if (mpDoc && mpDoc->IsTabProtected(maRange.aStart.Tab()))
 		bProtected = sal_True;
@@ -943,6 +1621,12 @@ sal_Bool ScAccessibleSpreadsheet::IsFocu
 
 sal_Bool ScAccessibleSpreadsheet::IsCompleteSheetSelected()
 {
+//IAccessibility2 Implementation 2009-----
+	if (IsFormulaMode())
+	{
+		return sal_False;
+	}
+//-----IAccessibility2 Implementation 2009
 	sal_Bool bResult(sal_False);
 	if(mpViewShell)
 	{
@@ -993,3 +1677,277 @@ Rectangle ScAccessibleSpreadsheet::GetVi
 	else
 		return Rectangle();
 }
+//IAccessibility2 Implementation 2009-----
+sal_Bool SAL_CALL ScAccessibleSpreadsheet::selectRow( sal_Int32 row ) 
+throw (lang::IndexOutOfBoundsException, uno::RuntimeException) 
+{
+	if (IsFormulaMode())
+	{
+		return sal_False;
+	}
+
+	mpViewShell->SetTabNo( maRange.aStart.Tab() );
+	mpViewShell->DoneBlockMode( sal_True ); // continue selecting
+	mpViewShell->InitBlockMode( 0, row, maRange.aStart.Tab(), sal_False, sal_False, sal_True );
+	mpViewShell->MarkCursor( MAXCOL, row, maRange.aStart.Tab(), sal_False, sal_True );
+	mpViewShell->SelectionChanged();
+	return sal_True;
+}
+
+sal_Bool SAL_CALL ScAccessibleSpreadsheet::selectColumn( sal_Int32 column ) 
+		throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+{
+	if (IsFormulaMode())
+	{
+		return sal_False;
+	}
+
+	mpViewShell->SetTabNo( maRange.aStart.Tab() );
+	mpViewShell->DoneBlockMode( sal_True ); // continue selecting
+	mpViewShell->InitBlockMode( static_cast<SCCOL>(column), 0, maRange.aStart.Tab(), sal_False, sal_True, sal_False );
+	mpViewShell->MarkCursor( static_cast<SCCOL>(column), MAXROW, maRange.aStart.Tab(), sal_True, sal_False );	
+    mpViewShell->SelectionChanged();
+	return sal_True;
+}
+
+sal_Bool SAL_CALL ScAccessibleSpreadsheet::unselectRow( sal_Int32 row ) 
+		throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+{	
+	if (IsFormulaMode())
+	{
+		return sal_False;
+	}
+
+	mpViewShell->SetTabNo( maRange.aStart.Tab() );
+	mpViewShell->DoneBlockMode( sal_True ); // continue selecting
+	mpViewShell->InitBlockMode( 0, row, maRange.aStart.Tab(), sal_False, sal_False, sal_True, sal_True );
+	mpViewShell->MarkCursor( MAXCOL, row, maRange.aStart.Tab(), sal_False, sal_True );	
+	mpViewShell->SelectionChanged();
+	mpViewShell->DoneBlockMode( sal_True );
+	return sal_True;
+}
+
+sal_Bool SAL_CALL ScAccessibleSpreadsheet::unselectColumn( sal_Int32 column ) 
+		throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+{	
+	if (IsFormulaMode())
+	{
+		return sal_False;
+	}
+
+	mpViewShell->SetTabNo( maRange.aStart.Tab() );
+	mpViewShell->DoneBlockMode( sal_True ); // continue selecting
+	mpViewShell->InitBlockMode( static_cast<SCCOL>(column), 0, maRange.aStart.Tab(), sal_False, sal_True, sal_False, sal_True );
+	mpViewShell->MarkCursor( static_cast<SCCOL>(column), MAXROW, maRange.aStart.Tab(), sal_True, sal_False );	
+	mpViewShell->SelectionChanged();		
+	mpViewShell->DoneBlockMode( sal_True );
+	return sal_True;
+}
+
+void ScAccessibleSpreadsheet::FireFirstCellFocus()
+{	
+	if (IsFormulaMode())
+	{
+		return ;
+	}
+	if (mbIsFocusSend)
+	{
+		return ;
+	}
+	mbIsFocusSend = sal_True;
+	AccessibleEventObject aEvent;
+	aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED;
+	aEvent.Source = uno::Reference< XAccessible >(this);
+	aEvent.NewValue <<= getAccessibleCellAt(maActiveCell.Row(), maActiveCell.Col());
+	CommitChange(aEvent);
+}
+void ScAccessibleSpreadsheet::NotifyRefMode()
+{
+	ScViewData *pViewData = mpViewShell->GetViewData();
+	sal_uInt16 nRefStartX =pViewData->GetRefStartX();
+	sal_Int32 nRefStartY=pViewData->GetRefStartY();
+	sal_uInt16 nRefEndX=pViewData->GetRefEndX(); 
+	sal_Int32 nRefEndY=pViewData->GetRefEndY(); 
+	ScAddress aFormulaAddr;
+	if(!GetFormulaCurrentFocusCell(aFormulaAddr))
+	{
+		return ;
+	}
+	if (m_aFormulaActiveCell != aFormulaAddr)
+	{//New Focus
+		m_nMinX =std::min(nRefStartX,nRefEndX);
+		m_nMaxX =std::max(nRefStartX,nRefEndX);
+		m_nMinY = std::min(nRefStartY,nRefEndY);
+		m_nMaxY = std::max(nRefStartY,nRefEndY);
+		RemoveFormulaSelection();
+		AccessibleEventObject aEvent;
+		aEvent.Source = uno::Reference< XAccessible >(this);
+		aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED;
+		aEvent.Source = uno::Reference< XAccessible >(this);
+		uno::Reference< XAccessible > xOld = m_pAccFormulaCell;
+		aEvent.OldValue <<= xOld;
+		m_pAccFormulaCell = GetAccessibleCellAt(aFormulaAddr.Row(), aFormulaAddr.Col());
+        m_pAccFormulaCell->acquire();
+        m_pAccFormulaCell->Init();
+		uno::Reference< XAccessible > xNew = m_pAccFormulaCell;
+		aEvent.NewValue <<= xNew;	
+		CommitChange(aEvent);
+		if (nRefStartX == nRefEndX && nRefStartY == nRefEndY)
+		{//Selection Single
+			aEvent.EventId = AccessibleEventId::SELECTION_CHANGED;
+			aEvent.NewValue <<= xNew;
+			CommitChange(aEvent);
+			m_mapFormulaSelectionSend.insert(MAP_ADDR_XACC::value_type(aFormulaAddr,xNew));
+			m_vecFormulaLastMyAddr.clear();
+			m_vecFormulaLastMyAddr.push_back(aFormulaAddr);
+		}
+		else
+		{
+			VEC_MYADDR vecCurSel;
+			int nCurSize =  (m_nMaxX - m_nMinX +1)*(m_nMaxY - m_nMinY +1) ;
+			vecCurSel.reserve(nCurSize);
+			for (sal_uInt16 x = m_nMinX ; x <= m_nMaxX ; ++x)
+			{
+				for (sal_Int32 y = m_nMinY ; y <= m_nMaxY ; ++y)
+				{
+					ScMyAddress aAddr(x,y,0);
+					vecCurSel.push_back(aAddr);
+				}
+			}
+			std::sort(vecCurSel.begin(), vecCurSel.end());
+			VEC_MYADDR vecNew;							
+			std::set_difference(vecCurSel.begin(),vecCurSel.end(),
+				m_vecFormulaLastMyAddr.begin(),m_vecFormulaLastMyAddr.end(),						
+				std::back_insert_iterator<VEC_MYADDR>(vecNew));
+			int nNewSize = vecNew.size();
+			if ( nNewSize > 10 )
+			{
+				aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_WITHIN;
+				aEvent.NewValue <<= ::com::sun::star::uno::Any();
+				CommitChange(aEvent);
+			}
+			else
+			{
+				VEC_MYADDR::iterator viAddr = vecNew.begin(); 
+				for(; viAddr != vecNew.end() ; ++viAddr )
+				{
+					uno::Reference< XAccessible > xChild;
+					if (*viAddr == aFormulaAddr)
+					{
+						xChild = m_pAccFormulaCell;
+					}
+					else
+					{
+						xChild = getAccessibleCellAt(viAddr->Row(),viAddr->Col());
+						aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED_NOFOCUS;							
+						aEvent.NewValue <<= xChild;							
+						CommitChange(aEvent);
+					}					
+					aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_ADD;
+					aEvent.NewValue <<= xChild;
+					CommitChange(aEvent);
+					m_mapFormulaSelectionSend.insert(MAP_ADDR_XACC::value_type(*viAddr,xChild));
+				}
+			}						
+			m_vecFormulaLastMyAddr.swap(vecCurSel);					
+		}
+	}
+	m_aFormulaActiveCell = aFormulaAddr;
+}
+void ScAccessibleSpreadsheet::RemoveFormulaSelection(sal_Bool bRemoveAll )
+{
+	AccessibleEventObject aEvent;
+	aEvent.Source = uno::Reference< XAccessible >(this);
+	aEvent.OldValue <<= ::com::sun::star::uno::Any();
+	MAP_ADDR_XACC::iterator miRemove = m_mapFormulaSelectionSend.begin();
+	for(;  miRemove != m_mapFormulaSelectionSend.end() ;)
+	{
+		if( !bRemoveAll && IsScAddrFormulaSel(miRemove->first) )
+		{
+			++miRemove;
+			continue;
+		}
+		aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_REMOVE;
+		aEvent.NewValue <<= miRemove->second;							
+		CommitChange(aEvent);
+		MAP_ADDR_XACC::iterator miNext = miRemove;
+		++miNext;
+		m_mapFormulaSelectionSend.erase(miRemove);
+		miRemove = miNext;
+	}	
+}
+sal_Bool ScAccessibleSpreadsheet::IsScAddrFormulaSel(const ScAddress &addr) const
+{
+	if( addr.Col() >= m_nMinX && addr.Col() <= m_nMaxX &&
+		addr.Row() >= m_nMinY && addr.Row() <= m_nMaxY &&
+		addr.Tab() == mpViewShell->GetViewData()->GetTabNo() )
+	{
+		return sal_True;
+	}
+	return sal_False;
+}
+sal_Bool ScAccessibleSpreadsheet::CheckChildIndex(sal_Int32 nIndex) const
+{
+	sal_Int32 nMaxIndex = (m_nMaxX - m_nMinX +1)*(m_nMaxY - m_nMinY +1) -1 ;
+	return nIndex <= nMaxIndex && nIndex >= 0 ;
+}
+ScAddress ScAccessibleSpreadsheet::GetChildIndexAddress(sal_Int32 nIndex) const
+{
+	sal_Int32 nRowAll = GetRowAll();
+	sal_uInt16  nColAll = GetColAll();
+	if (nIndex < 0 || nIndex >=  nRowAll * nColAll )
+	{
+		return ScAddress();
+	}
+	return ScAddress(		
+		static_cast<SCCOL>((nIndex - nIndex % nRowAll) / nRowAll +  + m_nMinX),
+		nIndex % nRowAll + m_nMinY, 
+		mpViewShell->GetViewData()->GetTabNo()
+		);
+}
+sal_Int32 ScAccessibleSpreadsheet::GetAccessibleIndexFormula( sal_Int32 nRow, sal_Int32 nColumn )
+{
+	sal_uInt16 nColRelative = sal_uInt16(nColumn) - GetColAll();
+	sal_Int32 nRowRelative = nRow - GetRowAll();
+	if (nRow < 0 || nColumn < 0  || nRowRelative >= GetRowAll() || nColRelative >= GetColAll() )
+	{
+		return -1;
+	}
+	return GetRowAll() * nRowRelative + nColRelative;
+}
+sal_Bool ScAccessibleSpreadsheet::IsFormulaMode() 
+{ 
+	ScViewData *pViewData = mpViewShell->GetViewData();
+	m_bFormulaMode = pViewData->IsRefMode() || SC_MOD()->IsFormulaMode();
+	return m_bFormulaMode ;
+}
+sal_Bool ScAccessibleSpreadsheet::GetFormulaCurrentFocusCell(ScAddress &addr)
+{
+	ScViewData *pViewData = mpViewShell->GetViewData();
+	sal_uInt16 nRefX=0;
+	sal_Int32 nRefY=0;
+	if(m_bFormulaLastMode)
+	{
+		nRefX=pViewData->GetRefEndX(); 
+		nRefY=pViewData->GetRefEndY(); 
+	}
+	else
+	{
+		nRefX=pViewData->GetRefStartX(); 
+		nRefY=pViewData->GetRefStartY(); 
+	}
+	if( /* Always true: nRefX >= 0 && */ nRefX <= MAXCOL && nRefY >= 0 && nRefY <= MAXROW)
+	{
+		addr = ScAddress(nRefX,nRefY,pViewData->GetTabNo());
+		return sal_True;
+	}
+	return sal_False;
+}
+uno::Reference < XAccessible > ScAccessibleSpreadsheet::GetActiveCell()
+{
+	if( m_mapSelectionSend.find( maActiveCell ) != m_mapSelectionSend.end() )
+			return m_mapSelectionSend[maActiveCell];
+		else
+			return getAccessibleCellAt(maActiveCell.Row(), maActiveCell .Col());
+}
+//-----IAccessibility2 Implementation 2009

Modified: openoffice/branches/l10n40/main/sc/source/ui/Accessibility/AccessibleTableBase.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sc/source/ui/Accessibility/AccessibleTableBase.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sc/source/ui/Accessibility/AccessibleTableBase.cxx (original)
+++ openoffice/branches/l10n40/main/sc/source/ui/Accessibility/AccessibleTableBase.cxx Tue Nov 19 22:39:40 2013
@@ -77,8 +77,23 @@ void SAL_CALL ScAccessibleTableBase::dis
 uno::Any SAL_CALL ScAccessibleTableBase::queryInterface( uno::Type const & rType )
 	throw (uno::RuntimeException)
 {
-	uno::Any aAny (ScAccessibleTableBaseImpl::queryInterface(rType));
-	return aAny.hasValue() ? aAny : ScAccessibleContextBase::queryInterface(rType);
+//IAccessibility2 Implementation 2009-----
+	//uno::Any aAny (ScAccessibleTableBaseImpl::queryInterface(rType));
+	//return aAny.hasValue() ? aAny : ScAccessibleContextBase::queryInterface(rType);
+	uno::Any aRet;
+	if ( rType == ::getCppuType((uno::Reference<XAccessibleTableSelection> *)0) )
+    {
+		uno::Reference<XAccessibleTableSelection> xThis( this );
+       	aRet <<= xThis;
+		return aRet;
+    }
+	else
+	{
+		uno::Any aAny (ScAccessibleTableBaseImpl::queryInterface(rType));
+		return aAny.hasValue() ? aAny : ScAccessibleContextBase::queryInterface(rType);
+	}
+	return aRet;
+//-----IAccessibility2 Implementation 2009
 }
 
 void SAL_CALL ScAccessibleTableBase::acquire()
@@ -153,12 +168,18 @@ sal_Int32 SAL_CALL ScAccessibleTableBase
 	{
 		SCROW nEndRow(0);
         SCCOL nEndCol(0);
-		if (mpDoc->ExtendMerge(static_cast<SCCOL>(nColumn), static_cast<SCROW>(nRow),
-			nEndCol, nEndRow, maRange.aStart.Tab()))
-        {
-		    if (nEndRow > nRow)
-			    nCount = nEndRow - nRow + 1;
-        }
+//IAccessibility2 Implementation 2009-----
+		mpDoc->GetTableByIndex(maRange.aStart.Tab())->GetColumnByIndex(nColumn)->
+			ExtendMerge( static_cast<SCCOL>(nColumn), static_cast<SCROW>(nRow), nRow, nEndCol, nEndRow, sal_False, sal_False );
+		if (nEndRow > nRow)
+			   nCount = nEndRow - nRow + 1;
+	//	if (mpDoc->ExtendMerge(static_cast<SCCOL>(nColumn), static_cast<SCROW>(nRow),
+	//		nEndCol, nEndRow, maRange.aStart.Tab()))
+        //{
+	//	    if (nEndRow > nRow)
+	//		    nCount = nEndRow - nRow + 1;
+        //}
+//-----IAccessibility2 Implementation 2009
 	}
 
 	return nCount;
@@ -182,12 +203,18 @@ sal_Int32 SAL_CALL ScAccessibleTableBase
 	{
 		SCROW nEndRow(0);
         SCCOL nEndCol(0);
-		if (mpDoc->ExtendMerge(static_cast<SCCOL>(nColumn), static_cast<SCROW>(nRow),
-			nEndCol, nEndRow, maRange.aStart.Tab()))
-        {
-		    if (nEndCol > nColumn)
+//IAccessibility2 Implementation 2009-----
+		mpDoc->GetTableByIndex(maRange.aStart.Tab())->GetColumnByIndex(nColumn)->
+			ExtendMerge( static_cast<SCCOL>(nColumn), static_cast<SCROW>(nRow), nRow, nEndCol, nEndRow, sal_False, sal_False );
+		if (nEndCol > nColumn)
 			    nCount = nEndCol - nColumn + 1;
-        }
+	//	if (mpDoc->ExtendMerge(static_cast<SCCOL>(nColumn), static_cast<SCROW>(nRow),
+	//		nEndCol, nEndRow, maRange.aStart.Tab()))
+        //{
+	//	    if (nEndCol > nColumn)
+	//		    nCount = nEndCol - nColumn + 1;
+        //}
+//-----IAccessibility2 Implementation 2009
 	}
 
 	return nCount;
@@ -489,3 +516,27 @@ void ScAccessibleTableBase::CommitTableM
 
 	CommitChange(aEvent);
 }
+//IAccessibility2 Implementation 2009-----
+sal_Bool SAL_CALL ScAccessibleTableBase::selectRow( sal_Int32 ) 
+throw (lang::IndexOutOfBoundsException, uno::RuntimeException) 
+{
+	return sal_True;
+}
+sal_Bool SAL_CALL ScAccessibleTableBase::selectColumn( sal_Int32 ) 
+		throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+{
+	return sal_True;
+}
+sal_Bool SAL_CALL ScAccessibleTableBase::unselectRow( sal_Int32 ) 
+		throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+{
+		return sal_True;
+}
+sal_Bool SAL_CALL ScAccessibleTableBase::unselectColumn( sal_Int32 ) 
+		throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+{
+	return sal_True;
+}
+//-----IAccessibility2 Implementation 2009
+
+

Modified: openoffice/branches/l10n40/main/sc/source/ui/Accessibility/AccessibleText.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sc/source/ui/Accessibility/AccessibleText.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sc/source/ui/Accessibility/AccessibleText.cxx (original)
+++ openoffice/branches/l10n40/main/sc/source/ui/Accessibility/AccessibleText.cxx Tue Nov 19 22:39:40 2013
@@ -1058,8 +1058,10 @@ ScDocShell* ScAccessibleCellTextData::Ge
 
 
 // ============================================================================
-
-ScAccessibleEditObjectTextData::ScAccessibleEditObjectTextData(EditView* pEditView, Window* pWin)
+//IAccessibility2 Implementation 2009-----
+//ScAccessibleEditObjectTextData::ScAccessibleEditObjectTextData(EditView* pEditView, Window* pWin)
+ScAccessibleEditObjectTextData::ScAccessibleEditObjectTextData(EditView* pEditView, Window* pWin, sal_Bool isClone)
+//-----IAccessibility2 Implementation 2009
 	:
 	mpViewForwarder(NULL),
 	mpEditViewForwarder(NULL),
@@ -1068,13 +1070,22 @@ ScAccessibleEditObjectTextData::ScAccess
     mpForwarder(NULL),
     mpWindow(pWin)
 {
-    if (mpEditEngine)
+//IAccessibility2 Implementation 2009-----
+	// Solution: If the object is cloned, do NOT add notify hdl.
+	mbIsCloned = isClone;
+    //if (mpEditEngine)
+    if (mpEditEngine && !mbIsCloned)
+//-----IAccessibility2 Implementation 2009
         mpEditEngine->SetNotifyHdl( LINK(this, ScAccessibleEditObjectTextData, NotifyHdl) );
 }
 
 ScAccessibleEditObjectTextData::~ScAccessibleEditObjectTextData()
 {
-    if (mpEditEngine)
+//IAccessibility2 Implementation 2009-----
+	// Solution: If the object is cloned, do NOT set notify hdl.
+    //if (mpEditEngine)
+    if (mpEditEngine && !mbIsCloned)
+//-----IAccessibility2 Implementation 2009
         mpEditEngine->SetNotifyHdl(Link());
 	if (mpViewForwarder)
 		delete mpViewForwarder;
@@ -1106,7 +1117,11 @@ void ScAccessibleEditObjectTextData::Not
 
 ScAccessibleTextData* ScAccessibleEditObjectTextData::Clone() const
 {
-	return new ScAccessibleEditObjectTextData(mpEditView, mpWindow);
+//IAccessibility2 Implementation 2009-----
+	// Solution: Add para to indicate the object is cloned
+	//return new ScAccessibleEditObjectTextData(mpEditView, mpWindow);
+	return new ScAccessibleEditObjectTextData(mpEditView, mpWindow,sal_True);
+//-----IAccessibility2 Implementation 2009
 }
 
 SvxTextForwarder* ScAccessibleEditObjectTextData::GetTextForwarder()
@@ -1115,7 +1130,11 @@ SvxTextForwarder* ScAccessibleEditObject
 	{
         if (!mpEditEngine)
             mpEditEngine = mpEditView->GetEditEngine();
-        if (mpEditEngine && !mpEditEngine->GetNotifyHdl().IsSet())
+//IAccessibility2 Implementation 2009-----
+			// Solution: If the object is cloned, do NOT add notify hdl.
+        //if (mpEditEngine && !mpEditEngine->GetNotifyHdl().IsSet())
+	if (mpEditEngine && !mpEditEngine->GetNotifyHdl().IsSet()&&!mbIsCloned)
+//-----IAccessibility2 Implementation 2009
             mpEditEngine->SetNotifyHdl( LINK(this, ScAccessibleEditObjectTextData, NotifyHdl) );
         if(!mpForwarder)
             mpForwarder = new SvxEditEngineForwarder(*mpEditEngine);

Modified: openoffice/branches/l10n40/main/sc/source/ui/dbgui/dbnamdlg.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sc/source/ui/dbgui/dbnamdlg.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sc/source/ui/dbgui/dbnamdlg.cxx (original)
+++ openoffice/branches/l10n40/main/sc/source/ui/dbgui/dbnamdlg.cxx Tue Nov 19 22:39:40 2013
@@ -180,6 +180,11 @@ ScDbNameDlg::ScDbNameDlg( SfxBindings* p
 						aBtnDoSize, aBtnKeepFmt, aBtnStripData, theCurArea );
 	Init();
 	FreeResource();
+	//IAccessibility2 Implementation 2009-----
+	SynFocusTimer.SetTimeout(150);
+	SynFocusTimer.SetTimeoutHdl(LINK( this, ScDbNameDlg, FocusToComoboxHdl));
+	SynFocusTimer.Start();
+	//-----IAccessibility2 Implementation 2009
 	aRbAssign.SetAccessibleRelationMemberOf(&aFlAssign);
 }
 
@@ -716,8 +721,37 @@ IMPL_LINK( ScDbNameDlg, AssModifyHdl, vo
 	String aText = aEdAssign.GetText();
 	if ( aTmpRange.ParseAny( aText, pDoc, aAddrDetails ) & SCA_VALID )
 		theCurArea = aTmpRange;
-
+//IAccessibility2 Implementation 2009-----
+    if( aText.Len() > 0 && aEdName.GetText().Len() > 0 )
+    {
+		aBtnAdd.Enable();
+		aBtnHeader.Enable();
+		aBtnDoSize.Enable();
+		aBtnKeepFmt.Enable();
+		aBtnStripData.Enable();
+		aFTSource.Enable();
+		aFTOperations.Enable();
+    }
+    else
+    {
+		aBtnAdd.Disable();
+		aBtnHeader.Disable();
+		aBtnDoSize.Disable();
+		aBtnKeepFmt.Disable();
+		aBtnStripData.Disable();
+		aFTSource.Disable();
+		aFTOperations.Disable();
+    }
+//-----IAccessibility2 Implementation 2009
 	return 0;
 }
 
-
+//IAccessibility2 Implementation 2009-----
+IMPL_LINK( ScDbNameDlg, FocusToComoboxHdl, Timer*, pTi)
+{	
+	(void)pTi;
+	// CallEventListeners is still protected - figure out if we need to make it public, or if the focus stuff can be handled better in VCL directly. First see what AT is expecting...
+	// aEdName.CallEventListeners( VCLEVENT_CONTROL_GETFOCUS );
+	return 0;
+}
+//-----IAccessibility2 Implementation 2009

Modified: openoffice/branches/l10n40/main/sc/source/ui/docshell/docsh.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sc/source/ui/docshell/docsh.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sc/source/ui/docshell/docsh.cxx (original)
+++ openoffice/branches/l10n40/main/sc/source/ui/docshell/docsh.cxx Tue Nov 19 22:39:40 2013
@@ -121,6 +121,9 @@
 
 #include "docsh.hxx"
 #include "docshimp.hxx"
+//IAccessibility2 Implementation 2009-----
+#include <sfx2/viewfrm.hxx>
+//-----IAccessibility2 Implementation 2009
 #include <rtl/logfile.hxx>
 
 #include <comphelper/processfactory.hxx>
@@ -1587,6 +1590,23 @@ sal_Bool __EXPORT ScDocShell::SaveAs( Sf
 
     PrepareSaveGuard aPrepareGuard( *this);
 
+//IAccessibility2 Implementation 2009-----
+	aDocument.setDocAccTitle(String());
+	// SfxViewFrame* pFrame1 = SfxViewFrame::GetFirst( this, TYPE(SfxTopViewFrame));
+	SfxViewFrame* pFrame1 = SfxViewFrame::GetFirst( this );
+	if (pFrame1)
+	{
+		Window* pWindow = &pFrame1->GetWindow();
+		if ( pWindow )
+		{
+			Window* pSysWin = pWindow->GetSystemWindow();
+			if ( pSysWin )
+			{
+				pSysWin->SetAccessibleName(String());
+			}
+		}
+	}
+//-----IAccessibility2 Implementation 2009
 	//	wait cursor is handled with progress bar
     sal_Bool bRet = SfxObjectShell::SaveAs( rMedium );
 	if( bRet )

Modified: openoffice/branches/l10n40/main/sc/source/ui/drawfunc/fudraw.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sc/source/ui/drawfunc/fudraw.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sc/source/ui/drawfunc/fudraw.cxx (original)
+++ openoffice/branches/l10n40/main/sc/source/ui/drawfunc/fudraw.cxx Tue Nov 19 22:39:40 2013
@@ -354,10 +354,16 @@ sal_Bool __EXPORT FuDraw::KeyInput(const
 					// changeover to the next object
 					if(!pView->MarkNextObj( !aCode.IsShift() ))
 					{
+//IAccessibility2 Implementation 2009-----
+						//If there is only one object, don't do the UnmarkAlllObj() & MarkNextObj(). 
+						if ( pView->GetMarkableObjCount() > 1 && pView->HasMarkableObj() )
+						{
+//-----IAccessibility2 Implementation 2009
 						// #97016# No next object: go over open end and
 						// get first from the other side
 						pView->UnmarkAllObj();
 						pView->MarkNextObj(!aCode.IsShift());
+						}
 					}
 
 					// #97016# II

Modified: openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleCell.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleCell.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleCell.hxx (original)
+++ openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleCell.hxx Tue Nov 19 22:39:40 2013
@@ -32,17 +32,28 @@
 #include <unotools/accessiblerelationsethelper.hxx>
 #include <editeng/AccessibleStaticTextBase.hxx>
 #include <comphelper/uno3.hxx>
+//IAccessibility2 Implementation 2009-----
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XAccessibleExtendedAttributes_HPP_
+#include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp>
+#endif
+//-----IAccessibility2 Implementation 2009
 
 class ScTabViewShell;
 class ScAccessibleDocument;
 
+typedef cppu::ImplHelper1< ::com::sun::star::accessibility::XAccessibleExtendedAttributes>
+					ScAccessibleCellAttributeImpl;
+
 /**	@descr
         This base class provides an implementation of the
         <code>AccessibleCell</code> service.
 */
 class ScAccessibleCell
 	:	public	ScAccessibleCellBase,
-        public  accessibility::AccessibleStaticTextBase
+        public  accessibility::AccessibleStaticTextBase,
+//IAccessibility2 Implementation 2009-----
+		public  ScAccessibleCellAttributeImpl
+//-----IAccessibility2 Implementation 2009
 {
 public:
 	//=====  internal  ========================================================
@@ -134,6 +145,14 @@ public:
     	getSupportedServiceNames(void)
         throw (::com::sun::star::uno::RuntimeException);
 
+//IAccessibility2 Implementation 2009-----
+    virtual ::com::sun::star::uno::Any SAL_CALL getExtendedAttributes() 
+		throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ;
+
+	// Override this method to handle cell's ParaIndent attribute specially.
+    virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRequestedAttributes ) 
+		throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+//-----IAccessibility2 Implementation 2009
 private:
 	ScTabViewShell* mpViewShell;
     ScAccessibleDocument* mpAccDoc;
@@ -163,6 +182,10 @@ private:
 	void AddRelation(const ScRange& rRange,
 		const sal_uInt16 aRelationType,
 		::utl::AccessibleRelationSetHelper* pRelationSet);
+//IAccessibility2 Implementation 2009-----
+	sal_Bool IsFormulaMode();
+	sal_Bool IsDropdown();
+//-----IAccessibility2 Implementation 2009
 };
 
 

Modified: openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleCellBase.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleCellBase.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleCellBase.hxx (original)
+++ openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleCellBase.hxx Tue Nov 19 22:39:40 2013
@@ -142,6 +142,21 @@ private:
 	virtual sal_Bool IsEditable(
 		const com::sun::star::uno::Reference<
 		::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates);
+//IAccessibility2 Implementation 2009-----
+protected:
+	virtual ::rtl::OUString SAL_CALL GetNote(void)
+        throw (::com::sun::star::uno::RuntimeException);
+
+	virtual ::rtl::OUString SAL_CALL GetAllDisplayNote(void)
+        throw (::com::sun::star::uno::RuntimeException);
+	virtual ::rtl::OUString SAL_CALL getShadowAttrs(void) 
+		throw (::com::sun::star::uno::RuntimeException);
+	virtual ::rtl::OUString SAL_CALL getBorderAttrs(void) 
+		throw (::com::sun::star::uno::RuntimeException);
+public:
+	const ScAddress& GetCellAddress() const { return maCellAddress; }
+	sal_Bool IsCellInChangeTrack(const ScAddress &cell,Color *pColCellBoder);
+//-----IAccessibility2 Implementation 2009
 };
 	
 

Modified: openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleDocument.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleDocument.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleDocument.hxx (original)
+++ openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleDocument.hxx Tue Nov 19 22:39:40 2013
@@ -29,7 +29,12 @@
 #include "viewdata.hxx"
 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
 #include <com/sun/star/view/XSelectionChangeListener.hpp>
-#include <cppuhelper/implbase2.hxx>
+//IAccessibility2 Implementation 2009-----
+//#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implbase3.hxx>
+#include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp>
+#include <com/sun/star/accessibility/XAccessibleGetAccFlowTo.hpp>
+//-----IAccessibility2 Implementation 2009
 #include <svx/IAccessibleViewForwarder.hxx>
 
 class ScTabViewShell;
@@ -51,13 +56,19 @@ namespace utl
         <code>AccessibleContext</code> service.
 */
 
-typedef cppu::ImplHelper2< ::com::sun::star::accessibility::XAccessibleSelection,
+//IAccessibility2 Implementation 2009-----
+typedef cppu::ImplHelper3< ::com::sun::star::accessibility::XAccessibleSelection,
+							::com::sun::star::accessibility::XAccessibleExtendedAttributes,
+//-----IAccessibility2 Implementation 2009
 							::com::sun::star::view::XSelectionChangeListener >
 					ScAccessibleDocumentImpl;
 
 class ScAccessibleDocument
 	:	public ScAccessibleDocumentBase,
 		public ScAccessibleDocumentImpl,
+//IAccessibility2 Implementation 2009-----
+	       public com::sun::star::accessibility::XAccessibleGetAccFlowTo,
+//-----IAccessibility2 Implementation 2009
         public accessibility::IAccessibleViewForwarder
 {
 public:
@@ -124,6 +135,14 @@ public:
     	getAccessibleStateSet(void)
         throw (::com::sun::star::uno::RuntimeException);
 
+//IAccessibility2 Implementation 2009-----
+	virtual ::rtl::OUString SAL_CALL
+		getAccessibleName(void)
+		throw (::com::sun::star::uno::RuntimeException);
+
+	virtual ::com::sun::star::uno::Any SAL_CALL getExtendedAttributes() 
+		throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ;
+//-----IAccessibility2 Implementation 2009
 	///=====  XAccessibleSelection  ===========================================
 
     virtual void SAL_CALL 
@@ -318,6 +337,24 @@ private:
     rtl::OUString GetCurrentCellDescription() const;
 
     Rectangle GetVisibleArea_Impl() const;
+//IAccessibility2 Implementation 2009-----
+    com::sun::star::uno::Sequence< com::sun::star::uno::Any > GetScAccFlowToSequence();
+public:
+	ScDocument *GetDocument() const ;
+	ScAddress   GetCurCellAddress() const;
+	//=====  XAccessibleGetAccFromXShape  ============================================
+	::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
+		SAL_CALL get_AccFlowTo(const ::com::sun::star::uno::Any& rAny, sal_Int32 nType)
+		throw ( ::com::sun::star::uno::RuntimeException );
+	
+	 virtual sal_Int32 SAL_CALL getForeground(  ) 
+        throw (::com::sun::star::uno::RuntimeException);
+
+    virtual sal_Int32 SAL_CALL getBackground(  ) 
+        throw (::com::sun::star::uno::RuntimeException);
+protected:
+	void SwitchViewFireFocus();
+//-----IAccessibility2 Implementation 2009
 };
 
 

Modified: openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleDocumentBase.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleDocumentBase.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleDocumentBase.hxx (original)
+++ openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleDocumentBase.hxx Tue Nov 19 22:39:40 2013
@@ -37,6 +37,9 @@ public:
 	ScAccessibleDocumentBase(
         const ::com::sun::star::uno::Reference<
         ::com::sun::star::accessibility::XAccessible>& rxParent);
+//IAccessibility2 Implementation 2009-----
+	virtual void SwitchViewFireFocus();
+//-----IAccessibility2 Implementation 2009
 protected:
 	virtual ~ScAccessibleDocumentBase	(void);
 };

Modified: openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx (original)
+++ openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx Tue Nov 19 22:39:40 2013
@@ -85,6 +85,10 @@ public:
     	getAccessibleStateSet(void)
         throw (::com::sun::star::uno::RuntimeException);
 
+//IAccessibility2 Implementation 2009-----
+	virtual ::rtl::OUString SAL_CALL getAccessibleName(void)
+		throw (::com::sun::star::uno::RuntimeException);
+//-----IAccessibility2 Implementation 2009
 	///=====  XServiceInfo  ====================================================
 
     /**	Returns an identifier for the implementation of this object.

Modified: openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleEditObject.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleEditObject.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleEditObject.hxx (original)
+++ openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleEditObject.hxx Tue Nov 19 22:39:40 2013
@@ -27,6 +27,10 @@
 
 #include "AccessibleContextBase.hxx"
 
+//IAccessibility2 Implementation 2009-----
+#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
+#include "global.hxx"
+//-----IAccessibility2 Implementation 2009
 namespace accessibility
 {
     class AccessibleTextHelper;
@@ -46,7 +50,10 @@ enum EditObjectType
         <code>AccessibleCell</code> service.
 */
 class ScAccessibleEditObject
-	:	public	ScAccessibleContextBase
+	:	public	ScAccessibleContextBase,
+//IAccessibility2 Implementation 2009-----
+        public ::com::sun::star::accessibility::XAccessibleSelection 
+//-----IAccessibility2 Implementation 2009
 {
 public:
 	//=====  internal  ========================================================
@@ -71,7 +78,17 @@ public:
     virtual void LostFocus();
 
     virtual void GotFocus();
+//IAccessibility2 Implementation 2009-----
+///=====  XInterface  =====================================================
 
+	virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
+		::com::sun::star::uno::Type const & rType )
+		throw (::com::sun::star::uno::RuntimeException);
+
+	virtual void SAL_CALL acquire() throw ();
+
+	virtual void SAL_CALL release() throw ();
+//-----IAccessibility2 Implementation 2009
 	///=====  XAccessibleComponent  ============================================
 
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
@@ -110,6 +127,32 @@ public:
     	getAccessibleStateSet(void)
         throw (::com::sun::star::uno::RuntimeException);
 
+	//=====  XAccessibleSelection  ============================================
+		
+		virtual void SAL_CALL selectAccessibleChild( 
+			sal_Int32 nChildIndex ) 
+			throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 
+			::com::sun::star::uno::RuntimeException );
+		virtual sal_Bool SAL_CALL isAccessibleChildSelected( 
+			sal_Int32 nChildIndex ) 
+			throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 
+			::com::sun::star::uno::RuntimeException );
+		virtual void SAL_CALL clearAccessibleSelection(  ) 
+			throw ( ::com::sun::star::uno::RuntimeException );
+		virtual void SAL_CALL selectAllAccessibleChildren(  ) 
+			throw ( ::com::sun::star::uno::RuntimeException );
+		virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount(  ) 
+			throw ( ::com::sun::star::uno::RuntimeException );
+		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( 
+			sal_Int32 nSelectedChildIndex ) 
+			throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 
+			::com::sun::star::uno::RuntimeException);
+		virtual void SAL_CALL deselectAccessibleChild( 
+			sal_Int32 nSelectedChildIndex ) 
+			throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 
+			::com::sun::star::uno::RuntimeException );
+    virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet(  ) throw (::com::sun::star::uno::RuntimeException);
+//-----IAccessibility2 Implementation 2009
 protected:
     ///	Return this object's description.
 	virtual ::rtl::OUString SAL_CALL
@@ -168,6 +211,20 @@ private:
 		::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates);
 
 	void CreateTextHelper();
+//IAccessibility2 Implementation 2009-----
+	ScDocument *m_pScDoc;
+	ScAddress m_curCellAddress;
+
+
+	///=====  XAccessibleComponent  ============================================
+    virtual sal_Int32 SAL_CALL getForeground(  ) 
+        throw (::com::sun::star::uno::RuntimeException);
+
+    virtual sal_Int32 SAL_CALL getBackground(  ) 
+        throw (::com::sun::star::uno::RuntimeException);
+
+	sal_Int32 GetFgBgColor(  const rtl::OUString &strPropColor) ;
+//-----IAccessibility2 Implementation 2009
 };
 
 

Modified: openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleSpreadsheet.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleSpreadsheet.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleSpreadsheet.hxx (original)
+++ openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleSpreadsheet.hxx Tue Nov 19 22:39:40 2013
@@ -30,6 +30,10 @@
 
 #include <vector>
 
+//IAccessibility2 Implementation 2009-----
+#include "rangelst.hxx"
+#include <map>
+//-----IAccessibility2 Implementation 2009
 class ScMyAddress : public ScAddress
 {
 public:
@@ -239,6 +243,17 @@ public:
         	const ::com::sun::star::uno::Reference<
                 ::com::sun::star::accessibility::XAccessibleEventListener>& xListener)
         throw (com::sun::star::uno::RuntimeException);
+//IAccessibility2 Implementation 2009-----
+	//=====  XAccessibleTableSelection  ============================================
+	virtual sal_Bool SAL_CALL selectRow( sal_Int32 row ) 
+		throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ;
+    virtual sal_Bool SAL_CALL selectColumn( sal_Int32 column ) 
+		throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ;
+    virtual sal_Bool SAL_CALL unselectRow( sal_Int32 row ) 
+		throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ;
+    virtual sal_Bool SAL_CALL unselectColumn( sal_Int32 column ) 
+		throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ;
+//-----IAccessibility2 Implementation 2009
 
 protected:
     ///	Return the object's current bounding box relative to the desktop.
@@ -279,6 +294,55 @@ private:
 	ScDocument* GetDocument(ScTabViewShell* pViewShell);
 	Rectangle	GetVisArea(ScTabViewShell* pViewShell, ScSplitPos eSplitPos);
 	Rectangle	GetVisCells(const Rectangle& rVisArea);
+//IAccessibility2 Implementation 2009-----
+	//void CreateSortedMarkedCells();
+	//void AddMarkedRange(const ScRange& rRange);
+	typedef std::vector<ScMyAddress> VEC_MYADDR;
+
+	typedef std::map<ScMyAddress,com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > > 
+		MAP_ADDR_XACC;
+	MAP_ADDR_XACC m_mapSelectionSend;
+	void RemoveSelection(ScMarkData &refScMarkData);
+	sal_Bool IsSameMarkCell();
+	void CommitFocusCell(const ScAddress &aNewCell);
+public:
+	void FireFirstCellFocus();
+private:
+	sal_Bool m_bFormulaMode;
+	sal_Bool m_bFormulaLastMode;
+	ScAddress m_aFormulaActiveCell;
+	MAP_ADDR_XACC m_mapFormulaSelectionSend;
+	VEC_MYADDR m_vecFormulaLastMyAddr;
+    ScAccessibleCell*   m_pAccFormulaCell;
+	sal_uInt16 m_nMinX;
+	sal_uInt16 m_nMaxX;
+	sal_Int32 m_nMinY;
+	sal_Int32 m_nMaxY;
+	sal_Int32 GetRowAll() const { return m_nMaxY - m_nMinY + 1 ; }
+	sal_uInt16  GetColAll() const { return m_nMaxX - m_nMinX + 1; }
+	void NotifyRefMode();
+	void RemoveFormulaSelection(sal_Bool bRemoveAll =sal_False);
+	sal_Bool CheckChildIndex(sal_Int32)const ;
+	ScAddress GetChildIndexAddress(sal_Int32) const;
+    sal_Int32 GetAccessibleIndexFormula( sal_Int32 nRow, sal_Int32 nColumn );
+	sal_Bool GetFormulaCurrentFocusCell(ScAddress &addr);
+public:
+	sal_Bool IsScAddrFormulaSel (const ScAddress &addr) const ;
+	sal_Bool IsFormulaMode() ;
+	::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessible > GetActiveCell();
+	ScRange m_aLastWithInMarkRange;
+    String m_strCurCellValue;
+    ScRangeList m_LastMarkedRanges;
+    typedef std::vector<ScRange*> VEC_RANGE;
+    VEC_RANGE m_vecTempRange;
+    typedef std::pair<sal_uInt16,sal_uInt16> PAIR_COL;
+    typedef std::vector<PAIR_COL> VEC_COL;
+    VEC_COL m_vecTempCol;
+    ScMyAddress CalcScAddressFromRangeList(ScRangeList *pMarkedRanges,sal_Int32 nSelectedChildIndex);
+	sal_Bool CalcScRangeDifferenceMax(ScRange *pSrc,ScRange *pDest,int nMax,VEC_MYADDR &vecRet,int &nSize);
+	sal_Bool CalcScRangeListDifferenceMax(ScRangeList *pSrc,ScRangeList *pDest,int nMax,VEC_MYADDR &vecRet);
+	String m_strOldTabName;
+//-----IAccessibility2 Implementation 2009
 };
 
 

Modified: openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleTableBase.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleTableBase.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleTableBase.hxx (original)
+++ openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleTableBase.hxx Tue Nov 19 22:39:40 2013
@@ -30,6 +30,9 @@
 #include "address.hxx"
 #include <com/sun/star/accessibility/XAccessibleTable.hpp>
 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
+//IAccessibility2 Implementation 2009-----
+#include <com/sun/star/accessibility/XAccessibleTableSelection.hpp>
+//-----IAccessibility2 Implementation 2009
 #include <cppuhelper/implbase2.hxx>
 
 class ScTabViewShell;
@@ -45,6 +48,9 @@ typedef cppu::ImplHelper2< ::com::sun::s
 
 class ScAccessibleTableBase :
 			public ScAccessibleContextBase,
+//IAccessibility2 Implementation 2009-----
+			public	 ::com::sun::star::accessibility::XAccessibleTableSelection,
+//-----IAccessibility2 Implementation 2009
 			public ScAccessibleTableBaseImpl
 {
 public:
@@ -199,6 +205,16 @@ public:
     	getAccessibleChild(sal_Int32 nIndex)
         throw (::com::sun::star::uno::RuntimeException,
 				::com::sun::star::lang::IndexOutOfBoundsException);
+//IAccessibility2 Implementation 2009-----
+	virtual sal_Bool SAL_CALL selectRow( sal_Int32 row ) 
+		throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ;
+    virtual sal_Bool SAL_CALL selectColumn( sal_Int32 column ) 
+		throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ;
+    virtual sal_Bool SAL_CALL unselectRow( sal_Int32 row ) 
+		throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ;
+    virtual sal_Bool SAL_CALL unselectColumn( sal_Int32 column ) 
+		throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ;
+//-----IAccessibility2 Implementation 2009
 
 protected:
     ///	Return this object's description.

Modified: openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleText.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleText.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleText.hxx (original)
+++ openoffice/branches/l10n40/main/sc/source/ui/inc/AccessibleText.hxx Tue Nov 19 22:39:40 2013
@@ -132,7 +132,11 @@ private:
 class ScAccessibleEditObjectTextData : public ScAccessibleTextData
 {
 public:
-						ScAccessibleEditObjectTextData(EditView* pEditView, Window* pWin);
+//IAccessibility2 Implementation 2009-----
+	// Solution: Add a para to indicate whether the object is cloned
+						//ScAccessibleEditObjectTextData(EditView* pEditView, Window* pWin);
+						ScAccessibleEditObjectTextData(EditView* pEditView, Window* pWin, sal_Bool isClone=sal_False);
+//-----IAccessibility2 Implementation 2009
 	virtual				~ScAccessibleEditObjectTextData();
 
 	virtual	ScAccessibleTextData* Clone() const;
@@ -155,6 +159,9 @@ protected:
     EditEngine* mpEditEngine;
     SvxEditEngineForwarder*	mpForwarder;
     Window* mpWindow;
+//IAccessibility2 Implementation 2009-----
+    sal_Bool mbIsCloned;
+//-----IAccessibility2 Implementation 2009
 };
 
 

Modified: openoffice/branches/l10n40/main/sc/source/ui/inc/content.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sc/source/ui/inc/content.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sc/source/ui/inc/content.hxx (original)
+++ openoffice/branches/l10n40/main/sc/source/ui/inc/content.hxx Tue Nov 19 22:39:40 2013
@@ -34,6 +34,9 @@ class ScNavigatorSettings;
 class ScDocument;
 class ScDocShell;
 class ScAreaLink;
+//IAccessibility2 Implementation 2009-----
+class SdrPage;
+//-----IAccessibility2 Implementation 2009
 
 #define SC_CONTENT_ROOT			0
 #define SC_CONTENT_TABLE		1
@@ -64,6 +67,10 @@ class ScContentTree : public SvTreeListB
 	String				aHiddenName;		// URL zum Laden
 	String				aHiddenTitle;		// fuer Anzeige
 	ScDocument*			pHiddenDocument;	// temporaer
+//IAccessibility2 Implementation 2009-----
+    sal_Bool                           bisInNavigatoeDlg;
+	String 				sKeyString;
+//-----IAccessibility2 Implementation 2009
 
 	sal_uInt16				pPosList[SC_CONTENT_COUNT];		// fuer die Reihenfolge
 
@@ -112,7 +119,12 @@ class ScContentTree : public SvTreeListB
 
     DECL_LINK( ContentDoubleClickHdl, ScContentTree* );
 	DECL_STATIC_LINK( ScContentTree, ExecDragHdl, void* );
+//IAccessibility2 Implementation 2009-----
+public:
+	SvLBoxEntry* pTmpEntry;
 
+	bool m_bFirstPaint;
+//-----IAccessibility2 Implementation 2009
 protected:
 //	virtual sal_Bool	Drop( const DropEvent& rEvt );
 //	virtual sal_Bool	QueryDrop( DropEvent& rEvt );
@@ -126,11 +138,21 @@ protected:
 
 	virtual void	Command( const CommandEvent& rCEvt );
 	virtual void	RequestHelp( const HelpEvent& rHEvt );
-
+//IAccessibility2 Implementation 2009-----
+	virtual void 	InitEntry(SvLBoxEntry*,const XubString&,const Image&,const Image&, SvLBoxButtonKind);
+//-----IAccessibility2 Implementation 2009
 public:
 			ScContentTree( Window* pParent, const ResId& rResId );
 			~ScContentTree();
 
+//IAccessibility2 Implementation 2009-----
+    String			getAltLongDescText( SvLBoxEntry* pEntry , sal_Bool isAltText) const;
+    String  		GetEntryAltText( SvLBoxEntry* pEntry ) const;
+    String  		GetEntryLongDescription( SvLBoxEntry* pEntry ) const;
+
+	void     ObjectFresh( sal_uInt16 nType,SvLBoxEntry* pEntry = NULL);
+	sal_Bool     SetNavigatorDlgFlag(sal_Bool isInNavigatoeDlg){ return bisInNavigatoeDlg=isInNavigatoeDlg;};
+//-----IAccessibility2 Implementation 2009
     virtual void    MouseButtonDown( const MouseEvent& rMEvt );
     virtual void    KeyInput( const KeyEvent& rKEvt );
 

Modified: openoffice/branches/l10n40/main/sc/source/ui/inc/dbnamdlg.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sc/source/ui/inc/dbnamdlg.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sc/source/ui/inc/dbnamdlg.hxx (original)
+++ openoffice/branches/l10n40/main/sc/source/ui/inc/dbnamdlg.hxx Tue Nov 19 22:39:40 2013
@@ -100,6 +100,10 @@ private:
 	ScDBCollection	aLocalDbCol;
 	ScRange			theCurArea;
 	List			aRemoveList;
+	//IAccessibility2 Implementation 2009-----
+	Timer		SynFocusTimer;
+	DECL_LINK( FocusToComoboxHdl, Timer* );
+	//-----IAccessibility2 Implementation 2009
 
 #ifdef _DBNAMDLG_CXX
 private:

Modified: openoffice/branches/l10n40/main/sc/source/ui/inc/docsh.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sc/source/ui/inc/docsh.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sc/source/ui/inc/docsh.hxx (original)
+++ openoffice/branches/l10n40/main/sc/source/ui/inc/docsh.hxx Tue Nov 19 22:39:40 2013
@@ -406,6 +406,14 @@ public:
 
     const ScOptSolverSave* GetSolverSaveData() const    { return pSolverSaveData; }     // may be null
     void            SetSolverSaveData( const ScOptSolverSave& rData );
+
+//IAccessibility2 Implementation 2009-----
+	virtual void setDocAccTitle( const String& rTitle ) { aDocument.setDocAccTitle( rTitle ); }
+	virtual const String getDocAccTitle() const { return aDocument.getDocAccTitle(); }
+	void setDocReadOnly( sal_Bool b){ aDocument.setDocReadOnly(b);}
+	sal_Bool getDocReadOnly() const { return aDocument.getDocReadOnly(); }
+//-----IAccessibility2 Implementation 2009
+
 	//<!--Added by PengYunQuan for Validity Cell Range Picker
 	sal_Bool		AcceptStateUpdate() const;
 	//-->Added by PengYunQuan for Validity Cell Range Picker

Modified: openoffice/branches/l10n40/main/sc/source/ui/inc/drawview.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sc/source/ui/inc/drawview.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sc/source/ui/inc/drawview.hxx (original)
+++ openoffice/branches/l10n40/main/sc/source/ui/inc/drawview.hxx Tue Nov 19 22:39:40 2013
@@ -155,6 +155,11 @@ public:
 	SdrEndTextEditKind	ScEndTextEdit();	// ruft SetDrawTextUndo(0)
 //UNUSED2009-05 void                    CaptionTextDirection(sal_uInt16 nSlot);
     ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > CopyToTransferable();
+//IAccessibility2 Implementation 2009-----
+	SdrObject*  GetObjectByName(const String& rName);
+	sal_Bool           GetObjectIsMarked(  SdrObject * pObject );
+	sal_Bool           SelectCurrentViewObject( const String& rName );
+//-----IAccessibility2 Implementation 2009
 };
 
 

Modified: openoffice/branches/l10n40/main/sc/source/ui/inc/gridwin.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sc/source/ui/inc/gridwin.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sc/source/ui/inc/gridwin.hxx (original)
+++ openoffice/branches/l10n40/main/sc/source/ui/inc/gridwin.hxx Tue Nov 19 22:39:40 2013
@@ -239,7 +239,9 @@ private:
 	void			ExecPageFieldSelect( SCCOL nCol, SCROW nRow, sal_Bool bHasSelection, const String& rStr );
 
 	sal_Bool			HasScenarioButton( const Point& rPosPixel, ScRange& rScenRange );
-
+//IAccessibility2 Implementation 2009-----
+	sal_Bool			HasScenarioRange( sal_uInt16 nCol, sal_Int32 nRow, ScRange& rScenRange ); 
+//-----IAccessibility2 Implementation 2009
 	sal_Bool			DropScroll( const Point& rMousePos );
 
 	sal_Int8		AcceptPrivateDrop( const AcceptDropEvent& rEvt );
@@ -388,6 +390,9 @@ public:
 	void			DoInvertRect( const Rectangle& rPixel );
 
 	void			CheckNeedsRepaint();
+//IAccessibility2 Implementation 2009-----
+	virtual void SwitchView();
+//-----IAccessibility2 Implementation 2009
 
     void            UpdateDPFromFieldPopupMenu();
 



Mime
View raw message