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
with large property maps, even a binary search starts
showing up, but we can do a O(1) search here by using a map
Change-Id: Ie7916076073e6dd393f0a1fb5a0db1b973999408
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171173
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Use the correct typographic (curly) apostrophe instead of the
obsolete straight (typewriter or ASCII) apostrophe.
Follow-up to commit e6fade1ce1
"tdf#38395 enable smart apostrophe replacement by default" and
commit 8de1941fe6
"tdf#150582 linguistic: fix always rejected words with U+2019 apostrophe".
Change-Id: Ic0e9aabcce7e95703601dd74e039f2838c89c769
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169087
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
During spell checking, words added to the user dictionaries still
weren't recognized by Calc, Impress and Draw because of the unnecessary
conversion their typographic apostrophes to ASCII apostrophes.
Note: Writer has no such problem because of its (obsolete) apostrophe
conversion for the user dictionary.
First skip the obsolete apostrophe conversion in isValid(), but keep
it as a fallback for Writer users.
Change-Id: I09870a35d7a91017281ba4b228d338336e7bd9c1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168858
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
This reverts commit 829fa53fe8, which started all
sorts of `make check` tests to hang for me due to a recursive locking attempt in
> #5 std::mutex::lock (this=0x7f6af81e62c0) at ~/gcc/inst/include/c++/14.0.1/bits/std_mutex.h:113
> #6 std::unique_lock<std::mutex>::lock (this=<synthetic pointer>) at ~/gcc/inst/include/c++/14.0.1/bits/unique_lock.h:147
> #7 std::unique_lock<std::mutex>::unique_lock (this=<synthetic pointer>, __m=...) at ~/gcc/inst/include/c++/14.0.1/bits/unique_lock.h:73
> #8 GrammarCheckingIterator::NextDocId (this=0x7f6af81e6260) at linguistic/source/gciterator.cxx:317
> #9 GrammarCheckingIterator::GetOrCreateDocId (this=this@entry=0x7f6af81e6260, xComponent=uno::Reference to (SwXTextDocument *) 0x7f6af8430ec8) at linguistic/source/gciterator.cxx:339
> #10 0x00007f6b3b9e9da9 in GrammarCheckingIterator::startProofreading (this=0x7f6af81e6260, xDoc=<optimized out>, xIteratorProvider=<optimized out>) at linguistic/source/gciterator.cxx:773
> #11 0x00007f6b16441ec3 in SwDoc::StartGrammarChecking (this=<optimized out>, bSkipStart=bSkipStart@entry=false) at sw/source/core/doc/docnew.cxx:180
> #12 0x00007f6b164c4eae in sw::DocumentTimerManager::DoIdleJobs (this=0x7f6afad005a0) at sw/source/core/doc/DocumentTimerManager.cxx:169
> #13 0x00007f6b3e83a68b in Scheduler::CallbackTaskScheduling () at vcl/source/app/scheduler.cxx:509
> #14 0x00007f6b3eb1725f in SalTimer::CallCallback (this=<optimized out>) at vcl/inc/saltimer.hxx:54
> #15 SvpSalInstance::CheckTimeout (this=this@entry=0xffebe0, bExecuteTimers=bExecuteTimers@entry=true) at vcl/headless/svpinst.cxx:157
> #16 0x00007f6b3eb1761d in SvpSalInstance::ImplYield (this=this@entry=0xffebe0, bWait=bWait@entry=true, bHandleAllCurrentEvents=bHandleAllCurrentEvents@entry=false) at vcl/headless/svpinst.cxx:395
> #17 0x00007f6b3eb17cd5 in SvpSalInstance::DoYield (this=0xffebe0, bWait=<optimized out>, bHandleAllCurrentEvents=<optimized out>) at vcl/headless/svpinst.cxx:467
> #18 0x00007f6b3e86aa44 in ImplYield (i_bWait=true, i_bAllEvents=false) at vcl/source/app/svapp.cxx:394
> #19 0x00007f6b3e86b13b in Application::Execute () at vcl/source/app/svapp.cxx:369
> #20 0x00007f6b3c8e715f in desktop::Desktop::Main (this=0x7ffe5e22fcb0) at desktop/source/app/app.cxx:1615
> #21 0x00007f6b3e87e6fb in ImplSVMain () at vcl/source/app/svmain.cxx:229
> #22 0x00007f6b3e87e9c5 in SVMain () at vcl/source/app/svmain.cxx:261
> #23 0x00007f6b3c91de37 in soffice_main () at desktop/source/app/sofficemain.cxx:93
> #24 0x000000000040078b in sal_main () at desktop/source/app/main.c:51
> #25 main (argc=argc@entry=8, argv=argv@entry=0x7ffe5e22feb8) at desktop/source/app/main.c:49
Change-Id: I60b8b0ba00cae691d6089325e4379a86221dc95b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165764
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
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 c899d3608d
"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>
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>
Necessary to do this before forking on Unix systems; use a
dynamic_cast interface since this is all for internal use.
Change-Id: I8a911322acd4ec5654eb0d14804c09d513a0bd4b
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163335
Tested-by: Jenkins
This PR fixes the IgnoreAll issue. "Ignore" functionality needs another PR.
Grammar checker and spell checker have different implementations. IgnoreAll functionality is implemented for spell checker but not grammar checker.
This PR implements IgnoreAll for grammar checkers.
Note: Ignore All function is valid per editing session. The ignored words is reset after the session is closed.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: I7c2b77b18e0a26a6a1c5fa9e8e66075a34612884
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159813
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit c0a619aa94)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161699
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
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>
Fixes not working "Ignore All" context menu entry in e.g. German UI
in Online.
Change-Id: I761c9f65c89fb5c7e929ea20f2db4eff20f7d53d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161170
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
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>
By default, unencrypted network connections are allowed.
But now it can be disabled, for everything that uses libcurl.
Change-Id: I8e103f5a968ace2a19fdb9d6934c9a51b2aeabe4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159011
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
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 c2930ebff8)
Change-Id: Ibf1cc0069bc2ae011ecead9a4c2b455e94b01241
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158915
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
...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>
OUStringLiteral should be declared constexpr, to enforce
that it is initialised at compile-time and not runtime.
This seems to make a different at least on Visual Studio
Change-Id: I1698f5fa22ddb480347c2f4d444530c2e0e88d92
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153499
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>