1. mst
  2. ooo340

Commits

Malte Timmermann [mt]  committed f4989e1

accstuff: merged remaining changes from CWS oo31ia2, module sd

  • Participants
  • Parent commits d521ed5
  • Branches default

Comments (0)

Files changed (58)

File sd/inc/drawdoc.hxx

View file
 class SdDrawDocument : public FmFormModel
 {
 private:
+//IAccessibility2 Implementation 2009-----
+	String msDocAccTitle;
+public:
+	virtual void setDocAccTitle( const String& rTitle ) { msDocAccTitle = rTitle; }
+	virtual const String getDocAccTitle() const { return msDocAccTitle; }
+private:	
+	sal_Bool bReadOnly;
+public:
+	virtual void setDocReadOnly( sal_Bool b){ bReadOnly = b; }
+	virtual sal_Bool getDocReadOnly() const { return bReadOnly; }
+private:
+//IAccessibility2 Implementation 2009-----
 	::sd::Outliner*		mpOutliner;		    // local outliner for outline mode
 	::sd::Outliner*		mpInternalOutliner;  // internal outliner for creation of text objects
 	Timer*			    mpWorkStartupTimer;
 	// #109538#
 	virtual void PageListChanged();
 	virtual void MasterPageListChanged();
+//IAccessibility2 Implementation 2009-----
+	virtual ImageMap* GetImageMapForObject(SdrObject* pObj);
+//-----IAccessibility2 Implementation 2009
 };
 
 namespace sd

File sd/inc/glob.hxx

View file
 #define SD_IF_SDDRAWDOCSHELL            SFX_INTERFACE_SD_START + 1
 #define SD_IF_SDVIEWSHELL               SFX_INTERFACE_SD_START + 2
 #define SD_IF_SDDRAWVIEWSHELL           SFX_INTERFACE_SD_START + 3
+//IAccessibility2 Implementation 2009-----
+#define SD_IF_SDSLIDEVIEWSHELL          SFX_INTERFACE_SD_START + 4
+//-----IAccessibility2 Implementation 2009
 #define SD_IF_SDOUTLINEVIEWSHELL        SFX_INTERFACE_SD_START + 5
 #define SD_IF_SDDRAWSTDOBJECTBAR        SFX_INTERFACE_SD_START + 6
 #define SD_IF_SDDRAWTEXTOBJECTBAR       SFX_INTERFACE_SD_START + 7

File sd/source/core/drawdoc.cxx

View file
 
 SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh)
 : FmFormModel( SvtPathOptions().GetPalettePath(), NULL, pDrDocSh )
+, bReadOnly(sal_False)
 , mpOutliner(NULL)
 , mpInternalOutliner(NULL)
 , mpWorkStartupTimer(NULL)

File sd/source/core/drawdoc2.cxx

View file
 	return pIMapObj;
 }
 
