You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ja...@apache.org on 2013/11/20 01:50:01 UTC

svn commit: r1543679 [19/32] - in /openoffice/branches/capstone2013: ./ main/ main/accessibility/inc/accessibility/extended/ main/accessibility/inc/accessibility/helper/ main/accessibility/inc/accessibility/standard/ main/accessibility/source/extended/...

Modified: openoffice/branches/capstone2013/main/sw/inc/hintids.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/sw/inc/hintids.hxx?rev=1543679&r1=1543678&r2=1543679&view=diff
==============================================================================
--- openoffice/branches/capstone2013/main/sw/inc/hintids.hxx (original)
+++ openoffice/branches/capstone2013/main/sw/inc/hintids.hxx Wed Nov 20 00:49:46 2013
@@ -33,11 +33,15 @@
 #define CH_TXTATR_INWORD		((sal_Unicode)0x02)
 #define CH_TXTATR_TAB           ((sal_Unicode)'\t')
 #define CH_TXTATR_NEWLINE       ((sal_Unicode)'\n')
-#define CH_TXT_ATR_FIELDSTART ((sal_Unicode)0x04)
-#define CH_TXT_ATR_FIELDEND ((sal_Unicode)0x05)
+#define CH_TXT_ATR_INPUTFIELDSTART ((sal_Unicode)0x04)
+#define CH_TXT_ATR_INPUTFIELDEND ((sal_Unicode)0x05)
+
+#define CH_TXT_ATR_FORMELEMENT ((sal_Unicode)0x06)
+
+#define CH_TXT_ATR_FIELDSTART ((sal_Unicode)0x07)
+#define CH_TXT_ATR_FIELDEND ((sal_Unicode)0x08)
 #define CH_TXT_ATR_SUBST_FIELDSTART ("[")
 #define CH_TXT_ATR_SUBST_FIELDEND ("]")
-#define CH_TXT_ATR_FORMELEMENT ((sal_Unicode)0x06)
 
 /*
  * Hier kommen erst mal die enums fuer die Hints
@@ -129,7 +133,7 @@ RES_TXTATR_WITHEND_BEGIN = RES_TXTATR_BE
     RES_TXTATR_CHARFMT,                             // 49
     RES_TXTATR_CJK_RUBY,                            // 50
     RES_TXTATR_UNKNOWN_CONTAINER,                   // 51
-    RES_TXTATR_DUMMY5,                              // 52
+    RES_TXTATR_INPUTFIELD,                          // 52
 RES_TXTATR_WITHEND_END,
 
 // alle TextAttribute ohne ein Ende

Modified: openoffice/branches/capstone2013/main/sw/inc/mdiexp.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/sw/inc/mdiexp.hxx?rev=1543679&r1=1543678&r2=1543679&view=diff
==============================================================================
--- openoffice/branches/capstone2013/main/sw/inc/mdiexp.hxx (original)
+++ openoffice/branches/capstone2013/main/sw/inc/mdiexp.hxx Wed Nov 20 00:49:46 2013
@@ -70,5 +70,7 @@ TblChgMode GetTblChgDefaultMode();
 
 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

Modified: openoffice/branches/capstone2013/main/sw/inc/ndole.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/sw/inc/ndole.hxx?rev=1543679&r1=1543678&r2=1543679&view=diff
==============================================================================
--- openoffice/branches/capstone2013/main/sw/inc/ndole.hxx (original)
+++ openoffice/branches/capstone2013/main/sw/inc/ndole.hxx Wed Nov 20 00:49:46 2013
@@ -66,6 +66,9 @@ public:
     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
 };

Modified: openoffice/branches/capstone2013/main/sw/inc/ndtxt.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/sw/inc/ndtxt.hxx?rev=1543679&r1=1543678&r2=1543679&view=diff
==============================================================================
--- openoffice/branches/capstone2013/main/sw/inc/ndtxt.hxx (original)
+++ openoffice/branches/capstone2013/main/sw/inc/ndtxt.hxx Wed Nov 20 00:49:46 2013
@@ -52,7 +52,8 @@ namespace utl {
 
 class SwTxtFmtColl;
 class SwCntntFrm;
-class SwTxtFld; 		 // Fuer GetTxtFld()
+class SwTxtFld;
+class SwTxtInputFld;
 class SfxItemSet;
 class SwUndoTransliterate;
 
@@ -92,9 +93,7 @@ class SW_DLLPUBLIC SwTxtNode: public SwC
 	//Also niemals direkt zugreifen!
     SwpHints    *m_pSwpHints;
 
-    // --> OD 2005-11-02 #i51089 - TUNING#
     mutable SwNodeNum* mpNodeNum;  // Numerierung fuer diesen Absatz
-    // <--
     XubString   m_Text;
 
     SwParaIdleData_Impl* m_pParaIdleData_Impl;
@@ -111,20 +110,15 @@ class SW_DLLPUBLIC SwTxtNode: public SwC
     bool m_bNotifiable;
 
     // sal_uInt8 nOutlineLevel; //#outline level, removed by zhaojianwei.
-    // --> OD 2008-11-19 #i70748#
+
     bool mbEmptyListStyleSetDueToSetOutlineLevelAttr;
-    // <--
 
-    // --> OD 2008-03-27 #refactorlists#
     // boolean, indicating that a <SetAttr(..)> or <ResetAttr(..)> or
     // <ResetAllAttr(..)> method is running.
     // Needed to avoid duplicate handling of attribute change actions.
     bool mbInSetOrResetAttr;
-    // <--
-    // --> OD 2008-05-06 #refactorlists#
     // pointer to the list, to whose the text node is added to
     SwList* mpList;
-    // <--
     /// #i111677# cached expansion (for clipboard)
     ::std::auto_ptr< ::rtl::OUString > m_pNumStringCache;
 
@@ -184,9 +178,6 @@ class SW_DLLPUBLIC SwTxtNode: public SwC
 
     /** create number for this text node, if not already existing
 
-        OD 2005-11-02 #i51089 - TUNING#
-        OD 2007-10-26 #i83479# - made private
-
         @return number of this node
     */
     SwNodeNum* CreateNum() const;
@@ -195,6 +186,8 @@ class SW_DLLPUBLIC SwTxtNode: public SwC
 
     SW_DLLPRIVATE void impl_FmtToTxtAttr(const SfxItemSet& i_rAttrSet);
 
+    const SwTxtInputFld* GetOverlappingInputFld( const SwTxtAttr& rTxtAttr ) const;
+
 public:
 	//Bug 120881:Modify here for Directly Page Numbering
 	bool HasPageNumberField();
@@ -211,9 +204,7 @@ public:
     void SetAutoCompleteWordDirty( bool bNew ) const;
     void SetWrong( SwWrongList* pNew, bool bDelete = true );
     SwWrongList* GetWrong();
-    // --> OD 2008-05-23 #i71360#
     const SwWrongList* GetWrong() const;
