summaryrefslogtreecommitdiff
path: root/unotools
AgeCommit message (Collapse)AuthorFilesLines
2021-05-05loplugin:constmethodNoel Grandin1-2/+2
Change-Id: I7913fd8144d521b8293ac43036d0fad82e457cd1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115145 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-02sal_uLong->sal_uInt32 in ImplFontAttrsNoel Grandin1-2/+2
Change-Id: If0f9304eee98b442a5d3b4cdbf71230461e830bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114994 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-02throw() -> noexcept, part 2/3: Automatic loplugin:noexcept rewriteStephan Bergmann2-13/+13
Change-Id: I076f16d0536b534abf0ced4d76051eadb4c0e033 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114949 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-05-02tdf#79049 speed up OOXML workbook load (4)Noel Grandin2-397/+185
Optimise LocaleDataWrapper for reads by initialising the data we in the constructor, so we don't need any kind of locking Reduces load time from 34s to 28s. Change-Id: I4bd3bddb30b70ba015fe5b1372534f9507762b74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114960 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-27loplugin:stringadd convert chained append to +Noel Grandin3-9/+8
which can use the more efficient *StringConcat Also fix a crash in stringview plugin which started happening while I working on this. Change-Id: I91a5b9b7707d1594d27d80b73930f5afac8ae608 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114568 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-07Updated README.md files to represent current code / use Markdown formatHossein1-0/+2
Previously, all of the README files have been renamed to README.md and now, the contents of these files were changed to use Markdown format. Other than format inconsistency, some README.md files lacked information about modules, or were out of date. By using LibreOffice / OpenOffice wiki and other documentation websites, these files were updated. Now every README.md file has a title, and some description. The top-level README.md file is changed to add links to the modules. The result of processing the Markdown format README.md files can be seen at: https://docs.libreoffice.org/ Change-Id: Ic3b0c3c064a2498d6a435253b041df010cd7797a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113424 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-03-24Using .md extension/Markdown syntax for modules READMEHossein1-0/+0
Renaming all README files for all top level modules to README.md, applying no content change at this stage to be able to track history of the files. These files should be edited to use correct Markdown syntax later. Change-Id: I542fa3f3d32072156f16eaad2211a397cc212665 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112977 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2021-03-23tdf#124176 Use pragma once in u*Vincent LE GARREC4-14/+4
ucb, uno*, uui Change-Id: Ic4b6d541eb0df8bf7bceddf178ebb5177ad2b87b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112046 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2021-03-23use single-use attribute for ServiceDocumenterNoel Grandin2-20/+3
instead of rtl::Instance, which means it will get cleaned up when UNO shuts down Change-Id: I90f23e9439a7478e28cd466545ed498dfaf6e4de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112928 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-10Drop 'static_cast<cppu::OWeakObject*>' syntactic noiseMike Kaganski1-2/+1
... where the object is created in-place, and its type is known Change-Id: Ifabfcf2f3ad0d60152f14e8d970c1faa42115288 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112256 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-09Make sal/config.h the first in pchMike Kaganski1-2/+2
By convention, it should be the first include in C/CXX files; so use of pch should not break that. Change-Id: Ic329c5f39e8f48ad1778724368e262e48972342b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112123 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-01At least warn about the missing osl::Thread::join with a TODO commentStephan Bergmann1-0/+3
(as is already done in other such cases, too). This apparently randomly hit e.g. <https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/81371/> now, > Program terminated with signal 11, Segmentation fault. > > Thread 2 (Thread 0x2b2d9ec16600 (LWP 23008)): [...] > #72 0x00002b2d9edff4d2 in configmgr::Components::~Components() (this=0x2b2d9ef26e58 <configmgr::Components::getSingleton(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&)::singleton>) at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/configmgr/source/components.cxx:641 > #73 0x00002b2d854cdce9 in __run_exit_handlers () at /lib64/libc.so.6 > #74 0x00002b2d854cdd37 in () at /lib64/libc.so.6 > #75 0x00002b2d854b655c in __libc_start_main () at /lib64/libc.so.6 > #76 0x00000000004007a9 in _start () > > Thread 1 (Thread 0x2b2db04a5700 (LWP 24092)): > #0 0x00002b2d8672a36b in pthread_rwlock_wrlock () at /lib64/libpthread.so.0 > #1 0x00002b2db00d97d5 in CRYPTO_THREAD_write_lock (lock=0x0) at crypto/threads_pthread.c:78 > #2 0x00002b2db00a9b69 in RAND_get_rand_method () at crypto/rand/rand_lib.c:847 > #3 0x00002b2db00aa30d in RAND_status () at crypto/rand/rand_lib.c:956 > #4 0x00002b2daff92b9d in seed_ssl_prng () at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/workdir/UnpackedTarball/neon/src/ne_socket.c:265 > #5 0x00002b2daff929c9 in ne_sock_connect_ssl (sock=0x29845a0, ctx=0x34e6150, userdata=0x1e224e0) at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/workdir/UnpackedTarball/neon/src/ne_socket.c:1800 > #6 0x00002b2daff9ac02 in ne__negotiate_ssl (sess=0x1e224e0) at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/workdir/UnpackedTarball/neon/src/ne_openssl.c:717 > #7 0x00002b2daff8de68 in open_connection (sess=0x1e224e0) at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/workdir/UnpackedTarball/neon/src/ne_request.c:1716 > #8 0x00002b2daff8cfd6 in send_request (req=0x351d930, request=0x2ea4460) at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/workdir/UnpackedTarball/neon/src/ne_request.c:1021 > #9 0x00002b2daff8c698 in ne_begin_request (req=0x351d930) at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/workdir/UnpackedTarball/neon/src/ne_request.c:1255 > #10 0x00002b2daff8db25 in ne_request_dispatch (req=0x351d930) at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/workdir/UnpackedTarball/neon/src/ne_request.c:1466 > #11 0x00002b2dafe4921b in webdav_ucp::NeonSession::OPTIONS(rtl::OUString const&, webdav_ucp::DAVOptions&, webdav_ucp::DAVRequestEnvironment const&) (this=0x34e6390, inPath="/api/Icons.json", rOptions=..., rEnv=...) at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/ucb/source/ucp/webdav-neon/NeonSession.cxx:879 > #12 0x00002b2dafe11bbc in webdav_ucp::DAVResourceAccess::OPTIONS(webdav_ucp::DAVOptions&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) (this=0x34e7880, rOptions=..., xEnv=uno::Reference to (utl::(anonymous namespace)::UcbTaskEnvironment *) 0x34e8908) at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/ucb/source/ucp/webdav-neon/DAVResourceAccess.cxx:187 > #13 0x00002b2dafe9fc28 in webdav_ucp::Content::getResourceOptions(com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&, webdav_ucp::DAVOptions&, std::unique_ptr<webdav_ucp::DAVResourceAccess, std::default_delete<webdav_ucp::DAVResourceAccess> > const&, bool*) (this=0x34e8970, xEnv=uno::Reference to (utl::(anonymous namespace)::UcbTaskEnvironment *) 0x34e8908, rDAVOptions=..., rResAccess=..., networkAccessAllowed=0x0) at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/ucb/source/ucp/webdav-neon/webdavcontent.cxx:3928 > #14 0x00002b2dafe90664 in webdav_ucp::Content::open(com::sun::star::ucb::OpenCommandArgument3 const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) (this=0x34e8970, rArg=..., xEnv=uno::Reference to (utl::(anonymous namespace)::UcbTaskEnvironment *) 0x34e8908) at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/ucb/source/ucp/webdav-neon/webdavcontent.cxx:2225 > #15 0x00002b2dafe87e0d in webdav_ucp::Content::execute(com::sun::star::ucb::Command const&, int, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) (this=0x34e8970, aCommand=..., Environment=uno::Reference to (utl::(anonymous namespace)::UcbTaskEnvironment *) 0x34e8908) at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/ucb/source/ucp/webdav-neon/webdavcontent.cxx:553 > #16 0x00002b2dafe997c1 in non-virtual thunk to webdav_ucp::Content::execute(com::sun::star::ucb::Command const&, int, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) () at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/instdir/program/../program/libucpdav1.so > #17 0x00002b2d8d5436aa in ucbhelper::Content_Impl::executeCommand(com::sun::star::ucb::Command const&) (this=0x34cbbd0, rCommand=...) at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/ucbhelper/source/client/content.cxx:1255 > #18 0x00002b2d8d5447b6 in ucbhelper::Content::executeCommand(rtl::OUString const&, com::sun::star::uno::Any const&) (this=0x34e8858, rCommandName="open", rCommandArgument=uno::Any("com.sun.star.ucb.OpenCommandArgument2": {<com::sun::star::ucb::OpenCommandArgument> = {Mode = 2, Priority = 0, Sink = uno::Reference to (utl::(anonymous namespace)::ModeratorsActiveDataSink *) 0x34e7100, Properties = empty uno::Sequence}, SortingInfo = empty uno::Sequence})) at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/ucbhelper/source/client/content.cxx:558 > #19 0x00002b2d8d8257a6 in utl::(anonymous namespace)::Moderator::run() (this=0x34e87b0) at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/unotools/source/ucbhelper/ucblockbytes.cxx:580 > #20 0x00002b2d8d82cd9e in threadFunc(void*) (param=0x34e87b0) at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/include/osl/thread.hxx:189 > #21 0x00002b2d850b3f3a in osl_thread_start_Impl(void*) (pData=0x34e7200) at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/sal/osl/unx/thread.cxx:264 > #22 0x00002b2d86726ea5 in start_thread () at /lib64/libpthread.so.0 > #23 0x00002b2d8559296d in clone () at /lib64/libc.so.6 during UITest_sw_options Change-Id: I739bca5c27fba12efb9ed0e902e8d9d1a06c49af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111742 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-23loplugin:refcounting in unotoolsNoel6-25/+19
Change-Id: I7c4540a6b2975c590b36332f23d15882a79491a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111376 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-16loplugin:referencecasting in UnoControls..unoxmlNoel3-4/+4
Change-Id: I42f216b6115be693a4e57d70f6cbbf11b62ec185 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110998 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-29Replace rtl::Static with function-local static hereMike Kaganski1-17/+6
Change-Id: Iaba5c16c9f80431a5a9c03b94087e3f0b14fd9d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110132 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-01-29loplugin:stringviewparam extend to new..Noel1-1/+1
O[U]StringBuffer methods Change-Id: I0ffbc33d54ae7c98b5652434f3370ee4f819f6f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110090 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-28simplify code, use more subView()Noel1-2/+2
Change-Id: I569c7f34acbdf8451cd5c9acf1abd334637072d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110051 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-10fix coverity parse errorsCaolán McNamara1-5/+5
Change-Id: I4884bfb67a061b865e8cf38b2fea6de0cb1bc3d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109057 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-09fix coverity parse errorsCaolán McNamara3-9/+9
Change-Id: I3a1179947704452e3ffec02be59d0f7bf0b75ab0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109017 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-04loplugin:stringviewparam: operator +=Stephan Bergmann2-3/+5
Change-Id: I30ce1b5bd8fb168da7067c1967c5af2569df2653 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108512 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-01-01tdf#119367: use Unicode paths on Windows in unotoolsMike Kaganski1-1/+8
Change-Id: I671c42c5dfe5acc8a6dd670694c07ff04f08c3e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108477 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-12-29loplugin:stringviewparam: operator +Stephan Bergmann4-32/+44
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-26New loplugin:stringliteralvarStephan Bergmann4-14/+15
See the comment at the top of compilerplugins/clang/stringliteralvar.cxx for details. (Turned some affected variables in included files into inline variables, to avoid GCC warnings about unused variables.) Change-Id: Ie77219e6adfdaaceaa8b4e590b08971f2f04c83a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108239 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-23Use char16_t string literalsStephan Bergmann1-5/+5
Change-Id: I0a8b577957ac1d4cad5fc1163f244012a8391a77 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108216 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-11Adapt the remaining OUString functions to std string_viewStephan Bergmann1-2/+2
...for LIBO_INTERNAL_ONLY. These had been missed by 1b43cceaea2084a0489db68cd0113508f34b6643 "Make many OUString functions take std::u16string_view parameters" because they did not match the multi-overload pattern that was addressed there, but they nevertheless benefit from being changed just as well (witness e.g. the various resulting changes from copy() to subView()). This showed a conversion from OStringChar to std::string_view to be missing (while the corresponding conversion form OUStringChar to std::u16string_view was already present). The improvement to loplugin:stringadd became necessary to fix > [CPT] compilerplugins/clang/test/stringadd.cxx > error: 'error' diagnostics expected but not seen: > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 43 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:42): simplify by merging with the preceding assignment [loplugin:stringadd] > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 61 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:60): simplify by merging with the preceding assignment [loplugin:stringadd] > 2 errors generated. Change-Id: Ie40de0616a66e60e289c1af0ca60aed6f9ecc279 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107602 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-08use proper struct for trusted authorsNoel1-18/+18
instead of passing around a Sequence<String>, there is no need to use UNO types here. Change-Id: I1b9a1b6919f830d8ce29139b4362b979a669d505 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107396 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-08remove rest of 'xmlsec05' stuffNoel1-186/+11
which has never been used since creation in commit fd069bee7e57ad529c3c0974559fd2d84ec3151a Author: Jens-Heiner Rechtien <hr@openoffice.org> Date: Mon Sep 18 16:07:07 2000 +0000 initial import Change-Id: I1ead1bee759eb09eb72517d90b42813ad66ea1e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107373 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-07remove SID_BASIC_ENABLED and BasicEnabled optionNoel1-71/+15
which has never been used since creation in commit fd069bee7e57ad529c3c0974559fd2d84ec3151a Author: Jens-Heiner Rechtien <hr@openoffice.org> Date: Mon Sep 18 16:07:07 2000 +0000 initial import Change-Id: I018b1f734c8263167dab3d5c6f98a400666f01d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107047 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-04update pchesCaolán McNamara1-1/+2
Change-Id: I3e22c2000da03f6f3345353846213203993aa865 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107192 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-03convert EHistoryType to scoped enumNoel1-4/+4
Change-Id: I115fc0ed81d6392d3649757727c4d9468213619d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107046 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-03convert SvtPathOptions::Paths to scoped enumNoel2-164/+158
Change-Id: I2e6cab798309a1bc2ade00661bc95dd5ae20f748 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107045 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-02simplify SvtDynamicMenuOptionsNoel Grandin1-36/+15
just use the struct instead of passing around sequence of sequence of PropertyValue Change-Id: Ic03c066962a10daac6f83f30413a5ab09e1bfd5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106915 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-01OSL_FAIL.*exception -> TOOLS_WARN_EXCEPTIONNoel2-21/+5
Change-Id: I6800e23ead2767d245d5da71d2d40e0f8a6d7e1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106859 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-30loplugin:stringviewparam include comparisons with string literalsNoel2-36/+36
Change-Id: I8ba1214500dddaf413c506a4b82f43d63cda804b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-24loplugin:stringviewparam extend to comparison operatorsNoel2-3/+3
which means that some call sites have to change to use unicode string literals i.e. u"foo" instead of "foo" Change-Id: Ie51c3adf56d343dd1d1710777f9d2a43ee66221c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106125 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-17loplugin:stringviewparam check methods tooNoel2-5/+5
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-11loplugin:stringviewNoel1-1/+1
Add new methods "subView" to O(U)String to return substring views of the underlying data. Add a clang plugin to warn when replacing existing calls to copy() would be better to use subView(). Change-Id: I03a5732431ce60808946f2ce2c923b22845689ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105420 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-03ucbGet needs a non-null interaction handler after allStephan Bergmann1-5/+0
In db6c7a486395304f38e9ea52951f576f34749cbc "Use UCB instead of cURL to download https files", I had not further investigated why using the (GUI) interaction handler within utl::UcbStreamHelper::CreateStream would lead to deadlock during UITest_sw_options (UITEST_TEST_NAME=optionsDialog.optionsDialog.test_moreIconsDialog). Instead, I had passed a null XInteractionHandler into utl::UcbStreamHelper::CreateStream, assuming that would solve whatever the issue was (and it did make the UITest pass). However, that caused the AdditionsDialog to not be populated at all, with > warn:cui.dialogs:26878:26950:cui/source/dialogs/AdditionsDialog.cxx:95: Reading <https://yusufketen.com/api/Templates.json> failed with 0x20d(Error Area:Io Class:General Code:13) (see comment at <https://bugs.documentfoundation.org/show_bug.cgi?id=137922#c1> "Extensions button in Template choose does not show anything"), because interaction requests like com.sun.star.ucb.CertificateValidationRequest were not handled properly. As it turns out, the real reason for the deadlock was that the UITest quickly closes the dialog, causing the main thread to block at m_pSearchThread->join(); in ~AdditionsDialog waiting for the SearchAndParseThread to finish, while SearchAndParseThread::execute encountered a CertificateValidationRequest that needs to be handled and thus blocks in UUIInteractionHelper::handleRequest (uui/source/iahndl.cxx) waiting for the main thread to process the PostUserEvent. In an ideal world, the UCB would allow to cancel the download request issued from ucbGet while that download is waiting for the CertificateValidationRequest to be handled, and the AdditionsDialog CloseButtonHdl would initiate such cancellation. Lacking that, just keep the Close button disabled until the SearchAndParseThread has finished downloading. (Pressing the Close button earlier, ~AdditionsDialog would have blocked the main thread anyway until SearchAndParseThread had finished downloading, so this should not actually worsen the user experience. And the UITest now blocks waiting for the Close button to become enabled before pressing it; there would already be UITest.wait_until_property_is_updated available, but it has a hard-coded timeout which might or might not be relevant in existing uses of that function, so leave it alone and repeat the relevant code without an unhelpful timeout here.) This means that the additional utl::UcbStreamHelper::CreateStream overload introduced in db6c7a486395304f38e9ea52951f576f34749cbc "Use UCB instead of cURL to download https files" is not necessary after all, so remove it again. Two further items that should be looked into: * Should ucbGet pass the AdditionsDialog into utl::UcbStreamHelper::CreateStream as css::uno::Reference<css::awt::XWindow> xParentWin argument (which defaults to null)? * There might be similar deadlock issues involving ucbDownload, which can also be called (indirectly) from SearchAndParseThread::execute. Change-Id: I8d549066940fa4f259a814a31ec7c62960e0db8f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105169 Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2020-10-28Use UCB instead of cURL to download https filesStephan Bergmann1-0/+5
Since 7dc6fc32eb618da6defb8a9f330978fa019677b8 "uitest: Check the more icons dialog opens" started to test the AdditionsDialog code, some ASan builds started to report use-after-poison from within SearchAndParseThread::execute -> curlGet -> curl_easy_perform -> ... -> https_connecting -> ... -> secmod_ModuleInit -> pemC_Initialize -> ..., see the comments starting at <https://gerrit.libreoffice.org/c/core/+/98226/ 10#message-2a55980ab2477e41dc7515e4aeabc7234afc2053> "tdf#133026: Tight integration of extensions - Adding thread structure". The exact cause for that ASan use-after-poison is not quite clear to me. First, I thought it was due to liberal use of curl_easy_init (without a central curl_global_init) in a multi-threaded process; see <https://curl.haxx.se/libcurl/c/curl_easy_init.html> for this being considered "lethal". But then, another issue could be that most of the nss libraries like instdir/program/libnss3.so (implementing the "... -> secmod_ModuleInit" part) come from LO's bundled --without-system-nss while /lib64/libnsspem.so (implementing the "pemC_Initialize -> ..." part) comes from the system, and there could be some mismatch when mixing these (esp. if the former are built with ASan). So whatever the actual cause, the right fix should be to use LO's UCB instead of directly calling into cURL anyway. That required a version of utl::UcbStreamHelper::CreateStream that uses a given XInteractionHandler (which may be null to indicate no interaction handling, instead reporting all interaction requests as exceptions) instead of internally creating an XInteractionHandler using the GUI, and which would cause deadlock in 7dc6fc32eb618da6defb8a9f330978fa019677b8's UITest_sw_options. (And introducing that additional utl::UcbStreamHelper::CreateStream overload required css::awt::XWindow to be a complete type now in vcl/source/graphic/GraphicLoader.cxx, for > include/com/sun/star/uno/Reference.h:277:18: note: in instantiation of variable template specialization 'std::is_base_of_v<com::sun::star::task::XInteractionHandler, com::sun::star::awt::XWindow>' requested here > std::is_base_of_v<interface_type, derived_type> > ^ ) (The removed code in cui/source/dialogs/AdditionsDialog.cxx should have been the last remaining use of curl in Library_cui. Apparently, e1e9e2aa16f08a8fd9e38db706d63e8eceeda8d1 "Kill Mozilla personas" had forgotten to remove it from cui/Library_cui.mk the last time Library_cui had become curl-free, before the introduction of the AdditionsDialog code.) (I did not remove the #undef ABSOLUTE FIXME from cui/source/dialogs/AdditionsDialog.cxx. c4bee547b02fbe3d07b1e9ee203c73e48f86e6bf "tdf#133026: Additions: Better Search Function" does not tell whether it had been added to mitigate a macro definition from the (now removed) #include <curl/curl.h>.) Change-Id: I1fec7488d36df81c3543d12d97da1291f77712fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104938 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-10-25UNOTOOLS : simplify AccessibleRelationHelper by removing useless impl patternArnaud Versini1-89/+33
Change-Id: I6cb14c5c973067c0ea1c64eab40e38b8b548174f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104776 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-12Changed font order for Korean locale tdf#137392DaeHyun Sung1-1/+1
changed font order priority. 1. put 'Noto Sans KR' ahead of 'Noto Sans CJK KR'. Because, New Noto Sans CJK font change the name. New Noto Sans CJK V2.001 released on 10 Apr 2019. In these font files, removed 'CJK' on names. Nowadays, New Linux distributions includes Noto CJK font V2.0. In Korean Linux environments, Noto CJK font v2.0 'Noto Sans KR' & 'Noto Serif KR' are already set default. 2. fixed Windows fonts for Korean on LibreOffice I watched Windows 10's Korean Font List Microsoft Docs: Font List Windows 10 - Typography; Korean Supplemental Fonts https://docs.microsoft.com/en-us/typography/fonts/windows_10_font_list#korean-supplemental-fonts I missed 굴림체;GulimChe, 돋움체;DotumChe, 굴림체;GulimChe. So. I added MS Default Korean fonts. As a result, I changed font order and add default Windows font names. Ref. 1: Google Noto CJK fonts Repository: https://github.com/googlefonts/noto-cjk 2: Microsoft Docs: Font List Windows's Korean supplemental fonts https://docs.microsoft.com/en-us/typography/fonts/windows_10_font_list#korean-supplemental-fonts cf.Apple Docs - Format Chinese, Japanese, or Korean text in Pages on Mac https://support.apple.com/guide/pages/format-chinese-japanese-or-korean-text-tanfbd4156e/mac Change-Id: I12594aa8f3122c05810a07a718aae7ec185ba481 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104189 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-10-04loplugin:reducevarscope in toolkit..unotoolsNoel2-2/+2
Change-Id: I439b9f456ac0bfaa3eb9bf17472053bd4787e828 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103840 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-03use more TOOLS_WARN_EXCEPTIONNoel4-24/+26
Change-Id: Id83c478af5d04ad548c7cf4239fe2fb3ee154dc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103861 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-03use more TOOLS_WARN_EXCEPTIONNoel1-2/+1
Change-Id: I8b5cde993c13e0b7c8c830b1ff698933a6b7cfd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103863 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-25Fix typo in codeAndrea Gelmini1-3/+3
It passed "make check" on Linux Change-Id: I78ef6952782cedead97cf118588f4b7923bb0909 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103306 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2020-09-24tdf#134782 sw,unotools,officecfg: adapt configuration and UIMichael Stahl1-0/+2
Store AddParaLineSpacingToTableCells in configuration as "AddTableLineSpacing", consistently inconsistent like AddTableSpacing (the <desc> elements are not subject to translation). Adapt SwCompatibilityOptPage with some ugly hacks to allow 3 different states (TriState) for the corresponding checkbox that map to false/false, true/false and true/true. The checkbox widget doesn't allow to change *to* indeterminate but at least the status of the document can be displayed this way, with a non-obvious tweak to optcompatpage.ui to reference "checktri1" column. Change-Id: I5f32e05c93b5e16e782cba5d1d055809d9e5e251 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103318 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-09-21update pchesCaolán McNamara1-1/+2
Change-Id: I41a204fbc5e2c9b819fb948c5288f8d7b4195489 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103117 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-16Turn OUStringLiteral into a consteval'ed, static-refcound rtl_uStringStephan Bergmann1-1/+5
...from which an OUString can cheaply be instantiated. This is the OUString equivalent of 4b9e440c51be3e40326bc90c33ae69885bfb51e4 "Turn OStringLiteral into a consteval'ed, static-refcound rtl_String". Most remarks about that commit apply here too (this commit is just substantially bigger and a bit more complicated because there were so much more uses of OUStringLiteral than of OStringLiteral): The one downside is that OUStringLiteral now needs to be a template abstracting over the string length. But any uses for which that is a problem (e.g., as the element type of a container that would no longer be homogeneous, or in the signature of a function that shall not be turned into a template for one reason or another) can be replaced with std::u16string_view, without loss of efficiency compared to the original OUStringLiteral, and without loss of expressivity. The new OUStringLiteral ctor code would probably not be very efficient if it were ever executed at runtime, but it is intended to be only executed at compile time. Where available, C++20 "consteval" is used to statically ensure that. The intended use of the new OUStringLiteral is in all cases where an object that shall itself not be an OUString (e.g., because it shall be a global static variable for which the OUString ctor/dtor would be detrimental at library load/unload) must be converted to an OUString instance in at least one place. Other string literal abstractions could use std::u16string_view (or just plain char16_t const[N]), but interestingly OUStringLiteral might be more efficient than constexpr std::u16string_view even for such cases, as it should not need any relocations at library load time. For now, no existing uses of OUStringLiteral have been changed to some other abstraction (unless technically necessary as discussed above), and no additional places that would benefit from OUStringLiteral have been changed to use it. Global constexpr OUStringLiteral variables defined in an included file would be somewhat suboptimal, as each translation unit that uses them would create its own, unshared instance. The envisioned solution is to turn them into static data members of some class (and there may be a loplugin coming to find and fix affected places). Another approach that has been taken here in a few cases where such variables were only used in one .cxx anyway is to move their definitions from the .hxx into that one .cxx (in turn causing some files to become empty and get removed completely)---which also silenced some GCC -Werror=unused-variable if a variable from a .hxx was not used in some .cxx including it. To keep individual commits reasonably manageable, some consumers of OUStringLiteral in rtl/ustrbuf.hxx and rtl/ustring.hxx are left in a somewhat odd state for now, where they don't take advantage of OUStringLiteral's equivalence to rtl_uString, but just keep extracting its contents and copy it elsewhere. In follow-up commits, those consumers should be changed appropriately, making them treat OUStringLiteral like an rtl_uString or dropping the OUStringLiteral overload in favor of an existing (and cheap to use now) OUString overload, etc. In a similar vein, comparison operators between OUString and std::u16string_view have been added to the existing plethora of comparison operator overloads. It would be nice to eventually consolidate them, esp. with the overloads taking OUStringLiteral and/or char16_t const[N] string literals, but that appears tricky to get right without introducing new ambiguities. Also, a handful of places across the code base use comparisons between OUString and OUStringNumber, which are now ambiguous (converting the OUStringNumber to either OUString or std::u16string_view). For simplicity, those few places have manually been fixed for now by adding explicit conversion to std::u16string_view. Also some compilerplugins code needed to be adapted, and some of the compilerplugins/test cases have become irrelevant (and have been removed), as the tested code would no longer compile in the first place. sal/qa/rtl/strings/test_oustring_concat.cxx documents a workaround for GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96878> "Failed class template argument deduction in unevaluated, parenthesized context". That place, as well as uses of OUStringLiteral in extensions/source/abpilot/fieldmappingimpl.cxx and i18npool/source/localedata/localedata.cxx, which have been replaced with OUString::Concat (and which is arguably a better choice, anyway), also caused failures with at least Clang 5.0.2 (but would not have caused failures with at least recent Clang 12 trunk, so appear to be bugs in Clang that have meanwhile been fixed). Change-Id: I34174462a28f2000cfeb2d219ffd533a767920b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102222 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-09-07UNOTOOLS : simplify AccessibleStateSetHelper by not using an impl classArnaud Versini1-96/+37
Change-Id: Iae7a028d2845d8b0bef2aefdce2ae00fa7f5660f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102110 Tested-by: Jenkins Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
2020-09-05Simplify creation of the FontNameDictionaryStephan Bergmann1-242/+228
Some of the key sal_Unicode arrays contained embedded NUL characters, for which everything after the first NUL was ignored. But from the corresponding comment, it looks like those sal_Unicode arrays were presumably meant to contain multiple keys that should all map to the same "English name," which I have added now. (The original history of this source file beyond 942dbe34b9a1400c926a81f88e849d248b58ed55 "#i103496#: move some fontsubstitution stuff from vcl to unotools to get xmloff vcl free" appears to be lost, unfortunately. Another comment had already wondered why keys were terminated by double NULs, where the second NUL maybe was originally meant to terminate that sequence of individual keys all stored in a single sal_Unicode array.) There was also another // TODO: check if all dictionary entries are already normalized? in the construction of the FontNameDictionary aDictionary, of which I'm not sure what it should mean exactly, and whether I should have left it in. (This change is a prerequisite for making the OUString ctor taking a raw pointer explicit.) Change-Id: I168778307a67c6b72bf483dc34bfd45f8a48a143 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102086 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>