+//IAccessibility2 Implementation 2009-----
+ImageMap* SdDrawDocument::GetImageMapForObject(SdrObject* pObj)
+{
+	SdIMapInfo* pIMapInfo = GetIMapInfo( pObj );
+	if ( pIMapInfo )
+	{
+		return const_cast<ImageMap*>( &(pIMapInfo->GetImageMap()) );
+	}
+	return NULL;
+}
+//-----IAccessibility2 Implementation 2009
 /** this method enforces that the masterpages are in the currect order,
 	that is at position 1 is a PK_STANDARD masterpage followed by a
 	PK_NOTES masterpage and so on. #

File sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx

View file
 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <rtl/ustring.h>
-#include<sfx2/viewfrm.hxx>
-
+#include <sfx2/viewfrm.hxx>
+//IAccessibility2 Implementation 2009-----
+#include <com/sun/star/accessibility/AccessibleStateType.hpp>
+#include <sfx2/objsh.hxx>
+//-----IAccessibility2 Implementation 2009
 #include <svx/AccessibleShape.hxx>
-
 #include <svx/svdobj.hxx>
 #include <svx/svdmodel.hxx>
 #include <svx/unoapi.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
 #include "Window.hxx"
 #include <vcl/svapp.hxx>
+//IAccessibility2 Implementation 2009-----
+#include "OutlineViewShell.hxx"
 
+#include "SlideViewShell.hxx"
 
+#include <svx/svdlayer.hxx>
+#include <editeng/editobj.hxx>
+#include "LayerTabBar.hxx"
+// Sym2_3241----, added by Steve Yin
+#include <svtools/colorcfg.hxx>
+// ----Sym2_3241
+//-----IAccessibility2 Implementation 2009
 #include "ViewShell.hxx"
 #include "View.hxx"
 #include <memory>
     maShapeTreeInfo.SetViewForwarder (&maViewForwarder);
 
     mxWindow = ::VCLUnoHelper::GetInterface (pSdWindow);
+//IAccessibility2 Implementation 2009-----
+	mpViewShell = pViewShell;
+//-----IAccessibility2 Implementation 2009
 }
 
 
             }
         }
     }
+//IAccessibility2 Implementation 2009-----
+	SfxObjectShell* pObjShell = mpViewShell->GetViewFrame()->GetObjectShell();
+	if(!pObjShell->IsReadOnly())
+		SetState(AccessibleStateType::EDITABLE);
+//-----IAccessibility2 Implementation 2009
 }
 
 
             static_cast<beans::XPropertyChangeListener*>(this),
             static_cast<awt::XWindowListener*>(this),
             static_cast<awt::XFocusListener*>(this)
+//IAccessibility2 Implementation 2009-----
+		   ,static_cast<XAccessibleAttribute*>(this)
+		   ,static_cast<XAccessibleGetAccFlowTo*>(this)
+//-----IAccessibility2 Implementation 2009
             );
     return aReturn;
 }
 {
 }
 
+//IAccessibility2 Implementation 2009-----
+uno::Any SAL_CALL AccessibleDocumentViewBase::get_attributes() 
+		throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) 
+{
+	uno::Any anyAtrribute;
+	rtl::OUString sValue;
+	if (mpViewShell && mpViewShell->ISA(::sd::DrawViewShell))
+	{
+		::sd::DrawViewShell* pDrViewSh = (::sd::DrawViewShell*) mpViewShell;
+		rtl::OUString sName;
+		String sDisplay;
+			sName = rtl::OUString::createFromAscii("page-name:");
+			// MT IA2: Not used...
+			// SdPage*	pCurrPge = pDrViewSh->getCurrentPage();
+			SdDrawDocument* pDoc = pDrViewSh->GetDoc();
+			sDisplay = pDrViewSh->getCurrentPage()->GetName();
+			sDisplay.SearchAndReplace( String::CreateFromAscii( "\\" ), String::CreateFromAscii("\\\\" ));
+			sDisplay.SearchAndReplace( String::CreateFromAscii( "=" ), String::CreateFromAscii("\\=" ) );
+			sDisplay.SearchAndReplace( String::CreateFromAscii( ";" ), String::CreateFromAscii("\\;" ) );
+			sDisplay.SearchAndReplace( String::CreateFromAscii( "," ), String::CreateFromAscii("\\," ) );
+			sDisplay.SearchAndReplace( String::CreateFromAscii( ":" ), String::CreateFromAscii("\\:" ) );
+			sValue = sName + sDisplay ;
+			sName = rtl::OUString::createFromAscii(";page-number:");
+			sValue += sName;
+			sValue += String::CreateFromInt32((sal_Int16)((sal_uInt16)((pDrViewSh->getCurrentPage()->GetPageNum()-1)>>1) + 1)) ;
+			sName = rtl::OUString::createFromAscii(";total-pages:");
+			sValue += sName;
+			sValue += String::CreateFromInt32(pDrViewSh->GetPageTabControl()->GetPageCount()) ;
+			sValue +=  rtl::OUString::createFromAscii(";");
+		if(pDrViewSh->IsLayerModeActive() )
+		{
+			sName = rtl::OUString::createFromAscii("page-name:");
+			sValue = sName;
+			sDisplay = pDrViewSh->GetLayerTabControl()->GetPageText(pDrViewSh->GetLayerTabControl()->GetCurPageId());
+			if( pDoc )
+			{
+				SdrLayerAdmin& rLayerAdmin = pDoc->GetLayerAdmin();
+				SdrLayer* aSdrLayer = rLayerAdmin.GetLayer(sDisplay, sal_False);
+				if( aSdrLayer )
+				{
+					String layerAltText = aSdrLayer->GetTitle();
+					if(  layerAltText.Len() > 0)
+					{
+						sName = rtl::OUString::createFromAscii(" ");
+						sDisplay = sDisplay + sName; 
+						sDisplay += layerAltText;
+					}
+				}
+			}
+			sDisplay.SearchAndReplace( String::CreateFromAscii( "\\" ), String::CreateFromAscii("\\\\" ));
+			sDisplay.SearchAndReplace( String::CreateFromAscii( "=" ), String::CreateFromAscii("\\=" ));
+			sDisplay.SearchAndReplace( String::CreateFromAscii( ";" ), String::CreateFromAscii("\\;" ));
+			sDisplay.SearchAndReplace( String::CreateFromAscii( "," ), String::CreateFromAscii("\\," ));
+			sDisplay.SearchAndReplace( String::CreateFromAscii( ":" ), String::CreateFromAscii("\\:" ));
+			sValue +=  sDisplay;
+			sName = rtl::OUString::createFromAscii(";page-number:");
+			sValue += sName;
+			sValue += String::CreateFromInt32(pDrViewSh->GetActiveTabLayerIndex()+1) ;
+			sName = rtl::OUString::createFromAscii(";total-pages:");
+			sValue += sName;
+			sValue += String::CreateFromInt32(pDrViewSh->GetLayerTabControl()->GetPageCount()) ;
+			sValue +=  rtl::OUString::createFromAscii(";");
+		}
+	}	
+	if (mpViewShell && mpViewShell->ISA(::sd::PresentationViewShell))
+	{
+		::sd::PresentationViewShell* pPresViewSh = (::sd::PresentationViewShell*) mpViewShell;
+		SdPage*	pCurrPge = pPresViewSh->getCurrentPage();
+		SdDrawDocument* pDoc = pPresViewSh->GetDoc();
+		SdPage*	pNotesPge = (SdPage*)pDoc->GetSdPage((pCurrPge->GetPageNum()-1)>>1, PK_NOTES);
+		if (pNotesPge)
+		{
+			SdrObject* pNotesObj = pNotesPge->GetPresObj(PRESOBJ_NOTES);
+			if (pNotesObj)
+			{
+				OutlinerParaObject* pPara = pNotesObj->GetOutlinerParaObject();
+				if (pPara)
+				{
+					sValue += rtl::OUString::createFromAscii("note:");
+					const EditTextObject& rEdit = pPara->GetTextObject();
+					for (sal_uInt16 i=0;i<rEdit.GetParagraphCount();i++)
+					{
+						String strNote = rEdit.GetText(i);
+						//add by duan mei hua, 2007/03/28, sodc_7429
+						strNote.SearchAndReplace( String::CreateFromAscii( "\\" ), String::CreateFromAscii("\\\\" ));
+						//end add by duan mei hua, 2007/03/28, sodc_7429
+						strNote.SearchAndReplace( String::CreateFromAscii( "=" ), String::CreateFromAscii("\\=" ));
+						strNote.SearchAndReplace( String::CreateFromAscii( ";" ), String::CreateFromAscii("\\;" ));
+						strNote.SearchAndReplace( String::CreateFromAscii( "," ), String::CreateFromAscii("\\," ));
+						strNote.SearchAndReplace( String::CreateFromAscii( ":" ), String::CreateFromAscii("\\:" ));
+						sValue += rtl::OUString( strNote );
+						sValue += rtl::OUString::createFromAscii(";");//to divide each paragraph
+					}
+				}
+			}
+		}
+	}
+	if (mpViewShell && mpViewShell->ISA(::sd::OutlineViewShell) )
+	{
+		rtl::OUString sName;
+		String sDisplay;
+		SdPage*	pCurrPge = mpViewShell->GetActualPage();
+		SdDrawDocument* pDoc = mpViewShell->GetDoc();
+		if(pCurrPge && pDoc)
+		{
+			sName = rtl::OUString::createFromAscii("page-name:");
+			sDisplay = pCurrPge->GetName();
+			sDisplay.SearchAndReplace( String::CreateFromAscii( "=" ), String::CreateFromAscii("\\=" ) );
+			sDisplay.SearchAndReplace( String::CreateFromAscii( ";" ), String::CreateFromAscii("\\;" ) );
+			sDisplay.SearchAndReplace( String::CreateFromAscii( "," ), String::CreateFromAscii("\\," ) );
+			sDisplay.SearchAndReplace( String::CreateFromAscii( ":" ), String::CreateFromAscii("\\:" ) );
+			sValue = sName + sDisplay ;
+			sName = rtl::OUString::createFromAscii(";page-number:");
+			sValue += sName;
+			sValue += String::CreateFromInt32((sal_Int16)((sal_uInt16)((pCurrPge->GetPageNum()-1)>>1) + 1)) ;
+			sName = rtl::OUString::createFromAscii(";total-pages:");
+			sValue += sName;
+			sValue += String::CreateFromInt32(pDoc->GetSdPageCount(PK_STANDARD)) ;
+			sValue +=  rtl::OUString::createFromAscii(";");
+		}
+	}	
+	if (sValue.getLength())
+		anyAtrribute <<= sValue;
+	return anyAtrribute;	
+}
+::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
+		SAL_CALL AccessibleDocumentViewBase::get_AccFlowTo(const ::com::sun::star::uno::Any&, sal_Int32 )
+		throw ( ::com::sun::star::uno::RuntimeException )
+{
+	::com::sun::star::uno::Sequence< uno::Any> aRet;
+
+	return aRet;
+}
+
+// Sym2_3241----, added by Steve Yin
+sal_Int32 SAL_CALL AccessibleDocumentViewBase::getForeground(  )
+        throw (uno::RuntimeException)
+{
+    return COL_BLACK;
+}
+
+sal_Int32 SAL_CALL AccessibleDocumentViewBase::getBackground(  )
+        throw (uno::RuntimeException)
+{
+	 ThrowIfDisposed ();
+    ::osl::MutexGuard aGuard (maMutex);
+    return mpViewShell->GetView()->getColorConfig().GetColorValue( ::svtools::DOCCOLOR ).nColor;
+}
+// ----Sym2_3241
+//-----IAccessibility2 Implementation 2009
 } // end of namespace accessibility

File sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx

View file
 
 #include "ViewShell.hxx"
 #include "View.hxx"
+//IAccessibility2 Implementation 2009-----
+#include "DrawDocShell.hxx"
+#include <drawdoc.hxx>
+#include <algorithm>
+#include "sdpage.hxx"
+#include "slideshow.hxx"
+#include "anminfo.hxx"
+//-----IAccessibility2 Implementation 2009
 #include <memory>
 
 #include "accessibility.hrc"
 namespace accessibility {
 
 
+//IAccessibility2 Implementation 2009-----
+struct XShapePosCompareHelper
+{
+	bool operator() ( const uno::Reference<drawing::XShape>& xshape1, 
+		const uno::Reference<drawing::XShape>& xshape2 ) const
+	{
+		//Added by Li Xing, 2007/01/09, SODC_6628, modify the compare method to return the Z-Order, not layout order
+		SdrObject* pObj1 = GetSdrObjectFromXShape(xshape1);
+		SdrObject* pObj2 = GetSdrObjectFromXShape(xshape2);		
+		if(pObj1 && pObj2)
+			return pObj1->GetOrdNum() < pObj2->GetOrdNum();
+		else
+			return 0;
+	}
+};
+//-----IAccessibility2 Implementation 2009
 //=====  internal  ============================================================
 
 AccessibleDrawDocumentView::AccessibleDrawDocumentView (
     const uno::Reference<frame::XController>& rxController,
     const uno::Reference<XAccessible>& rxParent)
     : AccessibleDocumentViewBase (pSdWindow, pViewShell, rxController, rxParent),
+      mpSdViewSh( pViewShell ),
       mpChildrenManager (NULL)
 {
     OSL_TRACE ("AccessibleDrawDocumentView");
             static_cast<uno::XWeak*>(this));
 }
 
+//IAccessibility2 Implementation 2009-----
+OUString SAL_CALL
+	AccessibleDrawDocumentView::getAccessibleName(void)
+	throw (::com::sun::star::uno::RuntimeException)
+{
+	OUString sName = String( SdResId(SID_SD_A11Y_D_PRESENTATION) );
+	::sd::View* pSdView = static_cast< ::sd::View* >( maShapeTreeInfo.GetSdrView() );
+	if ( pSdView )
+	{
+		SdDrawDocument* pDoc = pSdView->GetDoc();
+		if ( pDoc )
+		{
+			rtl::OUString sFileName = pDoc->getDocAccTitle();
+			if ( !sFileName.getLength() )
+			{
+				::sd::DrawDocShell* pDocSh = pSdView->GetDocSh();
+				if ( pDocSh )
+				{
+					sFileName = pDocSh->GetTitle( SFX_TITLE_APINAME );
+				}			
+			}
 
+			OUString sReadOnly;
+			if(pDoc->getDocReadOnly())
+			{				
+				sReadOnly = String(SdResId(SID_SD_A11Y_D_PRESENTATION_READONLY));				
+			}
 
+			if ( sFileName.getLength() )
+			{
+				sName = sFileName + sReadOnly + OUString(RTL_CONSTASCII_USTRINGPARAM(" - ")) + sName;
+			}			
+		}
+	}
 
+	return sName;
+}
+//-----IAccessibility2 Implementation 2009
 //=====  XEventListener  ======================================================
 
 void SAL_CALL
     AccessibleDocumentViewBase::propertyChange (rEventObject);
 
     OSL_TRACE ("AccessibleDrawDocumentView::propertyChange");
-    if (rEventObject.PropertyName == OUString (RTL_CONSTASCII_USTRINGPARAM("CurrentPage")))
+    //Sym2_5533, 0204, add page switch event for slide show mode
+    if (rEventObject.PropertyName == OUString (RTL_CONSTASCII_USTRINGPARAM("CurrentPage")) ||
+		rEventObject.PropertyName == OUString (RTL_CONSTASCII_USTRINGPARAM("PageChange")) )
     {
         OSL_TRACE ("    current page changed");
 
         }
         else
             OSL_TRACE ("View invalid");
+//IAccessibility2 Implementation 2009-----
+		CommitChange(AccessibleEventId::PAGE_CHANGED,rEventObject.NewValue,rEventObject.OldValue);
+//-----IAccessibility2 Implementation 2009
     }
     else if (rEventObject.PropertyName == OUString (RTL_CONSTASCII_USTRINGPARAM("VisibleArea")))
     {
                 IAccessibleViewForwarderListener::VISIBLE_AREA, 
                 &maViewForwarder);
     }
+//IAccessibility2 Implementation 2009-----
+	else if (rEventObject.PropertyName == OUString (RTL_CONSTASCII_USTRINGPARAM("ActiveLayer")))
+	{
+		CommitChange(AccessibleEventId::PAGE_CHANGED,rEventObject.NewValue,rEventObject.OldValue);
+	}
+    else if (rEventObject.PropertyName == OUString (RTL_CONSTASCII_USTRINGPARAM("UpdateAcc")))
+    {
+        OSL_TRACE ("    acc on current page should be updated");
+
+        // The current page changed.  Update the children manager accordingly.
+        uno::Reference<drawing::XDrawView> xView (mxController, uno::UNO_QUERY);
+        if (xView.is() && mpChildrenManager!=NULL)
+        {
+            // Inform the children manager to forget all children and give
+            // him the new ones.
+            mpChildrenManager->ClearAccessibleShapeList ();
+	    // Sym2_5533, update the slide show page's accessible info
+            //mpChildrenManager->SetShapeList (uno::Reference<drawing::XShapes> (
+            //    xView->getCurrentPage(), uno::UNO_QUERY));
+	    rtl::Reference< sd::SlideShow > xSlideshow( sd::SlideShow::GetSlideShow( mpSdViewSh->GetViewShellBase() ) );
+	    if( xSlideshow.is() && xSlideshow->isRunning() && xSlideshow->isFullScreen() )
+	    {
+		    ::com::sun::star::uno::Reference< drawing::XDrawPage > xSlide;
+			// MT IA2: Not used...
+			// sal_Int32 currentPageIndex = xSlideshow->getCurrentPageIndex();
+			::com::sun::star::uno::Reference< ::com::sun::star::presentation::XSlideShowController > mpSlideController = xSlideshow->getController();
+			if( mpSlideController.is() )
+			{
+				xSlide = mpSlideController->getCurrentSlide();
+				if (xSlide.is())
+				{
+					mpChildrenManager->SetShapeList (uno::Reference<drawing::XShapes> (
+				                xSlide, uno::UNO_QUERY));
+				}
+			}
+	    }			
+            // Create the page shape and initialize it.  The shape is
+            // acquired before initialization and released after
+            // transferring ownership to the children manager to prevent
+            // premature disposing of the shape.
+            AccessiblePageShape* pPage = CreateDrawPageShape ();
+            if (pPage != NULL)
+            {
+                pPage->acquire();
+                pPage->Init();
+                mpChildrenManager->AddAccessibleShape (
+                    std::auto_ptr<AccessibleShape>(pPage));
+                mpChildrenManager->Update (false);
+                pPage->release();
+            }
+	}
+    }
+//-----IAccessibility2 Implementation 2009
     else
     {
         OSL_TRACE ("  unhandled");
     return aServiceNames;
 }
 
+//IAccessibility2 Implementation 2009-----
+//=====  XInterface  ==========================================================
+    
+uno::Any SAL_CALL
+    AccessibleDrawDocumentView::queryInterface (const uno::Type & rType)
+    throw (uno::RuntimeException)
+{
+    uno::Any aReturn = AccessibleDocumentViewBase::queryInterface (rType);
+    if ( ! aReturn.hasValue())
+        aReturn = ::cppu::queryInterface (rType,
+            static_cast<XAccessibleGroupPosition*>(this)
+            );
+    return aReturn;
+}
 
-        
-
+void SAL_CALL
+    AccessibleDrawDocumentView::acquire (void) 
+    throw ()
+{
+    AccessibleDocumentViewBase::acquire ();
+}
+void SAL_CALL
+    AccessibleDrawDocumentView::release (void)
+    throw ()
+{
+    AccessibleDocumentViewBase::release ();
+}
+//=====  XAccessibleGroupPosition  =========================================
+uno::Sequence< sal_Int32 > SAL_CALL
+    AccessibleDrawDocumentView::getGroupPosition( const uno::Any& rAny )
+    throw (uno::RuntimeException)
+{
+	// we will return the:
+	// [0] group level(always be 0 now)
+	// [1] similar items counts in the group
+	// [2] the position of the object in the group
+	uno::Sequence< sal_Int32 > aRet( 3 );
+	//get the xShape of the current selected drawing object
+	uno::Reference<XAccessibleContext> xAccContent;
+	rAny >>= xAccContent;
+	if ( !xAccContent.is() )
+	{
+		return aRet;
+	}
+	AccessibleShape* pAcc = AccessibleShape::getImplementation( xAccContent );
+	if ( !pAcc )
+	{
+		return aRet;
+	}
+	uno::Reference< drawing::XShape > xCurShape = pAcc->GetXShape();
+	if ( !xCurShape.is() )
+	{
+		return aRet;
+	}
+	//find all the child in the page, insert them into a vector and sort
+	if ( mpChildrenManager == NULL )
+	{
+		return aRet;
+	}
+	std::vector< uno::Reference<drawing::XShape> > vXShapes;
+	sal_Int32 nCount = mpChildrenManager->GetChildCount();
+	//get pointer of SdView & SdrPageView for further use.
+	SdrPageView* pPV = NULL;
+	::sd::View* pSdView = NULL;
+	if ( mpSdViewSh )
+	{
+		pSdView = mpSdViewSh->GetView();
+		pPV = pSdView->GetSdrPageView();
+	}
+	for ( sal_Int32 i = 0; i < nCount; i++ )
+	{
+		uno::Reference< drawing::XShape > xShape = mpChildrenManager->GetChildShape(i);
+		if ( xShape.is() )
+		{
+			//if the object is visable in the page, we add it into the group list.
+			SdrObject* pObj = GetSdrObjectFromXShape(xShape);
+			if ( pObj && pPV && pSdView && pSdView->IsObjMarkable( pObj, pPV ) )
+			{
+				vXShapes.push_back( xShape );
+			}
+		}
+	}
+	std::sort( vXShapes.begin(), vXShapes.end(), XShapePosCompareHelper() );
+	//get the the index of the selected object in the group
+	std::vector< uno::Reference<drawing::XShape> >::iterator aIter;
+	//we start counting position from 1
+	sal_Int32 nPos = 1;
+	for ( aIter = vXShapes.begin(); aIter != vXShapes.end(); aIter++, nPos++ )
+	{
+		if ( (*aIter).get() == xCurShape.get() )
+		{
+			sal_Int32* pArray = aRet.getArray();
+			pArray[0] = 1; //it should be 1 based, not 0 based.
+			pArray[1] = vXShapes.size();
+			pArray[2] = nPos;
+			break;
+		}
+	}
+	return aRet;
+}
+::rtl::OUString AccessibleDrawDocumentView::getObjectLink( const uno::Any& rAny )
+	throw (uno::RuntimeException)
+{
+	::rtl::OUString aRet;
+	//get the xShape of the current selected drawing object
+	uno::Reference<XAccessibleContext> xAccContent;
+	rAny >>= xAccContent;
+	if ( !xAccContent.is() )
+	{
+		return aRet;
+	}
+	AccessibleShape* pAcc = AccessibleShape::getImplementation( xAccContent );
+	if ( !pAcc )
+	{
+		return aRet;
+	}
+	uno::Reference< drawing::XShape > xCurShape = pAcc->GetXShape();
+	if ( !xCurShape.is() )
+	{
+		return aRet;
+	}
+	SdrObject* pObj = GetSdrObjectFromXShape(xCurShape);
+	if (pObj)
+	{
+		SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pObj);
+		if( pInfo && (pInfo->meClickAction == presentation::ClickAction_DOCUMENT) )
+			aRet = (::rtl::OUString)pInfo->GetBookmark();
+	}
+	return aRet;
+}
+//-----IAccessibility2 Implementation 2009
 ///	Create a name for this view.
 ::rtl::OUString
     AccessibleDrawDocumentView::CreateAccessibleName (void)
 {
     if (mpChildrenManager != NULL)
     {
-        mpChildrenManager->UpdateSelection();
+//IAccessibility2 Implementation 2009-----
+        //mpChildrenManager->UpdateSelection();
+	sal_Bool bChange = sal_False;
+//-----IAccessibility2 Implementation 2009
         // When none of the children has the focus then claim it for the
         // view.
         if ( ! mpChildrenManager->HasFocus())
+	{
             SetState (AccessibleStateType::FOCUSED);
+	    bChange = sal_True;
+	}
         else
             ResetState (AccessibleStateType::FOCUSED);
+//IAccessibility2 Implementation 2009-----
+	mpChildrenManager->UpdateSelection();
+	//Sym2_6262, if the child gets focus in UpdateSelection(), needs to reset the focus on document.
+	if (mpChildrenManager->HasFocus() && bChange)
+		ResetState (AccessibleStateType::FOCUSED);
+//-----IAccessibility2 Implementation 2009
     }
 }
 
     AccessibleDocumentViewBase::disposing ();
 }
 
+//IAccessibility2 Implementation 2009-----
+::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
+		SAL_CALL AccessibleDrawDocumentView::get_AccFlowTo(const ::com::sun::star::uno::Any& rAny, sal_Int32 nType)
+		throw ( ::com::sun::star::uno::RuntimeException )
+{
+	const sal_Int32 SPELLCHECKFLOWTO = 1;
+	const sal_Int32 FINDREPLACEFLOWTO = 2;
+	if ( nType == SPELLCHECKFLOWTO )
+	{
+		uno::Reference< ::com::sun::star::drawing::XShape > xShape;
+		rAny >>= xShape;
+		if ( mpChildrenManager && xShape.is() )
+		{
+			uno::Reference < XAccessible > xAcc = mpChildrenManager->GetChild(xShape);
+			uno::Reference < XAccessibleSelection > xAccSelection( xAcc, uno::UNO_QUERY );
+			if ( xAccSelection.is() )
+			{
+				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;							
+							}
+						}
+					}
+				}
+			}
+			uno::Reference<XAccessible> xPara = GetSelAccContextInTable();
+			if ( xPara.is() )
+			{
+				uno::Sequence<uno::Any> aRet( 1 );
+				aRet[0] = uno::makeAny( xPara );
+				return aRet;
+			}			
+		}
+		else
+		{
+			goto Rt;
+		}
+	}
+	else if ( nType == FINDREPLACEFLOWTO )
+	{
+		sal_Int32 nChildCount = getSelectedAccessibleChildCount();
+		if ( nChildCount )
+		{
+			uno::Reference < XAccessible > xSel = getSelectedAccessibleChild( 0 );
+			if ( xSel.is() )
+			{
+				uno::Reference < XAccessibleSelection > xAccChildSelection( xSel, uno::UNO_QUERY );
+				if ( xAccChildSelection.is() )
+				{
+					if ( xAccChildSelection->getSelectedAccessibleChildCount() )
+					{
+						uno::Reference < XAccessible > xChildSel = xAccChildSelection->getSelectedAccessibleChild( 0 );
+						if ( xChildSel.is() )
+						{
+							uno::Reference < XAccessibleContext > xChildSelContext( xChildSel->getAccessibleContext() );
+							if ( xChildSelContext.is() &&
+								xChildSelContext->getAccessibleRole() == AccessibleRole::PARAGRAPH )
+							{
+								uno::Sequence<uno::Any> aRet( 1 );
+								aRet[0] = uno::makeAny( xChildSel );
+								return aRet;
+							}
+						}
+					}
+				}
+			}
+		}
+		else
+		{
+			uno::Reference<XAccessible> xPara = GetSelAccContextInTable();
+			if ( xPara.is() )
+			{
+				uno::Sequence<uno::Any> aRet( 1 );
+				aRet[0] = uno::makeAny( xPara );
+				return aRet;
+			}
+		}
+	}
+	
+Rt:
+	::com::sun::star::uno::Sequence< uno::Any> aRet;
+	return aRet;
+}
+uno::Reference<XAccessible> AccessibleDrawDocumentView::GetSelAccContextInTable()
+{
+	uno::Reference<XAccessible> xRet;
+	sal_Int32 nCount = mpChildrenManager ? mpChildrenManager->GetChildCount() : 0;
+	if ( nCount )
+	{
+		for ( sal_Int32 i = 0; i < nCount; i++ )
+		{
+			try
+			{
+				uno::Reference<XAccessible> xObj = mpChildrenManager->GetChild(i);
+				if ( xObj.is() )
+				{
+					uno::Reference<XAccessibleContext> xObjContext( xObj, uno::UNO_QUERY );
+					if ( xObjContext.is() && xObjContext->getAccessibleRole() == AccessibleRole::TABLE )
+					{
+						uno::Reference<XAccessibleSelection> xObjSelection( xObj, uno::UNO_QUERY );
+						if ( xObjSelection.is() && xObjSelection->getSelectedAccessibleChildCount() )
+						{
+							uno::Reference<XAccessible> xCell = xObjSelection->getSelectedAccessibleChild(0);
+							if ( xCell.is() )
+							{
+								uno::Reference<XAccessibleSelection> xCellSel( xCell, uno::UNO_QUERY );
+								if ( xCellSel.is() && xCellSel->getSelectedAccessibleChildCount() )
+								{
+									uno::Reference<XAccessible> xPara = xCellSel->getSelectedAccessibleChild( 0 );
+									if ( xPara.is() )
+									{
+										uno::Reference<XAccessibleContext> xParaContext( xPara, uno::UNO_QUERY );
+										if ( xParaContext.is() &&
+											xParaContext->getAccessibleRole() == AccessibleRole::PARAGRAPH )
+										{
+											xRet = xPara;
+											return xRet;
+										}
+									}
+								}
+							}
+						}
+					}
+				}
+			}
+			catch ( lang::IndexOutOfBoundsException )
+			{
+				uno::Reference<XAccessible> xEmpty;
+				return xEmpty;
+			}
+			catch ( uno::RuntimeException )
+			{
+				uno::Reference<XAccessible> xEmpty;
+				return xEmpty;
+			}
+		}
+	}
 
-
+	return xRet;
+}
+//-----IAccessibility2 Implementation 2009
 
 void AccessibleDrawDocumentView::UpdateAccessibleName (void)
 {

File sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx

View file
           mViewForwarder( rOutlView )
     {       
         // register as listener - need to broadcast state change messages
-        rOutliner.SetNotifyHdl( LINK(this, AccessibleOutlineEditSource, NotifyHdl) );
+		// Sym2_5755----, Moved to ::GetTextForwarder() by Steve Yin
+        //rOutliner.SetNotifyHdl( LINK(this, AccessibleOutlineEditSource, NotifyHdl) );
         StartListening(rOutliner);
     }
 
 
     SvxEditSource* AccessibleOutlineEditSource::Clone() const
     {
-        return NULL;
+		//IAccessibility2 Implementation 2009-----
+        /*return NULL;*/
+		return new AccessibleOutlineEditSource(*mpOutliner, mrView, *mpOutlinerView, mrWindow);
+		//-----IAccessibility2 Implementation 2009
     }
 
     SvxTextForwarder* AccessibleOutlineEditSource::GetTextForwarder()
     {
         // TODO: maybe suboptimal
         if( IsValid() )
+		{
+			// Sym2_5755----, Moved here by Steve Yin to make sure that 
+			// the NotifyHandler was set on the current object.
+			mpOutliner->SetNotifyHdl( LINK(this, AccessibleOutlineEditSource, NotifyHdl) );
+			// ----Sym2_5755
             return &mTextForwarder;
+		}
         else
             return NULL;
     }