-    // <--
     void SetGrammarCheck( SwGrammarMarkUp* pNew, bool bDelete = true );
     SwGrammarMarkUp* GetGrammarCheck();
     // SMARTTAGS
@@ -252,14 +243,12 @@ public:
 	void GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rMax, sal_uLong &rAbs,
 						OutputDevice* pOut = 0 ) const;
 
-    // --> OD 2008-03-13 #refactorlists#
     // overriding to handle change of certain paragraph attributes
     virtual sal_Bool SetAttr( const SfxPoolItem& );
     virtual sal_Bool SetAttr( const SfxItemSet& rSet );
     virtual sal_Bool ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 = 0 );
     virtual sal_Bool ResetAttr( const SvUShorts& rWhichArr );
     virtual sal_uInt16 ResetAllAttr();
-    // <--
 
     /// insert text content
     void InsertText( const XubString & rStr, const SwIndex & rIdx,
@@ -285,7 +274,7 @@ public:
             refmarks, toxmarks, and metas will be ignored unless this is true
         ATTENTION: setting bInclRefToxMark is only allowed from UNDO!
      */
-    void RstAttr(
+    void RstTxtAttr(
         const SwIndex &rIdx,
         const xub_StrLen nLen,
         const sal_uInt16 nWhich = 0,
@@ -296,7 +285,7 @@ public:
 	// loesche das Text-Attribut (muss beim Pool abgemeldet werden!)
 	void 	DestroyAttr( SwTxtAttr* pAttr );
 
-	// loesche alle Attribute aus dem SwpHintsArray.
+    // loesche alle Attribute aus dem SwpHintsArray.
     void    ClearSwpHintsArr( bool bDelFields );
 
     /// Insert pAttr into hints array. @return true iff inserted successfully
@@ -308,13 +297,15 @@ public:
                   const xub_StrLen nStart, const xub_StrLen nEnd,
                   const SetAttrMode nMode = nsSetAttrMode::SETATTR_DEFAULT );
 
-	// setze diese Attribute am TextNode. Wird der gesamte Bereich umspannt,
-	// dann setze sie nur im AutoAttrSet (SwCntntNode:: SetAttr)
-    sal_Bool SetAttr( const SfxItemSet& rSet,
-                  xub_StrLen nStt, xub_StrLen nEnd,
-                  const SetAttrMode nMode = nsSetAttrMode::SETATTR_DEFAULT );
-	// erfrage die Attribute vom TextNode ueber den Bereich
-    // --> OD 2008-01-16 #newlistlevelattrs#
+    // setze diese Attribute am TextNode. Wird der gesamte Bereich umspannt,
+    // dann setze sie nur im AutoAttrSet (SwCntntNode:: SetAttr)
+    sal_Bool SetAttr(
+        const SfxItemSet& rSet,
+        const xub_StrLen nStt,
+        const xub_StrLen nEnd,
+        const SetAttrMode nMode = nsSetAttrMode::SETATTR_DEFAULT );
+
+    // erfrage die Attribute vom TextNode ueber den Bereich
     // Introduce 4th optional parameter <bMergeIndentValuesOfNumRule>.
     // If <bMergeIndentValuesOfNumRule> == sal_True, the indent attributes of
     // the corresponding list level of an applied list style is merged into
@@ -337,7 +328,6 @@ public:
     void DeleteAttribute ( SwTxtAttr * const pTxtAttr );
 
 	// Aktionen auf Text und Attributen
-    // --> OD 2008-11-18 #i96213#
     // introduce optional parameter to control, if all attributes have to be copied.
     void CopyText( SwTxtNode * const pDest,
                const SwIndex &rStart,
@@ -348,7 +338,6 @@ public:
                const SwIndex &rStart,
                xub_StrLen nLen,
                const bool bForceCopyOfAllAttrs = false );
-    // <--
 
     void        CutText(SwTxtNode * const pDest,
                     const SwIndex & rStart, const xub_StrLen nLen);
@@ -374,8 +363,8 @@ public:
 						sal_Bool bFmtToTxtAttributes = sal_True );
 
     enum GetTxtAttrMode {
-        DEFAULT,    /// DEFAULT: (Start <  nIndex <= End)
-        EXPAND,     /// EXPAND : (Start <= nIndex <  End)
+        DEFAULT,    /// DEFAULT: (Start <= nIndex <  End)
+        EXPAND,     /// EXPAND : (Start <  nIndex <= End)
         PARENT,     /// PARENT : (Start <  nIndex <  End)
     };
 
@@ -387,20 +376,19 @@ public:
         hints of which several may cover a single position, like
         RES_TXTATR_CHARFMT, RES_TXTATR_REFMARK, RES_TXTATR_TOXMARK
      */
-    SwTxtAttr *GetTxtAttrAt(xub_StrLen const nIndex, RES_TXTATR const nWhich,
-                            enum GetTxtAttrMode const eMode = DEFAULT) const;
-	//Bug 120881:Modify here for Directly Page Numbering
-	SwTxtFld  *GetTxtFld( xub_StrLen const rIdx )
-				{ return (SwTxtFld *)GetTxtAttrAt( rIdx, RES_TXTATR_FIELD ); }
-	//Bug 120881(End)
+    SwTxtAttr *GetTxtAttrAt(
+        xub_StrLen const nIndex,
+        RES_TXTATR const nWhich,
+        enum GetTxtAttrMode const eMode = DEFAULT ) const;
 
     /** get the innermost text attributes covering position nIndex.
         @param nWhich   only attributes with this id are returned.
         @param eMode    the predicate for matching (@see GetTxtAttrMode).
      */
-    ::std::vector<SwTxtAttr *> GetTxtAttrsAt(xub_StrLen const nIndex,
-                            RES_TXTATR const nWhich,
-                            enum GetTxtAttrMode const eMode = DEFAULT) const;
+    ::std::vector<SwTxtAttr *> GetTxtAttrsAt(
+        xub_StrLen const nIndex,
+        RES_TXTATR const nWhich,
+        enum GetTxtAttrMode const eMode = DEFAULT ) const;
 
     /** get the text attribute at position nIndex which owns
         the dummy character CH_TXTATR_* at that position, if one exists.
@@ -409,8 +397,13 @@ public:
                         attribute with given which id
         @return the text attribute at nIndex of type nWhich, if it exists
     */
-    SwTxtAttr *GetTxtAttrForCharAt( const xub_StrLen nIndex,
-                       const RES_TXTATR nWhich = RES_TXTATR_END ) const;
+    SwTxtAttr *GetTxtAttrForCharAt(
+        const xub_StrLen nIndex,
+        const RES_TXTATR nWhich = RES_TXTATR_END ) const;
+
+    SwTxtFld* GetFldTxtAttrAt(
+        const xub_StrLen nIndex,
+        const bool bIncludeInputFldAtStart = false ) const;
 
 	// Aktuelles Wort zurueckliefern
     XubString GetCurWord(xub_StrLen) const;
@@ -427,8 +420,6 @@ public:
 	// (Methode steht im ndcopy.cxx!!)
 	void CopyCollFmt( SwTxtNode& rDestNd );
 
-    //const SwNodeNum* _GetNodeNum() const { return pNdNum; }
-
     //
     // BEGIN OF BULLET/NUMBERING/OUTLINE STUFF:
     //
@@ -461,20 +452,6 @@ public:
 
     void UpdateOutlineState();
 
-    /** -> #i23730#
-
-        Returns if this text node may be numbered.
-
-        A text node may be numbered if
-          - it has no SwNodeNum
-          - it has a SwNodeNum and it has a numbering rule and the according
-            SwNumFmt defines a numbering type that is an enumeration.
-
-       @retval sal_True      this text node may be numbered
-       @retval sal_False     else
-     */
-    //sal_Bool MayBeNumbered() const;
-
     /**
        Notify this textnode that its numbering rule has changed.
      */
@@ -482,7 +459,6 @@ public:
 
     /** Returns outline of numbering string
 
-        OD 2005-11-17 #128041#
         Introduce parameter <_bInclPrefixAndSuffixStrings> in order to control,
         if the prefix and the suffix strings have to been included or not.
 
@@ -518,9 +494,7 @@ public:
      */
     sal_Bool GetFirstLineOfsWithNum( short& rFirstOffset ) const;
 
-    // --> OD 2010-01-05 #b6884103#
     SwTwips GetAdditionalIndentForStartingNewList() const;
-    // <--
 
     // --> OD 2008-12-02 #i96772#
     void ClearLRSpaceItemDueToListLevelIndents( SvxLRSpaceItem& o_rLRSpaceItem ) const;
@@ -667,15 +641,12 @@ public:
      */
     bool HasVisibleNumberingOrBullet() const;
 
-    // --> OD 2008-02-19 #refactorlists#
     void SetListId( const String sListId );
     String GetListId() const;
-    // <--
 
     /** Determines, if the list level indent attributes can be applied to the
         paragraph.
 
-        OD 2008-01-17 #newlistlevelattrs#
         The list level indents can be applied to the paragraph under the one
         of following conditions:
         - the list style is directly applied to the paragraph and the paragraph
@@ -694,8 +665,6 @@ public:
     /** Retrieves the list tab stop position, if the paragraph's list level defines
         one and this list tab stop has to merged into the tap stops of the paragraph
 
-        OD 2008-01-17 #newlistlevelattrs#
-
         @author OD
 
         @param nListTabStopPosition
@@ -708,8 +677,6 @@ public:
     /** Retrieves the character following the list label, if the paragraph's
         list level defines one.
 
-        OD 2008-01-17 #newlistlevelattrs#
-
         @author OD
 
         @return XubString - the list tab stop position
@@ -805,8 +772,11 @@ public:
 	TYPEINFO();	// fuer rtti
 
     // override SwIndexReg
-    virtual void Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
-                 const bool bNegative = false, const bool bDelete = false );
+    virtual void Update(
+        SwIndex const & rPos,
+        const xub_StrLen nChangeLen,
+        const bool bNegative = false,
+        const bool bDelete = false );
 
 	// change text to Upper/Lower/Hiragana/Katagana/...
 	void TransliterateText( utl::TransliterationWrapper& rTrans,
@@ -836,13 +806,9 @@ public:
     void SetCountedInList( bool bCounted );
     bool IsCountedInList() const;
 
-    // --> OD 2008-03-13 #refactorlists#
-//    void SyncNumberAndNumRule();
-//    void UnregisterNumber();
     void AddToList();
     void RemoveFromList();
     bool IsInList() const;
-    // <--
 
     bool IsFirstOfNumRule() const;
 

Modified: openoffice/branches/capstone2013/main/sw/inc/node.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/sw/inc/node.hxx?rev=1543679&r1=1543678&r2=1543679&view=diff
==============================================================================
--- openoffice/branches/capstone2013/main/sw/inc/node.hxx (original)
+++ openoffice/branches/capstone2013/main/sw/inc/node.hxx Wed Nov 20 00:49:46 2013
@@ -442,7 +442,12 @@ public:
 	 * 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;

Modified: openoffice/branches/capstone2013/main/sw/inc/tblsel.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/sw/inc/tblsel.hxx?rev=1543679&r1=1543678&r2=1543679&view=diff
==============================================================================
--- openoffice/branches/capstone2013/main/sw/inc/tblsel.hxx (original)
+++ openoffice/branches/capstone2013/main/sw/inc/tblsel.hxx Wed Nov 20 00:49:46 2013
@@ -177,7 +177,11 @@ public:
 
 	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 );

Modified: openoffice/branches/capstone2013/main/sw/inc/txatbase.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/sw/inc/txatbase.hxx?rev=1543679&r1=1543678&r2=1543679&view=diff
==============================================================================
--- openoffice/branches/capstone2013/main/sw/inc/txatbase.hxx (original)
+++ openoffice/branches/capstone2013/main/sw/inc/txatbase.hxx Wed Nov 20 00:49:46 2013
@@ -60,6 +60,7 @@ private:
     bool m_bDontExpandStart     : 1;    // don't expand start at paragraph start (ruby)
     bool m_bNesting             : 1;    // SwTxtAttrNesting
     bool m_bHasDummyChar        : 1;    // without end + meta
+    bool m_bHasContent          : 1;    // text attribute with content
 
 protected:
     SwTxtAttr( SfxPoolItem& rAttr, xub_StrLen nStart );
@@ -72,6 +73,7 @@ protected:
     void SetDontExpandStartAttr(bool bFlag) { m_bDontExpandStart = bFlag; }
     void SetNesting(const bool bFlag)       { m_bNesting = bFlag; }
     void SetHasDummyChar(const bool bFlag)  { m_bHasDummyChar = bFlag; }
+    void SetHasContent( const bool bFlag )  { m_bHasContent = bFlag; }
 
 public:
 
@@ -83,10 +85,10 @@ public:
             const xub_StrLen* GetStart() const  { return & m_nStart; }
 
     /// end position
-	virtual 	 xub_StrLen* GetEnd();
-	inline const xub_StrLen* GetEnd() const;
-    /// end (if available), else start
-	inline const xub_StrLen* GetAnyEnd() const;
+            virtual xub_StrLen* GetEnd(); // also used to change the end position
+            inline const xub_StrLen* End() const;
+            /// end (if available), else start
+            inline const xub_StrLen* GetAnyEnd() const;
 
     inline void SetDontExpand( bool bDontExpand );
     bool DontExpand() const                 { return m_bDontExpand; }
@@ -99,6 +101,7 @@ public:
     bool IsDontExpandStartAttr() const      { return m_bDontExpandStart; }
     bool IsNesting() const                  { return m_bNesting; }
     bool HasDummyChar() const               { return m_bHasDummyChar; }
+    bool HasContent() const                 { return m_bHasContent; }
 
 	inline const SfxPoolItem& GetAttr() const;
     inline       SfxPoolItem& GetAttr();
@@ -127,21 +130,20 @@ protected:
 public:
     SwTxtAttrEnd( SfxPoolItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd );
 
-    using SwTxtAttr::GetEnd;
     virtual xub_StrLen* GetEnd();
 };
 
 
 // --------------- Inline Implementierungen ------------------------
 
-inline const xub_StrLen* SwTxtAttr::GetEnd() const
+inline const xub_StrLen* SwTxtAttr::End() const
 {
     return const_cast<SwTxtAttr * >(this)->GetEnd();
 }
 
 inline const xub_StrLen* SwTxtAttr::GetAnyEnd() const
 {
-	const xub_StrLen* pEnd = GetEnd();
+	const xub_StrLen* pEnd = End();
     return pEnd ? pEnd : GetStart();
 }
 
@@ -183,8 +185,10 @@ inline const SwFmtAutoFmt& SwTxtAttr::Ge
 
 inline const SwFmtFld& SwTxtAttr::GetFmtFld() const
 {
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_TXTATR_FIELD,
-        "Wrong attribute" );
+    ASSERT( m_pAttr
+            && ( m_pAttr->Which() == RES_TXTATR_FIELD
+                 || m_pAttr->Which() == RES_TXTATR_INPUTFIELD ),
+            "Wrong attribute" );
     return (const SwFmtFld&)(*m_pAttr);
 }
 

Modified: openoffice/branches/capstone2013/main/sw/inc/txtfld.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/sw/inc/txtfld.hxx?rev=1543679&r1=1543678&r2=1543679&view=diff
==============================================================================
--- openoffice/branches/capstone2013/main/sw/inc/txtfld.hxx (original)
+++ openoffice/branches/capstone2013/main/sw/inc/txtfld.hxx Wed Nov 20 00:49:46 2013
@@ -33,44 +33,69 @@ class SwTxtNode;
 
 class SwTxtFld : public SwTxtAttr
 {
-    mutable   String m_aExpand;
+    mutable String m_aExpand; // only used to determine, if field content is changing in <ExpandTxtFld()>
     SwTxtNode * m_pTxtNode;
 
 public:
-    SwTxtFld(SwFmtFld & rAttr, xub_StrLen const nStart);
+    SwTxtFld(
+        SwFmtFld & rAttr,
+        xub_StrLen const nStart );
+
     virtual ~SwTxtFld();
 
-	void CopyFld( SwTxtFld *pDest ) const;
-    void Expand() const;
-	inline void ExpandAlways();
+    void CopyTxtFld( SwTxtFld *pDest ) const;
+
+    void ExpandTxtFld() const;
+    inline void ExpandAlways()
+    {
+        m_aExpand += ' '; // changing current value to assure that <ExpandTxtFld()> changes the value.
+        ExpandTxtFld();
+    }
 
     // get and set TxtNode pointer
-    SwTxtNode* GetpTxtNode() const { return m_pTxtNode; }
-    inline SwTxtNode& GetTxtNode() const;
-    void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; }
+    inline SwTxtNode* GetpTxtNode() const
+    {
+        return m_pTxtNode;
+    }
+    inline SwTxtNode& GetTxtNode() const
+    {
+        ASSERT( m_pTxtNode, "SwTxtFld:: where is my TxtNode?" );
+        return *m_pTxtNode;
+    }
+    inline void ChgTxtNode( SwTxtNode* pNew )
+    {
+        m_pTxtNode = pNew;
+    }
+
+    bool IsFldInDoc() const;
+
     // enable notification that field content has changed and needs reformatting
-    void NotifyContentChange(SwFmtFld& rFmtFld);
+    virtual void NotifyContentChange( SwFmtFld& rFmtFld );
 
-    // #111840#
-    /**
-       Returns position of this field.
-
-       @return position of this field. Has to be deleted explicitly.
-    */
-//    SwPosition * GetPosition() const;
 };
 
