Commits

Malte Timmermann [mt]  committed 532f1f1

accstuff: merged remaining changes from CWS oo31ia2, module sw

  • Participants
  • Parent commits 03826b8

Comments (0)

Files changed (108)

File sw/Library_sw.mk

 	sw/source/core/access/accdoc \
 	sw/source/core/access/accembedded \
 	sw/source/core/access/accfootnote \
+	sw/source/core/access/accfield \
 	sw/source/core/access/accframe \
 	sw/source/core/access/accframebase\
 	sw/source/core/access/accfrmobj \
 	sw/source/core/access/acchypertextdata \
 	sw/source/core/access/accmap \
 	sw/source/core/access/accnotextframe \
+	sw/source/core/access/accnotexthyperlink \
 	sw/source/core/access/accpage \
 	sw/source/core/access/accpara \
 	sw/source/core/access/accportions \

File sw/inc/PostItMgr.hxx

 			sal_uInt16 SearchReplace(const SwFmtFld &pFld, const ::com::sun::star::util::SearchOptions& rSearchOptions,bool bSrchForward);
 			sal_uInt16 FinishSearchReplace(const ::com::sun::star::util::SearchOptions& rSearchOptions,bool bSrchForward);
 
+			//IAccessibility2 Implementation 2009-----
+			// get the PostIt window by index
+			sal_Int32 GetPostItCount() {return mvPostItFlds.size();};
+			//SwPostIt* GetPostIt(sal_Int32 index);
+			//-----IAccessibility2 Implementation 2009
             void AssureStdModeAtShell();
 
             void ConnectSidebarWinToFrm( const SwFrm& rFrm,

File sw/inc/access.hrc

 #define STR_ACCESS_SW_CATEGORY 					(RC_ACCESS_BEGIN + 29)
 #define STR_ACCESS_TL_GLOBAL					(RC_ACCESS_BEGIN + 30)
 #define STR_ACCESS_TL_CONTENT					(RC_ACCESS_BEGIN + 31)
+#define STR_ACCESS_FORMULA_TYPE					(RC_ACCESS_BEGIN + 32)
+#define STR_ACCESS_FORMULA_TEXT					(RC_ACCESS_BEGIN + 33)
+#define STR_ACCESS_FORMULA_TOOLBAR				(RC_ACCESS_BEGIN + 34)
 //-----IAccessibility2 Implementation 2009
 
-#define ACCESS_ACT_END STR_ACCESS_TL_CONTENT
+#define ACCESS_ACT_END STR_ACCESS_FORMULA_TOOLBAR
 
 #if ACCESS_ACT_END > RC_ACCESS_END
 #error Resource-Id Ueberlauf in #file, #line

File sw/inc/accmap.hxx

 #include <tools/debug.hxx>
 #include <tools/fract.hxx>
 
+//IAccessibility2 Implementation 2009-----
+#include <svx/AccessibleControlShape.hxx>
+#include <svx/AccessibleShape.hxx>
+#include "fesh.hxx"
 #include <vector>
+#include <set>
+class SwAccessibleParagraph;
+//-----IAccessibility2 Implementation 2009
 
 class ViewShell;
 class Rectangle;
 typedef sal_uInt16 tAccessibleStates;
 // <--
 
-class SwAccessibleMap : public accessibility::IAccessibleViewForwarder,
-						public accessibility::IAccessibleParent
+class SwAccessibleMap : public ::accessibility::IAccessibleViewForwarder,
+						public ::accessibility::IAccessibleParent
 {
     mutable ::vos::OMutex maMutex;
 	::vos::OMutex maEventMutex;
 	void InvalidateCursorPosition(
 		const ::com::sun::star::uno::Reference<
 			::com::sun::star::accessibility::XAccessible>& rAcc );
-	void DoInvalidateShapeSelection();
-	void DoInvalidateShapeFocus();
+	//IAccessibility2 Implementation 2009-----
+	void DoInvalidateShapeSelection(sal_Bool bInvalidateFocusMode = sal_False);
+	
+	//Replace by DoInvalidateShapeSelection
+	//void DoInvalidateShapeFocus();
 	void InvalidateShapeSelection();
 
+	//mpSelectedFrmMap contains the old selected objects.
+	SwAccessibleContextMap_Impl *mpSeletedFrmMap;
+	//IvalidateShapeInParaSelection() method is reponsible for the updating the selected states of the objects.
+	void InvalidateShapeInParaSelection();
+	//-----IAccessibility2 Implementation 2009
+
     void _InvalidateRelationSet( const SwFrm* pFrm, sal_Bool bFrom );
 
 	::com::sun::star::uno::Reference<
     {
         return mpVSh;
     }
+	//IAccessibility2 Implementation 2009-----
+	sal_Bool IsInSameLevel(const SdrObject* pObj, const SwFEShell* pFESh);
+	void AddShapeContext(const SdrObject *pObj,
+							 ::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessible > xAccShape);
+	
+	void AddGroupContext(const SdrObject *pParentObj,
+					::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessible > xAccParent);
+	void RemoveGroupContext(const SdrObject *pParentObj, ::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessible > xAccParent);
+	//-----IAccessibility2 Implementation 2009
 
     const SwRect& GetVisArea() const;
 
 
 	void InvalidateCursorPosition( const SwFrm *pFrm );
 	void InvalidateFocus();
-
+	//IAccessibility2 Implementation 2009-----
+	void FirePageChangeEvent(sal_uInt16 nOldPage, sal_uInt16 nNewPage);
+	void FireSectionChangeEvent(sal_uInt16 nOldSection, sal_uInt16 nNewSection);
+	void FireColumnChangeEvent(sal_uInt16 nOldColumn, sal_uInt16 nNewColumn);
+	//-----IAccessibility2 Implementation 2009
 	void SetCursorContext(
 		const ::vos::ORef < SwAccessibleContext >& rCursorContext );
 
 	// IAccessibleParent
     virtual sal_Bool ReplaceChild (
         ::accessibility::AccessibleShape* pCurrentChild,
-		const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& _rxShape,
+		const ::com::sun::star::uno::Reference < ::com::sun::star::drawing::XShape >& _rxShape,
 		const long _nIndex,
 		const ::accessibility::AccessibleShapeTreeInfo& _rShapeTreeInfo
 	)	throw (::com::sun::star::uno::RuntimeException);
+	//IAccessibility2 Implementation 2009-----
+	virtual ::accessibility::AccessibleControlShape* GetAccControlShapeFromModel
+		(::com::sun::star::beans::XPropertySet* pSet) 
+		throw (::com::sun::star::uno::RuntimeException);
+	virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >   GetAccessibleCaption (
+		const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & xShape)
+    throw (::com::sun::star::uno::RuntimeException);
+	//-----IAccessibility2 Implementation 2009
 
     // additional Core/Pixel conversions for internal use; also works
     // for preview
     */
     void GetMapMode( const Point& _rPoint,
                      MapMode&     _orMapMode ) const;
+//IAccessibility2 Implementation 2009-----
+public:
+	virtual sal_Bool IsDocumentSelAll();
+
+	::com::sun::star::uno::WeakReference < ::com::sun::star::accessibility::XAccessible > 
+		GetCursorContext() const { return mxCursorContext; }
+
+    //Para Container for InvalidateCursorPosition
+    typedef std::set< SwAccessibleParagraph* >  SET_PARA;
+    SET_PARA m_setParaAdd;
+    SET_PARA m_setParaRemove;
+    //-----IAccessibility2 Implementation 2009
 };
 #endif

File sw/inc/crsrsh.hxx

     // is cursor or the point in/over a right to left formatted text?
     sal_Bool IsInRightToLeftText( const Point* pPt = 0 ) const;
 
+    //IAccessibility2 Implementation 2009-----
+    void FirePageChangeEvent(sal_uInt16 nOldPage, sal_uInt16 nNewPage);
+	SwFrm* oldColFrm;
+	bool   bColumnChange();
+    void FireSectionChangeEvent(sal_uInt16 nOldSection, sal_uInt16 nNewSection);
+    void FireColumnChangeEvent(sal_uInt16 nOldColumn, sal_uInt16 nNewColumn);
+    //-----IAccessibility2 Implementation 2009
     // If the current cursor position is inside a hidden range, the hidden range
     // is selected and true is returned:
     bool SelectHiddenRange();

File sw/inc/doc.hxx

     bool mbClipBoard             : 1;    // true: this document represents the clipboard
     bool mbColumnSelection       : 1;    // true: this content has bee created by a column selection
                                          //       (clipboard docs only)
+	//IAccessibility2 Implementation 2009-----
+	sal_Bool	bIsPrepareSelAll		:1;
+	//-----IAccessibility2 Implementation 2009
 
 #ifdef DBG_UTIL
     bool mbXMLExport : 1;                // sal_True: during XML export
      SwFmt *_MakeFrmFmt(const String &, SwFmt *, sal_Bool, sal_Bool );
      SwFmt *_MakeTxtFmtColl(const String &, SwFmt *, sal_Bool, sal_Bool );
 
+//IAccessibility2 Implementation 2009-----
+private:
+	sal_Bool bReadOnly;
+	String msDocAccTitle;
+
      void InitTOXTypes();
      void   Paste( const SwDoc& );
      bool DeleteAndJoinImpl(SwPaM&, const bool);
      bool ReplaceRangeImpl(SwPaM&, String const&, const bool);
 
 public:
+	virtual void setDocReadOnly( sal_Bool b) { bReadOnly = b; }
+	virtual sal_Bool getDocReadOnly() const { return bReadOnly; }
+	virtual void setDocAccTitle( const String& rTitle ) { msDocAccTitle = rTitle; }
+	virtual const String getDocAccTitle() const { return msDocAccTitle; }
+	//-----IAccessibility2 Implementation 2009
 
     /** Life cycle
     */
     bool InXMLExport() const            { return mbXMLExport; }
     void SetXMLExport( bool bFlag )     { mbXMLExport = bFlag; }
 #endif
+	//-----IAccessibility2 Implementation 2009
+	void SetSelAll( sal_Bool bSel ) 
+	{
+		bIsPrepareSelAll = bSel;
+	}
+	sal_Bool IsPrepareSelAll()  { return bIsPrepareSelAll; }
+	void SetPrepareSelAll() { bIsPrepareSelAll = sal_True; }
+	//IAccessibility2 Implementation 2009-----
 
 	// liefert zu allen fliegenden Rahmen die Position im Dokument.
 	// Wird ein Pam-Pointer uebergeben, muessen die absatzgebundenen

File sw/inc/docsh.hxx

     // read by the binary filter:
     virtual void UpdateLinks();
     // <--
+	//IAccessibility2 Implementation 2009-----
+	virtual void setDocAccTitle( const String& rTitle );
+	virtual const String getDocAccTitle() const;
 
+	void setDocReadOnly( sal_Bool bReadOnly);
+	sal_Bool getDocReadOnly() const;
+	//-----IAccessibility2 Implementation 2009
     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >
                                 GetController();
 

File sw/inc/fesh.hxx

 	sal_uInt16 IsObjSelected() const;	//Liefert gleich die Anzahl der Objekte,
 									//zaehlt aber nicht die Objekte in Gruppen.
 	sal_Bool IsObjSelected( const SdrObject& rObj ) const;
+	//IAccessibility2 Implementation 2009-----
+	sal_Bool IsObjSameLevelWithMarked(const SdrObject* pObj) const;
+    const SdrMarkList* GetMarkList() const{ return _GetMarkList(); };
+    //-----IAccessibility2 Implementation 2009
 
 	void EndTextEdit();				//Loescht ggf. das Objekt.
 

File sw/inc/fldbas.hxx

     TYP_DROPDOWN,
 	TYP_END
 };