File sd/source/ui/accessibility/AccessibleOutlineView.cxx

View file
     return maTextHelper.GetChild(nIndex);
 }
 
+//IAccessibility2 Implementation 2009-----
+#include <drawdoc.hxx>
+::rtl::OUString SAL_CALL
+	AccessibleOutlineView::getAccessibleName(void)
+	throw (::com::sun::star::uno::RuntimeException)
+{
+	::rtl::OUString sName = String( SdResId(SID_SD_A11Y_D_PRESENTATION) );
+	::sd::View* pSdView = static_cast< ::sd::View* >( maShapeTreeInfo.GetSdrView() );
+	if ( pSdView )
+	{
+		SdDrawDocument* pDoc = pSdView->GetDoc();
+		if ( pDoc )
+		{
+			rtl::OUString sFileName = pDoc->getDocAccTitle();
+			if ( !sFileName.getLength() )
+			{
+				::sd::DrawDocShell* pDocSh = pSdView->GetDocSh();
+				if ( pDocSh )
+				{
+					sFileName = pDocSh->GetTitle( SFX_TITLE_APINAME );
+				}			
+			}
+			if ( sFileName.getLength() )
+			{
+				sName = sFileName + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - ")) + sName;
+			}
+		}
+	}
+	return sName;
+}
+//-----IAccessibility2 Implementation 2009
 //=====  XAccessibleEventBroadcaster  ========================================
 
 void SAL_CALL AccessibleOutlineView::addEventListener( const uno::Reference< XAccessibleEventListener >& xListener ) throw (uno::RuntimeException)
     // delegate listener handling to children manager.
     if ( ! IsDisposed())
         maTextHelper.AddEventListener(xListener);