-inline SwTxtNode& SwTxtFld::GetTxtNode() const
+class SwTxtInputFld : public SwTxtFld
 {
-    ASSERT( m_pTxtNode, "SwTxtFld:: where is my TxtNode?" );
-    return *m_pTxtNode;
-}
+public:
+    SwTxtInputFld(
+        SwFmtFld & rAttr,
+        xub_StrLen const nStart,
+        xub_StrLen const nEnd );
 
-inline void SwTxtFld::ExpandAlways()
-{
-    m_aExpand += ' ';
-    Expand();
-}
+    virtual ~SwTxtInputFld();
+
+    virtual xub_StrLen* GetEnd();
+
+    virtual void NotifyContentChange( SwFmtFld& rFmtFld );
+
+    void UpdateTextNodeContent( const String& rNewContent );
+
+    const String GetFieldContent() const;
+    void UpdateFieldContent();
+
+private:
+    xub_StrLen m_nEnd;
+};
 
 #endif
 

Modified: openoffice/branches/capstone2013/main/sw/inc/txtrfmrk.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/sw/inc/txtrfmrk.hxx?rev=1543679&r1=1543678&r2=1543679&view=diff
==============================================================================
--- openoffice/branches/capstone2013/main/sw/inc/txtrfmrk.hxx (original)
+++ openoffice/branches/capstone2013/main/sw/inc/txtrfmrk.hxx Wed Nov 20 00:49:46 2013
@@ -40,7 +40,6 @@ public:
             xub_StrLen const nStart, xub_StrLen const*const pEnd = 0);
 
     virtual xub_StrLen * GetEnd();       // SwTxtAttr