-
-
+//IAccessibility2 Implementation 2009-----
+enum SwAttrFieldTYpe
+{
+	ATTR_NONE,
+	ATTR_DATEFLD,
+	ATTR_TIMEFLD,
+	ATTR_PAGENUMBERFLD,
+	ATTR_PAGECOOUNTFLD,
+	ATTR_BOOKMARKFLD,
+	ATTR_SETREFATTRFLD
+};
+//-----IAccessibility2 Implementation 2009
 enum SwFileNameFormat
 {
 	FF_BEGIN,

File sw/inc/frmfmt.hxx

         ::com::sun::star::uno::XInterface> m_wXObject;
 
 protected:
+	//IAccessibility2 Implementation 2009-----
+	SwFrmFmt* pCaptionFmt;
+	//-----IAccessibility2 Implementation 2009
 	SwFrmFmt( SwAttrPool& rPool, const sal_Char* pFmtNm,
 				SwFrmFmt *pDrvdFrm, sal_uInt16 nFmtWhich = RES_FRMFMT,
 				const sal_uInt16* pWhichRange = 0 )
 	  	: SwFmt( rPool, pFmtNm, (pWhichRange ? pWhichRange : aFrmFmtSetRange),
 				pDrvdFrm, nFmtWhich )
+				//IAccessibility2 Implementation 2009-----
+				,pCaptionFmt( NULL )
+				//-----IAccessibility2 Implementation 2009
 	{}
 
 	SwFrmFmt( SwAttrPool& rPool, const String &rFmtNm,
 				const sal_uInt16* pWhichRange = 0 )
 	  	: SwFmt( rPool, rFmtNm, (pWhichRange ? pWhichRange : aFrmFmtSetRange),
 				pDrvdFrm, nFmtWhich )
+				//IAccessibility2 Implementation 2009-----
+				,pCaptionFmt( NULL )
+				//-----IAccessibility2 Implementation 2009
 	{}
 
 public:
     // <--
 
     virtual String GetDescription() const;
+	//IAccessibility2 Implementation 2009-----
+	sal_Bool HasCaption() const;
+	void SetCaptionFmt(SwFrmFmt* pFmt);
+	SwFrmFmt* GetCaptionFmt() const;
+	//-----IAccessibility2 Implementation 2009	
 
     SW_DLLPRIVATE ::com::sun::star::uno::WeakReference<
         ::com::sun::star::uno::XInterface> const& GetXObject() const
 class SW_DLLPUBLIC SwFlyFrmFmt: public SwFrmFmt
 {
 	friend class SwDoc;
+	//IAccessibility2 Implementation 2009-----
+	String msTitle;
+	String msDesc;
+	//-----IAccessibility2 Implementation 2009
 
     // #i972:
     // it stores the previous position of Prt rectangle from RequestObjectResize

File sw/inc/mdiexp.hxx

 
 sal_Bool JumpToSwMark( ViewShell* pVwSh, const UniString& rMark );
 
+// IAccessible2 Implementation
+extern void AccessibilityScrollMDI(ViewShell* pVwSh, const SwRect &, sal_uInt16 nRangeX, sal_uInt16 nRangeY, sal_Bool isLeftTop);
 
 #endif

File sw/inc/ndole.hxx

     const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > GetOleRef();
     svt::EmbeddedObjectRef& GetObject();
     const String& GetCurrentPersistName() const { return aName; }
+	//IAccessibility2 Implementation 2009-----
+	String GetStyleString();
+	//-----IAccessibility2 Implementation 2009
 	sal_Bool IsOleRef() const;	//Damit das Objekt nicht unnoetig geladen werden muss.
 #endif
 };

File sw/inc/node.hxx

 	 * Dokument. Die Contentframes werden aus dem entsprechenden
 	 * Layout ausgehaengt.
 	 */
-	void DelFrms();
+	//IAccessibility2 Implementation 2009-----
+	//Solution:Add an input param to identify if acc table should be disposed
+	//void DelFrms();
+	void DelFrms( sal_Bool bNeedDel = sal_False, sal_Bool bIsAccTableDispose = sal_True );
+	//void DelFrms(sal_Bool bNeedDel = sal_False);//added by zlcdl for al
+	//-----IAccessibility2 Implementation 2009
 
 	/*
 	 * liefert die Anzahl der Elemente des Inhalts des Nodes;

File sw/inc/tblsel.hxx

 
 	void SetTableLines( const SwSelBoxes &rBoxes, const SwTable &rTable );
 	void SetTableLines( const SwTable &rTable );
-	void DelFrms ( SwTable &rTable );
+	//IAccessibility2 Implementation 2009-----
+	//Solution:Add an input param to identify if acc table should be disposed
+	//void DelFrms ( SwTable &rTable );
+	void DelFrms ( SwTable &rTable,sal_Bool bAccTableDispose = sal_False );
+	//-----IAccessibility2 Implementation 2009
 	void MakeFrms( SwTable &rTable );
 	void MakeNewFrms( SwTable &rTable, const sal_uInt16 nNumber,
 									   const sal_Bool bBehind );

File sw/inc/viewsh.hxx

     OutputDevice& GetRefDev() const;
     inline Window* GetWin()    const { return pWin; }
     inline OutputDevice* GetOut()     const { return pOut; }
-
+    //IAccessibility2 Implementation 2009-----
+    void SetWin(Window* win) { pWin = win; }
+   //-----IAccessibility2 Implementation 2009
 	static inline sal_Bool IsLstEndAction() { return ViewShell::bLstAct; }
 
     //Andern alle PageDescriptoren

File sw/source/core/access/acccell.cxx

 
 #include <limits.h>
 
+//IAccessibility2 Implementation 2009-----
+#include <ndtxt.hxx>
+#include <editeng/brshitem.hxx>
+#include <swatrset.hxx>
+#include <frmatr.hxx>
+#include "acctable.hxx"
+//-----IAccessibility2 Implementation 2009
+
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::accessibility;
 using ::rtl::OUString;
     DBG_ASSERT( pVSh, "no shell?" );
 	if( pVSh->ISA( SwCrsrShell ) )
 		rStateSet.AddState( AccessibleStateType::SELECTABLE );
+	//IAccessibility2 Implementation 2009-----
+	//Solution:Add resizable state to table cell.
+	rStateSet.AddState( AccessibleStateType::RESIZABLE );
+	//-----IAccessibility2 Implementation 2009
 
 	// SELECTED
 	if( IsSelected() )
 SwAccessibleCell::SwAccessibleCell( SwAccessibleMap *pInitMap,
                                     const SwCellFrm *pCellFrm )
     : SwAccessibleContext( pInitMap, AccessibleRole::TABLE_CELL, pCellFrm )
+    , aSelectionHelper( *this )
     , bIsSelected( sal_False )
 {
 	vos::OGuard aGuard(Application::GetSolarMutex());
     SetName( sBoxName );
 
 	bIsSelected = IsSelected();
+
+	//IAccessibility2 Implementation 2009-----
+	//Need not assign the pointer of accessible table object to m_pAccTable, 
+	//for it already done in SwAccessibleCell::GetTable(); Former codes:
+	//m_pAccTable= GetTable();
+	GetTable();
+	//-----IAccessibility2 Implementation 2009
 }
 
 sal_Bool SwAccessibleCell::_InvalidateMyCursorPos()
 	}
 
 	sal_Bool bChanged = bOld != bNew;
+	//IAccessibility2 Implementation 2009-----
 	if( bChanged )
+	{
 		FireStateChangedEvent( AccessibleStateType::SELECTED, bNew );
-
+		if (m_pAccTable)
+		{
+			m_pAccTable->AddSelectionCell(this,bNew);
+		}
+	}	
+	//-----IAccessibility2 Implementation 2009
 	return bChanged;
 }
 
 				{
 					ASSERT( xAccImpl->GetFrm()->IsCellFrm(),
 						 	"table child is not a cell frame" )
-					bChanged |= static_cast< SwAccessibleCell *>(
+					//IAccessibility2 Implementation 2009-----
+					bChanged = static_cast< SwAccessibleCell *>( 
 							xAccImpl.getBodyPtr() )->_InvalidateMyCursorPos();
+					//-----IAccessibility2 Implementation 2009 
 				}
 				else
 					bChanged = sal_True; // If the context is not know we
 
 void SwAccessibleCell::_InvalidateCursorPos()
 {
+	//IAccessibility2 Implementation 2009-----
+	if (IsSelected())
+	{
+		const SwAccessibleChild aChild( GetChild( *(GetMap()), 0 ) );
+		if( aChild.IsValid()  && aChild.GetSwFrm() )
+		{
+			::vos::ORef < SwAccessibleContext > xChildImpl(	GetMap()->GetContextImpl( aChild.GetSwFrm())  );
+			if(xChildImpl.isValid())
+			{
+				AccessibleEventObject aEvent;
+				aEvent.EventId = AccessibleEventId::STATE_CHANGED;
+				aEvent.NewValue<<=AccessibleStateType::FOCUSED;
+				xChildImpl->FireAccessibleEvent( aEvent );
+			}
+		}
+	}
 
     const SwFrm *pParent = GetParent( SwAccessibleChild(GetFrm()), IsInPagePreview() );
 	ASSERT( pParent->IsTabFrm(), "parent is not a tab frame" );
 
 	while( pTabFrm )
 	{
+                _InvalidateChildrenCursorPos( pTabFrm );
+/*
 		sal_Bool bChanged = _InvalidateChildrenCursorPos( pTabFrm );
 		if( bChanged )
 		{
 				xAccImpl->FireAccessibleEvent( aEvent );
 			}
 		}
-
+*/
 		pTabFrm = pTabFrm->GetFollow();
 	}