+//IAccessibility2 Implementation 2009-----
+	AccessibleContextBase::addEventListener(xListener);
+//-----IAccessibility2 Implementation 2009
 }
 
 void SAL_CALL AccessibleOutlineView::removeEventListener( const uno::Reference< XAccessibleEventListener >& xListener ) throw (uno::RuntimeException)
     // forward
     if ( ! IsDisposed())
         maTextHelper.RemoveEventListener(xListener);
+//IAccessibility2 Implementation 2009-----
+	AccessibleContextBase::removeEventListener(xListener);
+//-----IAccessibility2 Implementation 2009
 }
 
 //=====  XServiceInfo  ========================================================
     AccessibleDocumentViewBase::propertyChange (rEventObject);
 
     OSL_TRACE ("AccessibleOutlineView::propertyChange");
-    if (rEventObject.PropertyName == ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("CurrentPage")))
+	//Sym2_5533, 0204, add page switch event for slide show mode
+    if (rEventObject.PropertyName == ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("CurrentPage")) ||
+		rEventObject.PropertyName == ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("PageChange")) )
     {
         OSL_TRACE ("    current page changed");
 
         // The current page changed. Update the children accordingly.
         UpdateChildren();
+//IAccessibility2 Implementation 2009-----
+    	CommitChange(AccessibleEventId::PAGE_CHANGED,rEventObject.NewValue,rEventObject.OldValue);
+//-----IAccessibility2 Implementation 2009
     }
     else if (rEventObject.PropertyName == ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("VisibleArea")))
     {

File sd/source/ui/accessibility/AccessiblePresentationGraphicShape.cxx

View file
 
     return aDG();
 }