-    inline const xub_StrLen * GetEnd() const { return m_pEnd; }
 
     // get and set TxtNode pointer
     inline const SwTxtNode& GetTxtNode() const;

Modified: openoffice/branches/capstone2013/main/sw/inc/txttxmrk.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/sw/inc/txttxmrk.hxx?rev=1543679&r1=1543678&r2=1543679&view=diff
==============================================================================
--- openoffice/branches/capstone2013/main/sw/inc/txttxmrk.hxx (original)
+++ openoffice/branches/capstone2013/main/sw/inc/txttxmrk.hxx Wed Nov 20 00:49:46 2013
@@ -42,7 +42,6 @@ public:
     virtual ~SwTxtTOXMark();
 
     virtual xub_StrLen *GetEnd();     // SwTxtAttr
-    inline const xub_StrLen* GetEnd() const { return m_pEnd; }
 
     void CopyTOXMark( SwDoc* pDestDoc );
 

Modified: openoffice/branches/capstone2013/main/sw/inc/viewsh.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/sw/inc/viewsh.hxx?rev=1543679&r1=1543678&r2=1543679&view=diff
==============================================================================
--- openoffice/branches/capstone2013/main/sw/inc/viewsh.hxx (original)
+++ openoffice/branches/capstone2013/main/sw/inc/viewsh.hxx Wed Nov 20 00:49:46 2013
@@ -353,7 +353,9 @@ public:
     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

