22#include <com/sun/star/i18n/KCharacterType.hpp>
23#include <com/sun/star/i18n/ParseResult.hpp>
24#include <com/sun/star/i18n/CharacterClassification.hpp>
34 cclass = CharacterClassification::create( rxContext );
47#define DIGIT KCharacterType::DIGIT
51 const OUString& str2, sal_Int32 off2, sal_Int32 len2)
53 if( len1 <= 1 || len2 <= 1 || !
cclass.is() )
57 for (i1 = len1; i1 && (
cclass->getCharacterType(str1, off1+i1-1,
nLocale) &
DIGIT); i1--) ;
58 for (i2 = len2; i2 && (
cclass->getCharacterType(str2, off2+i2-1,
nLocale) &
DIGIT); i2--) ;
64 static constexpr OUStringLiteral aAddAllowed(
u"?");
65 ParseResult res1, res2;
68 OUString s1 = str1.copy(off1+i1, len1-i1), s2 = str2.copy(off2+i2, len2-i2);
72 return res1.Value == res2.Value ? 0 : res1.Value > res2.Value ? 1 : -1;
75constexpr OUStringLiteral
cChapCollator =
u"com.sun.star.i18n.ChapterCollator";
89Sequence< OUString > SAL_CALL
css::uno::Reference< css::i18n::XCharacterClassification > cclass
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
sal_Int32 SAL_CALL compareSubstring(const OUString &s1, sal_Int32 off1, sal_Int32 len1, const OUString &s2, sal_Int32 off2, sal_Int32 len2) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual OUString SAL_CALL getImplementationName() override
ChapterCollator(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
sal_Int32 SAL_CALL compareString(const OUString &s1, const OUString &s2) override
virtual ~ChapterCollator() override
virtual sal_Int32 SAL_CALL compareSubstring(const OUString &s1, sal_Int32 off1, sal_Int32 len1, const OUString &s2, sal_Int32 off2, sal_Int32 len2) override
css::lang::Locale nLocale
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
Constant values shared between i18npool and, for example, the number formatter.
constexpr OUStringLiteral cChapCollator