+//IAccessibility2 Implementation 2009-----
+sal_Int16 SAL_CALL AccessiblePresentationGraphicShape::getAccessibleRole () 
+	throw (::com::sun::star::uno::RuntimeException)
+{
 
+	return  AccessibleRole::GRAPHIC ;
+}
+//-----IAccessibility2 Implementation 2009
 } // end of namespace accessibility

File sd/source/ui/accessibility/AccessiblePresentationOLEShape.cxx

View file
 
     return aDG();
 }
+//IAccessibility2 Implementation 2009-----
+//	Return this object's role.
+sal_Int16 SAL_CALL AccessiblePresentationOLEShape::getAccessibleRole () 
+	throw (::com::sun::star::uno::RuntimeException)
+{
 
+	return  AccessibleRole::EMBEDDED_OBJECT ;
+}
+//-----IAccessibility2 Implementation 2009
 } // end of namespace accessibility

File sd/source/ui/accessibility/AccessiblePresentationShape.cxx

View file
 
 #include "SdShapeTypes.hxx"
 
+//IAccessibility2 Implementation 2009-----
+#include "accessibility.hrc"
+#include "sdresid.hxx"
+#include <tools/string.hxx>
+//-----IAccessibility2 Implementation 2009
 #include <svx/DescriptionGenerator.hxx>
 #include <rtl/ustring.h>
 
     ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape);
     switch (nShapeType)
     {
+    //IAccessibility2 Implementation 2009-----
         case PRESENTATION_TITLE:
-            sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressTitle"));
+            //sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressTitle"));
+            sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_TITLE_N)));
             break;
         case PRESENTATION_OUTLINER:
-            sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressOutliner"));
+            //sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressOutliner"));
+            sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_OUTLINER_N)));
             break;
         case PRESENTATION_SUBTITLE:
-            sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressSubtitle"));
+            //sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressSubtitle"));
+            sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_SUBTITLE_N)));
             break;
         case PRESENTATION_PAGE:
-            sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressPage"));
+            //sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressPage"));
+            sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_PAGE_N)));
             break;
         case PRESENTATION_NOTES:
-            sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressNotes"));
+            //sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressNotes"));
+            sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_NOTES_N)));
             break;
         case PRESENTATION_HANDOUT:
-            sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressHandout"));
+            //sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressHandout"));
+            sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_HANDOUT_N)));
             break;
 		case PRESENTATION_HEADER:
-            sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressHeader"));
+            //sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressHeader"));
+	    sName = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_HEADER_N)) );
             break;
 		case PRESENTATION_FOOTER:
-            sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressFooter"));
+            //sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressFooter"));
+	    sName = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_FOOTER_N)) );
             break;
 		case PRESENTATION_DATETIME:
-            sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressDateAndTime"));
+            //sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressDateAndTime"));
+	    sName = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_DATE_N)) );
             break;
 		case PRESENTATION_PAGENUMBER:
-            sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressPageNumber"));
+            //sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressPageNumber"));
+	    sName = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_NUMBER_N)) );
             break;
         default:
-            sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("UnknownAccessibleImpressShape"));
+            //sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("UnknownAccessibleImpressShape"));
+            sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_UNKNOWN_N)));
+	//-----IAccessibility2 Implementation 2009
             uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape, uno::UNO_QUERY);
             if (xDescriptor.is())
                 sName += ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM(": "))
     throw (::com::sun::star::uno::RuntimeException)
 {
     //    return createAccessibleName ();
+    ::rtl::OUString sDescription;
     DescriptionGenerator aDG (mxShape);
     ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape);
     switch (nShapeType)
     {
+    //IAccessibility2 Implementation 2009-----
         case PRESENTATION_TITLE:
-            aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationTitleShape"));
+            //aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationTitleShape"));
+	    sDescription = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_TITLE_D)) );
+	    aDG.Initialize (sDescription);		
             break;
         case PRESENTATION_OUTLINER:
-            aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationOutlinerShape"));
+            //aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationOutlinerShape"));
+	    sDescription = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_OUTLINER_D)) );
+	    aDG.Initialize (sDescription);				//PresentationOutlinerShape
             break;
         case PRESENTATION_SUBTITLE:
             aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationSubtitleShape"));
+ 	    sDescription = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_SUBTITLE_D)) );
+	    aDG.Initialize (sDescription);				//PresentationSubtitleShape
             break;
         case PRESENTATION_PAGE:
             aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationPageShape"));
+            sDescription = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_PAGE_D)) );
+	    aDG.Initialize (sDescription);				//PresentationPageShape
             break;
         case PRESENTATION_NOTES:
             aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationNotesShape"));
+	    sDescription = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_NOTES_D)) );
+	    aDG.Initialize (sDescription);				//PresentationNotesShape
             break;
         case PRESENTATION_HANDOUT:
             aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationHandoutShape"));
+	    sDescription = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_HANDOUT_D)) );
+	    aDG.Initialize (sDescription);				//PresentationHandoutShape
             break;
 		case PRESENTATION_HEADER:
-            aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationHeaderShape"));
+            //aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationHeaderShape"));
+	    sDescription = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_HEADER_D)) );
+	    aDG.Initialize (sDescription);				//PresentationHeaderShape
             break;
 		case PRESENTATION_FOOTER:
-            aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationFooterShape"));
+            //aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationFooterShape"));
+	    sDescription = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_FOOTER_D)) );
+	    aDG.Initialize (sDescription);				//PresentationFooterShape
             break;
 		case PRESENTATION_DATETIME:
-            aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationDateAndTimeShape"));
+            //aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationDateAndTimeShape"));
+	    sDescription = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_DATE_D)) );
+	    aDG.Initialize (sDescription);				//PresentationDateShape
             break;
 		case PRESENTATION_PAGENUMBER:
-            aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationPageNumberShape"));
+            //aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationPageNumberShape"));
+	    sDescription = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_NUMBER_D)) );
+	    aDG.Initialize (sDescription);				//PresentationNumberShape
             break;
         default:
-            aDG.Initialize (::rtl::OUString::createFromAscii ("Unknown accessible presentation shape"));
+            //aDG.Initialize (::rtl::OUString::createFromAscii ("Unknown accessible presentation shape"));
+	    sDescription = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_UNKNOWN_D)) );
+	    aDG.Initialize (sDescription);				//Unknown accessible presentation shape
+	    //-----IAccessibility2 Implementation 2009
             uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape, uno::UNO_QUERY);
             if (xDescriptor.is())
             {
 
     return aDG();
 }
+//IAccessibility2 Implementation 2009-----
+::rtl::OUString AccessiblePresentationShape::GetStyle()
+{
+    ::rtl::OUString sName;
 
+    ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape);
+    switch (nShapeType)
+    {
+        case PRESENTATION_TITLE:
+            sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_TITLE_N_STYLE)));
+            break;
+        case PRESENTATION_OUTLINER:
+            sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_OUTLINER_N_STYLE)));
+            break;
+        case PRESENTATION_SUBTITLE:
+            sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_SUBTITLE_N_STYLE)));
+            break;
+        case PRESENTATION_PAGE:
+            sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_PAGE_N_STYLE)));
+            break;
+        case PRESENTATION_NOTES:
+            sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_NOTES_N_STYLE)));
+            break;
+        case PRESENTATION_HANDOUT:
+            sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_HANDOUT_N_STYLE)));
+            break;
+        case PRESENTATION_FOOTER:
+		sName = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_FOOTER_N_STYLE)) );
+            break;
+	case PRESENTATION_HEADER:
+		sName = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_HEADER_N_STYLE)) );
+            break;
+        case PRESENTATION_DATETIME:
+			sName = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_DATE_N_STYLE)) );
+            break;
+        case PRESENTATION_PAGENUMBER:
+			sName = ::rtl::OUString ( String(SdResId(SID_SD_A11Y_P_NUMBER_N_STYLE)) );
+            break;			
+        default:
+            sName = ::rtl::OUString (String(SdResId(SID_SD_A11Y_P_UNKNOWN_N_STYLE)));
+            uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape, uno::UNO_QUERY);
+            if (xDescriptor.is())
+                sName += ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM(": "))
+                    + xDescriptor->getShapeType();
+    }
+
+    return sName;
+
+}
+//-----IAccessibility2 Implementation 2009
 } // end of namespace accessibility	

File sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx

View file
     throw (uno::RuntimeException)
 {
     ThrowIfDisposed();
-    static sal_Int16 nRole = AccessibleRole::LIST_ITEM;
+    //Sym2_3376, Modified by Xing, set Role = Shape
+    //static sal_Int16 nRole = AccessibleRole::LIST_ITEM;
+    static sal_Int16 nRole = AccessibleRole::SHAPE;
     return nRole;
 }
 

File sd/source/ui/accessibility/AccessibleSlideSorterView.cxx

View file
     DECL_LINK(FocusChangeListener, void*);
     DECL_LINK(UpdateChildrenCallback, void*);
 
+    // Sym2_3376, Added by Xing
+    void Activated(void);
 private:
     AccessibleSlideSorterView& mrAccessibleSlideSorter;
     ::sd::slidesorter::SlideSorter& mrSlideSorter;
 
 void AccessibleSlideSorterView::Implementation::UpdateChildren (void)
 {
+  	//Sym2_3376,  Added by Xing. By default, all children should be accessable. So here workaround is to make all children visible. 
+  	// MT: THis was in UpdateVisibility, which has some similarity, and hg merge automatically has put it here. Correct?!
+  	// In the IA2 CWS, also setting mnFirst/LastVisibleChild was commented out!
+  	mnLastVisibleChild = maPageObjects.size();
+
     if (mbModelChangeLocked)
     {
         // Do nothing right now.  When the flag is reset, this method is
 }
 
 
+//Sym2_3376,  Added by Xing, 
+void AccessibleSlideSorterView::SwitchViewActivated (void)
+{
+	// Firstly, set focus to view
+	this->FireAccessibleEvent(AccessibleEventId::STATE_CHANGED,
+                    Any(),
+                    Any(AccessibleStateType::FOCUSED));
+	
+	mpImpl->Activated();
+}
+
+void AccessibleSlideSorterView::Implementation::Activated()
+{
+	mrSlideSorter.GetController().GetFocusManager().ShowFocus();
+
+}
+
 
 
 IMPL_LINK(AccessibleSlideSorterView::Implementation, WindowEventListener, VclWindowEvent*, pEvent)
     sal_Int32 nNewFocusedIndex (
         mrSlideSorter.GetController().GetFocusManager().GetFocusedPageIndex());
 
+    // Sym2_6062, 
+    sal_Bool bHasFocus = mrSlideSorter.GetController().GetFocusManager().IsFocusShowing();
+    if (!bHasFocus)
+    	nNewFocusedIndex = -1;
+
+    // Sym2_3376, Added by Xing, add a checker whether the focus event is sent out. Only after sent, the mnFocusedIndex should be updated. 
+    sal_Bool bSentFocus = sal_False;
     if (nNewFocusedIndex != mnFocusedIndex)
     {
         if (mnFocusedIndex >= 0)
         {
             AccessibleSlideSorterObject* pObject = GetAccessibleChild(mnFocusedIndex);
             if (pObject != NULL)
+			{
                 pObject->FireAccessibleEvent(
                     AccessibleEventId::STATE_CHANGED,
                     Any(AccessibleStateType::FOCUSED),
                     Any());
+				bSentFocus = sal_True;
+			}
         }
         if (nNewFocusedIndex >= 0)
         {
             AccessibleSlideSorterObject* pObject = GetAccessibleChild(nNewFocusedIndex);
             if (pObject != NULL)
+			{
                 pObject->FireAccessibleEvent(
                     AccessibleEventId::STATE_CHANGED,
                     Any(),
                     Any(AccessibleStateType::FOCUSED));
+				bSentFocus = sal_True;
+			}
         }
-        mnFocusedIndex = nNewFocusedIndex;
+		if (bSentFocus == sal_True)
+			mnFocusedIndex = nNewFocusedIndex;
     }
     return 1;
 }

File sd/source/ui/accessibility/accessibility.hrc

View file
 #define SID_SD_A11Y_I_HANDOUTVIEW_N		(SID_SD_A11Y_START + 10)
 #define SID_SD_A11Y_I_HANDOUTVIEW_D		(SID_SD_A11Y_START + 11)
 
+//IAccessibility2 Implementation 2009-----
+#define SID_SD_A11Y_P_TITLE_N			(SID_SD_A11Y_START + 12)
+#define SID_SD_A11Y_P_TITLE_D			(SID_SD_A11Y_START + 13)
+#define SID_SD_A11Y_P_OUTLINER_N		(SID_SD_A11Y_START + 14)
+#define SID_SD_A11Y_P_OUTLINER_D		(SID_SD_A11Y_START + 15)
+#define SID_SD_A11Y_P_SUBTITLE_N		(SID_SD_A11Y_START + 16)
+#define SID_SD_A11Y_P_SUBTITLE_D		(SID_SD_A11Y_START + 17)
+#define SID_SD_A11Y_P_PAGE_N			(SID_SD_A11Y_START + 18)
+#define SID_SD_A11Y_P_PAGE_D			(SID_SD_A11Y_START + 19)
+#define SID_SD_A11Y_P_NOTES_N			(SID_SD_A11Y_START + 20)
+#define SID_SD_A11Y_P_NOTES_D			(SID_SD_A11Y_START + 21)
+#define SID_SD_A11Y_P_HANDOUT_N			(SID_SD_A11Y_START + 22)
+#define SID_SD_A11Y_P_HANDOUT_D			(SID_SD_A11Y_START + 23)
+#define SID_SD_A11Y_P_UNKNOWN_N			(SID_SD_A11Y_START + 24)
+#define SID_SD_A11Y_P_UNKNOWN_D			(SID_SD_A11Y_START + 25)
+#define SID_SD_A11Y_P_FOOTER_N			(SID_SD_A11Y_START + 26)
+#define SID_SD_A11Y_P_FOOTER_D			(SID_SD_A11Y_START + 27)
+#define SID_SD_A11Y_P_HEADER_N			(SID_SD_A11Y_START + 28)
+#define SID_SD_A11Y_P_HEADER_D			(SID_SD_A11Y_START + 29)
+#define SID_SD_A11Y_P_DATE_N			(SID_SD_A11Y_START + 30)
+#define SID_SD_A11Y_P_DATE_D			(SID_SD_A11Y_START + 31)
+#define SID_SD_A11Y_P_NUMBER_N			(SID_SD_A11Y_START + 32)
+#define SID_SD_A11Y_P_NUMBER_D			(SID_SD_A11Y_START + 33)
+#define SID_SD_A11Y_D_PRESENTATION		(SID_SD_A11Y_START + 34)
+#define   SID_SD_A11Y_P_TITLE_N_STYLE		(SID_SD_A11Y_START + 35)
+#define   SID_SD_A11Y_P_OUTLINER_N_STYLE	(SID_SD_A11Y_START + 36)
+#define   SID_SD_A11Y_P_SUBTITLE_N_STYLE	(SID_SD_A11Y_START + 37)
+#define   SID_SD_A11Y_P_PAGE_N_STYLE		(SID_SD_A11Y_START + 38)
+#define   SID_SD_A11Y_P_NOTES_N_STYLE 		(SID_SD_A11Y_START + 39)
+#define   SID_SD_A11Y_P_HANDOUT_N_STYLE		(SID_SD_A11Y_START + 40)
+#define   SID_SD_A11Y_P_UNKNOWN_N_STYLE		(SID_SD_A11Y_START + 41)
+#define   SID_SD_A11Y_P_FOOTER_N_STYLE		(SID_SD_A11Y_START + 42)
+#define   SID_SD_A11Y_P_HEADER_N_STYLE		(SID_SD_A11Y_START + 43)
+#define   SID_SD_A11Y_P_DATE_N_STYLE		(SID_SD_A11Y_START + 44)
+#define   SID_SD_A11Y_P_NUMBER_N_STYLE		(SID_SD_A11Y_START + 45)
 
+#define   SID_SD_A11Y_I_PREVIEW_N (SID_SD_A11Y_START + 46)
+#define   SID_SD_A11Y_I_PREVIEW_D (SID_SD_A11Y_START + 47)
+#define   SID_SD_A11Y_I_PREVIEW_SUFFIX (SID_SD_A11Y_START + 48)
+#define   SID_SD_A11Y_D_PRESENTATION_READONLY (SID_SD_A11Y_START + 49)
+//-----IAccessibility2 Implementation 2009
 #endif /* _SD_ACCESSIBILITY_HRC */
 

File sd/source/ui/accessibility/accessibility.src

View file
 	Text [ en-US ] = "This is where you decide on the layout for handouts.";
 };
 
+//IAccessibility2 Implementation 2009-----
+String SID_SD_A11Y_P_TITLE_N
+{
+	Text [ en-US ] = "PresentationTitle";
+};
 
+String SID_SD_A11Y_P_OUTLINER_N
+{
+	Text [ en-US ] = "PresentationOutliner";
+};
 
+String SID_SD_A11Y_P_SUBTITLE_N
+{
+	Text [ en-US ] = "PresentationSubtitle";
+};
 
+String SID_SD_A11Y_P_PAGE_N
+{
+	Text [ en-US ] = "PresentationPage";
+};
 