Modified: openoffice/branches/capstone2013/main/sw/inc/viscrs.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/sw/inc/viscrs.hxx?rev=1543679&r1=1543678&r2=1543679&view=diff
==============================================================================
--- openoffice/branches/capstone2013/main/sw/inc/viscrs.hxx (original)
+++ openoffice/branches/capstone2013/main/sw/inc/viscrs.hxx Wed Nov 20 00:49:46 2013
@@ -30,6 +30,7 @@
 
 class SwCrsrShell;
 class SwShellCrsr;
+class SwTxtInputFld;
 
 // --------  Ab hier Klassen / Methoden fuer den nicht Text-Cursor ------
 
@@ -76,6 +77,7 @@ public:
 
 // #i75172# predefines
 namespace sdr { namespace overlay { class OverlayObject; }}
+namespace sw { namespace overlay { class OverlayRangesOutline; }}
 
 class SwSelPaintRects : public SwRects
 {
@@ -89,7 +91,6 @@ class SwSelPaintRects : public SwRects
 	const SwCrsrShell* pCShell;
 
 	virtual void Paint( const Rectangle& rRect );
-	virtual void FillRects() = 0;
 
 	// #i75172#
 	sdr::overlay::OverlayObject*	mpCursorOverlay;
@@ -98,11 +99,18 @@ class SwSelPaintRects : public SwRects
 	sdr::overlay::OverlayObject* getCursorOverlay() const { return mpCursorOverlay; }
 	void setCursorOverlay(sdr::overlay::OverlayObject* pNew) { mpCursorOverlay = pNew; }
 
+    bool mbShowTxtInputFldOverlay;
+    sw::overlay::OverlayRangesOutline* mpTxtInputFldOverlay;
+
+    void HighlightInputFld();
+
 public:
 	SwSelPaintRects( const SwCrsrShell& rCSh );
 	virtual ~SwSelPaintRects();
 
-	// #i75172# in SwCrsrShell::CreateCrsr() the content of SwSelPaintRects is exchanged. To
+	virtual void FillRects() = 0;
+
+    // #i75172# in SwCrsrShell::CreateCrsr() the content of SwSelPaintRects is exchanged. To
 	// make a complete swap access to mpCursorOverlay is needed there
 	void swapContent(SwSelPaintRects& rSwap);
 
@@ -110,6 +118,11 @@ public:
 	void Hide();
 	void Invalidate( const SwRect& rRect );
 
+    inline void SetShowTxtInputFldOverlay( const bool bShow )
+    {
+        mbShowTxtInputFldOverlay = bShow;
+    }
+
 	const SwCrsrShell* GetShell() const { return pCShell; }
 	// check current MapMode of the shell and set possibly the static members.
 	// Optional set the parameters pX, pY
@@ -124,8 +137,6 @@ class SwShellCrsr : public virtual SwCur
 	Point aMkPt, aPtPt;
 	const SwPosition* pPt;		// fuer Zuordung vom GetPoint() zum aPtPt
 
-	virtual void FillRects();	// fuer Table- und normalen Crsr
-
     using SwCursor::UpDown;
 
 public:
@@ -135,6 +146,8 @@ public:
 	SwShellCrsr( SwShellCrsr& );
 	virtual ~SwShellCrsr();
 
+	virtual void FillRects();	// fuer Table- und normalen Crsr
+
 	void Show();			// Update und zeige alle Selektionen an
 	void Hide();	  		// verstecke alle Selektionen
 	void Invalidate( const SwRect& rRect );
@@ -182,7 +195,6 @@ class SwShellTableCrsr : public virtual 
 	// TabellenBoxen. D.h., wird aus dem einen Array an einer Position
 	// etwas geloescht, dann muss es auch im anderen erfolgen!!
 
-
 public:
 	SwShellTableCrsr( const SwCrsrShell& rCrsrSh, const SwPosition& rPos );
 	SwShellTableCrsr( const SwCrsrShell& rCrsrSh,

Modified: openoffice/branches/capstone2013/main/sw/sdi/_textsh.sdi
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/sw/sdi/_textsh.sdi?rev=1543679&r1=1543678&r2=1543679&view=diff
==============================================================================
--- openoffice/branches/capstone2013/main/sw/sdi/_textsh.sdi (original)
+++ openoffice/branches/capstone2013/main/sw/sdi/_textsh.sdi Wed Nov 20 00:49:46 2013
@@ -36,6 +36,7 @@ interface BaseText
 	FN_INSERT_GLOSSARY // status(final|play|record)
 	[
 		ExecMethod = ExecGlossary ;
+        StateMethod = GetState ;
 	]
 
     FN_TXTATR_INET // status()
@@ -138,7 +139,7 @@ interface BaseText
 	SID_INSERTDOC // status(final|play|rec)
 	[
 		ExecMethod = Execute ;
-		StateMethod = NoState ;
+		StateMethod = GetState ;
 		DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
 	]
 	FN_INSERT_BOOKMARK // status(final|play)
@@ -242,13 +243,13 @@ interface BaseText
     FN_INSERT_BREAK // status(final|play)
 	[
 		ExecMethod = ExecInsert ;
-		StateMethod = NoState ;
+		StateMethod = GetState ;
 		DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
 	]
 	FN_INSERT_PAGEBREAK // status(final|play)
 	[
 		ExecMethod = ExecInsert ;
-		StateMethod = NoState ;
+		StateMethod = GetState ;
 		DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
 	]
 	FN_INSERT_LINEBREAK  // status(final|play)
@@ -260,19 +261,19 @@ interface BaseText
 	FN_INSERT_COLUMN_BREAK // status(final|play)
 	[
 		ExecMethod = ExecInsert ;
-		StateMethod = NoState ;
+		StateMethod = GetState ;
 		DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
 	]
 	FN_INSERT_BREAK_DLG // status(final|play)
 	[
 		ExecMethod = Execute ;
-		StateMethod = NoState ;
+		StateMethod = GetState ;
 		DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
 	]
 	SID_INSERT_AVMEDIA // status(final|play)
 	[
 		ExecMethod = ExecInsert;
-		StateMethod = NoState ;
+		StateMethod = StateInsert ;
 		DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
 	]
 	FN_INSERT_HRULER // status()
@@ -340,6 +341,7 @@ interface BaseText
 	FN_INSERT_HYPERLINK // status()
 	[
 		ExecMethod = Execute ;
+		StateMethod = GetState;
 		DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
 	]
 	SID_HYPERLINK_DIALOG
@@ -931,6 +933,7 @@ interface BaseText
 	FN_EXPAND_GLOSSARY // status(final|play)
 	[
 		ExecMethod = ExecGlossary ;
+		StateMethod = GetState ;
 		DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
 	]
 	FN_POSTIT // status(final|play)

Modified: openoffice/branches/capstone2013/main/sw/sdi/_viewsh.sdi
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/sw/sdi/_viewsh.sdi?rev=1543679&r1=1543678&r2=1543679&view=diff
==============================================================================
--- openoffice/branches/capstone2013/main/sw/sdi/_viewsh.sdi (original)
+++ openoffice/branches/capstone2013/main/sw/sdi/_viewsh.sdi Wed Nov 20 00:49:46 2013
@@ -641,12 +641,12 @@ interface BaseTextEditView
         ExecMethod = Execute ;
         StateMethod = GetState ;
     ]
-        SID_INSERT_GRAPHIC // status(final|play)
-        [
-                ExecMethod = Execute ;
-                StateMethod = NoState ;
-                DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
-        ]
+    SID_INSERT_GRAPHIC // status(final|play)
+    [
+        ExecMethod = Execute ;
+        StateMethod = GetState ;
+        DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+    ]
     SID_AUTOSPELL_CHECK
     [
         ExecMethod = ExecViewOptions ;

Modified: openoffice/branches/capstone2013/main/sw/source/core/access/acccell.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/sw/source/core/access/acccell.cxx?rev=1543679&r1=1543678&r2=1543679&view=diff
==============================================================================
--- openoffice/branches/capstone2013/main/sw/source/core/access/acccell.cxx (original)
+++ openoffice/branches/capstone2013/main/sw/source/core/access/acccell.cxx Wed Nov 20 00:49:46 2013
@@ -50,6 +50,14 @@
 
 #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;
@@ -90,6 +98,10 @@ void SwAccessibleCell::GetStates( ::utl:
     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() )
@@ -104,6 +116,7 @@ void SwAccessibleCell::GetStates( ::utl:
 SwAccessibleCell::SwAccessibleCell( SwAccessibleMap *pInitMap,
                                     const SwCellFrm *pCellFrm )
     : SwAccessibleContext( pInitMap, AccessibleRole::TABLE_CELL, pCellFrm )
+    , aSelectionHelper( *this )
     , bIsSelected( sal_False )
 {
 	vos::OGuard aGuard(Application::GetSolarMutex());
@@ -111,6 +124,13 @@ SwAccessibleCell::SwAccessibleCell( SwAc
     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()
@@ -131,9 +151,16 @@ sal_Bool SwAccessibleCell::_InvalidateMy
 	}
 
 	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;
 }
 
@@ -157,8 +184,10 @@ sal_Bool SwAccessibleCell::_InvalidateCh
 				{
 					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
@@ -179,6 +208,22 @@ sal_Bool SwAccessibleCell::_InvalidateCh
 
 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" );
@@ -188,6 +233,8 @@ void SwAccessibleCell::_InvalidateCursor
 
 	while( pTabFrm )
 	{
+                _InvalidateChildrenCursorPos( pTabFrm );
+/*
 		sal_Bool bChanged = _InvalidateChildrenCursorPos( pTabFrm );
 		if( bChanged )
 		{
@@ -200,9 +247,14 @@ void SwAccessibleCell::_InvalidateCursor
 				xAccImpl->FireAccessibleEvent( aEvent );
 			}
 		}
-
+*/
 		pTabFrm = pTabFrm->GetFollow();
 	}
+	if (m_pAccTable)
+	{
+		m_pAccTable->FireSelectionEvent();
+	}		
+	//-----IAccessibility2 Implementation 2009
 }
 
 sal_Bool SwAccessibleCell::HasCursor()
@@ -273,6 +325,21 @@ void SwAccessibleCell::InvalidatePosOrSi
 uno::Any SwAccessibleCell::queryInterface( const uno::Type& rType )
     throw( uno::RuntimeException )
 {
+	//IAccessibility2 Implementation 2009-----
+	if (rType == ::getCppuType((const uno::Reference<XAccessibleExtendedAttributes>*)0))
+	{
+		uno::Any aR; 
+		aR <<= uno::Reference<XAccessibleExtendedAttributes>(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;
@@ -326,7 +393,8 @@ SwFrmFmt* SwAccessibleCell::GetTblBoxFor
     return pCellFrm->GetTabBox()->GetFrmFmt();
 }
 
-
+//IAccessibility2 Implementation 2009-----
+//Implement TableCell currentValue
 uno::Any SwAccessibleCell::getCurrentValue( )
     throw( uno::RuntimeException )
 {
@@ -334,9 +402,33 @@ uno::Any SwAccessibleCell::getCurrentVal
 	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 )
@@ -369,3 +461,133 @@ uno::Any SwAccessibleCell::getMinimumVal
     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::getExtendedAttributes() 
+		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

Modified: openoffice/branches/capstone2013/main/sw/source/core/access/acccell.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/sw/source/core/access/acccell.hxx?rev=1543679&r1=1543678&r2=1543679&view=diff
==============================================================================
--- openoffice/branches/capstone2013/main/sw/source/core/access/acccell.hxx (original)
+++ openoffice/branches/capstone2013/main/sw/source/core/access/acccell.hxx Wed Nov 20 00:49:46 2013
@@ -26,13 +26,27 @@
 #include "acccontext.hxx"
 #include <com/sun/star/accessibility/XAccessibleValue.hpp>
 
+//IAccessibility2 Implementation 2009-----
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XAccessibleExtendedAttributes_HPP_
+#include <com/sun/star/accessibility/XAccessibleExtendedAttributes.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::XAccessibleExtendedAttributes
 {
+    // Implementation for XAccessibleSelection interface
+    SwAccessibleSelectionHelper aSelectionHelper;
 	sal_Bool	bIsSelected;	// protected by base class mutex
 
 	sal_Bool	IsSelected();
@@ -110,6 +124,11 @@ public:
 
 	//=====  XAccessibleValue  ================================================
 
+	//=====  XAccessibleExtendedAttributes ================================================	
+	//IAccessibility2 Implementation 2009-----
+	::com::sun::star::uno::Any SAL_CALL getExtendedAttributes() 
+		throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ;
+	//-----IAccessibility2 Implementation 2009
 private:
     SwFrmFmt* GetTblBoxFormat() const;
 
@@ -126,6 +145,41 @@ public:
 
     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
 };
 
 

Modified: openoffice/branches/capstone2013/main/sw/source/core/access/acccontext.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/sw/source/core/access/acccontext.cxx?rev=1543679&r1=1543678&r2=1543679&view=diff
==============================================================================
--- openoffice/branches/capstone2013/main/sw/source/core/access/acccontext.cxx (original)
+++ openoffice/branches/capstone2013/main/sw/source/core/access/acccontext.cxx Wed Nov 20 00:49:46 2013
@@ -60,6 +60,11 @@
 #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;
@@ -225,8 +230,11 @@ void SwAccessibleContext::ChildrenScroll
                             "<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 )
@@ -257,10 +265,15 @@ void SwAccessibleContext::ChildrenScroll
                     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 )
@@ -280,8 +293,11 @@ void SwAccessibleContext::ChildrenScroll
 								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:
@@ -390,8 +406,11 @@ void SwAccessibleContext::ScrolledOut( c
 	// 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>
@@ -527,8 +546,14 @@ void SwAccessibleContext::GetStates(
 
 	// 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 );
 
@@ -564,6 +589,12 @@ SwAccessibleContext::SwAccessibleContext
     , 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" )
@@ -591,6 +622,11 @@ sal_Int32 SAL_CALL SwAccessibleContext::
 	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()) );
 }
@@ -603,6 +639,12 @@ uno::Reference< XAccessible> SAL_CALL
 
 	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() )
 	{
@@ -618,6 +660,26 @@ uno::Reference< XAccessible> SAL_CALL
 	{
 		::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 );
@@ -727,6 +789,11 @@ uno::Reference<XAccessibleStateSet> SAL_
 	::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 );
 
@@ -998,13 +1065,15 @@ uno::Any SAL_CALL SwAccessibleContext::g
 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;
 }
 
 
@@ -1051,6 +1120,12 @@ void SwAccessibleContext::DisposeShape( 
 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 );
@@ -1194,7 +1269,10 @@ void SwAccessibleContext::InvalidatePosO
         SwAccessibleChild( GetParent() ).IsVisibleChildrenOnly() )
 	{
 		// The frame is now invisible -> dispose it
-		Dispose( sal_True );
+		//IAccessibility2 Implementation 2009-----
+		//Remove
+		//Dispose( sal_True );
+		//-----IAccessibility2 Implementation 2009
 	}
 	else
 	{
@@ -1598,3 +1676,15 @@ void lcl_SwAccessibleContext_DbgMsg( SwA
 	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

Modified: openoffice/branches/capstone2013/main/sw/source/core/access/acccontext.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/sw/source/core/access/acccontext.hxx?rev=1543679&r1=1543678&r2=1543679&view=diff
==============================================================================
--- openoffice/branches/capstone2013/main/sw/source/core/access/acccontext.hxx (original)
+++ openoffice/branches/capstone2013/main/sw/source/core/access/acccontext.hxx Wed Nov 20 00:49:46 2013
@@ -98,6 +98,10 @@ private:
     // <--
 
 	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; }
@@ -105,7 +109,12 @@ protected:
     {
         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;
 
@@ -172,6 +181,9 @@ protected:
 
 public:
 
+	//IAccessibility2 Implementation 2009-----
+	void SetMap(SwAccessibleMap *pM){pMap = pM;}
+	//-----IAccessibility2 Implementation 2009
 	void FireAccessibleEvent( ::com::sun::star::accessibility::AccessibleEventObject& rEvent );
 
 protected:
@@ -415,12 +427,15 @@ public:
     {
         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

Modified: openoffice/branches/capstone2013/main/sw/source/core/access/accdoc.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/sw/source/core/access/accdoc.cxx?rev=1543679&r1=1543678&r2=1543679&view=diff
==============================================================================
--- openoffice/branches/capstone2013/main/sw/source/core/access/accdoc.cxx (original)
+++ openoffice/branches/capstone2013/main/sw/source/core/access/accdoc.cxx Wed Nov 20 00:49:46 2013
@@ -45,6 +45,31 @@
 #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>
+
+#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";
 
@@ -178,8 +203,17 @@ sal_Int32 SAL_CALL SwAccessibleDocumentB
 
 	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;
 }
@@ -190,20 +224,62 @@ OUString SAL_CALL SwAccessibleDocumentBa
 	return GetResource( STR_ACCESS_DOC_DESC );
 }
 
-awt::Rectangle SAL_CALL SwAccessibleDocumentBase::getBounds()
-		throw (uno::RuntimeException)
-{
-	vos::OGuard aGuard(Application::GetSolarMutex());
-
-	Window *pWin = GetWindow();
+//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 );
+		}
 
-	CHECK_FOR_WINDOW( XAccessibleComponent, pWin )
+		if ( sFileName.getLength() )
+		{
+			sAccName = sFileName + sReadOnly + OUString(RTL_CONSTASCII_USTRINGPARAM(" - ")) + sAccName;			
+		}
+	}
 
