83 Commits
Author SHA1 Message Date
Caolán McNamara afc4a48212 more langtag length limits
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ie6a84f836be42e4edc16871d8d4dd12a99046d38
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1592
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit cca41c7cfbfb77777fe8a58be53f6f2ba84638ab)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207068
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-06-21 20:30:25 +02:00
Caolán McNamara 81043ab2dd limit langtag variant length
Change-Id: I4fa5d1a01eb55226403922c28cbca94a0d237d11
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/1154
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit cbc3cb9511d91b8d385da6f16dce5c415c08a5a5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204107
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-04-22 19:51:02 +02:00
Noel Grandin d573e2ae17 loplugin:ostr in various
Change-Id: I9f399b3752da9df930e0647536ffcd4e82beb1ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167856
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-20 22:09:56 +02:00
Stephan Bergmann bd6fb0cd3e Extended loplugin:ostr: Rewrite some O[U]StringLiteral -> O[U]String
...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-10-23 11:04:42 +02:00
Eike Rathke 66719bbdf9 Unit test for {es-419} and fallbacks
Change-Id: I3ced70df064cfd331974da7c6713c950a509168c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147183
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2023-02-17 02:39:41 +00:00
Eike Rathke 88d0559134 Add unit tests for zh-Hans and zh-Hant mapping and fallbacks
Change-Id: I99db25676e38a85639f4f2fb09b7fc42cc6f8755
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147111
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2023-02-15 22:45:28 +00:00
Eike Rathke 5aa2002644 More zh-* legacy
Change-Id: I859bb1d100eed0d1940e31575611f34c1c308698
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140982
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2022-10-05 17:01:26 +02:00
Eike Rathke 437abb3abb Check acor_langtag for language-script fallback instead of only language
A tag with script could be added for which we don't have locale
data but for the same language in another script. Do not fall back
to that.

With that the share/autocorr/acor_zh-{CN,TW}.dat files created
additional Asian language listbox entries
"Chinese (Simplified, China) {zh-Hans-CN}"
"Chinese (Traditional, Taiwan) {zh-Hant-TW}"
because those are the canonicalized language tags.
Prefer the known legacy zh-CN and zh-TW tags instead.
Could also had happened with any document import.

Which again revealed a flaw in the handling of mapping overrides
where converting from a LanguageType LCID to Locale could yield a
different mapping than from BCP47 to LCID, which in the case of
a fallback for locale data lead to odd side effects.

Change-Id: I1e2aaa8e9f99b6b3bc2c9a661215cb00bddd33d6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140939
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2022-10-04 19:15:45 +02:00
Eike Rathke 2c2e0568e8 Related: tdf#150370 Convert isValidBcp47() bool to enum LanguageTag::PrivateUse
... 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-08-31 20:49:46 +02:00
Eike Rathke 196f2b6f8e Resolves: tdf#147390 tag oc-FR to oc-FR-lengadoc, oc-ES to oc-ES-aranes
Change-Id: I849e8e2c6cf2a61b81b25c96b79478bc04907b5c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135458
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2022-06-06 20:35:27 +02:00
Andrea Gelmini dc35df15c5 Fix typos
Change-Id: Ib132f2582fce1fb62755926d3f55987ea474ec74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128297
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-01-12 08:08:59 +01:00
Hossein 98eea4c8c7 tdf#146084 Test for languages without hyphenation
Add test for languages without hyphenation. The fix can be tested with:

make CPPUNIT_TEST_NAME="testLanguagesWithoutHyphenation" -sr \
			CppunitTest_i18nlangtag_test_languagetag

It is important to know that Kurdish language consists of different
dialects with differences in hyphenation:

1. Central Kurdish (Sorani): Arabic script, no hyphenation
2. Northern Kurdish (Kurmanji): Latin script, uses hyphenation
3. Southern Kurdish (Xwarîn): Arabic script, no hyphenation