+	if (m_pAccTable)
+	{
+		m_pAccTable->FireSelectionEvent();
+	}		
+	//-----IAccessibility2 Implementation 2009
 }
 
 sal_Bool SwAccessibleCell::HasCursor()
 uno::Any SwAccessibleCell::queryInterface( const uno::Type& rType )
     throw( uno::RuntimeException )
 {
+	//IAccessibility2 Implementation 2009-----
+	if (rType == ::getCppuType((const uno::Reference<XAccessibleAttribute>*)0))
+	{
+		uno::Any aR; 
+		aR <<= uno::Reference<XAccessibleAttribute>(this); 
+		return aR;
+	}
+
+	if (rType == ::getCppuType((const uno::Reference<XAccessibleSelection>*)0))
+	{
+		uno::Any aR; 
+		aR <<= uno::Reference<XAccessibleSelection>(this); 
+		return aR;
+	}
+	//-----IAccessibility2 Implementation 2009
     if ( rType == ::getCppuType( static_cast< uno::Reference< XAccessibleValue > * >( 0 ) ) )
     {
         uno::Reference<XAccessibleValue> xValue = this;
     return pCellFrm->GetTabBox()->GetFrmFmt();
 }
 
-
+//IAccessibility2 Implementation 2009-----
+//Implement TableCell currentValue
 uno::Any SwAccessibleCell::getCurrentValue( )
     throw( uno::RuntimeException )
 {
 	CHECK_FOR_DEFUNC( XAccessibleValue );
 
     uno::Any aAny;
-    aAny <<= GetTblBoxFormat()->GetTblBoxValue().GetValue();
+
+    const SwCellFrm* pCellFrm = static_cast<const SwCellFrm*>( GetFrm() );
+    const SwStartNode *pSttNd = pCellFrm->GetTabBox()->GetSttNd();	
+	if( pSttNd )
+	{
+		::rtl::OUString strRet;	
+		SwNodeIndex aCntntIdx( *pSttNd, 0 );
+		SwCntntNode* pCNd=NULL;
+		for(int nIndex = 0 ; 
+			0 != ( pCNd = pSttNd->GetNodes().GoNext( &aCntntIdx ) ) &&
+			aCntntIdx.GetIndex() < pSttNd->EndOfSectionIndex(); 
+			++nIndex )
+		{
+			if(pCNd && pCNd->IsTxtNode())
+			{
+				if (0 != nIndex)
+				{
+					strRet += ::rtl::OUString::createFromAscii(" ");					
+				}
+				strRet +=((SwTxtNode*)pCNd)->GetTxt();				
+			}
+		}
+		aAny <<= strRet;
+	}
     return aAny;
 }
+//-----IAccessibility2 Implementation 2009
 
 sal_Bool SwAccessibleCell::setCurrentValue( const uno::Any& aNumber )
     throw( uno::RuntimeException )
     aAny <<= -DBL_MAX;
     return aAny;
 }
+
+//IAccessibility2 Implementation 2009-----
+::rtl::OUString ReplaceOneChar(::rtl::OUString oldOUString, ::rtl::OUString replacedChar, ::rtl::OUString replaceStr)
+{
+	int iReplace = -1;
+	iReplace = oldOUString.lastIndexOf(replacedChar);
+	if (iReplace > -1)
+	{
+		for(;iReplace>-1;)
+		{
+			oldOUString = oldOUString.replaceAt(iReplace,1, replaceStr);
+			iReplace=oldOUString.lastIndexOf(replacedChar,iReplace);
+		}
+	}
+	return oldOUString;
+}
+::rtl::OUString ReplaceFourChar(::rtl::OUString oldOUString)
+{
+	oldOUString = ReplaceOneChar(oldOUString,OUString::createFromAscii("\\"),OUString::createFromAscii("\\\\"));
+	oldOUString = ReplaceOneChar(oldOUString,::rtl::OUString::createFromAscii(";"),::rtl::OUString::createFromAscii("\\;"));
+	oldOUString = ReplaceOneChar(oldOUString,::rtl::OUString::createFromAscii("="),::rtl::OUString::createFromAscii("\\="));
+	oldOUString = ReplaceOneChar(oldOUString,::rtl::OUString::createFromAscii(","),::rtl::OUString::createFromAscii("\\,"));
+	oldOUString = ReplaceOneChar(oldOUString,::rtl::OUString::createFromAscii(":"),::rtl::OUString::createFromAscii("\\:"));
+	return oldOUString;
+}
+
+::com::sun::star::uno::Any SAL_CALL SwAccessibleCell::get_attributes() 
+		throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) 
+{
+	::com::sun::star::uno::Any strRet;
+    SwFrmFmt *pFrmFmt = GetTblBoxFormat();
+	DBG_ASSERT(pFrmFmt,"Must be Valid");
+	
+	const SwTblBoxFormula& tbl_formula = pFrmFmt->GetTblBoxFormula();
+
+	::rtl::OUString strFormula = ReplaceFourChar(tbl_formula.GetFormula());
+	::rtl::OUString strFor = ::rtl::OUString::createFromAscii("Formula:");
+	strFor += strFormula;
+	strFor += ::rtl::OUString::createFromAscii(";") ; 
+	strRet <<= strFor;
+
+	return strRet;
+}
+
+sal_Int32 SAL_CALL SwAccessibleCell::getBackground() 
+		throw (::com::sun::star::uno::RuntimeException)
+{
+	const SvxBrushItem &rBack = GetFrm()->GetAttrSet()->GetBackground();
+	sal_uInt32 crBack = rBack.GetColor().GetColor();
+	
+	if (COL_AUTO == crBack)
+	{
+		uno::Reference<XAccessible> xAccDoc = getAccessibleParent();
+		if (xAccDoc.is())
+		{
+			uno::Reference<XAccessibleComponent> xCompoentDoc(xAccDoc, uno::UNO_QUERY);
+			if (xCompoentDoc.is())
+			{
+				crBack = (sal_uInt32)xCompoentDoc->getBackground();
+			}
+		}
+	}
+	return crBack;
+}
+
+//=====  XAccessibleSelection  ============================================
+void SwAccessibleCell::selectAccessibleChild( 
+    sal_Int32 nChildIndex ) 
+	throw ( lang::IndexOutOfBoundsException, uno::RuntimeException )
+{
+    aSelectionHelper.selectAccessibleChild(nChildIndex);
+}
+
+sal_Bool SwAccessibleCell::isAccessibleChildSelected( 
+    sal_Int32 nChildIndex ) 
+	throw ( lang::IndexOutOfBoundsException, uno::RuntimeException )
+{
+    return aSelectionHelper.isAccessibleChildSelected(nChildIndex);
+}
+
+void SwAccessibleCell::clearAccessibleSelection(  ) 
+	throw ( uno::RuntimeException )
+{
+    aSelectionHelper.clearAccessibleSelection();
+}
+
+void SwAccessibleCell::selectAllAccessibleChildren(  ) 
+    throw ( uno::RuntimeException )
+{
+    aSelectionHelper.selectAllAccessibleChildren();
+}
+
+sal_Int32 SwAccessibleCell::getSelectedAccessibleChildCount(  ) 
+    throw ( uno::RuntimeException )
+{
+    return aSelectionHelper.getSelectedAccessibleChildCount();
+}
+
+uno::Reference<XAccessible> SwAccessibleCell::getSelectedAccessibleChild( 
+    sal_Int32 nSelectedChildIndex ) 
+	throw ( lang::IndexOutOfBoundsException, uno::RuntimeException)
+{
+    return aSelectionHelper.getSelectedAccessibleChild(nSelectedChildIndex);
+}
+
+void SwAccessibleCell::deselectAccessibleChild( 
+    sal_Int32 nSelectedChildIndex ) 
+	throw ( lang::IndexOutOfBoundsException, uno::RuntimeException )
+{
+    aSelectionHelper.deselectAccessibleChild(nSelectedChildIndex);
+}
+
+SwAccessibleTable *SwAccessibleCell::GetTable()
+{
+	if (!m_pAccTable)
+	{
+		if (!xTableReference.is())
+		{
+			xTableReference = getAccessibleParent();
+		#ifdef OSL_DEBUG_LEVEL
+			uno::Reference<XAccessibleContext> xContextTable(xTableReference, uno::UNO_QUERY);
+			OSL_ASSERT(xContextTable.is() && xContextTable->getAccessibleRole() == AccessibleRole::TABLE);
+		#endif
+			//SwAccessibleTable aTable = *(static_cast<SwAccessibleTable *>(xTable.get()));
+		}
+		m_pAccTable = static_cast<SwAccessibleTable *>(xTableReference.get());
+	}
+	return m_pAccTable;
+}
+//-----IAccessibility2 Implementation 2009

