summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-11-28 13:36:47 +0000
committerMiklos Vajna <vmiklos@suse.cz>2012-11-29 09:23:52 +0000
commit85549899ad814f401449dff9f0b57ccc25cca14a (patch)
tree88cef50bd47958e40e89263dfc16645ba321c355
parent41459013f8ffed4cbfd6e7c4a59b5d9a7d90fb74 (diff)
Resolves: fdo#57640 we really want to *titlecase* the initial character
http://srfi.schemers.org/srfi-13/mail-archive/msg00046.html summarizes well.. " - Titlecase <> uppercase Unicode defines three kinds of case mapping: lowercase, uppercase, and titlecase. The difference between uppercasing and titlecasing a character or character sequence can be seen in compound characters (that is, a single character that represents a compount of two characters). For example, in Unicode, character U+01F3 is LATIN SMALL LETTER DZ. (Let us write this compound character using ASCII as "dz".) This character uppercases to character U+01F1, LATIN CAPITAL LETTER DZ. (Which is basically "DZ".) But it titlecases to to character U+01F2, LATIN CAPITAL LETTER D WITH SMALL LETTER Z. (Which we can write "Dz".) character uppercase titlecase --------- --------- --------- dz DZ Dz " See TestCharacterClassification::testTitleCase for titlecase regression tests. (cherry picked from commit 150e32777c99a5d67a51726972f46c06dae8a6ac) Conflicts: editeng/source/misc/svxacorr.cxx Change-Id: I198379832d1910632bb6358149a5276b68d7c6eb Reviewed-on: https://gerrit.libreoffice.org/1191 Reviewed-by: Miklos Vajna <vmiklos@suse.cz> Tested-by: Miklos Vajna <vmiklos@suse.cz>
-rw-r--r--editeng/source/misc/svxacorr.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 6d2440b25009..084a79f0346c 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -888,7 +888,7 @@ sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc,
{
// valid separator -> replace
String sChar( *pWordStt );
- sChar = rCC.uppercase( sChar );
+ sChar = rCC.titlecase( sChar ); //see fdo#56740
return sChar != *pWordStt &&
rDoc.ReplaceRange( xub_StrLen( pWordStt - pStart ), 1, sChar );
}
@@ -1064,7 +1064,7 @@ sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc,
sal_Unicode cSave = *pWordStt;
nSttPos = sal::static_int_cast< xub_StrLen >( pWordStt - rTxt.GetBuffer() );
String sChar( cSave );
- sChar = rCC.uppercase( sChar );
+ sChar = rCC.titlecase( sChar ); //see fdo#56740
sal_Bool bRet = sChar.GetChar(0) != cSave && rDoc.ReplaceRange( nSttPos, 1, sChar );
// Parahaps someone wants to have the word