diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-11-28 13:36:47 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-11-28 15:12:35 +0000 |
commit | 150e32777c99a5d67a51726972f46c06dae8a6ac (patch) | |
tree | 70800663268b7861263ed91d5b8216e12688f5b7 /editeng | |
parent | 6541e4474df1bfc6d0e8880aaa513f456b64a58e (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.
Change-Id: I198379832d1910632bb6358149a5276b68d7c6eb
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/misc/svxacorr.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 930e5406ab74..934876f81c0e 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -855,7 +855,7 @@ sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, { // valid separator -> replace rtl::OUString sChar( *pWordStt ); - sChar = rCC.uppercase( sChar ); + sChar = rCC.titlecase(sChar); //see fdo#56740 return !comphelper::string::equals(sChar, *pWordStt) && rDoc.ReplaceRange( xub_StrLen( pWordStt - pStart ), 1, sChar ); } @@ -1030,7 +1030,7 @@ sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, sal_Unicode cSave = *pWordStt; nSttPos = sal::static_int_cast< xub_StrLen >( pWordStt - rTxt.GetBuffer() ); rtl::OUString sChar( cSave ); - sChar = rCC.uppercase( sChar ); + sChar = rCC.titlecase(sChar); //see fdo#56740 sal_Bool bRet = sChar[0] != cSave && rDoc.ReplaceRange( nSttPos, 1, sChar ); // Parahaps someone wants to have the word |