-	Rectangle aPixBounds( pWin->GetWindowExtentsRelative( pWin->GetAccessibleParentWindow() ) );
-	awt::Rectangle aBox( aPixBounds.Left(), aPixBounds.Top(),
-						 aPixBounds.GetWidth(), aPixBounds.GetHeight() );
+	return sAccName;
+}
+//-----IAccessibility2 Implementation 2009
 
-	return aBox;
+awt::Rectangle SAL_CALL SwAccessibleDocumentBase::getBounds()
+		throw (uno::RuntimeException)
+{
+	//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
 }
 
 
@@ -303,6 +379,9 @@ void SwAccessibleDocument::GetStates(
 
 	// MULTISELECTABLE
 	rStateSet.AddState( AccessibleStateType::MULTI_SELECTABLE );
+	//IAccessibility2 Implementation 2009-----
+	rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
+	//-----IAccessibility2 Implementation 2009
 }
 
 
@@ -423,6 +502,24 @@ uno::Any SwAccessibleDocument::queryInte
         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<XAccessibleExtendedAttributes> *)NULL) )
+    {
+        uno::Reference<XAccessibleExtendedAttributes> 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;
@@ -435,11 +532,16 @@ uno::Sequence< uno::Type > SAL_CALL SwAc
 	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;
 }
 
