summaryrefslogtreecommitdiff
path: root/lingucomponent
AgeCommit message (Collapse)AuthorFilesLines
11 hourstdf#164006: Only use original word's positions, ignore extra encoded lengthMike Kaganski1-1/+2
The encoding of the string passed to Hunspell/hyphen service depends on the encoding of the dictionary itself. When the usual UTF-8 encoding is used, the resulting octet string may be longer than the original UTF-16 code unit count. In that case, the length of the buffer receiving the positions will be longer, respectively. But on return, the buffer will only contain data in positions corresponding to the characters, not code units (it is unclear if we even need to pass buffer that large). So just as the following loop only iterates up to nWord length, the calculation of hyphen count must use its length, too, not the length of encWord. I suspect that the use of UTF-16 code units as hyphen positions is wrong; it will break in SMP surrogate pairs. The proper would be to iterate code points. However, I don't have data to test, so let it be TODO/LATER. Change-Id: Ieed5e696e03cb22e3b48fabc14537372bbe74363 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177077 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
11 hourstdf#164005: make sure to initialize locales before use of HyphenatorMike Kaganski2-5/+11
Change-Id: I23ab742801ab00b68e4f8c5e7bc415c401e28c37 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177076 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2024-11-08no need to take a copy of the getProcessComponentContext return valueNoel Grandin2-2/+2
we can just take a "const &". (found by running clang-tidy with the performance-unnecessary-copy-initialization warning) Change-Id: I20fd208c65303da78170b1ac06c638fdf3aa094b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176267 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-10-17Optimize a bit: only create std::locale once in parseDudenResponseMike Kaganski1-4/+3
Change-Id: If1aee9fa908b4ad730d858738f3e472a17fd235a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175039 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-10-16tdf#160127: Improve grammar check popups from DudenMike Kaganski1-11/+25
When there is a grammar check error that it has no suggestions for, Duden may return a JSON without suggestions, but still informing about the type of the error, like ... { "offset": 468, "length": 8, "errorcode": 21, "type": "orth", "proposals": [] }, ... Before the change, we underlined the error, but right-clicking it would only bring the normal Writer's context menu, as if there were no error. This was made in commit 7697ef9d8fbbed7afba10c00ff9f5362d0540cdd (Proof reading suggestions:, 2023-11-28); before that change, the context menu was shown, but since it had no suggestions, and no explanation text, it was considered better to just not show the grammar check results. But no menu for an underlined word is no better; so let's instead show the explanation, based on the type of the error reported by Duden - that is stored in SingleProofreadingError::aShortComment. Also set aFullComment, which is used in the grammar check dialog. Incidentally, it even improves popups with suggestions, because it now has the explanation as well, where previously only was an icon without any text. It may be further improved in a follow-up, because there is "errorcode" in the message, which we may use to add more details to the explanation. tdf#160127 should be fixed with this, too; but if there are cases when there are neither suggestions, nor explanation available, it will need further work. Change-Id: I62cde204e0142d6226c9c9486f1cdb5ffc20dca8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175017 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2024-08-18cid#1557699 COPY_INSTEAD_OF_MOVECaolán McNamara1-1/+1
and cid#1557435 COPY_INSTEAD_OF_MOVE cid#1557307 COPY_INSTEAD_OF_MOVE cid#1557209 COPY_INSTEAD_OF_MOVE cid#1557192 COPY_INSTEAD_OF_MOVE cid#1557184 COPY_INSTEAD_OF_MOVE cid#1557183 COPY_INSTEAD_OF_MOVE cid#1557171 COPY_INSTEAD_OF_MOVE cid#1557150 COPY_INSTEAD_OF_MOVE cid#1557148 COPY_INSTEAD_OF_MOVE cid#1557123 COPY_INSTEAD_OF_MOVE cid#1557118 COPY_INSTEAD_OF_MOVE cid#1557116 COPY_INSTEAD_OF_MOVE cid#1557103 COPY_INSTEAD_OF_MOVE cid#1557078 COPY_INSTEAD_OF_MOVE cid#1557075 COPY_INSTEAD_OF_MOVE cid#1557071 COPY_INSTEAD_OF_MOVE cid#1557070 COPY_INSTEAD_OF_MOVE cid#1557067 COPY_INSTEAD_OF_MOVE cid#1557049 COPY_INSTEAD_OF_MOVE cid#1557046 COPY_INSTEAD_OF_MOVE cid#1557042 COPY_INSTEAD_OF_MOVE cid#1557036 COPY_INSTEAD_OF_MOVE cid#1557030 COPY_INSTEAD_OF_MOVE cid#1557024 COPY_INSTEAD_OF_MOVE cid#1557012 COPY_INSTEAD_OF_MOVE cid#1557009 COPY_INSTEAD_OF_MOVE cid#1557008 COPY_INSTEAD_OF_MOVE cid#1557004 COPY_INSTEAD_OF_MOVE cid#1556999 COPY_INSTEAD_OF_MOVE cid#1556992 COPY_INSTEAD_OF_MOVE cid#1556987 COPY_INSTEAD_OF_MOVE cid#1556984 COPY_INSTEAD_OF_MOVE cid#1556981 COPY_INSTEAD_OF_MOVE Change-Id: Id2687aa282f4e2d4b8053b73c7aa1a74a9516b16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171974 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-11cid#1558088 COPY_INSTEAD_OF_MOVECaolán McNamara1-2/+2
and cid#1558080 COPY_INSTEAD_OF_MOVE cid#1558077 COPY_INSTEAD_OF_MOVE cid#1558055 COPY_INSTEAD_OF_MOVE cid#1558043 COPY_INSTEAD_OF_MOVE cid#1558039 COPY_INSTEAD_OF_MOVE cid#1558015 COPY_INSTEAD_OF_MOVE cid#1558014 COPY_INSTEAD_OF_MOVE cid#1558009 COPY_INSTEAD_OF_MOVE cid#1558002 COPY_INSTEAD_OF_MOVE cid#1557998 COPY_INSTEAD_OF_MOVE cid#1557996 COPY_INSTEAD_OF_MOVE cid#1557990 COPY_INSTEAD_OF_MOVE cid#1557986 COPY_INSTEAD_OF_MOVE cid#1557980 COPY_INSTEAD_OF_MOVE cid#1557971 COPY_INSTEAD_OF_MOVE cid#1557968 COPY_INSTEAD_OF_MOVE cid#1557967 COPY_INSTEAD_OF_MOVE cid#1557961 COPY_INSTEAD_OF_MOVE cid#1557959 COPY_INSTEAD_OF_MOVE cid#1557958 COPY_INSTEAD_OF_MOVE cid#1557956 COPY_INSTEAD_OF_MOVE cid#1557953 COPY_INSTEAD_OF_MOVE cid#1557949 COPY_INSTEAD_OF_MOVE cid#1557947 COPY_INSTEAD_OF_MOVE cid#1557940 COPY_INSTEAD_OF_MOVE cid#1557931 COPY_INSTEAD_OF_MOVE cid#1557930 COPY_INSTEAD_OF_MOVE cid#1557915 COPY_INSTEAD_OF_MOVE cid#1557913 COPY_INSTEAD_OF_MOVE cid#1557910 COPY_INSTEAD_OF_MOVE cid#1557886 COPY_INSTEAD_OF_MOVE cid#1557884 COPY_INSTEAD_OF_MOVE cid#1557880 COPY_INSTEAD_OF_MOVE cid#1557875 COPY_INSTEAD_OF_MOVE cid#1557871 COPY_INSTEAD_OF_MOVE cid#1557862 COPY_INSTEAD_OF_MOVE cid#1557847 COPY_INSTEAD_OF_MOVE cid#1557845 COPY_INSTEAD_OF_MOVE cid#1557844 COPY_INSTEAD_OF_MOVE cid#1557843 COPY_INSTEAD_OF_MOVE cid#1557838 COPY_INSTEAD_OF_MOVE cid#1557835 COPY_INSTEAD_OF_MOVE cid#1557834 COPY_INSTEAD_OF_MOVE cid#1557828 COPY_INSTEAD_OF_MOVE cid#1557823 COPY_INSTEAD_OF_MOVE cid#1557817 COPY_INSTEAD_OF_MOVE cid#1557813 COPY_INSTEAD_OF_MOVE cid#1557812 COPY_INSTEAD_OF_MOVE Change-Id: I55d4a920daa2d148683419169eb828325fd3c757 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171732 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-07-22tdf#161858 prevent crashing by catching any JSON exceptionsPatrick Luby1-1/+10
Change-Id: I733ac428c96a96be668d6334db8c71efaf51beff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170818 Reviewed-by: Patrick Luby <guibomacdev@gmail.com> Tested-by: Jenkins
2024-07-20Remove now unneeded osl/diagnose.hGabor Kelemen3-0/+3
followup to commit 57c228803e55ed343c6693de7d0857ad7d3cd9e3 Change-Id: Iebfb23bb65e2bf898bf27f367cc9641f47a14cf3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167998 Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de> Tested-by: Jenkins
2024-06-28languagetool show cURL errors with the interaction handlerSarper Akdemir3-14/+68
Only shows the error once for a given checkerURL. Change-Id: I1873dc09584df33162c93d9d133b12eb8dfede04 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169518 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akdemir@allotropia.de>
2024-05-09loplugin:ostr in lingucomponentNoel Grandin7-19/+20
Change-Id: I1910fd2a7cba63404c37b7bb80b77de2443dd7a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167386 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-04-01tdf#146619 Drop unused 'using namespace' in: lingucomponent/Gabor Kelemen3-3/+0
Change-Id: I98f6edf1da4915ff43312c187e92891371833fc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165533 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-03-20tdf#158885 cui offapi sw xmloff: fix hyphenation at stem boundaryLászló Németh1-3/+3
Add new hyphenation option "Compound characters at line end", equivalent of libhyphen's COMPOUNDLEFTHYPHENMIN, to limit bad pattern based hyphenation of compound words using morphological analysis of Hunspell. * Add checkbox to Text Flow in paragraph formatting dialog window * Store property in paragraph model: css::style::ParagraphProperties::ParaHyphenationCompoundMinLeadingChars * Add ODF import/export (loext:hyphenation-compound-remain-char-count) * Add ODF unit tests Note: slower Hunspell based hyphenation is used only if ParaHyphenationCompoundMinLeadingChars >= 3 (we assume that libhyphen hyphenation patterns cover the smaller distances correctly). Hunpell based hyphenation doesn't introduce new hyphenation breaks, only detects the stem boundaries from the libhyphen based hyphenation breaks. Follow-up to commit c899d3608d30f3ab4c2bc193c1fcd765221614a4 "tdf#158885 sw: don't hyphenate right after a stem boundary", replacing hyphenation zone dependence with the new "Compound characters at line end". Note: preset COMPOUNDLEFTHYPHENMIN values aren't loaded yet from hyphenation dictionaries. Note: the suffix of the last stem of the compound is always hyphenated, i.e. the distance limits only hyphenation inside the stem, not inside its suffix or at the end of the stem before the suffix. Change-Id: I46a0288929a66f7453e3ff97fbc5a0c6a01f038f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164983 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2024-03-06remove deprecated IsGermanPreReform propertyNoel Grandin2-9/+0
deprecated in 2008 (and seemingly never even implemented) Replace the use of this property in sample code and in Java unit tests with another property (I arbitrarily selected "IsIgnoreControlCharacters") Change-Id: I2cb474f895ac221952b59e98bfdbc01012095519 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164355 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-04finish removing IsSpellCapitalisation propertyNoel Grandin2-4/+1
which was partially removed in commit 9bb9ba6ae02692e65498bae4598e3b63bb65c02e Author: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> Date: Mon Oct 2 12:33:34 2023 +0200 [API CHANGE] Remove deprecated IsSpellCapitalization Change-Id: I861c8c484b77a041d91cb25ddeecb7027a2fd96c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164183 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-27Drop std::as_const from css::uno::Sequence iterationsMike Kaganski4-5/+5
Obsoleted by commit 2484de6728bd11bb7949003d112f1ece2223c7a1 (Remove non-const Sequence::begin()/end() in internal code, 2021-10-15) and commit fb3c04bd1930eedacd406874e1a285d62bbf27d9 (Drop non-const Sequence::operator[] in internal code, 2021-11-05). Change-Id: Idbafef5d34c0d4771cbbf75b9db9712e504164cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162640 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-01tdf#158885 sw: don't hyphenate right after a stem boundaryLászló Németh1-0/+181
in compound words to get better typography or orthography with more readable text, if hyphenation zone is enabled. If there are multiple possible break points in the word according to the libhyphen based hyphenation, keep only the best ones using Hunspell morphological data based on compound word decomposition of non-dictionary words (pa: fields), and extra morphological data of dictionary words (hy: fields) or their combination. For readability and tradition, orthography and typography prefer or only allow hyphenation between stems in compound words in several languages, like Danish, Dutch, German, Hungarian, Norwegian and Sweden. Hyphenation zone is to avoid of too much or bad hyphenation. Preferring stem boundaries for hyphenation within the hyphenation zone is a natural extension of it, i.e. skip hyphenation within stems, if there is stem boundary within the hyphenation zone. Now skip break points after skip boundaries, if their distance is 3 or less characters (COMPOUNDLEFTHYPHENMIN = 4). Skip also break points on stem boundaries, if there is a weighted stem boundary before them within 3 characters. Weighted stem boundaries are there between the pa: fields, (stems resulted by the compound word decomposition), or in hy: field, boundaries marked by double || instead of a single |. More information: man (5) hunspell, and option -m hunspell. Note: break points skipped only in the last stems for languages with fogemorphemes, yet, because of their incomplete Hunspell output for morphological analysis. Change-Id: I739908716d11a9c2db0c9d36fba8657ba6f53bee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161498 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2023-12-30cid#1545965 COPY_INSTEAD_OF_MOVECaolán McNamara1-2/+1
and cid#1545849 COPY_INSTEAD_OF_MOVE cid#1545814 COPY_INSTEAD_OF_MOVE cid#1545685 COPY_INSTEAD_OF_MOVE cid#1545583 COPY_INSTEAD_OF_MOVE cid#1545575 COPY_INSTEAD_OF_MOVE cid#1545517 COPY_INSTEAD_OF_MOVE cid#1545474 COPY_INSTEAD_OF_MOVE Change-Id: I79a47ee34dace3a4664bfece26c59e719f469cab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161448 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-23cid#1546006 COPY_INSTEAD_OF_MOVECaolán McNamara1-2/+1
and cid#1545999 COPY_INSTEAD_OF_MOVE cid#1545995 COPY_INSTEAD_OF_MOVE cid#1545994 COPY_INSTEAD_OF_MOVE cid#1545989 COPY_INSTEAD_OF_MOVE cid#1545982 COPY_INSTEAD_OF_MOVE cid#1545977 COPY_INSTEAD_OF_MOVE cid#1545970 COPY_INSTEAD_OF_MOVE cid#1545856 COPY_INSTEAD_OF_MOVE cid#1545845 COPY_INSTEAD_OF_MOVE cid#1545838 COPY_INSTEAD_OF_MOVE cid#1545776 COPY_INSTEAD_OF_MOVE cid#1545774 COPY_INSTEAD_OF_MOVE cid#1545744 COPY_INSTEAD_OF_MOVE cid#1545719 COPY_INSTEAD_OF_MOVE cid#1545716 COPY_INSTEAD_OF_MOVE cid#1545687 COPY_INSTEAD_OF_MOVE cid#1545648 COPY_INSTEAD_OF_MOVE cid#1545643 COPY_INSTEAD_OF_MOVE cid#1545641 COPY_INSTEAD_OF_MOVE cid#1545604 COPY_INSTEAD_OF_MOVE cid#1545531 COPY_INSTEAD_OF_MOVE cid#1545530 COPY_INSTEAD_OF_MOVE cid#1545524 COPY_INSTEAD_OF_MOVE cid#1545516 COPY_INSTEAD_OF_MOVE cid#1545501 COPY_INSTEAD_OF_MOVE cid#1545486 COPY_INSTEAD_OF_MOVE Change-Id: Idcf3e27bb9e81b6a77d5ef75c9376eb1d6aff8c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161245 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-11-23tdf#158117: encode the username sent to LanguageToolMike Kaganski1-7/+7
Change-Id: I762ebb7487b3bcb80cd88b265b4e75c0d8b7c639 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159764 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-11-11Move user agent initialization to InitCurl_easyMike Kaganski1-9/+1
Places that didn't initialize it previously, would benefit automatically Change-Id: I2f1ff25fc58d9378462072bc92d7b37be2370fc8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159299 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-11-08loplugin:stringstatic, lopluign:ostr (clang-cl)Stephan Bergmann1-1/+1
Change-Id: I7a928a2385286f6d1ab3887c8d315af3f47c052d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159135 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-07curl: mitigate migration to OpenSSL on LinuxMichael Stahl1-0/+5
The problem is that curl 8.3.0 removed the NSS backend, so we now have no other choice than to use the bundled OpenSSL on Linux. Currently any curl https connection fails with: CurlSession.cxx:963: curl_easy_perform failed: (60) SSL certificate problem: unable to get local issuer certificate Apparently this requires manually telling curl which CA certificates to trust; there is a configure flag --with-ca-bundle but that is useless as it tries to load the file relative to whatever is the current working directory, and also did i mention that there are at least 3 different locations where a Linux system may store its system trusted CA certificates because ALL ABOUT CHOICE. So add a new header with an init function to try out various file locations listed in this nice blog article and call it from way too many places that independently use curl. https://www.happyassassin.net/posts/2015/01/12/a-note-about-ssltls-trusted-certificate-stores-and-platforms/ TODO: perhaps bundle a cacert.pem as a fallback in case the system chose to innovate by putting its certificates in yet another unexpected place (regression from commit c2930ebff82c4f7ffe8377ab82627131f8544226) Change-Id: Ibf1cc0069bc2ae011ecead9a4c2b455e94b01241 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158915 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-10-22Don't encode the text when sending it to Duden corrector.Gökay Şatır1-3/+3
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com> Change-Id: I9e1a2adede04858e5c43b878786bbcc28922aa5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158023 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> (cherry picked from commit 8989cba47fce3763229005b1ed2fec74da7cfb72) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158333 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-22lok: LanguageTool provides list of languagesSzymon Kłos1-2/+13
- it sends supported list to the LOK client - disables Spell Checker for locales supported by LanguageTool - duden protocol supports only german - initialize language tool config before usage to fetch correct list of supported languages Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146665 Reviewed-by: Henry Castro <hcastro@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153960 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154161 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> (cherry picked from commit 21d0489a5efa970e975ce1a70dfda2fd9e2c186d) Change-Id: Id0f909fbd2cca47e93ed8632217a45b5087c1ecf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158331 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-22Load the locales from config file for languagetoolMert Tumer2-37/+44
Locales needs to be read again in the Preferences/Writing Aids section and since this is a network operation it can cause a problem. Better to list all the supported locales in the xcu and load it right away. Signed-off-by: Mert Tumer <mert.tumer@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135598 Tested-by: Jenkins Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153959 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com> (cherry picked from commit 84bdf9e81a63a8bd308709c86b51bf3900a23c50) Change-Id: Iad9201101aa167ad33f479c67f72649786e1f2cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158330 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-07loplugin:ostr: automatic rewriteStephan Bergmann1-5/+5
Change-Id: I2d09b2b83e1b50493ec88d0b2c323a83c0c86395 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157647 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2023-09-14Fix --disable-curl buildMike Kaganski1-0/+2
Change-Id: I3020d41eb6d0988cc886495a88a073a23bc8161c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156910 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-07-12Revert recent LanguageTool commitsXisco Fauli2-52/+37
Reason for revert: See discussion in https://gerrit.libreoffice.org/c/core/+/154302 - it's causing CppunitTest_sw_layoutwriter2 to fail on Windows. - it's causing CppunitTest_sw_layoutwriter to fail on Linux. - Probably other recent CI failures are also related. - A similar commit was reverted one year ago for similar reasons -> https://gerrit.libreoffice.org/c/core/+/135859 This commit contains the following commits: Revert "lok: remove old hack for LanguageTool locales" This reverts commit 9a5329a266bd74abc4794f1fcbae3db07582dbde. Revert "lok: LanguageTool provides list of languages" This reverts commit 21d0489a5efa970e975ce1a70dfda2fd9e2c186d. Revert "lok: remove duplicated locales for LanguageTool" This reverts commit a0865169ab62508a7b933ed4634defa57b25f7b7. Revert "Load the locales from config file for languagetool" This reverts commit 81b0d9a951c9b15f4f1a76d45d0bd955b4dfc95b. Change-Id: I3dc48097615f510e33e233e868b6b10704d81e67 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154342 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-07-07lok: LanguageTool provides list of languagesSzymon Kłos1-2/+13
- it sends supported list to the LOK client - disables Spell Checker for locales supported by LanguageTool - duden protocol supports only german - initialize language tool config before usage to fetch correct list of supported languages Change-Id: Id9de8519303774163721def8661fa408da449348 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146665 Reviewed-by: Henry Castro <hcastro@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153960 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154161 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2023-07-07lok: remove duplicated locales for LanguageToolSzymon Kłos1-1/+1
Change-Id: I8fd1632f36a6c2c2d61331d6ce5dbd3cce83e2a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146776 Reviewed-by: Henry Castro <hcastro@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153961 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154155 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2023-07-07Load the locales from config file for languagetoolMert Tumer2-39/+43
Locales needs to be read again in the Preferences/Writing Aids section and since this is a network operation it can cause a problem. Better to list all the supported locales in the xcu and load it right away. Signed-off-by: Mert Tumer <mert.tumer@collabora.com> Change-Id: I2ced6789df2a1d6fa2996e2d6b7d2a18e266afac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154154 Tested-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2023-06-07tdf#64830: Don’t require hunspell dictionary for every Arabic localeKhaled Hosny1-1/+11
For old-style hunspell dictionaries, if “ar” dictionary is found, add the rest of Arabic locales for that dictionary’s aLocaleNames, so that distributions don’t have to symlink the dictionary files. This is similar to the fix for macOS spell checking in: Author: Khaled Hosny <khaled@aliftype.com> Date: Tue Feb 7 21:29:12 2023 +0200 tdf#153436: Improve handling of Arabic system spell dictionary on macOS Change-Id: I96b23566cba7b345a10e10c10f1bfe02ce1f8cf3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152706 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-06-04Use getXWeak in lingucomponentMike Kaganski1-1/+1
Change-Id: Icd70dd656d847f595cc1325ed0decb4941a82cde Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150857 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-04-24loplugin:unnecessarygetstr extend to more std::string checkingNoel Grandin3-7/+7
suggested by mike kaganski Change-Id: I5f5f254142767aca45a6101abdd84a0163ca6a34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150936 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-24loplugin:unnecessarygetstr extend to createFromAsciiNoel Grandin1-8/+8
idea from mike kaganski Change-Id: I0ecb9cad091d7a048d2ddae73165bf22748f3872 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150907 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-22Introduce o3tl::toU converting wstring_view to u16string_viewMike Kaganski1-1/+1
Change-Id: I5be9aa767020c2516984e47fcd0f51d4661fdf17 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150779 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-04-21loplugin:unnecessarygetstr extend to checking std::string::c_strNoel Grandin1-1/+1
Change-Id: I17398e2a6a31a2c98ba8e54b5c8045f22aee8759 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150749 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-09Use officecfg instead of SvxLanguageToolOptionsMike Kaganski2-23/+43
Change-Id: Ia9add4ff3ebe20ba491e33de1e9a2644a48ef7a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148548 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-03-09Some refactoring and deduplicationMike Kaganski2-139/+95
Change-Id: I443bd562bc9df6636bf71a230a05a12e443c6614 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148532 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-03-08Add some SAL_WARNs and SAL_INFOsMike Kaganski1-8/+6
These help when debugging the LanguageTool issues. Change-Id: I04bb84dbffc8e4c4e0b353f8e830fe66d8dff576 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148199 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-03-05Fix rtl::createUriCharClass argument (C++20)Stephan Bergmann1-2/+2
Change-Id: Ifb4d8a430adc19d51d07af3ca2aff66a7983224a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148283 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-03-04A bit more of refactoringMike Kaganski2-134/+131
Change-Id: I43dde0375674c4078658a2179108edb5187d2cfc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148257 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-03-04Set useragent for requests to LanguageTool serverMike Kaganski1-0/+13
Use the same string that is used in CurlSession Change-Id: Ia383f2490cf484715f429df09ec80603ca3f9387 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148251 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-03-04Restructure and deduplicate the codeMike Kaganski2-135/+97
Change-Id: Ib8701cbfbe0a025e19c34f0b52e0f67bf728f636 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148250 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-03-04tdf#153617: percent-encode the text sent to LanguageTool API.Mike Kaganski1-6/+20
Change-Id: I0bb55c70f5602444440fca6e3c13b3d75418e49d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148236 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-03-04tdf#153948: LanguageTool: cache the prepared requestMike Kaganski2-18/+20
So that when the same text is re-checked using different settings (e.g., language), the cached result is not used. Change-Id: Ic4ed63c6835f9d3935f1b9541c80822bb52313c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148200 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-03-03lingucomponent: don't get locales from the server when this is disabledMiklos Vajna1-0/+5
Do it like LanguageToolGrammarChecker::doProofreading(), which already checked for this setting. Helps when soffice starts up in an environment without network access and also is pointless. Avoids this warning: warn:languagetool:13511:13511:lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx:508: CURL request returned with error: 28 Which looked odd, given that LT was disabled already. Change-Id: Ideb0c59ad79bdbd7d22acef22e31a43377d30ec1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148166 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-02-15Drop 'using namespace ::std' in dirs [e-p]*Gabor Kelemen1-6/+5
Change-Id: Ibe6a2f662f5721c594d28a8e0d7340d0f3cffe95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147075 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com>
2023-02-07tdf#153436: Improve handling of Arabic system spell dictionary on macOSKhaled Hosny1-1/+13
The system has only a generic “ar” spell dictionary, but LibreOffice wants country code as well. Since it is the same dictionary for all Arabic locales, we now add entries to all Arabic country codes we know about. Change-Id: Iaf5a8f495b3d1023d7fe40654afa0cce3fe9fbdc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146641 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@aliftype.com>