i18npool/source/search/textsearch.cxx | 8 ++++++++ i18npool/source/search/textsearch.hxx | 1 + 2 files changed, 9 insertions(+)
New commits: commit 07a2d583ae5d7b6f983c4401eef92a052b15af02 Author: Caolán McNamara <[email protected]> Date: Wed Dec 13 11:52:39 2017 +0000 crash in sc, make TextSearch thread safe with tdf95460-1.odt Change-Id: Ic4e643b8e6ae6235fb79ed458f891afd4a4b73fc Reviewed-on: https://gerrit.libreoffice.org/46380 Reviewed-by: Eike Rathke <[email protected]> Tested-by: Jenkins <[email protected]> diff --git a/i18npool/source/search/textsearch.cxx b/i18npool/source/search/textsearch.cxx index 67eded1643ab..6f51d3b2cbf0 100644 --- a/i18npool/source/search/textsearch.cxx +++ b/i18npool/source/search/textsearch.cxx @@ -133,6 +133,8 @@ TextSearch::~TextSearch() void TextSearch::setOptions2( const SearchOptions2& rOptions ) { + osl::MutexGuard g(m_aMutex); + aSrchPara = rOptions; delete pRegexMatcher; @@ -263,6 +265,8 @@ void TextSearch::setOptions2( const SearchOptions2& rOptions ) void TextSearch::setOptions( const SearchOptions& rOptions ) { + osl::MutexGuard g(m_aMutex); + sal_Int16 nAlgorithmType2; switch (rOptions.algorithmType) { @@ -313,6 +317,8 @@ bool TextSearch::isCellStart(const OUString& searchStr, sal_Int32 nPos) SearchResult TextSearch::searchForward( const OUString& searchStr, sal_Int32 startPos, sal_Int32 endPos ) { + osl::MutexGuard g(m_aMutex); + SearchResult sres; OUString in_str(searchStr); @@ -428,6 +434,8 @@ SearchResult TextSearch::searchForward( const OUString& searchStr, sal_Int32 sta SearchResult TextSearch::searchBackward( const OUString& searchStr, sal_Int32 startPos, sal_Int32 endPos ) { + osl::MutexGuard g(m_aMutex); + SearchResult sres; OUString in_str(searchStr); diff --git a/i18npool/source/search/textsearch.hxx b/i18npool/source/search/textsearch.hxx index 6f9c3d189cf4..05c158d302a1 100644 --- a/i18npool/source/search/textsearch.hxx +++ b/i18npool/source/search/textsearch.hxx @@ -43,6 +43,7 @@ class TextSearch: public cppu::WeakImplHelper css::lang::XServiceInfo > { + osl::Mutex m_aMutex; css::uno::Reference < css::uno::XComponentContext > m_xContext; css::util::SearchOptions2 aSrchPara;
_______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