+String SID_SD_A11Y_P_NOTES_N
+{
+	Text [ en-US ] = "PresentationNotes";
+};
 
+String SID_SD_A11Y_P_HANDOUT_N
+{
+	Text [ en-US ] = "Handout";
+};
 
+String SID_SD_A11Y_P_UNKNOWN_N
+{
+	Text [ en-US ] = "UnknownAccessiblePresentationShape";
+};
 
+String SID_SD_A11Y_P_TITLE_D
+{
+	Text [ en-US ] = "PresentationTitleShape";
+};
 
+String SID_SD_A11Y_P_OUTLINER_D
+{
+	Text [ en-US ] = "PresentationOutlinerShape";
+};
 
+String SID_SD_A11Y_P_SUBTITLE_D
+{
+	Text [ en-US ] = "PresentationSubtitleShape";
+};
 
+String SID_SD_A11Y_P_PAGE_D
+{
+	Text [ en-US ] = "PresentationPageShape";
+};
 
+String SID_SD_A11Y_P_NOTES_D
+{
+	Text [ en-US ] = "PresentationNotesShape";
+};
 
+String SID_SD_A11Y_P_HANDOUT_D
+{
+	Text [ en-US ] = "PresentationHandoutShape";
+};
 
+String SID_SD_A11Y_P_UNKNOWN_D
+{
+	Text [ en-US ] = "Unknown accessible presentation shape";
+};
 
+String SID_SD_A11Y_P_FOOTER_N
+{
+	Text [ en-US ] = "PresentationFooter";
+};
+String SID_SD_A11Y_P_FOOTER_D
+{
+	Text [ en-US ] = "PresentationFooterShape";
+};
+String SID_SD_A11Y_P_HEADER_N
+{
+	Text [ en-US ] = "PresentationHeader";
+};
+String SID_SD_A11Y_P_HEADER_D
+{
+	Text [ en-US ] = "PresentationHeaderShape";
+};
+String SID_SD_A11Y_P_DATE_N
+{
+	Text [ en-US ] = "PresentationDateAndTime";
+};
+String SID_SD_A11Y_P_DATE_D
+{
+	Text [ en-US ] = "PresentationDateAndTimeShape";
+};
+String SID_SD_A11Y_P_NUMBER_N
+{
+	Text [ en-US ] = "PresentationPageNumber";
+};
+String SID_SD_A11Y_P_NUMBER_D
+{
+	Text [ en-US ] = "PresentationPageNumberShape";
+};
 
+String SID_SD_A11Y_D_PRESENTATION
+{
+	Text [ en-US ] = "%PRODUCTNAME Presentation";
+};
+String SID_SD_A11Y_P_TITLE_N_STYLE
+{
+	Text [ en-US ] = "Title";
+};
+String  SID_SD_A11Y_P_OUTLINER_N_STYLE
+{
+	Text [ en-US ] = "Outliner";
+};
+String  SID_SD_A11Y_P_SUBTITLE_N_STYLE
+{
+	Text [ en-US ] = "Sub Title";
+};
+String  SID_SD_A11Y_P_PAGE_N_STYLE
+{
+	Text [ en-US ] = "Page";
+};
+String  SID_SD_A11Y_P_NOTES_N_STYLE
+{
+	Text [ en-US ] = "Notes";
+};
+String  SID_SD_A11Y_P_HANDOUT_N_STYLE
+{
+	Text [ en-US ] = "Handout";
+};
+String  SID_SD_A11Y_P_UNKNOWN_N_STYLE
+{
+	Text [ en-US ] = "Unknown Accessible Presentation Shape";
+};
+String  SID_SD_A11Y_P_FOOTER_N_STYLE
+{
+	Text [ en-US ] = "Footer";
+};
+String  SID_SD_A11Y_P_HEADER_N_STYLE
+{
+	Text [ en-US ] = "Header";
+};
+String  SID_SD_A11Y_P_DATE_N_STYLE
+{
+	Text [ en-US ] = "Date";
+};
+String  SID_SD_A11Y_P_NUMBER_N_STYLE
+{
+	Text [ en-US ] = "Number";
+};
 
+String  SID_SD_A11Y_I_PREVIEW_N
+{
+	Text [ en-US ] = "Preview View";
+};
+String  SID_SD_A11Y_I_PREVIEW_D
+{
+	Text [ en-US ] = "This is where you print preview pages.";
+};
+String  SID_SD_A11Y_I_PREVIEW_SUFFIX
+{
+	Text [ en-US ] = "(Preview mode)";
+};
 
-
-
-
-
-
+String SID_SD_A11Y_D_PRESENTATION_READONLY
+{
+	Text [ en-US ] = "(read-only)";
+};
+//-----IAccessibility2 Implementation 2009

File sd/source/ui/dlg/navigatr.cxx

View file
     // set focus to listbox, otherwise it is in the toolbox which is only useful
     // for keyboard navigation
     maTlbObjects.GrabFocus();
+//IAccessibility2 Implementation 2009-----
+       maTlbObjects.SetSdNavigatorWinFlag(sal_True);
+//-----IAccessibility2 Implementation 2009
 
 	// DragTypeListBox
 	maLbDocs.SetSelectHdl( LINK( this, SdNavigatorWin, SelectDocumentHdl ) );
 
 // -----------------------------------------------------------------------
 
+//IAccessibility2 Implementation 2009-----
+//Solution: when object is marked , fresh the corresponding entry tree .
+//==================================================
+void SdNavigatorWin::FreshTree( const SdDrawDocument* pDoc )
+{
+	SdDrawDocument* pNonConstDoc = (SdDrawDocument*) pDoc; // const as const can...
+	sd::DrawDocShell* pDocShell = pNonConstDoc->GetDocSh();
+	String aDocShName( pDocShell->GetName() );
+	String aDocName = pDocShell->GetMedium()->GetName();
+	maTlbObjects.SetSaveTreeItemStateFlag(sal_True); //Added by yanjun for sym2_6385
+	maTlbObjects.Clear();
+	maTlbObjects.Fill( pDoc, sal_False, aDocName ); // Nur normale Seiten
+	maTlbObjects.SetSaveTreeItemStateFlag(sal_False); //Added by yanjun for sym2_6385
+	RefreshDocumentLB();
+	maLbDocs.SelectEntry( aDocShName );
+}
+void SdNavigatorWin::FreshEntry( )
+{
+	maTlbObjects.FreshCurEntry();
+}
+//==================================================
+//-----IAccessibility2 Implementation 2009
 void SdNavigatorWin::InitTreeLB( const SdDrawDocument* pDoc )
 {
 	SdDrawDocument* pNonConstDoc = (SdDrawDocument*) pDoc; // const as const can...
 }
 
 // -----------------------------------------------------------------------