Change-Id: I541281af6de296e57a5ab2dc8254f511787ebda0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128188
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
2022-01-10 13:28:54 +01:00
Eike Rathke 74afdccae5 Convert erroneous kw-UK language tag to kw-GB when encountering
Change-Id: I67a79dab3fac36b494ebc66b81d6d571e2486b1a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124842
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2021-11-08 14:38:55 +01:00
Eike Rathke bae2fbfd34 Resolves: tdf#143946 Add Klingon, tlhIngan Hol {tlh} 0x06AC to language list
Change-Id: Icf7452b2aef3ecae8ccdbcd4a66ab8b121a8120c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120814
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2021-08-21 14:38:35 +02:00
Eike Rathke 6d6119bc4e Unit test for LanguageTagIcu::getDisplayName()
Change-Id: Ibe95fba21ed94be7fb4848f19161d492bc403e4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120798
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
2021-08-21 01:58:16 +02:00
Eike Rathke 46131c5f82 Adapt LCIDs and language tags to [MS-LCID] rev.15
See
https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/70feba9f-294e-491e-b6eb-56532684c37f
https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-LCID/%5bMS-LCID%5d-210625.pdf

and

    commit 402dab839b
    CommitDate: Wed Aug 4 21:21:51 2021 +0200

        update list of [MS-LCID] from 6/25/2021 15.0 rev.

Change-Id: I44db2bfaf894ead119c7014e3770fc44be537148
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120128
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2021-08-06 23:44:49 +02:00
Stephan Bergmann f020784e14 Make loplugin:stringadd slightly more aggressive
...by assuming that all const member functions are side-effect free.  (This
presumably means that some of the special cases in
StringAdd::isSideEffectFree are obsoleted by this more general case, but any
such removal is postponed to later clean-up.)

(Came across this when idly wondering why
8b7f948d9d "sc, VmlFormControlExporter: avoid
OStringBuffer style" had not been found by the plugin before.)

Change-Id: I6bca10df53885b14a590543aabd61f23b3748572
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118675
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-07-09 15:07:05 +02:00
Stephan Bergmann 6b00d0576a Improve loplugin:cppunitassertequal for CPPUNIT_ASSERT(a && b)
...by re-enabling the code temporarily #if'ed-out in
a528392e71 "Fixed/improved
loplugin:cppunitassertequals" (and which then triggers lots of other
lopglugin:cppunitassertequal CPPUNIT_ASSERT -> CPPUNIT_ASSERT_EQUAL warnings).

For two css::uno::Reference equality comparisons in cppu/qa/test_any.cxx, it
was more straightforward to rewrite them with an explicit call to operator ==
(which silences loplugin:cppunitassertequal) than to adapt them to
CPPUNIT_ASSERT_EQUAL's requirement for arguments of identical types.

In sc/qa/unit/ucalc_pivottable.cxx, ScDPItemData needs toString, which has been
implemented trivially for now, but might want to combine that with the
DEBUG_PIVOT_TABLE-only ScDPItemData::Dump.

Change-Id: Iae6d09cf69bd4e52fe4411bba9e50c48e696291c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110546
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-08 09:15:01 +01:00
Noel 8332d6d820 loplugin:stringviewparam include comparisons with string literals
Change-Id: I8ba1214500dddaf413c506a4b82f43d63cda804b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106559
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-30 12:32:14 +01:00
Stephan Bergmann a75d76d202 Upcoming loplugin:elidestringvar: i18nlangtag
Change-Id: I8f910117c7b8a71fdf9c324ea3202b091ee3c046
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95479
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-04 13:55:06 +02:00
Eike Rathke c4f9b1cae7 Related: tdf#125404 alias cmn-CN to zh-CN, cmn-TW to zh-TW
Map 'cmn' Mandarin Chinese with associated country for Simplified
and Traditional to the technically used 'zh' macrolanguage code.

Change-Id: Ifb8a31e728bbf828f13145513bc56a51684ea134
Reviewed-on: https://gerrit.libreoffice.org/73563
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
2019-06-05 23:06:15 +02:00
Gabor Kelemen afb764f83b tdf#42949 Fix IWYU warnings in i18nlangtag/
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I8a40dc89e121bd121c1f90f5636eee65636cad17
Reviewed-on: https://gerrit.libreoffice.org/72014
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-21 09:27:05 +02:00
Eike Rathke f000f9f1a5 Override [sd-IN] with [sd-Deva-IN]
Deva is not listed as Suppress-Script for sd in
https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry

Also, this seems to be what MS expects, see
https://msdn.microsoft.com/en-us/library/cc233965

