On Wed, 2012-06-06 at 21:53 +1200, Brad Sowden wrote:
I just checked and your test case passes when sTest = "Some text" but if
I change it to sTest = "Some tExt" it fails (assuming "Some Text" is the
right result).
That looks sort of dubious alright. Way too many classes and wrappers
here. Its unclear to me whether that characterclassifcation thing is
intended to just operate on characters and convert all of them to a
given case, in which case its broken for title case since
https://issues.apache.org/ooo/show_bug.cgi?id=30863 or whether its
really supposed to do what it does now, which doesn't make a lot of
sense either.
The following function appears to do what I originally wanted (i.e.
Title case the first character and Lower case subsequent characters) but
using opengrok I can't find anywhere that actually instantiates this class.
rtl::OUString SAL_CALL Transliteration_titlecase::transliterate()
Looks like TransliterationWrapper in unotools is the "route" to that,
e.g. utl::TransliterationWrapper aTrans(factory,
TransliterationModulesExtra::TITLE_CASE);
where the call to the ctor for Transliteration_titlecase is hidden away
inside TransliterationImpl::loadModuleByName. Putting a breakpoint on
Transliteration_titlecase::Transliteration_titlecase and using the
"format->change case->Capitalize Every Word" in writer gives the bt for
it.
Its all the usual overengineered horror :-)
http://opengrok.libreoffice.org/xref/core/i18npool/source/transliteration/transliteration_body.cxx#329
Anyway, I think the solution I used in my patch is better as I actually
wanted Sentence case rather than Title case for the overall string.
fwiw that utl::TransliterationWrapper has a sentence case mode.
C.
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.