Commit Graph
118 Commits
Author SHA1 Message Date
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
Jonathan Clark 44699b3de3 tdf#49885 BreakIterator rule upgrades
This change re-bases the BreakIterator rule customizations on top of a
clean copy of the ICU 74.2 rules.

Change-Id: Iadcf16cab138cc6c869fac61ad64e996e65b5ae4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166273
Tested-by: Jenkins
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-05-09 21:23:50 +02:00
Noel Grandin 43f4c07574 loplugin:ostr in i18npool
Change-Id: I0176d93b38788e28fa42baad293597f98eaa7a21
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167378
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-09 12:48:08 +02:00
Jonathan Clark 14c6cde779 tdf#49885 Updated CJK BreakIterator to use ICU
Previously, the CJK BreakIterator used custom dictionaries for Chinese
and Japanese. This change removes these custom dictionaries in favor of
the upstream ICU implementation, which uses an externally-maintained
frequency dictionary for these languages.

This change also removes support code for dictionary-based break
iterators, as it is no longer used.

Change-Id: I55c4ce9c842d1751997309fd7446e0a6917915dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166136
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-05-03 12:30:59 +02:00
Jonathan Clark 64743ee6bc tdf#49885 Removed custom Thai BreakIterator
Previously, a custom BreakIterator was used for Thai grapheme clusters.
This change deletes the custom BreakIterator, in favor of the ICU
implementation.

Change-Id: Icec94c73a5734c2059786dfbba085f487c488d7c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166156
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
2024-04-20 21:26:06 +02:00
Jonathan Clark fb94cc0d13 tdf#49885 Reviewed BreakIterator customizations
This change completes the review of BreakIterator rule customizations,
and adds unit tests for relevant customizations.

Change-Id: I06678fcccfc48d020aac64dd9f58ff36a763af30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166017
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
2024-04-17 13:27:57 +02:00
Ashwani5009 ea462462db tdf#147021 Replace SAL_N_ELEMENTS with std::size
As part of the efforts in #145538 to replace the SAL_N_ELEMENTS()
macro with std::size() and std::ssize(), this commit performs the
necessary changes for a few files in the i18npool module.

Change-Id: Ic64be31b74cd74faf17497a47d6a15158b85184c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166013
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-04-12 19:54:13 +02:00
Stephan Bergmann 3bbed358b6 Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: i18npool
Change-Id: If3eb4d8fb3068e26ce42c8cc751c2de38b5d04cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158202
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-20 07:06:43 +02:00
Stephan Bergmann b4844c310b Repurpose loplugin:stringstatic for O[U]String vars that can be constexpr
...now that warning about O[U]String vars that could be O[U]StringLiteral is no
longer useful

Change-Id: I389e72038171f28482049b41f6224257dd11f452
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157992
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-15 21:15:49 +02:00
Khaled Hosny f0b87e8162 Require icu-i18n >= 66
We were requiring ICU 4.6 which was released in 2011, and ifdef'ing our
way through newer ICU versions. ICU is a core dependency and it makes no
sense to build LibreOffice with such ancient versions of it.

This change requires ICU 66 (released in 2020), and removes all the
ifdefs for older versions. There are more cleanups to do, but these will
be done separately.

Change-Id: I2e4f7608a08f4d531b0a4c74bbfdf91a451f833f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153387
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-06-21 16:59:20 +02:00
ektagoel12 eb5c14f305 tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macro
Also change some range based for

Change-Id: I2e17feaba7a6b219aa0c9126c5046cf3bdf855d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145988
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
2023-01-31 13:30:53 +00:00
Rene Engelhard 67c577c692 apply ICU test workaround to < 70 to "fix" test with ICU 71
See also 263961306e

Change-Id: Ib64ec43dba59ffddb34fe7f1a0f0d2e589c3455c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133063
Tested-by: René Engelhard <rene@debian.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
2022-04-15 20:23:13 +02:00
Eike Rathke 263961306e Update to ICU 70.1
Unicode 14, 5 new scripts, 12 new Unicode blocks.

In i18npool/qa/cppunit/test_breakiterator.cxx
TestBreakIterator::testLao() had to be disabled/adapted.
Needs to be investigated, see comments there.
As is, Lao script word break has regressions.