Change-Id: I974b0032c1c0485135690e68ed0a71c43f2adf6e
Reviewed-on: https://gerrit.libreoffice.org/59217
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2018-08-17 08:26:55 +02:00
Gabor Kelemen bdb0775a26 Add missing sal/log.hxx headers
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it.
This is a continuation of commit 6ff2d84ade to be able to remove those unneeded includes.

This commit adds missing headers to every file found by:
grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG')
to directories from filter to jvmfwk

Change-Id: I2a73d63f2aaef5f26d7d08957daaa8a30b412ac5
Reviewed-on: https://gerrit.libreoffice.org/58204
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-30 09:28:40 +02:00
Noel Grandin 23b0844973 loplugin: look for CPPUNIT_ASSERT_EQUALS with params swapped
idea originally from either tml or moggi, can't remember which

Change-Id: Id78d75035036d3aa1666e33469c6eeb38f9e624d
Reviewed-on: https://gerrit.libreoffice.org/55126
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-01 09:14:25 +02:00
Julien Nabet 1e3a5bb9e9 Use for-range loops in hwpfilter, i18n*, idl* and io
Change-Id: I980464162b73ed9ee0a09acbca1b9050af8d1027
Reviewed-on: https://gerrit.libreoffice.org/51492
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-03-18 11:33:16 +01:00
Stephan Bergmann 6491c1a603 More loplugin:cstylecast: i18nlangtag
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable
loplugin:cstylecast for some more cases" plus
solenv/clang-format/reformat-formatted-files

Change-Id: I4ffae11ad940c0b4248bc6fb8baa86f17b52c203
2018-01-12 20:22:57 +01:00
Eike Rathke 4f2a06379d Unit tests for 'es_ES_u_co_trad' and 'es_ES_tradnl', tdf#83190
Change-Id: Iac2b892f3b3e4146101a99d1febb6110c83e56ed
2017-09-12 16:57:55 +02:00
Eike Rathke 750991d454 Map MS malformed es-ES_tradnl to proper BCP 47 es-ES-u-co-trad, tdf#83190
See
BCP 47 Extension U
https://tools.ietf.org/html/rfc6067
and
http://www.unicode.org/repos/cldr/tags/latest/common/bcp47/collation.xml
http://www.unicode.org/repos/cldr/trunk/common/bcp47/collation.xml

Change-Id: I2b946ab00c2efdc1a877a5e6ce91bc703bcd9db0
2017-09-05 15:41:01 +02:00
Noel Grandin a006f60b6a loplugin:oncevar in helpcompiler..jvmfwk
Change-Id: Ia9b20a8ca95684cbeb21e3425972c43ba50df3cd
Reviewed-on: https://gerrit.libreoffice.org/39187
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-25 17:19:36 +02:00
Noel Grandin c70d49c7c8 use strong_int for LanguageType
Change-Id: If99a944f7032180355da291ad283b4cfcea4f448
Reviewed-on: https://gerrit.libreoffice.org/36629
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-26 08:50:54 +02:00
Eike Rathke b614ceb80c tdf#100462 prefer en-GB-oxendict over en-GB-oed
And make en-GB-oed just an alias of en-GB-oxendict.

Change-Id: I73c1208f85d06360dbd8def0b8d916cddfe59aca
2017-03-14 15:12:49 +01:00
Khaled Hosny 8dc27a0bbf Always enable liblangtag
The license should not be an issue any more since liblangtag now has an
LGPL/MPLv2 dual licence.

Change-Id: I4dfffcccf5d710bd16b21c3254c1449ae041b8ab
Reviewed-on: https://gerrit.libreoffice.org/34511
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
2017-02-24 15:46:41 +00:00
Stephan Bergmann be1d38ba24 loplugin:unnecessaryoverride (dtors) in i18nlangtag
Change-Id: Id7c37e6a1966b4e44184391d9207e390d9c8861d
2016-12-05 09:02:51 +01:00
Martin Hosken 6b35e80419 Fix tdf#103855 add language codes and names to language lists from extensions
Rationale for changes to languagetag.hxx can be found in the bug
tdf#103855.

