tdf#137737 i18n search: don't expand start/end with regex ^ or $
commita511bffd67a9cebfdc878766581ac08c79d7ff51
authorJustin Luth <justin_luth@sil.org>
Thu, 12 Aug 2021 19:29:42 +0000 (12 21:29 +0200)
committerJustin Luth <justin_luth@sil.org>
Wed, 25 Aug 2021 07:28:57 +0000 (25 09:28 +0200)
tree14160371a1c3a7c51fa4600dbe2ac3c2869e549f
parentb27ede1a629ac2b5f9e98def37326d546923edec
tdf#137737 i18n search: don't expand start/end with regex ^ or $

If the regex starts with ^, that means that it
matches only at the beginning of the content.
So don't expand the beginning of the content
or else it won't match anymore.
Similarly, $ indicates matching at the end of the content.

For the unit test I just randomly guessed at SearchItem.AlgorithmType,
and it kinda worked. I love black boxes...
I hope I remember what i learned about TransformParameters()
which was parsed in sfx2/source/appl/appuno.cxx,
splitting the "variable" into Item.PropName = PropValue.
That is definite black magic.

Change-Id: Ie1640821a7a430e78dbe72c57a92aeaa9b5272a3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120410
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
i18npool/source/search/textsearch.cxx
sw/qa/extras/uiwriter/data/tdf137737_FindReplace.docx [new file with mode: 0644]
sw/qa/extras/uiwriter/uiwriter2.cxx