diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-10-12 01:53:51 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-10-14 10:54:47 +0000 |
commit | 6add0104e250fd8653a93450d371404aa3ff3a6c (patch) | |
tree | a02847f424c84ccccc68fcf03c34d355299f0736 | |
parent | 8b12ee3ae1f22ada7d8ffb3d86fb7c5b94ef1971 (diff) |
fdo#64495: sw: fix regex search for soft hyphen \xAD
The problem is that the soft hyphen apparently needs special handling,
and SwPaM::DoSearch() looked for the no longer supported legacy syntax,
not for any of the unicode character syntax that ICU regex supports.
Conflicts:
sw/source/core/crsr/findtxt.cxx
Change-Id: I754296d2cf9286242e083cc7906ce3b8fda78dd5
(cherry picked from commit dca5163b6ef206ceb1f2d56feb7546c1929afe60)
Reviewed-on: https://gerrit.libreoffice.org/6228
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/core/crsr/findtxt.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index 427c4fab9efe..6b55ceafaaf1 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -416,9 +416,14 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt, bool bRemoveSoftHyphens = true; if ( bRegSearch ) { - const rtl::OUString a00AD(RTL_CONSTASCII_USTRINGPARAM("\\x00AD")); - if ( -1 != rSearchOpt.searchString.indexOf( a00AD ) ) + if ( -1 != rSearchOpt.searchString.indexOf("\\xAD") + || -1 != rSearchOpt.searchString.indexOf("\\x{00AD}") + || -1 != rSearchOpt.searchString.indexOf("\\u00AD") + || -1 != rSearchOpt.searchString.indexOf("\\U000000AD") + || -1 != rSearchOpt.searchString.indexOf("\\N{SOFT HYPHEN}")) + { bRemoveSoftHyphens = false; + } } else { |