Correct UBLOCK_TANGUT_SUPPLEMENT Unicode range endpoint to
0x18D7F, see
https://www.unicode.org/versions/Unicode14.0.0/erratafixed.html
for which ublock_getCode(0x18D8F) now returned UBLOCK_NO_BLOCK and
thus luckily the assert in svx/source/dialog/charmap.cxx hit.

Change-Id: I4bad16ecfab3f44be365b8f884c57f34af68218e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125322
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2021-11-16 20:23:45 +01:00
Stephan Bergmann 6bc8a1ba51 Missing static
...from aa2064c5c5 "Improve
loplugin:stringliteralvar", similar to 8b32a3edad
"Fix stack-use-after-scope" (though this case doesn't appear to have caused any
actual issues).

(After manual inspection, there appear to be no further missing `static` at
least in aa2064c5c5 "Improve
loplugin:stringliteralvar".)

Change-Id: I2b3d0d8d2af1d65f0c5bef8a858107020a620974
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124137
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-25 11:32:02 +02:00
Mike Kaganski a21fa7312c We only support ICU version 4.6 or newer, so drop these checks
The minimal ICU version check is in configure.ac.

Change-Id: Ib6480cd3290dabb45d87c6dcbcc9b5513d172e21
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117119
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-14 15:26:23 +02:00
Stephan Bergmann af16aa6256 Improve loplugin:stringview
Issue the "instead of O[U]String, pass [u16]string_view" diagnostic also for
operator call arguments.  (The "rather than copy, pass subView()" diagnostic is
already part of handleSubExprThatCouldBeView, so no need to repeat it explicitly
for operator call arguments.)

(And many call sites don't even require an explicit [u16]string_view, esp. with
the recent ad48b2b02f "Optimized OString operator
+= overloads".  Just some test code in sal/qa/ that explicitly tests the
O[U]String functionality had to be excluded.)

Change-Id: I8d55ba5a7fa16a563f5ffe43d245125c88c793bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115589
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-05-14 13:11:50 +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
Stephan Bergmann aa2064c5c5 Improve loplugin:stringliteralvar
...to also consider O[U]String ctors taking pointer and length

Change-Id: Iea5041634bfbf5054a1317701e30b56f72e940fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110025
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-01-27 23:24:42 +01:00
Caolán McNamara fc011ac027 drop custom Indic grapheme rules and rely on contemporary icu defaults
similar to...

commit 8578a1c9d1
Date:   Thu Nov 26 15:47:26 2020 +0200

    tdf#138481: Trust the built-in break iterator character data in ICU

    Don't use our own char.txt.

the char_in.txt hasn't really changed since 2008 and is woefully out of
date at this point.

we have cppunit tests for the only documented bug that touched
char_in.txt, #i111152# and tdf#40292, for tdf#40292 change the test
to test what was actually reported as a bug

Change-Id: I8e35b102b0a46d2c63e47e055e472892f65022ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106763
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-28 20:31:29 +01:00
Stephan Bergmann f8f5177805 Reinstate o3tl/cppunittraitshelper.hxx use for C++20
...introduced with 5d8f0fad50 "Adapt
CPPUNIT_ASSERT to C++20 deleted ostream << for sal_Unicode (aka char16_t)" (see
there for details) but erroneously removed with
877f40ac3f "tdf#42949 Fix new IWYU warnings in
directories [h-r]*"

Change-Id: Id22a4c0fdfe1471e2455ec3316f2c6c93cc00b22
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105549
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-10 17:51:53 +01:00
Noel Grandin 242320d303 new loplugin:reducevarscope
Change-Id: Iefe922c2e0d605114d54673d63eccc5e4abd545d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102143
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-10 17:11:00 +01:00
Gabor Kelemen 877f40ac3f tdf#42949 Fix new IWYU warnings in directories [h-r]*
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I886b6f446293d3b1cfbf4ae05e8dbd7fabab9f20
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105510
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-11-10 14:13:14 +01:00
Stephan Bergmann 3d20df43c4 Upcoming loplugin:elidestringvar: i18npool
Change-Id: I5644ca7f2ef1b251ce1c262d3001ca48f2ed9edd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95482
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-04 14:33:50 +02:00
Stephan Bergmann 5d8f0fad50 Adapt CPPUNIT_ASSERT to C++20 deleted ostream << for sal_Unicode (aka char16_t)
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1423r3.html> "char8_t
backward compatibility remediation", as implemented now by <https://gcc.gnu.org/
git/?p=gcc.git;a=commit;h=0c5b35933e5b150df0ab487efb2f11ef5685f713> "libstdc++:
P1423R3 char8_t remediation (2/4)" for -std=c++2a, deletes operator << overloads
that would print an integer rather than a (presumably expected) character.

