Support preserving case when replacing.

When making a case insensitive search, try to keep the string capitalization when doing
the replace:
      - All upper-case matches are replaced with the upper-case new	text.
      - All lower-case matches are replaced with the lower-case new text.
      - Capitalized matches are replace with the capitalized new text.
      - Other matches are replaced with the new text as provided.

Note: this does not work with regexp replace, only plain text.

Change-Id: I87cbc28eb64688bdf3c8c6ec173fcb22f91abcd0
Reviewed-by: Cristian Tibirna <tibirna@kde.org>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Francois Ferrand
2012-11-30 16:15:07 +01:00
committed by Eike Ziller
parent a8a33b9a3b
commit 058d2e8cb5
23 changed files with 256 additions and 32 deletions

View File

@@ -1172,6 +1172,28 @@
\endlist
The \gui{Preserve Case when Replacing} option can be selected to preserve
the case of the original text when replacing. This option is not compatible
with the \gui {Regular Expressions} search option, and will thus be
disabled when regular expressions are used. When the option is used, the
case of the occurrence will be conserved, according to the following rules:
\list
\o All upper-case occurrences are replaced with the upper-case new text.
\o All lower-case occurrences are replaced with the lower-case new text.
\o Capitalized occurrences are replaced with the capitalized new text.
\o Other occurrences are replaced with the new text as entered.
\o If an occurrence and the new text have the same prefix or suffix,
then the case of the prefix and/or suffix are preserved, and the
other rules are applied on the rest of the occurrence only.
\endlist
\section1 Advanced Search
To search through projects, files on a file system or the currently open