File sw/source/core/access/acccell.hxx

 #include "acccontext.hxx"
 #include <com/sun/star/accessibility/XAccessibleValue.hpp>
 
+//IAccessibility2 Implementation 2009-----
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEATTRIBUTE_HPP_
+#include <com/sun/star/accessibility/XAccessibleAttribute.hpp>
+#endif
+
+#ifndef _ACCSELECTIONHELPER_HXX_
+#include <accselectionhelper.hxx>
+#endif
+//-----IAccessibility2 Implementation 2009
+
 class SwCellFrm;
+class SwAccessibleTable;
 class SwFrmFmt;
 
 class SwAccessibleCell : public	SwAccessibleContext,
-                  ::com::sun::star::accessibility::XAccessibleValue
-
+                  ::com::sun::star::accessibility::XAccessibleValue,
+                  ::com::sun::star::accessibility::XAccessibleSelection, 
+					public  ::com::sun::star::accessibility::XAccessibleAttribute
 {
+    // Implementation for XAccessibleSelection interface
+    SwAccessibleSelectionHelper aSelectionHelper;
 	sal_Bool	bIsSelected;	// protected by base class mutex
 
 	sal_Bool	IsSelected();
 
 	//=====  XAccessibleValue  ================================================
 
+	//=====  XAccessibleAttribute ================================================	
+	//IAccessibility2 Implementation 2009-----
+	::com::sun::star::uno::Any SAL_CALL get_attributes() 
+		throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ;
+	//-----IAccessibility2 Implementation 2009
 private:
     SwFrmFmt* GetTblBoxFormat() const;
 
 
     virtual ::com::sun::star::uno::Any SAL_CALL getMinimumValue(  )
         throw (::com::sun::star::uno::RuntimeException);
+	//IAccessibility2 Implementation 2009-----
+	//=====  XAccessibleComponent  ============================================
+	sal_Int32 SAL_CALL getBackground() 
+		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 );
+
+	SwAccessibleTable *GetTable();
+	::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xTableReference;
+	SwAccessibleTable *m_pAccTable;
+	//-----IAccessibility2 Implementation 2009
 };
 
 

File sw/source/core/access/acccontext.cxx

 #include <acccontext.hxx>
 #include <svx/AccessibleShape.hxx>
 #include <comphelper/accessibleeventnotifier.hxx>
+//IAccessibility2 Implementation 2009-----
+#ifndef _ACCPARA_HXX
+#include "accpara.hxx"
+#endif
+//-----IAccessibility2 Implementation 2009
 #include <PostItMgr.hxx>
 
 using namespace sw::access;
                             "<SwAccessibleContext::ChildrenScrolled(..)> - always included child not considered!" );
                     const SwFrm* pLower( rLower.GetSwFrm() );
 					::vos::ORef< SwAccessibleContext > xAccImpl =
-						GetMap()->GetContextImpl( pLower, SCROLLED_OUT == eAction ||
-												SCROLLED_IN == eAction );
+						//IAccessibility2 Implementation 2009-----
+						//O is: GetMap()->GetContextImpl( pLower, SCROLLED_OUT == eAction ||
+						//						SCROLLED_IN == eAction );
+						GetMap()->GetContextImpl( pLower, sal_True );
+						//-----IAccessibility2 Implementation 2009
 					if( xAccImpl.isValid() )
 					{
 						switch( eAction )
                     ASSERT( !rLower.AlwaysIncludeAsChild(),
                             "<SwAccessibleContext::ChildrenScrolled(..)> - always included child not considered!" );
 					::vos::ORef< ::accessibility::AccessibleShape > xAccImpl =
+						//IAccessibility2 Implementation 2009-----
+						//O is:	GetMap()->GetContextImpl( rLower.GetSdrObject(),
+						//						  this,
+						//						  SCROLLED_OUT == eAction ||
+						//						  SCROLLED_IN == eAction ); 
                         GetMap()->GetContextImpl( rLower.GetDrawObject(),
 												  this,
-												  SCROLLED_OUT == eAction ||
-												  SCROLLED_IN == eAction );
+												  sal_True );
+						//-----IAccessibility2 Implementation 2009
 					if( xAccImpl.isValid() )
 					{
 						switch( eAction )
 								xAccImpl->ViewForwarderChanged(
 									::accessibility::IAccessibleViewForwarderListener::VISIBLE_AREA,
 									GetMap() );
-                                DisposeShape( rLower.GetDrawObject(),
-											  xAccImpl.getBodyPtr() );
+								//IAccessibility2 Implementation 2009-----
+								//Remove
+								//DisposeShape( rLower.GetDrawObject(),
+								//			  xAccImpl.getBodyPtr() );
+								//-----IAccessibility2 Implementation 2009
 							}
 							break;
 						case NONE:
 	// the child event. In this case no listener will exist.
 	FireStateChangedEvent( AccessibleStateType::SHOWING, sal_False );
 
+	//IAccessibility2 Implementation 2009-----
+	//Remove Dispose When scrolledout
 	// We now dispose the frame
-	Dispose( sal_True );
+	//	Dispose( sal_True );
+	//-----IAccessibility2 Implementation 2009
 }
 
 // --> OD 2005-12-12 #i27301# - use new type definition for <_nStates>
 
 	// EDITABLE
 	if( bIsEditableState )
+	//IAccessibility2 Implementation 2009-----
+	//Solution:Set editable state to graphic and other object when the document is editable
+	{
 		rStateSet.AddState( AccessibleStateType::EDITABLE );
-
+		rStateSet.AddState( AccessibleStateType::RESIZABLE );
+		rStateSet.AddState( AccessibleStateType::MOVEABLE );
+	}
+	//-----IAccessibility2 Implementation 2009
 	// ENABLED
 	rStateSet.AddState( AccessibleStateType::ENABLED );
 
     , nRole( nR )
     , bDisposing( sal_False )
     , bRegisteredAtAccessibleMap( true )
+    //IAccessibility2 Implementation 2009-----
+    //Solution:Initialize the begin document load and IfAsynLoad to true
+    , bBeginDocumentLoad( sal_True )
+	, isIfAsynLoad( sal_True )
+	, bIsSeletedInDoc( sal_False)
+	//-----IAccessibility2 Implementation 2009
 {
 	InitStates();
 	DBG_MSG_CD( "constructed" )
 	vos::OGuard aGuard(Application::GetSolarMutex());
 
 	CHECK_FOR_DEFUNC( XAccessibleContext )
+	//IAccessibility2 Implementation 2009-----
+	//Solution:Notify the frame is a document
+	if( nRole == AccessibleRole::DOCUMENT )		
+		bIsAccDocUse = sal_True;
+	//-----IAccessibility2 Implementation 2009
 
     return bDisposing ? 0 : GetChildCount( *(GetMap()) );
 }
 
 	CHECK_FOR_DEFUNC( XAccessibleContext )
 