@@ -509,3 +611,415 @@ void SwAccessibleDocument::deselectAcces
 {
     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::getExtendedAttributes() 
+		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)
+{
+	//IAccessibility2 Implementation 2009-----
+	vos::OGuard aGuard(Application::GetSolarMutex());
+	return SW_MOD()->GetColorConfig().GetColorValue( ::svtools::DOCCOLOR ).nColor;
+	//-----IAccessibility2 Implementation 2009
+}
+
+::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->getLayoutFrm( pCrsrShell->GetLayout() ) : 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

Modified: openoffice/branches/capstone2013/main/sw/source/core/access/accdoc.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/sw/source/core/access/accdoc.hxx?rev=1543679&r1=1543678&r2=1543679&view=diff
==============================================================================
--- openoffice/branches/capstone2013/main/sw/source/core/access/accdoc.hxx (original)
+++ openoffice/branches/capstone2013/main/sw/source/core/access/accdoc.hxx Wed Nov 20 00:49:46 2013
@@ -26,8 +26,19 @@
 #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_XAccessibleExtendedAttributes_HPP_
+#include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEGETACCFLOWTO_HPP_
+#include <com/sun/star/accessibility/XAccessibleGetAccFlowTo.hpp>
+#endif
+//-----IAccessibility2 Implementation 2009
+
 class VclSimpleEvent;
 
 /**
@@ -81,6 +92,9 @@ public:
     ///	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(
@@ -111,7 +125,12 @@ public:
  * 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::XAccessibleExtendedAttributes,
+							 //-----IAccessibility2 Implementation 2009
+							 public com::sun::star::accessibility::XAccessibleGetAccFlowTo
 {
     // Implementation for XAccessibleSelection interface
     SwAccessibleSelectionHelper maSelectionHelper;
@@ -129,6 +148,13 @@ public:
     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);
+	//-----IAccessibility2 Implementation 2009
 
 	//=====  XServiceInfo  ====================================================
 
@@ -199,10 +225,23 @@ public:
         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
                 ::com::sun::star::uno::RuntimeException );
 
+	//IAccessibility2 Implementation 2009-----
+    virtual ::com::sun::star::uno::Any SAL_CALL getExtendedAttributes() 
+		throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ;
 	//====== 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

Modified: openoffice/branches/capstone2013/main/sw/source/core/access/accembedded.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/sw/source/core/access/accembedded.cxx?rev=1543679&r1=1543678&r2=1543679&view=diff
==============================================================================
--- openoffice/branches/capstone2013/main/sw/source/core/access/accembedded.cxx (original)
+++ openoffice/branches/capstone2013/main/sw/source/core/access/accembedded.cxx Wed Nov 20 00:49:46 2013
@@ -31,6 +31,14 @@
 #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;
@@ -51,6 +59,34 @@ SwAccessibleEmbeddedObject::~SwAccessibl
 {
 }
 
+//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::XAccessibleExtendedAttributes* >(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 )
 {
@@ -91,3 +127,31 @@ uno::Sequence< sal_Int8 > SAL_CALL SwAcc
     }
     return aId;
 }
+//IAccessibility2 Implementation 2009-----
+//=====  XAccessibleExtendedAttributes  ========================================================
+::com::sun::star::uno::Any SAL_CALL SwAccessibleEmbeddedObject::getExtendedAttributes() 
+		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

Modified: openoffice/branches/capstone2013/main/sw/source/core/access/accembedded.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/sw/source/core/access/accembedded.hxx?rev=1543679&r1=1543678&r2=1543679&view=diff
==============================================================================
--- openoffice/branches/capstone2013/main/sw/source/core/access/accembedded.hxx (original)
+++ openoffice/branches/capstone2013/main/sw/source/core/access/accembedded.hxx Wed Nov 20 00:49:46 2013
@@ -24,7 +24,12 @@
 #define _ACCEMBEDDED_HXX
 #include "accnotextframe.hxx"
 
-class SwAccessibleEmbeddedObject : public   SwAccessibleNoTextFrame
+//IAccessibility2 Implementation 2009-----
+#include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp>
+//-----IAccessibility2 Implementation 2009
+class SwAccessibleEmbeddedObject : public	SwAccessibleNoTextFrame
+	        , public ::com::sun::star::accessibility::XAccessibleExtendedAttributes
+			
 {
 
 protected:
@@ -36,6 +41,21 @@ public:
     SwAccessibleEmbeddedObject( SwAccessibleMap* pInitMap,
                                 const SwFlyFrm* pFlyFrm );
 
+	//IAccessibility2 Implementation 2009-----
+    //=====  XInterface  ======================================================
+    
+    virtual com::sun::star::uno::Any SAL_CALL
+        queryInterface (const com::sun::star::uno::Type & rType)
+        throw (::com::sun::star::uno::RuntimeException);
+        
+    virtual void SAL_CALL
+        acquire (void) 
+        throw ();
+        
+    virtual void SAL_CALL
+        release (void)
+        throw ();
+	//-----IAccessibility2 Implementation 2009
 	//=====  XServiceInfo  ====================================================
 
     /**	Returns an identifier for the implementation of this object.
@@ -59,6 +79,12 @@ public:
 
 	//=====  XTypeProvider  ====================================================
     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) throw(::com::sun::star::uno::RuntimeException);
+
+	//IAccessibility2 Implementation 2009-----
+	// ====== XAccessibleExtendedAttributes =====================================
+	    virtual ::com::sun::star::uno::Any SAL_CALL getExtendedAttributes() 
+			throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ;
+	//-----IAccessibility2 Implementation 2009
 };
 
 

Modified: openoffice/branches/capstone2013/main/sw/source/core/access/accfootnote.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/sw/source/core/access/accfootnote.cxx?rev=1543679&r1=1543678&r2=1543679&view=diff
==============================================================================
--- openoffice/branches/capstone2013/main/sw/source/core/access/accfootnote.cxx (original)
+++ openoffice/branches/capstone2013/main/sw/source/core/access/accfootnote.cxx Wed Nov 20 00:49:46 2013
@@ -55,7 +55,6 @@ const sal_Char sImplementationNameEndnot
 SwAccessibleFootnote::SwAccessibleFootnote(
         SwAccessibleMap* pInitMap,
 		sal_Bool bIsEndnote,
-		sal_Int32 nFootEndNote,
 		const SwFtnFrm *pFtnFrm	) :
     SwAccessibleContext( pInitMap,
 		bIsEndnote ? AccessibleRole::END_NOTE : AccessibleRole::FOOTNOTE,
@@ -65,7 +64,19 @@ SwAccessibleFootnote::SwAccessibleFootno
 
 	sal_uInt16 nResId = bIsEndnote ? STR_ACCESS_ENDNOTE_NAME
 								   : STR_ACCESS_FOOTNOTE_NAME;
-	OUString sArg( OUString::valueOf( nFootEndNote ) );
+	//IAccessibility2 Implementation 2009-----
+	//OUString sArg( OUString::valueOf( nFootEndNote ) );
+	//old codes end
+	OUString sArg;
+	const SwTxtFtn *pTxtFtn =
+		static_cast< const SwFtnFrm *>( GetFrm() )->GetAttr();
+	if( pTxtFtn )
+	{
+		const SwDoc *pDoc = GetShell()->GetDoc();
+		sArg = pTxtFtn->GetFtn().GetViewNumStr( *pDoc );
+	}
+	//-----IAccessibility2 Implementation 2009
+
 	SetName( GetResource( nResId, &sArg ) );
 }
 

Modified: openoffice/branches/capstone2013/main/sw/source/core/access/accfootnote.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/capstone2013/main/sw/source/core/access/accfootnote.hxx?rev=1543679&r1=1543678&r2=1543679&view=diff
==============================================================================
--- openoffice/branches/capstone2013/main/sw/source/core/access/accfootnote.hxx (original)
+++ openoffice/branches/capstone2013/main/sw/source/core/access/accfootnote.hxx Wed Nov 20 00:49:46 2013
@@ -41,7 +41,6 @@ public:
 
     SwAccessibleFootnote( SwAccessibleMap* pInitMap,
 						  sal_Bool bIsEndnote,
-						  sal_Int32 nFootEndNote,
 						  const SwFtnFrm *pFtnFrm );