-
+//IAccessibility2 Implementation 2009-----
+//Solution: Get  SdDrawDocShell 
+sd::DrawDocShell* SdNavigatorWin::GetDrawDocShell( const SdDrawDocument* pDoc )
+{
+	if( !pDoc )
+		return NULL; // const as const can...
+	sd::DrawDocShell* pDocShell = pDoc->GetDocSh();
+	return pDocShell;
+}
+//-----IAccessibility2 Implementation 2009
 
 IMPL_LINK( SdNavigatorWin, SelectToolboxHdl, void *, EMPTYARG )
 {
 				SfxStringItem aItem( SID_NAVIGATOR_OBJECT, aStr );
 				mpBindings->GetDispatcher()->Execute(
 					SID_NAVIGATOR_OBJECT, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD, &aItem, 0L );
+//IAccessibility2 Implementation 2009-----
+				//Solution: set sign variable
+				maTlbObjects.MarkCurEntry(aStr);
+//-----IAccessibility2 Implementation 2009
 
                 // #98821# moved here from SetGetFocusHdl. Reset the
                 // focus only if something has been selected in the

File sd/source/ui/dlg/sdtreelb.cxx

View file
 
 SdPageObjsTLB::SdPageObjsTLB( Window* pParentWin, const SdResId& rSdResId ) 
 :	SvTreeListBox       ( pParentWin, rSdResId )
+,   bisInSdNavigatorWin  ( sal_False )
 ,	mpParent 		    ( pParentWin )
 ,	mpDoc			    ( NULL )
 ,	mpBookmarkDoc	    ( NULL )
 ,	mpDropNavWin		( NULL )
 ,   mbShowAllShapes     ( false )
 ,   mbShowAllPages      ( false )
-
 {
 	// Tree-ListBox mit Linien versehen
 	SetStyle( GetStyle() | WB_TABSTOP | WB_BORDER | WB_HASLINES |
         delete mpMedium;
 }
 
+//IAccessibility2 Implementation 2009-----
+// helper function for 	GetEntryAltText and GetEntryLongDescription
+String SdPageObjsTLB::getAltLongDescText( SvLBoxEntry* pEntry , sal_Bool isAltText) const
+{
+	sal_uInt16 maxPages = mpDoc->GetPageCount();
+	sal_uInt16 pageNo;
+	SdrObject*	 pObj = NULL;
+	SdPage* pPage = NULL;
+
+
+	String ParentName = GetEntryText( GetRootLevelParent( pEntry ) );
+	
+	for( pageNo = 0;  pageNo < maxPages; pageNo++ )
+	{		
+		pPage = (SdPage*) mpDoc->GetPage( pageNo );
+		if( pPage->GetPageKind() != PK_STANDARD ) continue;
+		if( pPage->GetName() !=  ParentName ) continue;
+		SdrObjListIter aIter( *pPage, IM_FLAT );
+		while( aIter.IsMore() )
+		{
+			pObj = aIter.Next();
+			if( GetEntryText(pEntry) ==  GetObjectName( pObj )  )
+			{
+				if( isAltText )
+					return pObj->GetTitle();
+				else
+					return pObj->GetDescription();
+			}
+		}
+	}	
+	return String();
+
+}
+
+String SdPageObjsTLB::GetEntryAltText( SvLBoxEntry* pEntry ) const
+{
+	return getAltLongDescText( pEntry, sal_True );
+}
+
+String SdPageObjsTLB::GetEntryLongDescription( SvLBoxEntry* pEntry ) const
+{
+	return getAltLongDescText( pEntry, sal_False);
+}
+
+void  SdPageObjsTLB::MarkCurEntry( const String& rName )
+{
+	
+	if( rName.Len() )
+	{
+		SvLBoxEntry* pCurEntry =GetCurEntry();
+		SvLBoxEntry* pEntry =NULL;
+		String aTmp1;
+		String aTmp2;
+
+	       if( GetParent(pCurEntry)==NULL )
+	       {
+	              aTmp1 = GetEntryText( pCurEntry );
+		       for( pEntry = First(); pEntry ; pEntry = Next( pEntry ) )
+			{
+			       if(GetParent( pEntry )==NULL)
+				   	     continue;
+				aTmp2 = GetEntryText( GetParent( pEntry ));
+				if( aTmp1 != aTmp2)
+				{
+					// IA2 CWS. MT: Removed in SvLBoxEntry for now - only used in Sw/Sd/ScContentLBoxString, they should decide if they need this
+					pEntry->SetMarked(sal_False);
+				}
+			}
+	           
+	       }
+              else
+              {
+	              for( pEntry = First(); pEntry ; pEntry = Next( pEntry ) )
+			{
+				aTmp2 = GetEntryText( pEntry );
+				if( aTmp2 == rName)
+				{
+					pEntry->SetMarked(sal_True);
+				}
+				else
+				{
+				        pEntry->SetMarked(sal_False);
+				}
+			}
+              }
+	}
+	Invalidate();
+}
+
+void  SdPageObjsTLB:: FreshCurEntry()
+{
+       SvLBoxEntry* pEntry =NULL;
+       for( pEntry = First(); pEntry ; pEntry = Next( pEntry ) )
+	{
+		        pEntry->SetMarked(sal_False);
+	}
+	Invalidate();
+}
+
+class SdContentLBoxString : public SvLBoxString
+{
+public:
+	SdContentLBoxString( SvLBoxEntry* pEntry, sal_uInt16 nFlags,
+		const String& rStr ) : SvLBoxString(pEntry,nFlags,rStr)	{}
+
+	virtual void Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags,
+		SvLBoxEntry* pEntry);
+};
+
+void SdPageObjsTLB::InitEntry(SvLBoxEntry* pEntry,
+		const XubString& rStr ,const Image& rImg1,const Image& rImg2,SvLBoxButtonKind eButtonKind)
+{
+	sal_uInt16 nColToHilite = 1; //0==Bitmap;1=="Spalte1";2=="Spalte2"
+	SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2, eButtonKind );
+	SvLBoxString* pCol = (SvLBoxString*)pEntry->GetItem( nColToHilite );
+	SdContentLBoxString* pStr = new SdContentLBoxString( pEntry, 0, pCol->GetText() );
+	pEntry->ReplaceItem( pStr, nColToHilite );
+}
+
+void SdContentLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags,
+	SvLBoxEntry* pEntry )
+{
+	// IA2 CWS. MT: Removed for now (also in SvLBoxEntry) - only used in Sw/Sd/ScContentLBoxString, they should decide if they need this
+	/*
+	if (pEntry->IsMarked())
+	{
+			rDev.DrawText( rPos, GetText() );
+			XubString str;
+			str = XubString::CreateFromAscii("*");
+			Point rPosStar(rPos.X()-6,rPos.Y());
+			Font aOldFont( rDev.GetFont());
+			Font aFont(aOldFont);
+			Color aCol( aOldFont.GetColor() );
+			aCol.DecreaseLuminance( 200 );
+			aFont.SetColor( aCol );
+			rDev.SetFont( aFont );
+			rDev.DrawText( rPosStar, str);
+			rDev.SetFont( aOldFont );
+	}
+	else 
+	*/
+		SvLBoxString::Paint( rPos, rDev, nFlags, pEntry);
+
+}
+
+//Added by yanjun for sym2_6385
+void SdPageObjsTLB::SaveExpandedTreeItemState(SvLBoxEntry* pEntry, vector<String>& vectTreeItem)
+{
+	if (pEntry)
+	{
+		SvLBoxEntry* pListEntry = pEntry;
+		while (pListEntry)
+		{
+			if (pListEntry->HasChilds())
+			{
+				if (IsExpanded(pListEntry))
+					vectTreeItem.push_back(GetEntryText(pListEntry));
+				SvLBoxEntry* pChildEntry = FirstChild(pListEntry);
+				SaveExpandedTreeItemState(pChildEntry, vectTreeItem);
+			}
+			pListEntry = NextSibling(pListEntry);
+		}
+	}
+}
+void SdPageObjsTLB::Clear()
+{
+	//Save the expanded tree item
+	if (mbSaveTreeItemState)
+	{
+		maSelectionEntryText = String();
+		maTreeItem.clear();
+		if (GetCurEntry())
+			maSelectionEntryText = GetSelectEntry();
+		SvLBoxEntry* pEntry = FirstChild(NULL);
+		SaveExpandedTreeItemState(pEntry, maTreeItem);
+	}
+	return SvTreeListBox::Clear();
+}
+//End
+//-----IAccessibility2 Implementation 2009
 /*************************************************************************
 |*
 |* return name of object
 	}
 	if( aSelection.Len() )
 		SelectEntry( aSelection );
+	//Added by yanjun for sym2_6385
+	else if (mbSaveTreeItemState && maSelectionEntryText.Len())
+	{
+		SelectEntry(maSelectionEntryText);
+	}
+	//End
 }
 
 /*************************************************************************
         IM_FLAT,
         sal_False /*not reverse*/);
 
+	//IAccessibility2 Implementation 2009-----
+	sal_Bool  bMarked=sal_False;
+	if(bisInSdNavigatorWin)
+	{
+		Window* pWindow=NULL;
+		SdNavigatorWin* pSdNavigatorWin=NULL;
+		sd::DrawDocShell* pSdDrawDocShell = NULL;
+		if(pEntry)
+			pWindow=(Window*)GetParent(pEntry);
+		if(pWindow)
+			pSdNavigatorWin = (SdNavigatorWin*)pWindow;
+		if( pSdNavigatorWin )
+			pSdDrawDocShell = pSdNavigatorWin->GetDrawDocShell(mpDoc);	
+		if(pSdDrawDocShell)
+			bMarked=pSdDrawDocShell->IsMarked(pShape);
+		if(pEntry)
+		{
+			if(bMarked)
+				pEntry->SetMarked(sal_True);
+			else
+				pEntry->SetMarked( sal_False );
+		}
+	}
+	//-----IAccessibility2 Implementation 2009
     while( aIter.IsMore() )
     {
         SdrObject* pObj = aIter.Next();
             {
                 SvLBoxEntry* pNewEntry = InsertEntry( aStr, maImgOle, maImgOle, pEntry,
                     sal_False, LIST_APPEND, pObj);
-
+				//IAccessibility2 Implementation 2009-----
+				if(bisInSdNavigatorWin)
+				{
+					Window* pWindow=NULL;
+					SdNavigatorWin* pSdNavigatorWin=NULL;
+					sd::DrawDocShell* pSdDrawDocShell = NULL;
+					if(pNewEntry)
+						pWindow=(Window*)GetParent(pNewEntry);
+					if(pWindow)
+						pSdNavigatorWin = (SdNavigatorWin*)pWindow;
+					if( pSdNavigatorWin )
+						pSdDrawDocShell = pSdNavigatorWin->GetDrawDocShell(mpDoc);	
+					if(pSdDrawDocShell)
+						bMarked=pSdDrawDocShell->IsMarked((SdrObject*)pObj);
+					if(pNewEntry)
+					{
+						if(bMarked)
+							pNewEntry->SetMarked(sal_True);
+						else
+							pNewEntry->SetMarked( sal_False );
+					}
+				}
+				//-----IAccessibility2 Implementation 2009
                 SetExpandedEntryBmp( pNewEntry, maImgOleH, BMP_COLOR_HIGHCONTRAST );
                 SetCollapsedEntryBmp( pNewEntry, maImgOleH, BMP_COLOR_HIGHCONTRAST );
             }
             {
                 SvLBoxEntry* pNewEntry = InsertEntry( aStr, maImgGraphic, maImgGraphic, pEntry,
                     sal_False, LIST_APPEND, pObj );
-
+				//IAccessibility2 Implementation 2009-----
+				if(bisInSdNavigatorWin)