Change-Id: I7fa7c8a3f7b219ce08df69a3965f544ae156beab
Reviewed-on: https://gerrit.libreoffice.org/30882
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-11-17 17:16:52 +00:00
Miklos Vajna d7ff853a5d i18nlangtag: fix loplugin:cppunitassertequals warnings
Change-Id: I2f7134c8308b68c0a01c83d7f1427d18ec7b164a
Reviewed-on: https://gerrit.libreoffice.org/29584
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-10-07 09:37:57 +00:00
Stephan Bergmann 91dd2db17b loplugin:override: No more need for the "MSVC dtor override" workaround
The issue of 362d4f0cd4 "Explicitly mark
overriding destructors as 'virtual'" appears to no longer be a problem with
MSVC 2013.

(The little change in the rewriting code of compilerplugins/clang/override.cxx
was necessary to prevent an endless loop when adding "override" to

  OOO_DLLPUBLIC_CHARTTOOLS    virtual ~CloseableLifeTimeManager();

in chart2/source/inc/LifeTime.hxx, getting stuck in the leading
OOO_DLLPUBLIC_CHARTTOOLS macro.  Can't remember what that
isAtEndOfImmediateMacroExpansion thing was originally necessary for, anyway.)

Change-Id: I534c634504d7216b9bb632c2775c04eaf27e927e
2016-09-13 13:19:22 +02:00
Eike Rathke 74e9456c6d unit test 'C' locale shall map to 'en-US'
Change-Id: Id4772b087add703537b588c961283466436f10c1
2016-04-21 19:04:00 +02:00
Eike Rathke a2b289c403 Resolves: tdf#73973 it's [crk-Latn-CA] and [crk-Cans-CA]
Change-Id: I0da8562fc378f873e208919999bfc85f30d26778
2016-04-14 14:12:56 +02:00
Wastack 1271eadfac tdf#97966 Drop 'static' keywords
Including no keywords from extern "C" blocks

Change-Id: Id9dd5a53d6ea5134ebb473bd0463f8f42965a211
Reviewed-on: https://gerrit.libreoffice.org/23674
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-04-01 06:45:46 +00:00
Eike Rathke 72c5e230f9 tdf#97315 add Basque [eu-ES] and map [eu] to [eu-ES]
Change-Id: I89641fa82f0d0129aeff0d86a10be26cdc721dfc
2016-01-22 21:50:00 +01:00
Stephan Bergmann 2c975878ff Pass ENABLE_LIBLANGTAG into code via config_liblangtag.h
...so changes to ENABLE_LIBLANGTAG during configure cause proper recompilation
of source code

Change-Id: I282623c885b83e3bf7d94f6f364c5031c012f058
2015-10-14 10:14:18 +02:00
Stephan Bergmann 713dc2fcb4 Fix various warnings in --disable-liblangtag code
Change-Id: I4dbc7ead359fc4cae0ac9d5eb98523590dd8954e
2015-10-14 08:19:00 +02:00
Eike Rathke 122a15f4a6 support en-GB-oxendict additionally to now deprecated en-GB-oed
Have them separated so when saving loaded documents the same tag is used
to keep the generator happy.

When to switch in UI language listbox? Or should we have both entries?

Change-Id: If78600229c4b24f6ee598c25d5a8974fef410bb5
2015-07-10 01:25:01 +02:00
David Tardon b43fde69ca fix langtag test with liblangtag 0.5.7
Change-Id: Ic8639daa5a32cf98fa17903424b00916cb6d8c6f
2015-07-08 09:49:14 +02:00
Stephan Bergmann 70ae9dbda8 More loplugin:simplifybool
Change-Id: I27dab9c717b0b4d38e1273006002ff595ddf4736
2015-04-27 15:30:57 +02:00
Stephan Bergmann 464ff17e71 i18nlangtag: Use appropriate OUString functions on string constants
Change-Id: I0c3a20e1d1273944f1f0f2f886d5d951e916336c
2014-12-18 14:12:27 +01:00
Eike Rathke a31f53d058 add unit test for LanguageTag::isValidBcp47() with bDisallowPrivate
Change-Id: I58089bc00c640bb1d8461d8f482ad623f9566e76
2014-06-03 14:48:46 +02:00
Eike Rathke b8e8c9c471 add unit test for static isValidBcp47() method
Change-Id: Ib234fb1d14087236d337dfe351aea941945e718c
2014-05-21 14:15:24 +02:00
Eike Rathke 2803e5c1e7 document why the test fails and is disabled
Change-Id: I17bb169f14d225b970014ab26a7f1d9d0d1b0af8
2014-04-05 22:12:28 +02:00