+	//IAccessibility2 Implementation 2009-----
+	//Solution:Notify the frame is a document
+	if( nRole == AccessibleRole::DOCUMENT )		
+		bIsAccDocUse = sal_True;
+	//-----IAccessibility2 Implementation 2009
+
     const SwAccessibleChild aChild( GetChild( *(GetMap()), nIndex ) );
 	if( !aChild.IsValid() )
 	{
 	{
 		::vos::ORef < SwAccessibleContext > xChildImpl(
 				GetMap()->GetContextImpl( aChild.GetSwFrm(), !bDisposing )  );
+		//IAccessibility2 Implementation 2009-----
+		//Solution:Send out accessible event when begin load.
+		if( bBeginDocumentLoad && nRole == AccessibleRole::DOCUMENT )
+		{
+			
+			FireStateChangedEvent( AccessibleStateType::FOCUSABLE,sal_True );
+			FireStateChangedEvent( AccessibleStateType::BUSY,sal_True );
+			if( !isIfAsynLoad )
+			{
+				FireStateChangedEvent( AccessibleStateType::FOCUSED,sal_True );
+				// IA2 CWS. MT: OFFSCREEN == !SHOWING, should stay consistent
+				// FireStateChangedEvent( AccessibleStateType::OFFSCREEN,sal_True );
+				FireStateChangedEvent( AccessibleStateType::SHOWING,sal_True );
+			    FireStateChangedEvent( AccessibleStateType::BUSY,sal_False );
+				// MT: OFFSCREEN again?
+			    // FireStateChangedEvent( AccessibleStateType::OFFSCREEN,sal_False );	
+			}
+			bBeginDocumentLoad = sal_False;
+		}
+		//-----IAccessibility2 Implementation 2009
 		if( xChildImpl.isValid() )
 		{
 			xChildImpl->SetParent( this );
 	::utl::AccessibleStateSetHelper *pStateSet =
 		new ::utl::AccessibleStateSetHelper;
 
+	//IAccessibility2 Implementation 2009-----
+	if( bIsSeletedInDoc )
+		pStateSet->AddState( AccessibleStateType::SELECTED );
+	//-----IAccessibility2 Implementation 2009
+
 	uno::Reference<XAccessibleStateSet> xStateSet( pStateSet );
 	GetStates( *pStateSet );
 
 sal_Int32 SAL_CALL SwAccessibleContext::getForeground()
 		throw (uno::RuntimeException)
 {
-	return 0;
+	//IAccessibility2 Implementation 2009-----
+	return COL_BLACK;
+	//-----IAccessibility2 Implementation 2009
 }
 
 sal_Int32 SAL_CALL SwAccessibleContext::getBackground()
 		throw (uno::RuntimeException)
 {
-	return 0xffffff;
+	return COL_WHITE;
 }
 
 
 void SwAccessibleContext::ScrolledInShape( const SdrObject* ,
 								::accessibility::AccessibleShape *pAccImpl )
 {
+	//IAccessibility2 Implementation 2009-----
+	if(NULL == pAccImpl)
+	{
+		return ; 
+	}
+	//-----IAccessibility2 Implementation 2009
 	AccessibleEventObject aEvent;
 	aEvent.EventId = AccessibleEventId::CHILD;
 	uno::Reference< XAccessible > xAcc( pAccImpl );
         SwAccessibleChild( GetParent() ).IsVisibleChildrenOnly() )
 	{
 		// The frame is now invisible -> dispose it
-		Dispose( sal_True );
+		//IAccessibility2 Implementation 2009-----
+		//Remove
+		//Dispose( sal_True );
+		//-----IAccessibility2 Implementation 2009
 	}
 	else
 	{
 	aStrm.Flush();
 }
 #endif
+//IAccessibility2 Implementation 2009-----
+sal_Bool SwAccessibleContext::SetSelectedState(sal_Bool bSeleted)
+{
+	if(bIsSeletedInDoc != bSeleted)
+	{
+		bIsSeletedInDoc = bSeleted;
+		FireStateChangedEvent( AccessibleStateType::SELECTED, bSeleted );
+		return sal_True;
+	}
+	return sal_False;
+};
+//-----IAccessibility2 Implementation 2009

File sw/source/core/access/acccontext.hxx

     // <--
 
 	void InitStates();
+	//IAccessibility2 Implementation 2009-----
+	//Solution:Add a member to identify the firt time that document load
+	sal_Bool bBeginDocumentLoad;
+	//-----IAccessibility2 Implementation 2009
 
 protected:
 	void SetName( const ::rtl::OUString& rName ) { sName = rName; }
     {
         return nRole;
     }
-
+	//IAccessibility2 Implementation 2009-----
+	//Solution:Add a member to identify if the document is Asyn load.
+    sal_Bool isIfAsynLoad;
+	//This flag is used to mark the object's selected state.
+	sal_Bool   bIsSeletedInDoc;
+	//-----IAccessibility2 Implementation 2009
 	void SetParent( SwAccessibleContext *pParent );
 	::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> GetWeakParent() const;
 
 
 public:
 
+	//IAccessibility2 Implementation 2009-----
+	void SetMap(SwAccessibleMap *pM){pMap = pM;}
+	//-----IAccessibility2 Implementation 2009
 	void FireAccessibleEvent( ::com::sun::star::accessibility::AccessibleEventObject& rEvent );
 
 protected:
     {
         return Select( 0, pObj, bAdd );
     }
+	//IAccessibility2 Implementation 2009-----
+	//This method is used to updated the selected state and fire the selected state changed event.
+	virtual sal_Bool SetSelectedState(sal_Bool bSeleted);
+	sal_Bool  IsSeletedInDoc(){  return bIsSeletedInDoc; }
+	//-----IAccessibility2 Implementation 2009
 
     static ::rtl::OUString GetResource( sal_uInt16 nResId,
                                         const ::rtl::OUString *pArg1 = 0,
                                         const ::rtl::OUString *pArg2 = 0 );
-
-
 };
 
 // some heaviliy used exception support

File sw/source/core/access/accdoc.cxx

 #include <doc.hxx>
 #include <accmap.hxx>
 #include <accdoc.hxx>
-#ifndef _ACCESS_HRC
 #include "access.hrc"
-#endif
 #include <pagefrm.hxx>
 
+//IAccessibility2 Implementation 2009-----
+#include <editeng/brshitem.hxx>
+#include <swatrset.hxx>
+#include <frmatr.hxx>
+#include "unostyle.hxx"
+#include "viewsh.hxx"
+#include "docsh.hxx"
+#include <crsrsh.hxx>
+#include "fesh.hxx"
+#include <fmtclds.hxx>
+#include <flyfrm.hxx>
+#include <colfrm.hxx>
+#include <txtfrm.hxx>
+#include <sectfrm.hxx>
+#include <section.hxx>
+#include <svx/unoapi.hxx>
+#include <swmodule.hxx>
+#include <svtools/colorcfg.hxx>
+//for note accessibility
+//#include "postit.hxx"
+//#include "PostItMgr.hxx"
+
+#include <fmtanchr.hxx>
+#include <viewimp.hxx>
+#include <dview.hxx>
+#include <dcontact.hxx>
+#include <svx/svdmark.hxx>
+//-----IAccessibility2 Implementation 2009
 const sal_Char sServiceName[] = "com.sun.star.text.AccessibleTextDocumentView";
 const sal_Char sImplementationName[] = "com.sun.star.comp.Writer.SwAccessibleDocumentView";
 
 
 	for( sal_Int32 i=0; i < nCount; i++ )
 	{
-		if( xAcc->getAccessibleChild( i ) == xThis )
-			return i;
+		//IAccessibility2 Implementation 2009-----
+		try
+		{
+			if( xAcc->getAccessibleChild( i ) == xThis )
+				return i;
+		}
+		catch(::com::sun::star::lang::IndexOutOfBoundsException e)
+		{
+			return -1L;
+		}
+		//-----IAccessibility2 Implementation 2009
 	}
 	return -1L;
 }
 	return GetResource( STR_ACCESS_DOC_DESC );
 }
 
+//IAccessibility2 Implementation 2009-----
+OUString SAL_CALL SwAccessibleDocumentBase::getAccessibleName (void)
+		throw (::com::sun::star::uno::RuntimeException)
+{
+	OUString sAccName = GetResource( STR_ACCESS_DOC_WORDPROCESSING );
+	SwDoc *pDoc = GetShell()->GetDoc();
+	if ( pDoc )
+	{
+		OUString sFileName = pDoc->getDocAccTitle();
+		if ( !sFileName.getLength() )
+		{
+			SwDocShell* pDocSh = pDoc->GetDocShell();
+			if ( pDocSh )
+			{
+				sFileName = pDocSh->GetTitle( SFX_TITLE_APINAME );
+			}
+		}
+		OUString sReadOnly;
+		if(pDoc->getDocReadOnly())
+		{
+			sReadOnly = GetResource( STR_ACCESS_DOC_WORDPROCESSING_READONLY );
+		}
+
+		if ( sFileName.getLength() )
+		{
+			sAccName = sFileName + sReadOnly + OUString(RTL_CONSTASCII_USTRINGPARAM(" - ")) + sAccName;			
+		}
+	}
+
+	return sAccName;
+}
+//-----IAccessibility2 Implementation 2009
+
 awt::Rectangle SAL_CALL SwAccessibleDocumentBase::getBounds()
 		throw (uno::RuntimeException)
 {
-	vos::OGuard aGuard(Application::GetSolarMutex());
-
-	Window *pWin = GetWindow();
-
-	CHECK_FOR_WINDOW( XAccessibleComponent, pWin )
-
-	Rectangle aPixBounds( pWin->GetWindowExtentsRelative( pWin->GetAccessibleParentWindow() ) );
-	awt::Rectangle aBox( aPixBounds.Left(), aPixBounds.Top(),
-						 aPixBounds.GetWidth(), aPixBounds.GetHeight() );
-
-	return aBox;
+	//IAccessibility2 Implementation 2009-----
+	try
+	{
+		vos::OGuard aGuard(Application::GetSolarMutex());
+		
+		Window *pWin = GetWindow();
+		
+		CHECK_FOR_WINDOW( XAccessibleComponent, pWin )
+			
+			Rectangle aPixBounds( pWin->GetWindowExtentsRelative( pWin->GetAccessibleParentWindow() ) );
+		awt::Rectangle aBox( aPixBounds.Left(), aPixBounds.Top(),
+			aPixBounds.GetWidth(), aPixBounds.GetHeight() );
+		
+		return aBox;
+	}
+	catch(::com::sun::star::lang::IndexOutOfBoundsException e)
+	{
+		return awt::Rectangle();
+	}
+	//-----IAccessibility2 Implementation 2009
 }
 
 
 
 	// MULTISELECTABLE
 	rStateSet.AddState( AccessibleStateType::MULTI_SELECTABLE );
+	//IAccessibility2 Implementation 2009-----
+	rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
+	//-----IAccessibility2 Implementation 2009
 }
 
 
 	return 0;
 }
 
-
 OUString SAL_CALL SwAccessibleDocument::getImplementationName()
         throw( uno::RuntimeException )
 {
         uno::Reference<XAccessibleSelection> aSelect = this;
         aRet <<= aSelect;
     }
+    //IAccessibility2 Implementation 2009-----
+    //Solution:Add XEventListener interface support.
+	else if ( (rType == ::getCppuType((uno::Reference<com::sun::star::document::XEventListener> *)NULL)) )
+    {
+        uno::Reference<com::sun::star::document::XEventListener> aSelect = this;
+        aRet <<= aSelect;
+    }
+    else  if ( rType == ::getCppuType((uno::Reference<XAccessibleAttribute> *)NULL) )
+    {
+        uno::Reference<XAccessibleAttribute> aAttribute = this;
+        aRet <<= aAttribute;
+    }
+    else if(rType == ::getCppuType((uno::Reference<XAccessibleGetAccFlowTo> *)NULL) )
+    {
+		uno::Reference<XAccessibleGetAccFlowTo> AccFlowTo = this;
+        aRet <<= AccFlowTo;
+    }
+    //-----IAccessibility2 Implementation 2009
     else
         aRet = SwAccessibleContext::queryInterface( rType );
     return aRet;
 	uno::Sequence< uno::Type > aTypes( SwAccessibleDocumentBase::getTypes() );
 
 	sal_Int32 nIndex = aTypes.getLength();
-	aTypes.realloc( nIndex + 1 );
+	//IAccessibility2 Implementation 2009-----
+	//Solution:Reset types memory alloc
+	//aTypes.realloc( nIndex + 1 );
+	aTypes.realloc( nIndex + 2 );
 
 	uno::Type* pTypes = aTypes.getArray();
 	pTypes[nIndex] = ::getCppuType( static_cast< uno::Reference< XAccessibleSelection > * >( 0 ) );
-
+	//Solution:Add XEventListener interface support.
+	pTypes[nIndex + 1 ] = ::getCppuType( static_cast< uno::Reference< com::sun::star::document::XEventListener > * >( 0 ) );
+	//-----IAccessibility2 Implementation 2009
 	return aTypes;
 }
 
 {
     maSelectionHelper.deselectAccessibleChild( nChildIndex );
 }
