summaryrefslogtreecommitdiff
path: root/accessibility
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-08-26 20:25:36 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-08-27 09:41:17 +0200
commit94273b45b57319e770e8c355392e75390e12811d (patch)
treef89906d0a11170272f51e443faaf61e016b2e3dc /accessibility
parent4c45ce3493e9ee842fff42228913cc11b173ca93 (diff)
cid#1608497 Double lock
Change-Id: Idacac84614411efe7516de9aa7740d7d47863ad7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172438 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'accessibility')
-rw-r--r--accessibility/inc/standard/vclxaccessiblelistitem.hxx2
-rw-r--r--accessibility/source/standard/vclxaccessiblelistitem.cxx9
2 files changed, 9 insertions, 2 deletions
diff --git a/accessibility/inc/standard/vclxaccessiblelistitem.hxx b/accessibility/inc/standard/vclxaccessiblelistitem.hxx
index 83142b50ed6f..64fd27d4d97c 100644
--- a/accessibility/inc/standard/vclxaccessiblelistitem.hxx
+++ b/accessibility/inc/standard/vclxaccessiblelistitem.hxx
@@ -75,6 +75,8 @@ private:
virtual css::lang::Locale implGetLocale() override;
virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override;
+ OUString getTextRangeImpl(std::unique_lock<std::mutex>& rGuard, sal_Int32 nStartIndex, sal_Int32 nEndIndex);
+
public:
/** OAccessibleBase needs a valid view
@param _nIndexInParent
diff --git a/accessibility/source/standard/vclxaccessiblelistitem.cxx b/accessibility/source/standard/vclxaccessiblelistitem.cxx
index af616805a50e..90f4c8bbebce 100644
--- a/accessibility/source/standard/vclxaccessiblelistitem.cxx
+++ b/accessibility/source/standard/vclxaccessiblelistitem.cxx
@@ -480,12 +480,17 @@ OUString SAL_CALL VCLXAccessibleListItem::getText()
return m_sEntryText;
}
+OUString VCLXAccessibleListItem::getTextRangeImpl(std::unique_lock<std::mutex>& /*rGuard*/, sal_Int32 nStartIndex, sal_Int32 nEndIndex)
+{
+ return OCommonAccessibleText::implGetTextRange(m_sEntryText, nStartIndex, nEndIndex);
+}
+
OUString SAL_CALL VCLXAccessibleListItem::getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
{
SolarMutexGuard aSolarGuard;
std::unique_lock aGuard( m_aMutex );
- return OCommonAccessibleText::implGetTextRange( m_sEntryText, nStartIndex, nEndIndex );
+ return getTextRangeImpl(aGuard, nStartIndex, nEndIndex);
}
css::accessibility::TextSegment SAL_CALL VCLXAccessibleListItem::getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType )
@@ -527,7 +532,7 @@ sal_Bool SAL_CALL VCLXAccessibleListItem::copyText( sal_Int32 nStartIndex, sal_I
Reference< datatransfer::clipboard::XClipboard > xClipboard = pListBoxHelper->GetClipboard();
if ( xClipboard.is() )
{
- OUString sText( getTextRange( nStartIndex, nEndIndex ) );
+ OUString sText(getTextRangeImpl(aGuard, nStartIndex, nEndIndex));
rtl::Reference<vcl::unohelper::TextDataObject> pDataObj = new vcl::unohelper::TextDataObject( sText );
SolarMutexReleaser aReleaser;