diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-02-10 21:08:07 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-02-11 12:52:22 +0100 |
commit | 368cff78a4be5bcbfc3e0d72ed8db4ef71bc892a (patch) | |
tree | 68518c8939f3039ebe447aec21a1329b17f006c3 /accessibility | |
parent | 06d5616f65c6195b65d06f3733a4b325b74f3877 (diff) |
accessibility: add some missing locks in new code
Change-Id: Ic38a07c592a89973ca1df807505f87910e84a17f
Diffstat (limited to 'accessibility')
4 files changed, 18 insertions, 9 deletions
diff --git a/accessibility/inc/accessibility/extended/accessiblelistbox.hxx b/accessibility/inc/accessibility/extended/accessiblelistbox.hxx index 58d22a55d874..ee0ae645fd89 100644 --- a/accessibility/inc/accessibility/extended/accessiblelistbox.hxx +++ b/accessibility/inc/accessibility/extended/accessiblelistbox.hxx @@ -66,6 +66,8 @@ namespace accessibility void RemoveChildEntries(SvTreeListEntry*); + sal_Int32 GetRoleType(); + public: /** OAccessibleBase needs a valid view @param _rListBox @@ -112,8 +114,6 @@ namespace accessibility ::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); void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); - sal_Int32 SAL_CALL getRoleType(); - private: typedef std::map< SvTreeListEntry*, ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > > MAP_ENTRY; diff --git a/accessibility/inc/accessibility/extended/accessiblelistboxentry.hxx b/accessibility/inc/accessibility/extended/accessiblelistboxentry.hxx index 57c4a8bd609b..06addbdcbb00 100644 --- a/accessibility/inc/accessibility/extended/accessiblelistboxentry.hxx +++ b/accessibility/inc/accessibility/extended/accessiblelistboxentry.hxx @@ -229,8 +229,7 @@ namespace accessibility private: ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > implGetParentAccessible( ) const; SvTreeListEntry* GetRealChild(sal_Int32 nIndex); - public: - sal_Int32 SAL_CALL getRoleType(); + sal_Int32 GetRoleType(); }; //........................................................................ diff --git a/accessibility/source/extended/accessiblelistbox.cxx b/accessibility/source/extended/accessiblelistbox.cxx index eced1e545935..795e66a610b0 100644 --- a/accessibility/source/extended/accessiblelistbox.cxx +++ b/accessibility/source/extended/accessiblelistbox.cxx @@ -400,7 +400,7 @@ namespace accessibility return m_xParent; } // ----------------------------------------------------------------------------- - sal_Int32 SAL_CALL AccessibleListBox::getRoleType() + sal_Int32 AccessibleListBox::GetRoleType() { sal_Int32 nCase = 0; SvTreeListEntry* pEntry = getListBox()->GetEntry(0); @@ -428,8 +428,12 @@ namespace accessibility } return nCase; } - sal_Int16 SAL_CALL AccessibleListBox::getAccessibleRole( ) throw (RuntimeException) + + sal_Int16 SAL_CALL AccessibleListBox::getAccessibleRole() + throw (RuntimeException) { + ::comphelper::OExternalLockGuard aGuard( this ); + if(getListBox()) { short nType = getListBox()->GetAllEntriesAccessibleRoleType(); @@ -444,7 +448,7 @@ namespace accessibility if(!bHasButtons && (getListBox()->GetTreeFlags() & TREEFLAG_CHKBTN)) return AccessibleRole::LIST; else - if(getRoleType() == 0) + if (GetRoleType() == 0) return AccessibleRole::LIST; else return AccessibleRole::TREE; diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx b/accessibility/source/extended/accessiblelistboxentry.cxx index 3d2cefa53dc2..cdbf9436da0d 100644 --- a/accessibility/source/extended/accessiblelistboxentry.cxx +++ b/accessibility/source/extended/accessiblelistboxentry.cxx @@ -390,7 +390,7 @@ namespace accessibility return m_aEntryPath.empty() ? -1 : m_aEntryPath.back(); } // ----------------------------------------------------------------------------- - sal_Int32 SAL_CALL AccessibleListBoxEntry::getRoleType() + sal_Int32 AccessibleListBoxEntry::GetRoleType() { sal_Int32 nCase = 0; SvTreeListEntry* pEntry = getListBox()->GetEntry(0); @@ -421,6 +421,9 @@ namespace accessibility // ----------------------------------------------------------------------------- sal_Int16 SAL_CALL AccessibleListBoxEntry::getAccessibleRole( ) throw (RuntimeException) { + SolarMutexGuard aSolarGuard; + ::osl::MutexGuard aGuard( m_aMutex ); + SvTreeListBox* pBox = getListBox(); if(pBox) { @@ -445,7 +448,7 @@ namespace accessibility return AccessibleRole::LABEL; } } - if(getRoleType() == 0) + if (GetRoleType() == 0) return AccessibleRole::LIST_ITEM; else //o is: return AccessibleRole::LABEL; @@ -456,6 +459,9 @@ namespace accessibility // ----------------------------------------------------------------------------- OUString SAL_CALL AccessibleListBoxEntry::getAccessibleDescription( ) throw (RuntimeException) { + SolarMutexGuard aSolarGuard; + ::osl::MutexGuard aGuard( m_aMutex ); + SvTreeListEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath ); if( getAccessibleRole() == AccessibleRole::TREE_ITEM ) { |