LibreOffice Module svx (master) 1
langbox.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <com/sun/star/linguistic2/XAvailableLocales.hpp>
21#include <com/sun/star/linguistic2/XLinguServiceManager2.hpp>
22#include <com/sun/star/linguistic2/XSpellChecker1.hpp>
23#include <linguistic/misc.hxx>
24#include <rtl/ustring.hxx>
25#include <sal/log.hxx>
27#include <tools/urlobj.hxx>
28#include <svtools/langtab.hxx>
30#include <i18nlangtag/lang.h>
31#include <editeng/unolingu.hxx>
33#include <svx/langbox.hxx>
34#include <svx/dialmgr.hxx>
35#include <svx/strings.hrc>
36#include <bitmaps.hlst>
37
38#include <comphelper/string.hxx>
41#include <vcl/svapp.hxx>
42#include <vcl/settings.hxx>
43
44using namespace ::com::sun::star::util;
45using namespace ::com::sun::star::linguistic2;
46using namespace ::com::sun::star::uno;
47
48OUString GetDicInfoStr( std::u16string_view rName, const LanguageType nLang, bool bNeg )
49{
50 INetURLObject aURLObj;
51 aURLObj.SetSmartProtocol( INetProtocol::File );
53 OUString aTmp( aURLObj.GetBase() + " " );
54
55 if ( bNeg )
56 {
57 aTmp += " (-) ";
58 }
59
60 if ( LANGUAGE_NONE == nLang )
61 aTmp += SvxResId(RID_SVXSTR_LANGUAGE_ALL);
62 else
63 {
64 aTmp += "[" + SvtLanguageTable::GetLanguageString( nLang ) + "]";
65 }
66
67 return aTmp;
68}
69
70// misc local helper functions
71static void appendLocaleSeqToLangs(Sequence<css::lang::Locale> const& rSeq,
72 std::vector<LanguageType>& aLangs)
73{
74 sal_Int32 nCount = rSeq.getLength();
75
76 aLangs.reserve(aLangs.size() + nCount);
77
78 std::transform(rSeq.begin(), rSeq.end(), std::back_inserter(aLangs),
79 [](const css::lang::Locale& rLocale) -> LanguageType {
80 return LanguageTag::convertToLanguageType(rLocale); });
81}
82
83static bool lcl_SeqHasLang( const Sequence< sal_Int16 > & rLangSeq, sal_Int16 nLang )
84{
85 return rLangSeq.hasElements()
86 && std::find(rLangSeq.begin(), rLangSeq.end(), nLang) != rLangSeq.end();
87}
88
89namespace {
90
91bool lcl_isPrerequisite(LanguageType nLangType, bool requireSublang)
92{
93 return
94 nLangType != LANGUAGE_DONTKNOW &&
95 nLangType != LANGUAGE_SYSTEM &&
96 nLangType != LANGUAGE_NONE &&
97 nLangType != LANGUAGE_USER_KEYID &&
98 !MsLangId::isLegacy( nLangType) &&
99 (!requireSublang || MsLangId::getSubLanguage( nLangType));
100}
101
102bool lcl_isScriptTypeRequested( LanguageType nLangType, SvxLanguageListFlags nLangList )
103{
104 return
105 bool(nLangList & SvxLanguageListFlags::ALL) ||
106 (bool(nLangList & SvxLanguageListFlags::WESTERN) &&
107 (SvtLanguageOptions::GetScriptTypeOfLanguage(nLangType) == SvtScriptType::LATIN)) ||
108 (bool(nLangList & SvxLanguageListFlags::CTL) &&
109 (SvtLanguageOptions::GetScriptTypeOfLanguage(nLangType) == SvtScriptType::COMPLEX)) ||
110 (bool(nLangList & SvxLanguageListFlags::CJK) &&
111 (SvtLanguageOptions::GetScriptTypeOfLanguage(nLangType) == SvtScriptType::ASIAN));
112}
113
114}
115
116
118{
119 OUString sLang = m_xControl->get_active_id();
120 if (!sLang.isEmpty())
121 return LanguageType(sLang.toInt32());
122 else
123 return LANGUAGE_DONTKNOW;
124}
125
126int SvxLanguageBox::find_id(const LanguageType eLangType) const
127{
128 return m_xControl->find_id(OUString::number(static_cast<sal_uInt16>(eLangType)));
129}
130
131void SvxLanguageBox::set_id(int pos, const LanguageType eLangType)
132{
133 m_xControl->set_id(pos, OUString::number(static_cast<sal_uInt16>(eLangType)));
134}
135
137{
138 return LanguageType(m_xControl->get_id(pos).toInt32());
139}
140
142{
143 m_xControl->remove_id(OUString::number(static_cast<sal_uInt16>(eLangType)));
144}
145
146void SvxLanguageBox::append(const LanguageType eLangType, const OUString& rStr)
147{
148 m_xControl->append(OUString::number(static_cast<sal_uInt16>(eLangType)), rStr);
149}
150
152{
153 // If the core uses a LangID of an imported MS document and wants to select
154 // a language that is replaced, we need to select the replacement instead.
156
157 sal_Int32 nAt = find_id( nLang );
158
159 if (nAt == -1)
160 {
161 InsertLanguage( nLang ); // on-the-fly-ID
162 nAt = find_id( nLang );
163 }
164
165 if (nAt != -1)
166 m_xControl->set_active(nAt);
167}
168
169void SvxLanguageBox::AddLanguages(const std::vector< LanguageType >& rLanguageTypes,
170 SvxLanguageListFlags nLangList, std::vector<weld::ComboBoxEntry>& rEntries, bool requireSublang)
171{
172 for ( auto const & nLangType : rLanguageTypes )
173 {
174 if (lcl_isPrerequisite(nLangType, requireSublang))
175 {
177 if (lcl_isScriptTypeRequested( nLang, nLangList))
178 {
179 int nAt = find_id(nLang);
180 if (nAt != -1)
181 continue;
182 weld::ComboBoxEntry aNewEntry(BuildEntry(nLang));
183 if (aNewEntry.sString.isEmpty())
184 continue;
185 rEntries.push_back(aNewEntry);
186 }
187 }
188 }
189}
190
191static void SortLanguages(std::vector<weld::ComboBoxEntry>& rEntries)
192{
193 auto langLess = [](const weld::ComboBoxEntry& e1, const weld::ComboBoxEntry& e2)
194 {
195 if (e1.sId == e2.sId)
196 return false; // shortcut
197 // Make sure that e.g. generic 'Spanish {es}' goes before 'Spanish (Argentina)'.
198 // We can't depend on MsLangId::getPrimaryLanguage/getSubLanguage, because e.g.
199 // for generic Bosnian {bs}, the MS-LCID is 0x781A, and getSubLanguage is not 0.
200 // So we have to do the expensive LanguageTag construction.
201 LanguageTag lt1(LanguageType(e1.sId.toInt32())), lt2(LanguageType(e2.sId.toInt32()));
202 if (lt1.getLanguage() == lt2.getLanguage())
203 {
204 const bool isLangOnly1 = lt1.isIsoLocale() && lt1.getCountry().isEmpty();
205 const bool isLangOnly2 = lt2.isIsoLocale() && lt2.getCountry().isEmpty();
206
207 if (isLangOnly1)
208 {
209 // lt1 is a generic language-only tag
210 if (!isLangOnly2)
211 return true; // lt2 is not
212 }
213 else if (isLangOnly2)
214 {
215 // lt2 is a generic language-only tag, lt1 is not
216 return false;
217 }
218 }
219 // Do a normal string comparison for other cases
220 static const auto aSorter = comphelper::string::NaturalStringSorter(
222 Application::GetSettings().GetUILanguageTag().getLocale());
223 return aSorter.compare(e1.sString, e2.sString) < 0;
224 };
225
226 std::sort(rEntries.begin(), rEntries.end(), langLess);
227 rEntries.erase(std::unique(rEntries.begin(), rEntries.end(),
228 [](const weld::ComboBoxEntry& e1, const weld::ComboBoxEntry& e2)
229 { return e1.sId == e2.sId; }),
230 rEntries.end());
231}
232
234 bool bLangNoneIsLangAll, bool bCheckSpellAvail,
235 bool bDefaultLangExist, LanguageType eDefaultLangType,
236 sal_Int16 nDefaultType)
237{
238 m_bHasLangNone = bHasLangNone;
239 m_bLangNoneIsLangAll = bLangNoneIsLangAll;
240 m_bWithCheckmark = bCheckSpellAvail;
241
242 m_xControl->freeze();
243 comphelper::ScopeGuard aThawGuard([this]() { m_xControl->thaw(); });
244 m_xControl->clear();
245
246 if (SvxLanguageListFlags::EMPTY == nLangList)
247 return;
248
249 bool bAddSeparator = false;
250
251 if (bHasLangNone)
252 {
254 bAddSeparator = true;
255 }
256
257 if (bDefaultLangExist)
258 {
259 m_xControl->append(BuildEntry(eDefaultLangType, nDefaultType));
260 bAddSeparator = true;
261 }
262
263 if (bAddSeparator)
264 m_xControl->append_separator("");
265
266 bool bAddAvailable = (!(nLangList & SvxLanguageListFlags::ONLY_KNOWN) &&
267 ((nLangList & SvxLanguageListFlags::ALL) ||
268 (nLangList & SvxLanguageListFlags::WESTERN) ||
269 (nLangList & SvxLanguageListFlags::CTL) ||
270 (nLangList & SvxLanguageListFlags::CJK)));
271 std::vector< LanguageType > aAvailLang;
272 Sequence< sal_Int16 > aSpellUsedLang;
273 if (bAddAvailable)
274 {
275 if (auto xAvail = LinguMgr::GetLngSvcMgr())
276 {
277 appendLocaleSeqToLangs(xAvail->getAvailableLocales(SN_SPELLCHECKER), aAvailLang);
278 appendLocaleSeqToLangs(xAvail->getAvailableLocales(SN_HYPHENATOR), aAvailLang);
279 appendLocaleSeqToLangs(xAvail->getAvailableLocales(SN_THESAURUS), aAvailLang);
280 }
281 }
282 if (SvxLanguageListFlags::SPELL_USED & nLangList)
283 {
284 Reference< XSpellChecker1 > xTmp1 = LinguMgr::GetSpellChecker();
285 if (xTmp1.is())
286 aSpellUsedLang = xTmp1->getLanguages();
287 }
288
289 std::vector<LanguageType> aKnown;
290 sal_uInt32 nCount;
291 if ( nLangList & SvxLanguageListFlags::ONLY_KNOWN )
292 {
294 nCount = aKnown.size();
295 }
296 else
297 {
299 }
300
301 std::vector<weld::ComboBoxEntry> aEntries;
302 for ( sal_uInt32 i = 0; i < nCount; i++ )
303 {
304 LanguageType nLangType;
305 if ( nLangList & SvxLanguageListFlags::ONLY_KNOWN )
306 nLangType = aKnown[i];
307 else
309 if ( lcl_isPrerequisite( nLangType, true ) &&
310 (lcl_isScriptTypeRequested( nLangType, nLangList) ||
311 (bool(nLangList & SvxLanguageListFlags::FBD_CHARS) &&
313 (bool(nLangList & SvxLanguageListFlags::SPELL_USED) &&
314 lcl_SeqHasLang(aSpellUsedLang, static_cast<sal_uInt16>(nLangType)))
315 ) )
316 {
317 aEntries.push_back(BuildEntry(nLangType));
318 if (aEntries.back().sString.isEmpty())
319 aEntries.pop_back();
320 }
321 }
322
323 if (bAddAvailable)
324 {
325 // Spell checkers, hyphenators and thesauri may add language tags
326 // unknown so far.
327 AddLanguages(aAvailLang, nLangList, aEntries, true);
328 }
329
331 m_xControl->insert_vector(aEntries, true);
332}
333
335{
336 if (find_id(nLangType) != -1)
337 return;
338 weld::ComboBoxEntry aEntry = BuildEntry(nLangType);
339 if (aEntry.sString.isEmpty())
340 return;
341 m_xControl->append(aEntry);
342}
343
344void SvxLanguageBox::InsertLanguages(const std::vector<LanguageType>& rLanguageTypes)
345{
346 std::vector<weld::ComboBoxEntry> entries;
347 AddLanguages(rLanguageTypes, SvxLanguageListFlags::ALL, entries, false);
348 SortLanguages(entries);
349 m_xControl->insert_vector(entries, true);
350}
351
353{
355 // For obsolete and to be replaced languages check whether an entry of the
356 // replacement already exists and if so don't add an entry with identical
357 // string as would be returned by SvtLanguageTable::GetString().
358 if (nLang != nLangType)
359 {
360 int nAt = find_id( nLang );
361 if (nAt != -1)
362 return weld::ComboBoxEntry("");
363 }
364
365 OUString aStrEntry = (LANGUAGE_NONE == nLang && m_bHasLangNone && m_bLangNoneIsLangAll)
366 ? SvxResId(RID_SVXSTR_LANGUAGE_ALL)
368
369 LanguageType nRealLang = nLang;
370 if (nRealLang == LANGUAGE_SYSTEM)
371 {
373 aStrEntry += " - " + SvtLanguageTable::GetLanguageString( nRealLang );
374 }
375 else if (nRealLang == LANGUAGE_USER_SYSTEM_CONFIG)
376 {
377 nRealLang = MsLangId::getSystemLanguage();
378 // Whatever we obtained, ensure a known supported locale.
379 nRealLang = LanguageTag(nRealLang).makeFallback().getLanguageType();
380 aStrEntry += " - " + SvtLanguageTable::GetLanguageString( nRealLang );
381 }
382
384 {
385 if (!m_xSpellUsedLang)
386 {
387 Reference<XSpellChecker1> xSpell = LinguMgr::GetSpellChecker();
388 if (xSpell.is())
389 m_xSpellUsedLang.reset(new Sequence<sal_Int16>(xSpell->getLanguages()));
390 }
391
392 bool bFound = m_xSpellUsedLang && lcl_SeqHasLang(*m_xSpellUsedLang, static_cast<sal_uInt16>(nRealLang));
393
394 return weld::ComboBoxEntry(aStrEntry, OUString::number(static_cast<sal_uInt16>(nLang)), bFound ? OUString(RID_SVXBMP_CHECKED) : OUString(RID_SVXBMP_NOTCHECKED));
395 }
396 else
397 return weld::ComboBoxEntry(aStrEntry, OUString::number(static_cast<sal_uInt16>(nLang)));
398}
399
400IMPL_LINK(SvxLanguageBox, ChangeHdl, weld::ComboBox&, rControl, void)
401{
402 if (rControl.has_entry())
403 {
404 EditedAndValid eOldState = m_eEditedAndValid;
405 OUString aStr(rControl.get_active_text());
406 if (aStr.isEmpty())
407 m_eEditedAndValid = EditedAndValid::Invalid;
408 else
409 {
410 const int nPos = rControl.find_text(aStr);
411 if (nPos != -1)
412 {
413 int nStartSelectPos, nEndSelectPos;
414 rControl.get_entry_selection_bounds(nStartSelectPos, nEndSelectPos);
415
416 // Select the corresponding listbox entry if not current. This
417 // invalidates the Edit Selection thus has to happen between
418 // obtaining the Selection and setting the new Selection.
419 int nSelPos = m_xControl->get_active();
420 bool bSetEditSelection;
421 if (nSelPos == nPos)
422 bSetEditSelection = false;
423 else
424 {
425 m_xControl->set_active(nPos);
426 bSetEditSelection = true;
427 }
428
429 // If typing into the Edit control led us here, advance start of a
430 // full selection by one so the next character will already
431 // continue the string instead of having to type the same character
432 // again to start a new string. The selection is in reverse
433 // when obtained from the Edit control.
434 if (nEndSelectPos == 0)
435 {
436 OUString aText(m_xControl->get_active_text());
437 if (nStartSelectPos == aText.getLength())
438 {
439 ++nEndSelectPos;
440 bSetEditSelection = true;
441 }
442 }
443
444 if (bSetEditSelection)
445 rControl.select_entry_region(nStartSelectPos, nEndSelectPos);
446
447 m_eEditedAndValid = EditedAndValid::No;
448 }
449 else
450 {
451 OUString aCanonicalized;
452 bool bValid = LanguageTag::isValidBcp47( aStr, &aCanonicalized, LanguageTag::PrivateUse::ALLOW_ART_X);
453 m_eEditedAndValid = (bValid ? EditedAndValid::Valid : EditedAndValid::Invalid);
454 if (bValid && aCanonicalized != aStr)
455 {
456 m_xControl->set_entry_text(aCanonicalized);
457 const auto nCursorPos = aCanonicalized.getLength();
458 m_xControl->select_entry_region(nCursorPos, nCursorPos);
459 }
460 }
461 }
462 if (eOldState != m_eEditedAndValid)
463 {
464 if (m_eEditedAndValid == EditedAndValid::Invalid)
465 rControl.set_entry_message_type(weld::EntryMessageType::Error);
466 else
467 rControl.set_entry_message_type(weld::EntryMessageType::Normal);
468 }
469 }
470 m_aChangeHdl.Call(rControl);
471}
472
473SvxLanguageBox::SvxLanguageBox(std::unique_ptr<weld::ComboBox> pControl)
474 : m_xControl(std::move(pControl))
475 , m_eSavedLanguage(LANGUAGE_DONTKNOW)
476 , m_eEditedAndValid(EditedAndValid::No)
477 , m_bHasLangNone(false)
478 , m_bLangNoneIsLangAll(false)
479 , m_bWithCheckmark(false)
480{
481 m_xControl->connect_changed(LINK(this, SvxLanguageBox, ChangeHdl));
482}
483
485{
487 return this;
488
489 LanguageTag aLanguageTag(m_xControl->get_active_text());
490 LanguageType nLang = aLanguageTag.getLanguageType();
491 if (nLang == LANGUAGE_DONTKNOW)
492 {
493 SAL_WARN( "svx.dialog", "SvxLanguageBox::SaveEditedAsEntry: unknown tag");
494 return this;
495 }
496
497 for (size_t i = 0; i < 3; ++i)
498 {
499 SvxLanguageBox* pBox = ppBoxes[i];
500 if (!pBox)
501 continue;
502
503 const int nPos = pBox->find_id( nLang);
504 if (nPos != -1)
505 {
506 // Already present but with a different string or in another list.
507 pBox->m_xControl->set_active(nPos);
508 return pBox;
509 }
510 }
511
513 {
514 // In SvtLanguageTable but not in SvxLanguageBox. On purpose? This
515 // may be an entry with different settings.
516 SAL_WARN( "svx.dialog", "SvxLanguageBox::SaveEditedAsEntry: already in SvtLanguageTable: " <<
517 SvtLanguageTable::GetLanguageString( nLang) << ", " << nLang);
518 }
519 else
520 {
521 // Add to SvtLanguageTable first. This at an on-the-fly LanguageTag
522 // also sets the ScriptType needed below.
523 SvtLanguageTable::AddLanguageTag( aLanguageTag );
524 }
525
526 // Add to the proper list.
527 SvxLanguageBox* pBox = nullptr;
528 switch (MsLangId::getScriptType(nLang))
529 {
530 default:
531 case css::i18n::ScriptType::LATIN:
532 pBox = ppBoxes[0];
533 break;
534 case css::i18n::ScriptType::ASIAN:
535 pBox = ppBoxes[1];
536 break;
537 case css::i18n::ScriptType::COMPLEX:
538 pBox = ppBoxes[2];
539 break;
540 }
541 if (!pBox)
542 pBox = this;
543 pBox->InsertLanguage(nLang);
544
545 // Select it.
546 const int nPos = pBox->find_id(nLang);
547 if (nPos != -1)
548 pBox->m_xControl->set_active(nPos);
549
550 return pBox;
551}
552
553/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static const AllSettings & GetSettings()
void SetSmartProtocol(INetProtocol eTheSmartScheme)
bool SetSmartURL(std::u16string_view rTheAbsURIRef, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
OUString GetBase() const
LanguageType getLanguageType(bool bResolveSystem=true) const
LanguageTag & makeFallback()
bool isValidBcp47() const
static css::uno::Reference< css::linguistic2::XSpellChecker1 > GetSpellChecker()
static css::uno::Reference< css::linguistic2::XLinguServiceManager2 > GetLngSvcMgr()
static const std::vector< LanguageType > & getInstalledLanguageTypes()
static bool isLegacy(LanguageType nLang)
static LanguageType resolveSystemLanguageByScriptType(LanguageType nLang, sal_Int16 nType)
static LanguageType getSubLanguage(LanguageType nLangID)
static LanguageType getReplacementForObsoleteLanguage(LanguageType nLang)
static LanguageType getSystemLanguage()
static sal_Int16 getScriptType(LanguageType nLang)
static bool hasForbiddenCharacters(LanguageType nLang)
static void AddLanguageTag(const LanguageTag &rLanguageTag)
static sal_uInt32 GetLanguageEntryCount()
static OUString GetLanguageString(const LanguageType eType)
static LanguageType GetLanguageTypeAtIndex(sal_uInt32 nIndex)
static bool HasLanguageType(const LanguageType eType)
bool m_bLangNoneIsLangAll
Definition: langbox.hxx:66
SVX_DLLPRIVATE void AddLanguages(const std::vector< LanguageType > &rLanguageTypes, SvxLanguageListFlags nLangList, std::vector< weld::ComboBoxEntry > &rEntries, bool requireSublang)
Definition: langbox.cxx:169
bool m_bWithCheckmark
Definition: langbox.hxx:67
void InsertLanguage(const LanguageType nLangType)
Definition: langbox.cxx:334
void remove_id(const LanguageType eLangType)
Definition: langbox.cxx:141
LanguageType get_active_id() const
Definition: langbox.cxx:117
void set_id(int nPos, const LanguageType eLangType)
Definition: langbox.cxx:131
SvxLanguageBox * SaveEditedAsEntry(SvxLanguageBox *ppBoxes[3])
Definition: langbox.cxx:484
EditedAndValid m_eEditedAndValid
Definition: langbox.hxx:64
void SetLanguageList(SvxLanguageListFlags nLangList, bool bHasLangNone, bool bLangNoneIsLangAll=false, bool bCheckSpellAvail=false, bool bDefaultLangExist=false, LanguageType eDefaultLangType=LANGUAGE_NONE, sal_Int16 nDefaultType=0)
Definition: langbox.cxx:233
bool m_bHasLangNone
Definition: langbox.hxx:65
SvxLanguageBox(std::unique_ptr< weld::ComboBox > pControl)
Definition: langbox.cxx:473
std::unique_ptr< weld::ComboBox > m_xControl
Definition: langbox.hxx:60
LanguageType get_id(int nPos) const
Definition: langbox.cxx:136
void set_active_id(const LanguageType eLangType)
Definition: langbox.cxx:151
void append(const LanguageType eLangType, const OUString &rStr)
Definition: langbox.cxx:146
std::unique_ptr< css::uno::Sequence< sal_Int16 > > m_xSpellUsedLang
Definition: langbox.hxx:62
void InsertLanguages(const std::vector< LanguageType > &rLanguageTypes)
Definition: langbox.cxx:344
int find_id(const LanguageType eLangType) const
Definition: langbox.cxx:126
SVX_DLLPRIVATE weld::ComboBoxEntry BuildEntry(const LanguageType nLangType, sal_Int16 nType=css::i18n::ScriptType::WEAK)
Definition: langbox.cxx:352
int nCount
OUString SvxResId(TranslateId aId)
Definition: dialmgr.cxx:24
ScXMLEditAttributeMap::Entry const aEntries[]
#define LANGUAGE_SYSTEM
#define LANGUAGE_NONE
#define LANGUAGE_USER_SYSTEM_CONFIG
#define LANGUAGE_USER_KEYID
#define LANGUAGE_DONTKNOW
static void SortLanguages(std::vector< weld::ComboBoxEntry > &rEntries)
Definition: langbox.cxx:191
static bool lcl_SeqHasLang(const Sequence< sal_Int16 > &rLangSeq, sal_Int16 nLang)
Definition: langbox.cxx:83
static void appendLocaleSeqToLangs(Sequence< css::lang::Locale > const &rSeq, std::vector< LanguageType > &aLangs)
Definition: langbox.cxx:71
OUString GetDicInfoStr(std::u16string_view rName, const LanguageType nLang, bool bNeg)
Definition: langbox.cxx:48
IMPL_LINK(SvxLanguageBox, ChangeHdl, weld::ComboBox &, rControl, void)
Definition: langbox.cxx:400
SvxLanguageListFlags
Definition: langbox.hxx:30
sal_uInt16 nPos
#define SAL_WARN(area, stream)
aStr
constexpr OUStringLiteral SN_SPELLCHECKER
constexpr OUStringLiteral SN_HYPHENATOR
constexpr OUStringLiteral SN_THESAURUS
No
SvtScriptType GetScriptTypeOfLanguage(LanguageType nLang)
const LanguageTag & getLocale()
Reference< XComponentContext > getProcessComponentContext()
int i
lt2
lt1
QPRO_FUNC_TYPE nType
Reference< XControl > m_xControl
size_t pos