summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-10-12 01:53:51 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-10-14 10:44:04 +0000
commit386d0c5d663fe50295be3714977a54b86212f766 (patch)
tree24c28b2cbf4c4bb55e1c083f3b12add052b41193 /sw
parent02a4d733ef24f4350f65179f46d144de7b948799 (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. Change-Id: I754296d2cf9286242e083cc7906ce3b8fda78dd5 (cherry picked from commit dca5163b6ef206ceb1f2d56feb7546c1929afe60) Reviewed-on: https://gerrit.libreoffice.org/6229 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/crsr/findtxt.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index cb6ec35fc33e..eb66500f6105 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -420,9 +420,14 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
bool bRemoveSoftHyphens = true;
if ( bRegSearch )
{
- const OUString a00AD("\\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
{