25#include <com/sun/star/uno/XComponentContext.hpp>
47 sal_Int32 collatorOptions )
50 if (std::any_of(algorithmList.begin(), algorithmList.end(),
51 [
this, &SortAlgorithm, &rLocale](
const OUString& rAlgorithm) {
52 return rAlgorithm == SortAlgorithm
53 && getLocaleSpecificIndexEntrySupplier(rLocale, SortAlgorithm).is(); }))
54 return xIES->loadAlgorithm(rLocale, SortAlgorithm, collatorOptions);
64 const Locale& rLocale )
68 return xIES->getPhoneticCandidate(rIndexEntry, rLocale);
72 const OUString& rPhoneticEntry,
const Locale& rLocale )
76 return xIES->getIndexKey(rIndexEntry, rPhoneticEntry, rLocale);
80 const OUString& rIndexEntry1,
const OUString& rPhoneticEntry1,
const Locale& rLocale1,
81 const OUString& rIndexEntry2,
const OUString& rPhoneticEntry2,
const Locale& rLocale2 )
85 return xIES->compareIndexEntry(rIndexEntry1, rPhoneticEntry1, rLocale1,
86 rIndexEntry2, rPhoneticEntry2, rLocale2);
90 const Locale& rLocale,
const OUString& rSortAlgorithm )
98 Reference < XInterface > xI =
m_xContext->getServiceManager()->createInstanceWithContext(
99 OUString::Concat(
"com.sun.star.i18n.IndexEntrySupplier_") +
name,
m_xContext);
102 xIES.set( xI, UNO_QUERY );
108Reference < css::i18n::XExtendedIndexEntrySupplier >
const &
112 rLocale.Country ==
aLocale.Country && rLocale.Variant ==
aLocale.Variant)
117 if (rSortAlgorithm.isEmpty())
126 bool bLoaded =
false;
138 for (
auto const& fallback : aFallbacks)
165 const Locale& rLocale )
167 Sequence< OUString > aFollowPageWords =
LocaleDataImpl::get()->getFollowPageWords(rLocale);
169 return (bMorePages && aFollowPageWords.getLength() > 1) ?
170 aFollowPageWords[1] : (aFollowPageWords.hasElements() ?
171 aFollowPageWords[0] : OUString());
188Sequence< OUString > SAL_CALL
Reference< XComponentContext > m_xContext
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual sal_Int16 SAL_CALL compareIndexEntry(const OUString &IndexEntry1, const OUString &PhoneticEntry1, const css::lang::Locale &rLocale1, const OUString &IndexEntry2, const OUString &PhoneticEntry2, const css::lang::Locale &rLocale2) override
virtual OUString SAL_CALL getImplementationName() override
css::lang::Locale aLocale
virtual sal_Bool SAL_CALL usePhoneticEntry(const css::lang::Locale &rLocale) override
virtual css::uno::Sequence< css::lang::Locale > SAL_CALL getLocaleList() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
css::uno::Reference< css::uno::XComponentContext > m_xContext
virtual OUString SAL_CALL getIndexCharacter(const OUString &IndexEntry, const css::lang::Locale &rLocale, const OUString &SortAlgorithm) override
virtual OUString SAL_CALL getIndexKey(const OUString &IndexEntry, const OUString &PhoneticEntry, const css::lang::Locale &rLocale) override
css::uno::Reference< css::i18n::XExtendedIndexEntrySupplier > const & getLocaleSpecificIndexEntrySupplier(const css::lang::Locale &rLocale, const OUString &rSortAlgorithm)
virtual OUString SAL_CALL getPhoneticCandidate(const OUString &IndexEntry, const css::lang::Locale &rLocale) override
virtual OUString SAL_CALL getIndexFollowPageWord(sal_Bool MorePages, const css::lang::Locale &rLocale) override
IndexEntrySupplier(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual css::uno::Sequence< OUString > SAL_CALL getAlgorithmList(const css::lang::Locale &rLocale) override
bool createLocaleSpecificIndexEntrySupplier(std::u16string_view name)
css::uno::Reference< css::i18n::XExtendedIndexEntrySupplier > xIES
virtual sal_Bool SAL_CALL loadAlgorithm(const css::lang::Locale &rLocale, const OUString &SortAlgorithm, sal_Int32 collatorOptions) override
static rtl::Reference< LocaleDataImpl > get()
static ::std::vector< OUString > getFallbackLocaleServiceNames(const css::lang::Locale &rLocale)
Generates fallback strings suitable as parts of service names, excluding the one obtained via getFirs...
static OUString getFirstLocaleServiceName(const css::lang::Locale &rLocale)
Generates a <Language>_<Country> or <Variant> (if Language=="qlt") string suitable as part of service...
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 implementationName