But for simplicity (and to avoid issues with non-printing characters), keep
printing an integer here.

Change-Id: I751b99ee32d418eb488131ffa130d6f7d6d38dc7
Reviewed-on: https://gerrit.libreoffice.org/84348
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-03 21:18:57 +01:00
Noel Grandin c68be56c29 size some stringbuffer to prevent re-alloc
Change-Id: I385587a922c555c320a45dcc6d644315b72510e9
Reviewed-on: https://gerrit.libreoffice.org/81278
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-23 08:55:00 +02:00
Stephan Bergmann 8b4719c29f Rename OUStringLiteral1 to OUStringChar
It started out as a wrapper around character literals, but has by now become a
wrapper around arbitrary single characters.  Besides updating the documentation,
this change is a mechanical

  for i in $(git grep -Fl OUStringLiteral1); do sed -i -e s/OUStringLiteral1/OUStringChar/g "$i"; done

Change-Id: I1b9eaa4b3fbc9025ce4a4bffea3db1c16188b76f
Reviewed-on: https://gerrit.libreoffice.org/80892
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-17 07:28:49 +02:00
Gabor Kelemen c6b7f5555d tdf#42949 Fix IWYU warnings in i18npool/
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: Ic331c845f0a8f06c4a8f8f79b6f87e26ca7c3a7d
Reviewed-on: https://gerrit.libreoffice.org/72972
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-05-28 12:07:25 +02:00
Khaled Hosny 5dc52ee001 tdf#113694 Fix BreakIterator_CTL surrogate pairs
BreakIterator_CTL in the non CharacterIteratorMode::SKIPCELL mode did
not handle UTF-16 surrogate pairs at all, causing backspace to delete
lone surrogates which is really bad. Just copied the corresponding code
from BreakIterator_Unicode.

Additionally, BreakIterator_th was not correctly skipping non-Thai text
and always treating one character as Thai.

Change-Id: Ia379327e042ff602fc19a485c4cbd1a3683f9230
Reviewed-on: https://gerrit.libreoffice.org/54631
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
2018-05-22 15:38:55 +02:00
Mark Hung 441fded7f7 tdf#96197 do not break Korean words in the middle.
Korean words are composed of Hangul and are separated
by space or newline. This patch improves line breaking
function in CJK break iterator so that it does not
break Korean words in the middle. It now breaks at the
first character of the last Korean word.

Change-Id: I91b20733c0c5ec4755bf68eb0d7c14c42c1f3556
Reviewed-on: https://gerrit.libreoffice.org/42987
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
2017-10-04 12:54:16 +02:00
Noel Grandin e669f70613 loplugin:constparams in i18npool,opencl,svl
Change-Id: I23368c3ce6d29c7b2e758e209e5a8315e82a2818
Reviewed-on: https://gerrit.libreoffice.org/40051
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-18 08:19:59 +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 0e2a6e8ea2 remove some unnecessary use of OUStringBuffer
Change-Id: Ia4e02589d2fe79a27b83200a0e7a528a2c806519
Reviewed-on: https://gerrit.libreoffice.org/38508
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-08 08:45:56 +02:00
Stephan Bergmann fb2013ccb1 loplugin:salunicodeliteral: i18npool
Change-Id: I7307cc96eac5868ed26e8ace1fc3c1a93e1bfec4
2017-04-28 18:26:59 +02:00
Khaled Hosny 55ddbfc610 tdf#106755: Fix script type for combining marks
We are classifying characters in the “Combining Diacritical Marks”
Unicode block with ScriptType::LATIN, but these are combining marks and
can combine with any script and should have been ScriptType::WEAK. Just
removing them from the range in scriptList does the trick as we will
fallback to getting the script classification based on the Unicode
script property.

