/source/lb/svl/

t://go.suokunlong.cn/lo/core' title='lo/core Git repository'/>
summaryrefslogtreecommitdiff
path: root/svx/source/dialog/langbox.cxx
AgeCommit message (Collapse)Author
2024-05-11loplugin:ostr in svxNoel Grandin
Change-Id: Ia765a03e033acb82e367873380d289587ea87d6c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167449 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-04-12Resolves: tdf#160256 Add "[Multiple]" and "[Undetermined]" to language listEike Rathke
Such that they are added to the top of the list after "[None]" and only if "[None]" was requested. {mul} and {und} ISO codes. Change-Id: I024311fe7d638124932a1d38759305e8efec5962 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166012 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2024-02-27Another attempt to ensure strict weak ordering when sortingMike Kaganski
The failure that Stephan noticed turns out to show a problem in the data - the use of the special LANGUAGE_USER_SYSTEM_CONFIG language type value. It should not appear in the sorted part of the list; if needed, it should be added explicitly, like the "default" entry is handled in SvxLanguageBox::SetLanguageList. So simplify the shortcut in GenericFirst::operator() again, and drop the special entries before sorting. Change-Id: If08e0ddbc5b597795e129fa4a2315c54205dab90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163964 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-08Try harder to use strict weak ordering when sortingMike Kaganski
Special LanguageType referring to a system locale can resolve to some language tag equal to another one, but they still compared inequal in the check at the top of GenericFirst comparator, because only values of LanguageType were compared. This could lead to a failed assertion later, because both could then be ISO locales, and have no country. Change-Id: I62dda8ed6f8b1b4c7ab4957b3eecfdef602b91a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163107 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-04Make sure to use strict weak ordering when sortingMike Kaganski
See https://gerrit.libreoffice.org/c/core/+/152676/2#message-ea10fe33b46fee581d47c04d04291a59049d4ac3 The complexity of intended sort requires to split the languages by language groups first, and use the "generic first" comparison only inside groups. As the result, e.g. Aranese and Occitan are grouped together. Change-Id: Ibf11e72c4dfb7876eecea7f3f302c313d153bcbc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162947 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-10-23Extended loplugin:ostr: Rewrite some O[U]StringLiteral -> O[U]StringStephan Bergmann
...in include files. This is a mix of automatic rewriting in include files and manual fixups (mostly addressing loplugin:redundantfcast) in source files that include those. Change-Id: I1f3cc1e67b9cabd2e9d61a4d9e9a01e587ea35cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158337 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-06-06Language list: sort generic language before country variantsMike Kaganski
In Edit Modules dialog, the language list may include entries added by LanguageTool, and among them are generic language-only entries like "Spanish {es}", stanfing for simple language tags like "es". These languages should go before country variants like "Spanish (Argentina)", but since "{" is sorted after "(", the order is the opposite. This change fixes this. Since other lists do not include generic language-only languages (filtered out by lcl_isPrerequisite and its requireSublang argument), this does not apply to them, but the code will execute nevertheless; hope that this UI-only performance hit will not be noticeable. Change-Id: I97adc1ae8feb4c8a94b567b33363d63d899cabaa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152676 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-06-06Drop the unneeded optimization for "[All]"Mike Kaganski
It will only be used *at most* once, but often will not be used at all. Change-Id: I13b0e9ab8a4918c56a7e710c80d6d9d36019c605 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152644 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-06-06Sort languages in Edit Modules dialogMike Kaganski
After commit e855481ead996a3b8270fae91bd23d6c8d75ef25, these languages are already ordered according to css::lang::Locale sorting implemented there; but this ordering does not follow the UI language sorting rules. TODO: put language without country/variant before respective languages having country/variant. Change-Id: Ic98b50ef4a500c799110611f7c35c74b4a239ed4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152641 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-06-06SvxLanguageBox::Store id from getReplacementForObsoleteLanguageMike Kaganski
... not the original id passed to the function. Theese corrected ids are used e.g. in set_active_id. Change-Id: I9967d52ed2362ace947ea21f526c4c0694f14476 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152640 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-06-05Drop unneeded indirectionMike Kaganski
Change-Id: Ie837aec7e2b4b87665cc98200d38329ec2155c56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152614 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-06-05Drop duplicating functionMike Kaganski
Change-Id: I15f6aea604f5bc05ae8e2e13c1e79003512b707f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152613 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-06-05Restructure SvxLanguageBox::SetLanguageList for clarityMike Kaganski
And extract sorting and removing duplicates to a separate function. Change-Id: I57ed8d3960eefb8df8128cdb461a0621ed998bbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152612 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-05-29replace find_if by any_ofDr. David Alan Gilbert
A few cases where find_if is used just to test if there are any matches; use any_of as per tdf#153109 In document3 we can merge two identical loops. In langbox we can optimise the arg capture (Arkadiy's suggestion) Change-Id: I480b80ec1b859980b651c6d727e7fb5d01d390e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152201 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-10-05Add on-the-fly language tag to proper language list Western/Asian/ComplexEike Rathke
In which combobox wherever it was added, the correct SfxItem will be updated and at least when switching to another dialog tab and back it will appear in the correct list. (shouldn't tabbing out of the combobox already trigger that?) Change-Id: I5aa78797dc24527c753c97d0357c3058271fa4d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140991 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-09-01Resolves: tdf#150370 Accept 'art-x-...' private-use input in language boxEike Rathke
... for artificial constructed languages. Change-Id: Ifd0f2ca63738eb9bbe78361cd3fdf507f3e397f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139135 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-08-31Related: tdf#150370 Convert isValidBcp47() bool to enum LanguageTag::PrivateUseEike Rathke
... to prepare for more finegrained private-use control. Change-Id: I118c3f5ee6e437435c07ed2cf699c4597e9cdf88 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139112 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-04-29use more string_view in INetURLObjectNoel Grandin
Change-Id: I4462f7cf4740fa4d1b129d76a0775f4250f41bbd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133555 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-18Related: tdf#145173 Ensure known supported system and default document localeEike Rathke
For an unsupported locale like {en-IL} that could had ended up as language-only {en} if the aImplIsoLangEntries map contains such entry as obtained through MsLangId::convertUnxByteStringToLanguage() and Conversion::convertIsoNamesToLanguage(). For the system locale in SvtSysLocale a proper fallback is used but the default document language was propagated as is Other places evaluating MsLangId::getSystemLanguage() are affected as well, those probably will have to be replaced by a call to MsLangId::getRealLanguage(LANGUAGE_SYSTEM) or a newly to be introduced MsLangId::getConfiguredSystemLanguage() and MsLangId::getSystemLanguage() be made private or accessible only by LanguageTag. Change-Id: I87eb9456d5b4ea8d64b0c41fec6bd2739256fb56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123756 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2021-07-16Resolves: tdf#143372 Exclude {qtz} KeyID from SvxLanguageBox listEike Rathke
Change-Id: I3e52407a33f79713635063ff4ba374267eb98005 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119002 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins