summaryrefslogtreecommitdiff
path: root/include/i18nutil
AgeCommit message (Collapse)Author
2024-09-26tdf#163105 Use HB data while selecting kashida insertion positionsJonathan Clark
Previously, Writer and Edit Engine would skip inserting kashida in words if the highest-priority candidate position is marked as invalid by HarfBuzz. This would happen even if the word contained multiple lower-ranked valid candidate positions. This change updates Writer and Edit Engine to pass HarfBuzz kashida position data to the selection algorithm. The algorithm has been updated to return the highest-priority valid position, if any. The algorithm has also been updated to use raw positions marked as valid by HarfBuzz as a fallback, if no better positions could be found. Change-Id: I40c6432c4607aee197e8767e5667db504469956a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173963 Tested-by: Jenkins Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
2024-09-25tdf#163105 Consolidated duplicated kashida justification codeJonathan Clark
The kashida candidate position selection logic was copied-and-pasted from Writer into Edit Engine. This change consolidates the shared code into a library. This change also adds some minimal characteristic tests, which previously did not exist. Change-Id: I2bfbfa79858347803474b754566436f3e74d1a54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173883 Reviewed-by: Jonathan Clark <jonathan@libreoffice.org> Tested-by: Jenkins
2024-08-28Drop newly unused ToggleUnicodeCodepoint::CharsToDeleteMike Kaganski
Change-Id: I25654d911b1cc11f8c0e7d0ef3e87898418c3408 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172535 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-08-28tdf#162657: re-check the result of combining surrogatesMike Kaganski
They may constitute a combining mark, and require more characters to the left to be processed. Change-Id: Ie626badf66edaf44c56e0ba2d294304f139d2bca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172533 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-05-14use more string_view in i18nutil::PaperInfoNoel Grandin
Change-Id: I54e75c14b7dbfbfb03e827b5c6167f1256f2733e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167628 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2023-09-23tdf#146619 Recheck include/[e-j]* with IWYUGabor Kelemen
Change-Id: I705becd4618989ca274ca8c42eeff3bc18a4ae76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156986 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com>
2023-07-25i18nutil: Make unicode::getUnicodeType() take a UTF-32 code pointKhaled Hosny
Still need to fix call sites to handles surrogate pairs. Change-Id: I3ba896714fc6a90596c041148a3c9d965f60f4a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154874 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-06-28Drop i18nutil::SearchOptionsMike Kaganski
It was mostly unused by now, only remained in a couple of function arguments, where callers actually passed SearchOptions2, and where internally it was converted back to SearchOptions2. Change-Id: Ib188ec3bf0de6d1f70a04eb90fb3a577df8b3d98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153687 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-06-23Remove recently unused unicode::isCJKIVSCharacter()Khaled Hosny
Change-Id: I7d41657e2611aa66303f9315ff6e36a8e08d8688 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153453 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-06-23Improve and rename unicode::isIVSSelector()Khaled Hosny
Check Variation_Selector Unicode property instead of hard-coding variation selector classes. This now handles also Mongolian Variation Selector. Change-Id: I2dd5c4770d7bb9bf4c1e9edc43926fe0863b0da7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153460 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-05-29Remove recently unused CTLScriptType codeKhaled Hosny
This is now unused after: commit 98f7ec383db74a6491e925e30125d3fbf270afc2 Author: Khaled Hosny <khaled@libreoffice.org> Date: Sun May 28 16:28:52 2023 +0300 tdf#139863, tdf#155514: Don’t split COMPLEX text portions The code is also broken as it doesn’t handle surrogate pairs. The UNO API now throws an exception. Change-Id: I454ed741e3834e762a2731d671c21a3e73515da3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152359 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: خالد حسني <khaled@libreoffice.org>
2022-11-30tdf#104597 related: restore the mirroring of Bidi_Mirrored charactersKevin Suo
The method PDFIProcessor::mirrorString() was removed, and ::comphelper::string::reverseString was used, by Kevin Suo in commit 69e9925ded584113e52f84ef0ed7c224079fa061. The old PDFIProcessor::mirrorString() did two things: 1) Reverse the code points in the string. However, due to its use of iterateCodePoints(&i) rather than iterateCodePoints(&i, -1) (i.e. iterating in forward rather than reversed order), the reverse was not functioning at all. 2) Use GetMirroredChar (i.e. the icu unicode u_charMirror() which was dropped in commit 720a093461aadff044ac0b1b7b45cf3d416b3785) to get the mirrored-image of characters with the Bidi_Mirrored properties. Stephan Bergmann restored the #1 in commit 50d73574b6c3d71f9a539c895a15d6fcda22390b (by introducing comphelper::string::reverseCodePoints). However, the #2 was not restored. I do not see a clear reason to drop #2 (at least this is an area I don't quite familiar with), so it's better to restore it as well, in *this* commit, named as SubstituteBidiMirrored. Change-Id: Ic263097938310e6e04f3b95bb12e4f4e834198f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143041 Tested-by: Jenkins Reviewed-by: Kevin Suo <suokunlong@126.com>
2022-10-05Introduce unicode::getScriptClassFromLanguageTag()Eike Rathke
Change-Id: Ifb932ff2aabc5767571433627314f0b29c35c471 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140953 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-05-19clang-tidy modernize-pass-by-value in i18nutilNoel Grandin
Change-Id: Ia0457c81ee1da2a88a8238a1a1d65354c1b639bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134533 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-11use more string_viewNoel Grandin
found by tweaking the loplugin:stringview and making it whitelist getLength Change-Id: Ic41cd4e3026d93b70a76fe1279c6de3abbe6b4a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132820 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-01Fix typosAndrea Gelmini
Change-Id: I9a98bac7c570f25ff7d77df98e93aaeed2665038 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130720 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-02-25tdf#145759 30.6001 -> monthDaysWithoutJanFebHossein
30.6001 shows month days without Jan and Feb. According to the below link, it is calcuated as (365-31-28)/10 = 30.6 but because of a floating point bug, it was used as 30.6001 as a workaround. "30.6001, 25 year old hack?" https://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv011.cgi?read=31650 The value 30.6 is used as i18nutil::monthDaysWithoutJanFeb here instead of 30.6001. The new value is ~30.60000038 which is > 30.6, so the calculations should be correct. In order to make sure, a unit test is added, and part of the values are checked against the values calculated by this website: Julian Day and Civil Date Calculator https://core2.gsfc.nasa.gov/time/julian.html Change-Id: I8cc7e046514dc3de652a1c37399e351cb2b614dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125813 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2021-11-02Add comments to two arrays mentioning that they must match the enum PaperTor Lillqvist
At least I think they must. Also add a comment to the enum pointing at those arrays. There are now four different places in four files that must be manually kept in sync. Quite possibly more. This stinks. Change-Id: I7b5c721329c69a16b8cdf07390d481ec77c7b5ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124610 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2021-10-14[API CHANGE] Fix all bad UNOIDL identifiers across offapiStephan Bergmann
Identifiers containing underscores must start with an uppercase letter. (So that the UNO implementation can use identifiers containing underscores and starting with a lowercase letter for internal purposes, see e.g. the static_type member functions in the C++ *.hdl files. idlc checks that with the -cid option, while unoidl-write silently allows bad identifiers for now, see the TODO in unoidl/source/sourceprovider-scanner.l, which can be dropped after this change.) All of the affected identifiers were present since early OOo times, but none of them appear to be used much, at least not across LO itself, so there is hope that we can get away with these incompatible changes. (For the constant group members, we could roll this out in two steps, introducing the new members alongside the old ones and deprecating the old ones in a first step, then removing the old, deprecated ones in a second step, so that third-party code would have more time to adapt. But that would not work for the enum members and interface methods, so just do all of this in one breaking step.) udkapi happened to not contain any bad identifiers. Change-Id: If2d4c16563606f9efb48b937c76af54746377428 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121725 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-09-17improve commentNoel Grandin
Change-Id: I12a29b08f5807bcb6e0a5b6e8bc5fc0f08462e44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122197 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-16speedup CharacterClassificationImpl::toUpperNoel Grandin
remove empty sequence creation in CharacterClassificationImpl::toUpper, rather pass a pointer, so it can be nullptr. Which results in a fair degree of cascading change. Change-Id: Ie56d49dc71480195c1807764b0d5124f0019f30b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122183 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-01clang-tidy:readability-redundant-member-initNoel Grandin
Change-Id: I78339f1df1f0c55c7edaa552940b07d1ada3aeb5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121386 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-13Add PowerPoint compatible screen size for ImpressJun NOGATA
I realized that Impress does not have the same screen size as PowerPoint. tdf#142286, tdf#142288 When I load a PowerPoint slide into Impress, it was a custom size, but when I add this screen size, it shows up with the screen size name. And when I load a slide with the added screen size into PowerPoint, it also shows up with the PowerPoint preset screen size name and not the custom size. The screen sizes I have added are as follows * Widescreen (Current PowerPoint default) * On-scren Show (4:3) * On-scren Show (16:9) (Google slide defualt) * On-scren Show (16:10) Change-Id: I33e2bbc36b2c92ecbb85c610c864f735bf540d03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116374 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-22tdf#135590 rotated paper sizes reported as portrait size they are notCaolán McNamara
since... commit ff4896a2af1df6138e9246fe1588dfe8c3748f1a Date: Fri Jun 29 11:36:03 2018 -0300 Sets paper sizes listbox in print dialog see as the above commit added some uses of doSloppyFit to vcl I imagine the calls there want to be able to match rotated paper sizes, but in the cases of tdf#135590 we don't want that behaviour because it doesn't match what the user is presented with, the width and height are swapped. So drop matching against swapped height/width by default, but let calls added in 'Sets paper sizes listbox in print dialog' continue to match rotated sizes. Change-Id: I34aeddf12a7ca22234fbc6394487d3c8da7772ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109784 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-21tdf#123936 Formatting files in module include with clang-formatPhilipp Hofer
Change-Id: I0507dd797cd5a35e0ae14f4b69ee4e172d08a71a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105681 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Jenkins
2020-11-17loplugin:stringviewparam check methods tooNoel
not just functions Change-Id: Icca295dd159002b428b73f2c95d40725434f04d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105789 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-04negative returnsCaolán McNamara
Change-Id: I6f710f1aecc2e242b6006a3360e31bf2a9438fe7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105286 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-10-22long->tools::Long in hwpfilter..ooxNoel
Change-Id: I9ab8876aac7b2f8b488db6dfa9c6fd0cecd2238b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104626 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-03use more compact namespace syntax in /includeNoel Grandin
excluding the UDK headers of course Change-Id: Iac7ab83d60265f7d362c860776f1de9d5e444ec0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93268 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-06mark some more classes hidden in --enable-mergelibs modeNoel Grandin
and speed up the script using python's multiprocessing module Change-Id: I01e1350937a0531e26603d6357982c91f3bcef0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90107 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-19make some classes module-privateNoel Grandin
Change-Id: I53809ab01d5e8eb091305c3cb618a64920ad22ad Reviewed-on: https://gerrit.libreoffice.org/82783 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-23Fix typoAndrea Gelmini
Change-Id: I1881e2c8cdccf9c020ed52d2e90689e6a02791b5 Reviewed-on: https://gerrit.libreoffice.org/75561 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2019-06-12Move isIVSSelector, isCJKIVSCharacter to i18nutil/unicode.hxxStephan Bergmann
6a7db071c75609093fc3a9cbc297b8069726a33e "tdf#125497 allow backspace to remove CJK IVS" had moved these functions from sw/source/uibase/wrtsh/delete.cxx to rtl/character.hxx, but the latter appears to be a less than ideal home for them: For one, it is part of the stable URE interface, which makes it harder to maintain (e.g., later versions of Unicode have added CJK Extension C--F code blocks, which the current implementation of isCJKIVSCharacter does not reflect). And for another, besides details of legacy/ubiquitous ASCII, it only deals with the "hard" structure of Unicode (isUnicodeCodePoint, isSurrogate, etc.), not with any specific code blocks or character classifications (which can change over time). Internal i18nutil/unicode.hxx appears to be better suited. Change-Id: I88b3e4e2488411f988c1a20f79b8a58626d93dce Reviewed-on: https://gerrit.libreoffice.org/73873 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-20Fix typo in codeAndrea Gelmini
It passed "make check" on Linux Change-Id: I577f6ff01e8216ed85556ce4b3365fd924f75608 Reviewed-on: https://gerrit.libreoffice.org/65468 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-11-29Adds 16k papers to print files in vcl and paper files in i18nutilDaniel Silva
Change-Id: Iacb5903e1a51134b65836f33948a1cf5cfc3af0d Reviewed-on: https://gerrit.libreoffice.org/57832 Tested-by: Jenkins Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
2018-11-07tdf#42949 Fix IWYU warnings in include/i18nutil/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Icc3cb8118b225c9b19b451b2a6463c844ef4162d Reviewed-on: https://gerrit.libreoffice.org/62459 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-10-31loplugin:useuniqueptr in oneToOneMappingWithFlagNoel Grandin
Change-Id: I729d6640c105ca43fdd2e3e702f6f62876db75e5 Reviewed-on: https://gerrit.libreoffice.org/62647 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-18loplugin:staticvar in hwpfilter..salNoel Grandin
Change-Id: I8bf3509637cb295847e0dd667c1862269a192bbe Reviewed-on: https://gerrit.libreoffice.org/61881 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-27fix thread-unsafe return of a reference to a staticLuboš Luňák
The Mapping struct is small, so there's no need to reuse it. Without this, sc/qa/.../sumif_wildcards.fods sometimes fails with calc threading. Change-Id: If1f370bebe8e1afa14f8645d843a056b6f0dbdea Reviewed-on: https://gerrit.libreoffice.org/56449 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2018-03-07Clarify that IGNORE_DIACRITICS_CTL is not only CTL, despite its nameEike Rathke
Change-Id: I5954094131debb7cdf0fc44a9db3a3609b356baf
2018-01-24loplugin:unused-returns in drawinglayer..svxNoel Grandin
Change-Id: I033a78cc7fe7d8e5086f1c855c4aa371cc98dc7c Reviewed-on: https://gerrit.libreoffice.org/48400 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-15More loplugin:cstylecast: i18nutilStephan Bergmann
Change-Id: Ibdfec3e35c6424fdd4d9b15ff4f4d7441a5f7e36
2018-01-12More loplugin:cstylecast: i18nutilStephan Bergmann
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: Idca83b62766c2de87bf112cf0bb565e953b7dcb0
2017-12-13Make loplugin:salcall look into macros tooStephan Bergmann
"Indirect" calls to isSallCallFunction (for canonic and overridden FunctionDecls) already needed to handle many cases of FunctionDecls spanning macros, so it isn't that much more work to make that also work for cases called directly from VisitFunctionDecl. Change-Id: I529f148c8872b86aa1ef082c6cb73db8ab1866e7 Reviewed-on: https://gerrit.libreoffice.org/46367 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-07loplugin:salcall handle static methodsNoel Grandin
Change-Id: Id6820abec4b8ca8bee26d62b333fd30b42a14aec Reviewed-on: https://gerrit.libreoffice.org/46007 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-11Remove duplication of Paper enum as #definesTor Lillqvist
Not needed any more. We still have the fragile requirement that the order of entries in the aDinTab array in i18nutil/source/utility/paper.cxx has to match the enum order. Change-Id: I858fd56ad6bb1a3f3c2c39f7830b4dc6aea7cc1f Reviewed-on: https://gerrit.libreoffice.org/44600 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2017-11-01loplugin:finalclasses in h*,i*,j*Noel Grandin
Change-Id: I3b5f319a88dbe6a9c2ffbfdf991345beda9a2fcd Reviewed-on: https://gerrit.libreoffice.org/44154 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-23loplugin:includeform: i18nutilStephan Bergmann
Change-Id: I47bdf2dc7f8f282136e320a660a5c4ef44ea0baa
2017-10-04move stuff in i18npool/i18nutil in own namespaceNoel Grandin
instead of trying to share the css::i18n namespace, which is just very confusing and should be left to actual UNO artifacts Change-Id: I2f5c36bf1af9a2a98c4f997dd450d015e75ed3f6 Reviewed-on: https://gerrit.libreoffice.org/43079 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-17loplugin:constparams in i18nutil,sotNoel Grandin
Change-Id: I8e91b11baa855b1049130746b34f53158010948b Reviewed-on: https://gerrit.libreoffice.org/40050 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>