Commit Graph
127 Commits
Author SHA1 Message Date
Stephan Bergmann 2c6f5a5b68 More loplugin:cstylecast: i18npool
Change-Id: Iafdc3593b7136f24e741dc63e3c46344636154eb
2018-01-15 09:05:03 +01:00
Stephan Bergmann 726f3ed546 More loplugin:cstylecast: i18npool
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: I5ca5f27425c150f58e5ec3f2392dda43a857fc33
2018-01-12 20:22:23 +01: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
Noel Grandin 5676ced825 make UNO enums scoped for internal LO code
this modifies codemaker so that, for an UNO enum, we generate code
that effectively looks like:

   #ifdef LIBO_INTERNAL_ONLY && HAVE_CX11_CONSTEXPR
       enum class XXX {
           ONE = 1
       };
       constexpr auto ONE = XXX_ONE;
   #else
      ...the old normal way..
   #endif

which means that for LO internal code, the enums are scoped.

The "constexpr auto" trick acts like an alias so we don't have to
use scoped naming everywhere.

Change-Id: I3054ecb230e8666ce98b4a9cb87b384df5f64fb4
Reviewed-on: https://gerrit.libreoffice.org/34546
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-04 06:38:03 +00: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
Stephan Bergmann 2a176fddc5 Blind fix for 32-bit builds
Change-Id: I056fe8fb3e6b87ecae4e07f757c1a9588bbb1c06
2017-03-01 09:15:47 +01:00
Noel Grandin 4c09fc48e9 typesafe wrappers for css::i18nutil::TransliterationModules
and related css::util::SearchOptions2

The TransliterationModules enum has it's constants spread over multiple
UNO enum/constant-collections - TransliterationModules and
TransliterationModulesExtra, which means that most code simply uses
sal_Int32.

Wrap them up into a better bundle so that only the lowest layer needs to
deal directly with the UNO constants.

Change-Id: I1edeab79fcc7817a4a97c933ef84ab7015bb849b
Reviewed-on: https://gerrit.libreoffice.org/34582
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-01 07:28:03 +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
Eike Rathke 5291e4826a unit test for tdf#99468
Change-Id: I833ad2779d0eda6f5183b2dd062dffaa410a7937
2016-04-24 16:42:39 +02:00
Eike Rathke 1f3357013b SearchFlags::WILD_MATCH_SELECTION, SearchOptions2::WildcardEscapeCharacter
At least '\' (search in Word) and '~' (search in Excel) should be
supported as escape character.

Being able to restrict a match to entire selection instead of substring
speeds up the Calc match whole cell scenario.

Change-Id: Ice242b9cd59009f172b724e03c2cc08feda4cd3c
2016-02-23 23:25:15 +01:00
Eike Rathke 8fd8a8875d wildcard search unit tests, tdf#72196
Change-Id: Ifa23592f5e72438267926acf89c113a69a7f0ca0
2016-02-17 21:17:08 +01:00
Mike Kaganski 4cf1d290ba tdf#94810: fix reverse offset mapping
With simple transliteration, TextSearch::searchForward used to use
whole string to perform the search, then started to create substring
to search. But it left the precautions from
commit c00601dab0 by Eike Rathke:
searching for $ may actually return a result set pointing behind the
search string which it does with the ICU regex engine.
The precaution made it to skip reverse mapping if index was 0.

Commit 9aae521b45 by Michael Stahl
didn't consider the case when nStop is 0, and startPos > 0. Then it
tried to get offset[-1].

Anyway, using value of startPos in those conditions seems illogical.

Removed those precautions (and made assertions for that).
Fixed handling zero indexes.

Change-Id: I2066abc51fff7fb7323bc7f6198bdea06439d4f3
Reviewed-on: https://gerrit.libreoffice.org/19840
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2015-11-23 19:03:32 +00: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 91957a75aa loplugin:cstylecast: deal with those that are (technically) const_cast
Change-Id: I5bad1428e96c76f7d295f69e10beea4397d560ff
2015-06-02 11:27:00 +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
Caolán McNamara 6e225b41f1 Resolves: fdo#55707 Word count incorrect if language is set to Finnish
Change-Id: I283dddaa4bd8baf05b90ce5f81d43b785021a3c4
2014-05-12 17:08:24 +01:00
Michael Meeks 69a74afb07 Avoid expensive dlopen thrash for break iterators.
Change-Id: I770c1b3e5164cb486b5a5c2b1259f713914a1bae
2014-05-12 10:56:33 +01:00
Stephan Bergmann 70cc2b191b First batch of adding SAL_OVERRRIDE to overriding function declarations
...mostly done with a rewriting Clang plugin, with just some manual tweaking
necessary to fix poor macro usage.

Change-Id: I71fa20213e86be10de332ece0aa273239df7b61a
2014-03-26 16:39:26 +01:00
Rohit Deshmukh d8fd158759 fdo#72219: Fix for corruption of symbols in docx
Issue:
OUString uses UTF-16, so for a Unicode surrogate character there are 2
values stored, not just 1.
So we are getting assert failure in "rtl_uString_iterateCodePoints" method.