+//IAccessibility2 Implementation 2009-----
+//Solution:Implement XEventListener interfaces
+void SAL_CALL SwAccessibleDocument::notifyEvent( const ::com::sun::star::document::EventObject& Event ) 
+			throw (::com::sun::star::uno::RuntimeException)
+{
+	if ( Event.EventName.equalsAscii( "FirstPageShows" ) )
+	{
+		FireStateChangedEvent( AccessibleStateType::FOCUSED,sal_True );
+	}
+	else if ( Event.EventName.equalsAscii( "LoadFinished" ) )
+	{
+		// IA2 CWS. MT: OFFSCREEN == !SHOWING, should stay consistent
+		// FireStateChangedEvent( AccessibleStateType::OFFSCREEN,sal_True );		
+		// MT: LoadFinished => Why not SHOWING == TRUE?
+		FireStateChangedEvent( AccessibleStateType::SHOWING,sal_False );		
+	}	
+	else if ( Event.EventName.equalsAscii( "FormatFinished" ) )
+	{
+		FireStateChangedEvent( AccessibleStateType::BUSY,sal_False );
+		// FireStateChangedEvent( AccessibleStateType::OFFSCREEN,sal_False );
+		FireStateChangedEvent( AccessibleStateType::SHOWING,sal_True );
+	}
+	else
+	{
+		isIfAsynLoad = sal_False;
+	}
+}
+
+void SAL_CALL SwAccessibleDocument::disposing( const ::com::sun::star::lang::EventObject& ) 
+			throw (::com::sun::star::uno::RuntimeException)
+{
+}
+
+uno::Any SAL_CALL SwAccessibleDocument::get_attributes() 
+		throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) 
+{
+	uno::Any anyAtrribute;
+	SwDoc *pDoc = GetShell()->GetDoc();
+	
+	if (!pDoc)
+		return anyAtrribute;
+	SwCrsrShell* pCrsrShell = GetCrsrShell();
+	if( !pCrsrShell )
+		return anyAtrribute;
+
+    SwFEShell* pFEShell = pCrsrShell->ISA( SwFEShell )
+								? static_cast<SwFEShell*>( pCrsrShell )
+							: 0;
+	rtl::OUString sAttrName;
+	rtl::OUString sValue;
+	sal_uInt16 nPage, nLogPage;
+	String sDisplay;
+
+	if( pFEShell )
+	{
+		pFEShell->GetPageNumber(-1,sal_True,nPage,nLogPage,sDisplay);
+		sAttrName = rtl::OUString::createFromAscii("page-name:");
+
+
+		sValue = sAttrName + sDisplay ;
+		sAttrName = rtl::OUString::createFromAscii(";page-number:");
+		sValue += sAttrName;
+		sValue += String::CreateFromInt32( nPage ) ;
+		sAttrName = rtl::OUString::createFromAscii(";total-pages:");
+		sValue += sAttrName;
+		sValue += String::CreateFromInt32( pCrsrShell->GetPageCnt() ) ;
+		sValue +=  rtl::OUString::createFromAscii(";");
+
+		
+		sAttrName=rtl::OUString::createFromAscii("line-number:");
+
+
+		
+		SwCntntFrm* pCurrFrm = pCrsrShell->GetCurrFrm();
+		SwPageFrm* pCurrPage=((SwFrm*)pCurrFrm)->FindPageFrm();
+		sal_uLong nLineNum = 0;
+		//IAccessibility2 Implementation 2009-----
+		SwTxtFrm* pTxtFrm = NULL;
+		SwTxtFrm* pCurrTxtFrm = NULL;
+		pTxtFrm = static_cast< SwTxtFrm* >(static_cast< SwPageFrm* > (pCurrPage)->ContainsCntnt());
+		if (pCurrFrm->IsInFly())//such as, graphic,chart
+		{
+			SwFlyFrm *pFlyFrm = pCurrFrm->FindFlyFrm();
+			const SwFmtAnchor& rAnchor = pFlyFrm->GetFmt()->GetAnchor();
+			RndStdIds eAnchorId = rAnchor.GetAnchorId();
+			if(eAnchorId == FLY_AS_CHAR)
+			{
+				const SwFrm *pSwFrm = pFlyFrm->GetAnchorFrm();
+				if(pSwFrm->IsTxtFrm())
+					pCurrTxtFrm = ((SwTxtFrm*)(pSwFrm));
+			}
+		}
+		else
+			pCurrTxtFrm = static_cast< SwTxtFrm* >(pCurrFrm);
+		//check whether the text frame where the Graph/OLE/Frame anchored is in the Header/Footer
+		SwFrm* pFrm = pCurrTxtFrm;
+		while ( pFrm && !pFrm->IsHeaderFrm() && !pFrm->IsFooterFrm() )
+			pFrm = pFrm->GetUpper();
+		if ( pFrm )
+			pCurrTxtFrm = NULL;
+		//check shape
+		if(pCrsrShell->Imp()->GetDrawView())
+		{
+			const SdrMarkList &rMrkList = pCrsrShell->Imp()->GetDrawView()->GetMarkedObjectList();
+			for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
+			{
+				SdrObject *pObj = rMrkList.GetMark(i)->GetMarkedSdrObj();		
+				SwFrmFmt* pFmt = ((SwDrawContact*)pObj->GetUserCall())->GetFmt();
+				const SwFmtAnchor& rAnchor = pFmt->GetAnchor();
+				if( FLY_AS_CHAR != rAnchor.GetAnchorId() ) 
+					pCurrTxtFrm = NULL;
+			}
+		}
+		//calculate line number
+		if (pCurrTxtFrm && pTxtFrm)
+		{
+			if (!(pCurrTxtFrm->IsInTab() || pCurrTxtFrm->IsInFtn()))
+			{
+				while( pTxtFrm != pCurrTxtFrm )
+				{
+					//check header/footer
+					pFrm = pTxtFrm;
+					while ( pFrm && !pFrm->IsHeaderFrm() && !pFrm->IsFooterFrm() )
+						pFrm = pFrm->GetUpper();
+					if ( pFrm )
+					{
+						pTxtFrm = static_cast< SwTxtFrm*>(pTxtFrm->GetNextCntntFrm());
+						continue;
+					}
+					if (!(pTxtFrm->IsInTab() || pTxtFrm->IsInFtn() || pTxtFrm->IsInFly()))
+						nLineNum += pTxtFrm->GetThisLines();
+					pTxtFrm = static_cast< SwTxtFrm* >(pTxtFrm ->GetNextCntntFrm());
+				}
+				SwPaM* pCaret = pCrsrShell->GetCrsr();
+				if (!pCurrTxtFrm->IsEmpty() && pCaret)
+				{
+					sal_uInt16 nActPos = 0;
+					if (pCurrTxtFrm->IsTxtFrm())
+					{
+						const SwPosition* pPoint = NULL;
+						if(pCurrTxtFrm->IsInFly())
+						{
+							SwFlyFrm *pFlyFrm = pCurrTxtFrm->FindFlyFrm();
+							const SwFmtAnchor& rAnchor = pFlyFrm->GetFmt()->GetAnchor();
+							pPoint= rAnchor.GetCntntAnchor();
+						}
+						else
+							pPoint = pCaret->GetPoint();
+						nActPos = pPoint->nContent.GetIndex();
+						nLineNum += pCurrTxtFrm->GetLineCount( nActPos );
+					}
+					else//graphic, form, shape, etc.
+					{
+						SwPosition* pPoint =  pCaret->GetPoint();
+						Point aPt = pCrsrShell->_GetCrsr()->GetPtPos();
+						if( pCrsrShell->GetLayout()->GetCrsrOfst( pPoint, aPt/*,* &eTmpState*/ ) )
+						{
+							nActPos = pPoint->nContent.GetIndex();
+							nLineNum += pCurrTxtFrm->GetLineCount( nActPos );
+						}
+					}
+				}
+				else
+					++nLineNum;
+			}
+		}
+		//-----IAccessibility2 Implementation 2009
+		
+		sValue += sAttrName;
+		sValue += String::CreateFromInt32( nLineNum ) ;
+
+		sValue +=  rtl::OUString::createFromAscii(";");
+
+		
+		SwFrm* pCurrCol=((SwFrm*)pCurrFrm)->FindColFrm();
+
+		sAttrName=rtl::OUString::createFromAscii("column-number:");
+		sValue += sAttrName;		
+
+		sal_uInt16 nCurrCol = 1;
+		if(pCurrCol!=NULL)
+		{
+			//SwLayoutFrm* pParent = pCurrCol->GetUpper();
+			SwFrm* pCurrPageCol=((SwFrm*)pCurrFrm)->FindColFrm();
+			while(pCurrPageCol && pCurrPageCol->GetUpper() && pCurrPageCol->GetUpper()->IsPageFrm())
+			{
+				pCurrPageCol = pCurrPageCol->GetUpper();
+			}
+			
+			SwLayoutFrm* pParent = (SwLayoutFrm*)(pCurrPageCol->GetUpper());
+
+			if(pParent!=NULL)
+			{
+				SwFrm* pCol = pParent->Lower();
+				while(pCol&&(pCol!=pCurrPageCol))
+				{
+					pCol = pCol->GetNext();
+					nCurrCol +=1;
+				}
+			}
+		}
+		sValue += String::CreateFromInt32( nCurrCol ) ;
+		sValue +=  rtl::OUString::createFromAscii(";");
+
+		sAttrName=rtl::OUString::createFromAscii("total-columns:");
+		
+		const SwFmtCol &rFmtCol=pCurrPage->GetAttrSet()->GetCol();
+		sal_uInt16 nColCount=rFmtCol.GetNumCols();
+		nColCount = nColCount>0?nColCount:1;
+		sValue += sAttrName;
+		sValue += String::CreateFromInt32( nColCount ) ;
+		
+		sValue +=  rtl::OUString::createFromAscii(";");
+
+		if(pCurrFrm!=NULL)
+		{
+			SwSectionFrm* pCurrSctFrm=((SwFrm*)pCurrFrm)->FindSctFrm();
+			if(pCurrSctFrm!=NULL && pCurrSctFrm->GetSection()!=NULL )
+			{
+				sAttrName = rtl::OUString::createFromAscii("section-name:");
+		
+				sValue += sAttrName;
+				String sectionName = pCurrSctFrm->GetSection()->GetSectionName();
+
+				sectionName.SearchAndReplace( String::CreateFromAscii( "\\" ), String::CreateFromAscii("\\\\" ));
+				sectionName.SearchAndReplace( String::CreateFromAscii( "=" ), String::CreateFromAscii("\\=" ) );
+				sectionName.SearchAndReplace( String::CreateFromAscii( ";" ), String::CreateFromAscii("\\;" ) );
+				sectionName.SearchAndReplace( String::CreateFromAscii( "," ), String::CreateFromAscii("\\," ) );
+				sectionName.SearchAndReplace( String::CreateFromAscii( ":" ), String::CreateFromAscii("\\:" ) );
+				
+				sValue += sectionName;
+				//sValue += pCurrSctFrm->GetSection()->GetName();
+				
+				sValue += rtl::OUString::createFromAscii(";");
+
+				//section-columns-number
+				{
+				sAttrName=rtl::OUString::createFromAscii("section-columns-number:");
+
+				nCurrCol = 1;
+				
+				if(pCurrCol!=NULL)
+				{
+					SwLayoutFrm* pParent = pCurrCol->GetUpper();
+					if(pParent!=NULL)
+					{
+						SwFrm* pCol = pParent->Lower();
+						while(pCol&&(pCol!=pCurrCol))
+						{
+							pCol = pCol->GetNext();
+							nCurrCol +=1;
+						}
+					}
+				}
+				sValue += sAttrName;
+				sValue += String::CreateFromInt32( nCurrCol ) ;
+				sValue +=  rtl::OUString::createFromAscii(";");
+				}
+
+				//section-total-columns
+				{
+				sAttrName=rtl::OUString::createFromAscii("section-total-columns:");
+				const SwFmtCol &rFmtSctCol=pCurrSctFrm->GetAttrSet()->GetCol();
+				sal_uInt16 nSctColCount=rFmtSctCol.GetNumCols();
+				nSctColCount = nSctColCount>0?nSctColCount:1;
+				sValue += sAttrName;
+				sValue += String::CreateFromInt32( nSctColCount ) ;
+				
+				sValue +=  rtl::OUString::createFromAscii(";");
+				}
+			}
+		}
+		anyAtrribute <<= sValue;
+	}
+	return anyAtrribute;
+}
+
+sal_Int32 SAL_CALL SwAccessibleDocument::getBackground() 
+		throw (::com::sun::star::uno::RuntimeException)
+{
+	// Sym2_3241----, added by Steve Yin
+	vos::OGuard aGuard(Application::GetSolarMutex());
+	return SW_MOD()->GetColorConfig().GetColorValue( ::svtools::DOCCOLOR ).nColor;
+	// ----Sym2_3241
+}
+
+::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
+		SAL_CALL SwAccessibleDocument::get_AccFlowTo(const ::com::sun::star::uno::Any& rAny, sal_Int32 nType)
+		throw ( ::com::sun::star::uno::RuntimeException )
+{
+	const sal_Int32 FORSPELLCHECKFLOWTO = 1;
+	const sal_Int32 FORFINDREPLACEFLOWTO = 2;
+	SwAccessibleMap* pAccMap = GetMap();
+	if ( !pAccMap )
+	{
+		goto Rt;
+	}
+
+	if ( nType == FORSPELLCHECKFLOWTO )
+	{
+		uno::Reference< ::com::sun::star::drawing::XShape > xShape;
+		rAny >>= xShape;
+		if( xShape.is() )
+		{
+			SdrObject* pObj = GetSdrObjectFromXShape(xShape);
+			if( pObj )
+			{
+				uno::Reference<XAccessible> xAcc = pAccMap->GetContext(pObj, this, sal_False);
+				uno::Reference < XAccessibleSelection > xAccSelection( xAcc, uno::UNO_QUERY );
+				if ( xAccSelection.is() )
+				{
+					try
+					{
+						if ( xAccSelection->getSelectedAccessibleChildCount() ) 
+						{
+							uno::Reference < XAccessible > xSel = xAccSelection->getSelectedAccessibleChild( 0 );
+							if ( xSel.is() )
+							{
+								uno::Reference < XAccessibleContext > xSelContext( xSel->getAccessibleContext() );
+								if ( xSelContext.is() )
+								{
+									//if in sw we find the selected paragraph here
+									if ( xSelContext->getAccessibleRole() == AccessibleRole::PARAGRAPH )
+									{
+										uno::Sequence<uno::Any> aRet( 1 );
+										aRet[0] = uno::makeAny( xSel );
+										return aRet;							
+									}
+								}
+							}
+						}
+					}
+					catch ( com::sun::star::lang::IndexOutOfBoundsException )
+					{
+						//return empty sequence
+						goto Rt;
+					}
+					//end of try...catch
+				}
+				/*uno::Sequence< uno::Any > aRet(1);
+				aRet[0] = uno::makeAny( xAcc );
+				return aRet;*/
+			}
+		}
+		else
+		{
+			uno::Reference< XAccessible > xAcc = pAccMap->GetCursorContext();
+			SwAccessibleContext *pAccImpl = static_cast< SwAccessibleContext *>( xAcc.get() );
+			if ( pAccImpl && pAccImpl->getAccessibleRole() == AccessibleRole::PARAGRAPH )
+			{
+				uno::Sequence< uno::Any > aRet(1);
+				aRet[0] = uno::makeAny( xAcc );
+				return aRet;
+			}
+		}
+	}
+	else if ( nType == FORFINDREPLACEFLOWTO )
+	{
+		SwCrsrShell* pCrsrShell = GetCrsrShell();
+		if ( pCrsrShell )
+		{
+			SwPaM *_pStartCrsr = pCrsrShell->GetCrsr(), *__pStartCrsr = _pStartCrsr;
+			SwCntntNode* pPrevNode = NULL;
+			std::vector<SwFrm*> vFrmList;
+			do
+			{
+				if ( _pStartCrsr && _pStartCrsr->HasMark() )
+				{
+					SwCntntNode* pCntntNode = _pStartCrsr->GetCntntNode();
+					if ( pCntntNode == pPrevNode )
+					{
+						continue;
+					}
+					SwFrm* pFrm = pCntntNode ? pCntntNode->GetFrm() : NULL;
+					if ( pFrm )
+					{
+						vFrmList.push_back( pFrm );
+					}
+					
+					pPrevNode = pCntntNode;
+				}
+			}
+
+			while( _pStartCrsr && ( (_pStartCrsr=(SwPaM *)_pStartCrsr->GetNext()) != __pStartCrsr) );
+
+			if ( vFrmList.size() )
+			{
+				uno::Sequence< uno::Any > aRet(vFrmList.size());
+				std::vector<SwFrm*>::iterator aIter = vFrmList.begin();
+				for ( sal_Int32 nIndex = 0; aIter != vFrmList.end(); aIter++, nIndex++ )
+				{
+					uno::Reference< XAccessible > xAcc = pAccMap->GetContext(*aIter, sal_False);
+					if ( xAcc.is() )
+					{
+						SwAccessibleContext *pAccImpl = static_cast< SwAccessibleContext *>( xAcc.get() );
+						if ( pAccImpl && pAccImpl->getAccessibleRole() == AccessibleRole::PARAGRAPH )
+						{
+							aRet[nIndex] = uno::makeAny( xAcc );
+						}
+					}					
+				}
+
+				return aRet;
+			}
+		}
+	}
+
+Rt:
+	uno::Sequence< uno::Any > aEmpty;
+	return aEmpty;
+}
+//-----IAccessibility2 Implementation 2009