Change-Id: I3577f4b03360a1c8e094a207f01b6bbb6abbaf30
Reviewed-on: https://gerrit.libreoffice.org/35811
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-03-28 20:02:56 +00:00
Caolán McNamara 7543399f72 coverity#1373441 Side effect in assertion
Change-Id: I10a8298e5379fa93a5d3616202a7802c0eda1cbb
2016-10-06 16:39:43 +01:00
Caolán McNamara 05528a6300 silence coverity#1373441 Side effect in assertion
Change-Id: I1cf7b7d20a0b567c7363c5a9abc5bf1195b57262
2016-10-01 10:27:56 +01:00
Miklos Vajna 6c76ade951 i18npool: fix loplugin:cppunitassertequals warnings
Change-Id: I2ebe54af7b769189e248b1a3af55ee1b6a66174a
Reviewed-on: https://gerrit.libreoffice.org/29399
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-09-30 08:34:53 +00:00
Stephan Bergmann 82b27577d2 loplugin:stringconstant: adapt to improved OUStringLiteral1 (i18npool)
Change-Id: If4bc7dd5af49cca85f474e817cc3cc358c2b48c2
2016-08-30 15:28:17 +02:00
Caolán McNamara 5e46e38269 crashtesting: fix tdf92993-1.docx failure
Change-Id: I76f09a09fd6c3b114ba74737d4a1ba5dad0fd28f
2016-07-22 13:20:07 +01:00
Noel Grandin fcb8df3bcf use uno::Reference::set method instead of assignment
Change-Id: I11822c50fa66d038a3d6f38054ab35c2e613f077
2015-11-04 14:20:51 +02:00
Stephan Bergmann b36963c0a6 Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY code
Change-Id: I2ea407acd763ef2d7dae2d3b8f32525523ac8274
2015-10-12 17:52:29 +02:00
Nathan Wells 10199478b8 Related: tdf#52020 Disable ICU Breakiterator for Khmer
Enabling the ICU Breakiterator causes Khmer spelling checkers to be worthless
as well as wrecks havoc on various minority languages that use the Khmer
script. See this https://bugs.documentfoundation.org/show_bug.cgi?id=52020
this: https://bugs.freedesktop.org/show_bug.cgi?id=59448 and this:
https://bugs.documentfoundation.org/show_bug.cgi?id=59447&redirected_from=fdo

Change-Id: I84529db9cca72ffe1108d2e12c1885f63a48f89d
2015-09-03 12:28:16 +01:00
Takeshi Abe 0a4c482a8a i18npool: tdf#88206 replace cppu::WeakImplHelper*
with the variadic variants.

Change-Id: I0381de7fde198df74556355984bdaba2ecdedd4b
Reviewed-on: https://gerrit.libreoffice.org/17768
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-08-18 07:12:26 +00:00
Stephan Bergmann 346938fa26 loplugin:stringconstant: Flag more inefficiencies
Change-Id: I7ef1dc1d42237ef101731b363359801d9e1e9db6
2015-06-25 12:38:36 +02:00
Stephan Bergmann 70b598ac14 Bring test function lists in sync
Change-Id: Ic91ddc695e9f3c7d8ba4d2bb67c8c84de2a22d5c
2015-05-29 12:14:03 +02:00
Stephan Bergmann 8c8ba8df11 Fix execution of testLao
...which had already been conditional on U_ICU_VERSION_MAJOR_NUM > 51, so
452a06b705 "Activate unit test for Lao
breakiterator support" should merely have extended that #if to the function
declaration/definition in response to loplugin:unreffun, not unconditionally
enabled it.

Change-Id: Ia1ce4e99b4a960b1e70cae0a61b0d526b0353d9a
2015-05-29 12:09:20 +02:00
Caolán McNamara 788b778d16 sal_Int32 as long strikes again
Change-Id: I26abf6d0e102712f76977e0763c4a672434a1325
2015-05-28 13:02:18 +01:00
David Ostrovsky 452a06b705 Activate unit test for Lao breakiterator support
In f24fa8efad added unit test wasn't
activated. Activating it now reveals that the test is failing. Add
TODOs for the failing asserts.

Change-Id: I6c9f36be3aa84a5d5092d2a3f576af39a15b935e
2015-05-28 13:52:46 +02:00
Adolfo Jayme Barrientos d02c15979b Update Apache Bugzilla’s URL
Change-Id: I6ef4ae530b7fb4e615100803ae6e3972d9b4545f
2015-05-19 19:48:11 -05:00
Stephan Bergmann 585807a77e i18npool: Use appropriate OUString functions on string constants
Change-Id: I6f2fabd9248b1b385439ff5c074342029fb660e0
2014-12-18 14:12:28 +01:00