erAck: Underlying cause was that the dictionary breakiterator misused UTF-16 positions as Unicode code point positions.

Change-Id: I923485f56c2d879b63687adaea2b489a3479991c
Reviewed-on: https://gerrit.libreoffice.org/6955
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2014-01-08 19:38:45 +00:00
Tomofumi Yagi 7d3999f2f2 Remove UTF-8 comment.
This breaks windows build with localized versions of MSVC.

Change-Id: I23c46830f96ae661eced88352476e7ae61fbcc2a
Reviewed-on: https://gerrit.libreoffice.org/6847
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2013-11-28 23:30:54 +01:00
Noel Grandin 1730df0127 remove unnecessary RTL_CONSTASCII_STRINGPARAM in OString::append
Convert code like:
   aOStringBuf.append( RTL_CONSTASCII_STRINGPARAM( " is missing )") );
to:
   aOStringBuf.append( " is missing )" );
which compiles down to the same code.

Change-Id: I3d8ed0cbf96a881686524a167412d5f303c06b71
2013-11-20 10:07:32 +02:00
Noel Grandin 610b2b94b3 remove unnecessary use of OUString constructor when assigning
change code like
   aStr = OUString("xxxx");
to
   aStr = "xxxx";

Change-Id: Ib981a5cc735677ec5dba76ef9279a107d22e99d4
2013-11-19 10:29:31 +02:00
Andras Timar 1ba111343e bugs.freedesktop.org -> bugs.libreoffice.org
Change-Id: I56c1190c93333636981acf2dd271515170a8a904
2013-11-17 08:33:01 +01:00
Robert M Campbell f24fa8efad Add Lao breakiterator support for selecting and counting Lao words.
Change-Id: I6da721dc25394dfee12e3028aefbf0546d1be984
Reviewed-on: https://gerrit.libreoffice.org/6669
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2013-11-13 16:25:58 +00:00
Noel Grandin e52779d2f8 remove unnecessary use of OUString constructor
Change-Id: Ifb220af71857ddacd64e8204fb6d3e4aad8eef71
2013-11-11 11:21:26 +02:00
Marcos Paulo de Souza bcb51cff22 fdo#63020: Replace ::comphelper::stl_begin()...
And use some templates inside include/com/sun/star/uno/Sequence.hxx

Change-Id: I48875fa1517751fc4cb0cf2b6c08b88975a29b47
Reviewed-on: https://gerrit.libreoffice.org/6599
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2013-11-07 10:43:34 -06:00
Noel Grandin 0e6a2601b3 Convert code that calls OUString::getStr()[] to use the [] operator
This also means that this code now gets bounds checked in debug builds.

Change-Id: Id777f85eaee6a737bbcb84625e6e110abe0e0f27
2013-11-04 08:06:10 +02:00
Caolán McNamara 9d5b07b908 Related: fdo#69641 add a regression test
Change-Id: Icf3324a224d02425acd679a286f3c4a0b7e3ed1c
2013-10-28 15:52:30 +00:00
Caolán McNamara 76e735b26a enable building against RHEL-6 system icu
Change-Id: I56f08d58d8d8a0e397412580451c90f9605bcb46
2013-08-30 17:30:01 +01:00
Michael Meeks 03993b47c5 targetted clean of redundant header piece from 62badf3828
Change-Id: Ic1240114d667fb7797afae4847427cc889f3cb48
2013-07-26 14:18:52 +01:00
Mark Wielaard addc791623 Fix icu version checks.
commit 30c303 "Make charmap.cxx compile with icu >= 4.4." was incomplete
and had wrong version checks. After ICU 4.8 (4.8.1.1) the next version
of ICU was 49 (49.1) so U_ICU_VERSION_MAJOR_NUM contains two digets (49),
earlier that it was just one digit (4). The correct header to include to
do version checks is unicode/uversion.h. USCRIPT_MANDAEAN is the old
alias of USCRIPT_MANDAIC (same numeric value). U_JG_FARSI_YEH is only
available since ICU 4.4. Note that on older icu versions (4.2.1) the
200B (ZWSP) Zero Width Space breakiterator testcase fails (others
succeed).

Change-Id: If73c1402239a28546077437e9382f0bd38642bad
Reviewed-on: https://gerrit.libreoffice.org/4139
Reviewed-by: Luboš Luňák <l.lunak@suse.cz>
Tested-by: Luboš Luňák <l.lunak@suse.cz>
2013-06-03 11:16:37 +00:00
Luboš Luňák e2e2cc6114 remove usage of RTL_CONSTASCII_USTRINGPARAM
Mechanical removal of usage together with OUString ctor, done
by compiler plugin.

Change-Id: I554227f76df0dac620b1b46fca32516f78b462c5
2013-05-06 16:51:45 +02:00
Michael Meeks 62badf3828 Move to MPLv2 license headers, with ESC decision and author's permission. 2013-04-22 09:37:38 +01:00