File sw/source/core/access/accdoc.hxx

 #include "acccontext.hxx"
 #endif
 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
+//IAccessibility2 Implementation 2009-----
+#include <com/sun/star/document/XEventListener.hpp>
 #include <accselectionhelper.hxx>
 
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEATTRIBUTE_HPP_
+#include <com/sun/star/accessibility/XAccessibleAttribute.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEGETACCFLOWTO_HPP_
+#include <com/sun/star/accessibility/XAccessibleGetAccFlowTo.hpp>
+#endif
+//-----IAccessibility2 Implementation 2009
+
 class VclSimpleEvent;
 
 /**
     ///	Return this object's description.
 	virtual ::rtl::OUString SAL_CALL
     	getAccessibleDescription (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
 
 	//=====  XAccessibleComponent  ==============================================
     virtual sal_Bool SAL_CALL containsPoint(
  * access to an accessible Writer document
  */
 class SwAccessibleDocument : public	SwAccessibleDocumentBase,
-                             public com::sun::star::accessibility::XAccessibleSelection
+                             public com::sun::star::accessibility::XAccessibleSelection,
+							 //IAccessibility2 Implementation 2009-----
+                             public com::sun::star::document::XEventListener,
+							 public com::sun::star::accessibility::XAccessibleAttribute,
+							 //-----IAccessibility2 Implementation 2009
+							 public com::sun::star::accessibility::XAccessibleGetAccFlowTo
 {
     // Implementation for XAccessibleSelection interface
     SwAccessibleSelectionHelper maSelectionHelper;
     SwAccessibleDocument( SwAccessibleMap* pInitMap );
 
 	DECL_LINK( WindowChildEventListener, VclSimpleEvent* );
+	//IAccessibility2 Implementation 2009-----
+	//=====  XEventListener====================================================
+	virtual void SAL_CALL notifyEvent( const ::com::sun::star::document::EventObject& Event ) 
+			throw (::com::sun::star::uno::RuntimeException);
+	virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Event ) 
+			throw (::com::sun::star::uno::RuntimeException);
+	// overwrite the children methods
+	//-----IAccessibility2 Implementation 2009
 
 	//=====  XServiceInfo  ====================================================
 
         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
                 ::com::sun::star::uno::RuntimeException );
 
+	//IAccessibility2 Implementation 2009-----
+    virtual ::com::sun::star::uno::Any SAL_CALL get_attributes() 
+		throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ;
 	//====== thread safe C++ interface ========================================
 
 	// The object is not visible an longer and should be destroyed
 	virtual void Dispose( sal_Bool bRecursive = sal_False );
+
+	//=====  XAccessibleComponent  ============================================
+	sal_Int32 SAL_CALL getBackground() 
+		throw (::com::sun::star::uno::RuntimeException);
+
+	//=====  XAccessibleGetAccFlowTo  ============================================
+	::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 );
+	//-----IAccessibility2 Implementation 2009
 };
 
 #endif

File sw/source/core/access/accembedded.cxx

 #include <rtl/uuid.h>
 #include <flyfrm.hxx>
 #include "accembedded.hxx"
+//IAccessibility2 Implementation 2009-----
+#include "cntfrm.hxx"
+#include "ndole.hxx"
+#include <doc.hxx>
+#include <docsh.hxx>
+#include <../../ui/inc/wrtsh.hxx>
+#include <../../ui/inc/view.hxx>
+//-----IAccessibility2 Implementation 2009
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::lang;
 {
 }
 
+//IAccessibility2 Implementation 2009-----
+//=====  XInterface  ==========================================================
+com::sun::star::uno::Any SAL_CALL
+    SwAccessibleEmbeddedObject::queryInterface (const com::sun::star::uno::Type & rType)
+    throw (::com::sun::star::uno::RuntimeException)
+{
+    ::com::sun::star::uno::Any aReturn = SwAccessibleNoTextFrame::queryInterface (rType);
+    if ( ! aReturn.hasValue())
+        aReturn = ::cppu::queryInterface (rType,
+	     static_cast< ::com::sun::star::accessibility::XAccessibleAttribute* >(this) );
+    return aReturn;
+}
+
+void SAL_CALL
+    SwAccessibleEmbeddedObject::acquire (void)
+    throw ()
+{
+    SwAccessibleNoTextFrame::acquire ();
+}
+
+void SAL_CALL
+    SwAccessibleEmbeddedObject::release (void)
+    throw ()
+{
+    SwAccessibleNoTextFrame::release ();
+}
+//-----IAccessibility2 Implementation 2009
+
 OUString SAL_CALL SwAccessibleEmbeddedObject::getImplementationName()
         throw( uno::RuntimeException )
 {
     }
     return aId;
 }
+//IAccessibility2 Implementation 2009-----
+//=====  XAccessibleAttribute  ========================================================
+::com::sun::star::uno::Any SAL_CALL SwAccessibleEmbeddedObject::get_attributes() 
+		throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) 
+{
+	::com::sun::star::uno::Any strRet;
+	::rtl::OUString style;
+	SwFlyFrm* pFFrm = getFlyFrm();
+	
+	if( pFFrm )
+	{
+		style = ::rtl::OUString::createFromAscii("style:");	
+		SwCntntFrm* pCFrm;
+		pCFrm = pFFrm->ContainsCntnt();
+		if( pCFrm )
+		{
+			SwCntntNode* pCNode = pCFrm->GetNode();
+			if( pCNode )
+			{
+				style += ((SwOLENode*)pCNode)->GetOLEObj().GetStyleString();
+			}
+		}
+		style += ::rtl::OUString::createFromAscii(";");	
+	}
+	strRet <<= style;
+	return strRet;
+}
+//-----IAccessibility2 Implementation 2009

File sw/source/core/access/accembedded.hxx

 #define _ACCEMBEDDED_HXX
 #include "accnotextframe.hxx"
 
-class SwAccessibleEmbeddedObject : public   SwAccessibleNoTextFrame
+//IAccessibility2 Implementation 2009-----
+#include <com/sun/star/accessibility/XAccessibleAttribute.hpp>
+//-----IAccessibility2 Implementation 2009
+class SwAccessibleEmbeddedObject : public	SwAccessibleNoTextFrame
+	        , public ::com::sun::star::accessibility::XAccessibleAttribute
+			
 {
 
 protected:
     SwAccessibleEmbeddedObject( SwAccessibleMap* pInitMap,
                                 const SwFlyFrm* pFlyFrm );
 
+	//IAccessibility2 Implementation 2009-----