summaryrefslogtreecommitdiff
path: root/unotools
AgeCommit message (Collapse)Author
2018-09-13tdf#42949 Fix IWYU warnings in include/ucbhelper/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I7bfeef47abaf94cfb355db95c0fdb928ce36c0a6 Reviewed-on: https://gerrit.libreoffice.org/60232 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-09-12loplugin:simplifyconstruct in ucbhelper..vclNoel Grandin
Change-Id: Id435bb3289dcfd9a7aeca6a661e249085958cb7c Reviewed-on: https://gerrit.libreoffice.org/60392 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-11clang-tidy bugprone-copy-constructor-initNoel Grandin
Change-Id: Idd435b3a4d081f6d3af26ff8add69ad4af50db57 warning: calling a base constructor other than the copy constructor Reviewed-on: https://gerrit.libreoffice.org/60239 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-09Revert "clang-tidy performance-move-const-arg"Noel Grandin
This reverts commit 3d604d1cd6cc70ef96782ef769f0479b509987a8. comments from sberg: I assume dropping the std::move from aCurSel(std::move(aSel)) is caused by performance-move-const-arg's warning "if std::move() is called with an argument of a trivially-copyable type" (<https://clang.llvm.org/extra/clang-tidy/checks/performance-move-const-arg.html>). For my taste, that approach is too tightly tied to a class's current implementation details, something that may change over time. Imagine a trivially copyable class C with a raw pointer member (where the lifecycle of the pointed-to object is tracked by some higher-level, likely broken protocol). Now, that protocol is fixed and the raw pointer member is replaced with a std::shared_ptr. C is no longer trivially copyable, and the dropped std::move would turn out to be beneficial again. (Also, if Clang and clang-tidy did implement the fixed rules for trivially copyable classes from CWG1734/C++17, where a subset of a trivially copyable class's copy/move members may be deleted, the above rule to warn "if std::move() is called with an argument of a trivially-copyable type" would no longer make sense as written; consider a trivially copyable class whose copy ctor has been deleted.) Change-Id: Icb91610e50ed98b8f55fe6323bdfa48c8cb9b4b9 Reviewed-on: https://gerrit.libreoffice.org/60166 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-06clang-tidy performance-move-const-argNoel Grandin
Change-Id: I607891e120688b746c8a4c577018d97147a79217 Reviewed-on: https://gerrit.libreoffice.org/60029 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-05clang-tidy performance-inefficient-vector-operationNoel Grandin
Change-Id: Iebcaea7b08c5284946d83b6b6b9ed26b218025d4 Reviewed-on: https://gerrit.libreoffice.org/59992 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-31tdf#42949 Fix IWYU warnings: boost/optional in include/Gabor Kelemen
Found with bin/find-unneeded-includes a few low hanging boost/optional headers. This gets us about 75M includebloat reduction; still much to go Change-Id: I5c737631767970f9145609aad298a5d11e3fed65 Reviewed-on: https://gerrit.libreoffice.org/59840 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-29loplugin:constantparam (3)Noel Grandin
Change-Id: Ifc47bb8e096c9a8563021b2fcb44199577740746 Reviewed-on: https://gerrit.libreoffice.org/59747 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-14create appendCopy method in OUStringBufferNoel Grandin
so we can avoid temporary copies when appending a substring of an OUString to the buffer. I would have preferred to call the method just "append" but that results in ambiguous method errors when the callsite is something like sal_Int32 n; OUStringBuffer s; s.append(n, 10); I'm not sure why Change-Id: I6b5b6641fcb5b26ce2269f89ef06e03c0b6aa76f Reviewed-on: https://gerrit.libreoffice.org/58666 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-13short-circuit IsFuzzing when FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION definedCaolán McNamara
Change-Id: Ib82daad19185de3d271adee3cdb6d39a35e9c082 Reviewed-on: https://gerrit.libreoffice.org/58941 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-02Add missing sal/log.hxx headersGabor Kelemen
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directories from test to vbahelper Change-Id: Ia7f773511624099505d6a36a8d6e23c0cde4a737 Reviewed-on: https://gerrit.libreoffice.org/58225 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-29cppcheck: useInitializationList in test to xmloffJochen Nitschke
Change-Id: I50545784c5412ab7767f401c6e40058a1d0bfab0 Reviewed-on: https://gerrit.libreoffice.org/58262 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-27new loplugin:stringloop, and applied in variousNoel Grandin
look for OUString being appended to in a loop, better to use OUStringBuffer to accumulate the results. Change-Id: Ia36e06e2781a7c546ce9cbad62727aa4c5f10c4b Reviewed-on: https://gerrit.libreoffice.org/58092 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-27unotools: avoid -Werror=deprecated-copy (GCC trunk towards GCC 9)Stephan Bergmann
...by explicitly defaulting the copy/move functions (and, where needed in turn, also a default ctor) for classes that have a user-declared dtor that does nothing other than an implicitly-defined one would do, but needs to be user- declared because it is virtual and potentially serves as a key function to emit the vtable, or is non-public, etc.; and by removing explicitly user- provided functions that do the same as their implicitly-defined counterparts, but may prevent implicitly declared copy functions from being defined as non- deleted in the future. (Even if such a user-provided function was declared non-inline in an include file, the apparently-used implicitly-defined copy functions are already include, so why bother with non-inline functions.) Change-Id: Iaa08ef916a2d266e011a2cb66592b377cb1eb23c Reviewed-on: https://gerrit.libreoffice.org/58095 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-07-26loplugin:returnconstant in tools,comphelper,unotoolsNoel Grandin
Change-Id: Iabc3c67b4cdcd0344a37c533bf92dd00cd4700d8 Reviewed-on: https://gerrit.libreoffice.org/57974 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-11clean up UNO available() implementationsNoel Grandin
There seems to be some confusion here. available() is actually the number of bytes that can be read without blocking, but most implementations seems to be just returning the number of bytes remaining in the stream. Since we're doing that, let's do it properly. (*) some of them were just casting, instead of clamping, which will return wrong values sometimes. (*) FileStreamWrapper_Impl/OInputStreamWrapper/OTempFileService were doing unnecessary work, instead of just asking the underlying SvStream for it's remaining size Change-Id: I3ef26e0363e989ed3e00be0fdb993e1cdeb7819f Reviewed-on: https://gerrit.libreoffice.org/57264 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-10pass SvStream around by std::unique_ptrNoel Grandin
and give utl::OStreamWrapper a new constructor so that it knows it is taking ownership of the SvStream, which appears to fix several leaks Change-Id: Idcbcca9b81a4f0345fd8b8c8a2f4e84213686a6b Reviewed-on: https://gerrit.libreoffice.org/57187 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-09loplugin:oncevarNoel Grandin
Change-Id: Id295dc0db174a448ef73db9de34f2de07d47f09a Reviewed-on: https://gerrit.libreoffice.org/57108 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-28Fix typosAndrea Gelmini
Change-Id: I1b966b636f67a549718ca19c00c2820e8d168c7a Reviewed-on: https://gerrit.libreoffice.org/56589 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-06-08tdf#115007: Use [NatNum12 params...] syntaxMike Kaganski
This allows using all the libnumbertext library functions. [NatNum12] gives cardinal number names (one, two, three, ...) [NatNum12 ordinal] gives ordinal number names (first, second, third, ...) [NatNum12 ordinal-number] gives ordinal indicators (1st, 2nd, 3rd, ...) [NatNum12 money USD][$-409] gives formal English (US) money text ... etc (see numbertext.org for syntax). Change-Id: I16dbb44d8d4bdb82a1b950de6d438c8311b554ff Reviewed-on: https://gerrit.libreoffice.org/54366 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2018-06-05tdf#42949 remove unused compheler includes ..Jochen Nitschke
and fix the fallout Change-Id: I15bc5d626f4d157cbc69a87392078b41e621d14e Reviewed-on: https://gerrit.libreoffice.org/54882 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-05-30make CharClass also mutex-protect calls to its dependent classLuboš Luňák
When calc_tests runs test_tdf53482_Range_contains_column_headings_file() with Calc's threading enabled, it ends up calling ScInterpreter::ScProper() from threads, which calls to CharClass. And while CharClass tries to be thread-safe (guessing from the mutex usage), it forwards calls to i18npool's CharacterClassificationImpl and cclass_Unicode, both of which aren't thread-safe. Which makes thread safety of CharClass itself pointless. Since CharClass already acquires the mutex anyway because of getMyLocale(), just extend the duration for the entire call, which hopefully shouldn't make that much of a difference. Change-Id: I544b34d7e58c4a901f3b6e3a3ff52156b9e320a8 Reviewed-on: https://gerrit.libreoffice.org/54999 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Luboš Luňák <l.lunak@collabora.com>
2018-05-28loplugin:unusedmethodsNoel Grandin
Change-Id: I64df1f467986b3d70c058adff289a6dd8f00fb20 Reviewed-on: https://gerrit.libreoffice.org/54821 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-20tdf#35798: Hide empty Database fields' paragraphs (+ compat option)Mike Kaganski
With this change, Database fields that expand to empty values behave as if they are "Hidden Paragraph" fields. A compatibility option to enable this behaviour is added. The option is enabled by default, and for any non-native documents (for compatibility with other office suites). For existing (F)ODT documents, the option is disabled for those documents that don't have this setting set, to keep the layout of legacy documents. Change-Id: Ic5e8cb15a3a7d1a765a984eef4b0d97666df7dfd Reviewed-on: https://gerrit.libreoffice.org/54552 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-05-17-Werror,-Wunused-private-fieldStephan Bergmann
Change-Id: Icc8c073040bbbb0c481bb6de8c605f72b51b1f37
2018-05-17loplugin:unusedfields in tools..xmlhelpNoel Grandin
Change-Id: I5e909a8def86ce9ad150440e6c6ad304e855cc69 Reviewed-on: https://gerrit.libreoffice.org/54415 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-11Avoid gengal hanging in an --enable-dbgutil build on WindowsTor Lillqvist
With a newer C++ debug runtime (in an --enable-dbgutil build), passing an invalid locale name causes an attempt to display an error dialog. Which does not even show up, at least for me, but instead the process (gengal, at least) just hangs. Which is far from ideal. Passing a POSIX-style locale name to the std::locale constructor on Windows is a bit odd, but apparently in the normal C++ runtime it "just" causes an exception to be thrown, that boost catches (see the loadable(std::string name) in boost's libs\locale\src\std\std_backend.cpp), and then instead uses the Windows style locale name it knows how to construct. (Why it even tries the POSIX style name on Windows I can't understand.) Actually it isn't just the locale name part "en_US" of a locale like "en_US.UTF-8" that is problematic, but also the encoding part, "UTF-8". The Microsoft C/C++ library does not support UTF-8 locales. The error message that our own report hook catches says: "f:\dd\vctools\crt\crtw32\stdcpp\xmbtowc.c(89) : Assertion failed: ploc->_Mbcurmax == 1 || ploc->_Mbcurmax == 2". Clearly in a UTF-8 locale (perhaps one that boost internally constructs?) the maximum bytes per character will be more than 2. With a debug C++ runtime, we need to avoid the error dialog, and just ignore the error. So we install an own CRT error report hook that ignores the error for the duration of the locale construcion. Change-Id: Ia2ca994f03d1ce94ce7e9d7607f204c320ab8f2d Reviewed-on: https://gerrit.libreoffice.org/54110 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-05-03tdf#117171 support localized number name numbering stylesLászló Németh
in page number, chapter and outline numbering in ~30 languages by integrating libnumbertext library. - offapi: add linguistic2::NumberText New NumberingType constants: - ordinal indicators (1st, 2nd, 3rd...) - cardinal number names (One, Two, Three...) - ordinal number names (First, Second, Third...) Note: these numberings are parts of OOXML, too. Plain text files of Libnumbertext's language data are installed in share/numbertext (similar to share/fingerprint), allowing further customization. Change-Id: I4034da0a40a8c926f14a3f591749a89a8d807d5a Reviewed-on: https://gerrit.libreoffice.org/53313 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2018-04-26identify tab pages by name for save/storing active tabCaolán McNamara
Change-Id: Id66f8ff62ed08724702572f457b9fc857d567e89 Reviewed-on: https://gerrit.libreoffice.org/53465 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-04-25Revert "make UcbStreamHelper return SvStream by std::unique_ptr"Noel Grandin
This reverts commit eeefb8c440b514cefdc4e82cc06843da9eabeb13. this was pushed in error
2018-04-25make UcbStreamHelper return SvStream by std::unique_ptrNoel Grandin
Change-Id: I408f9193680ea73c61fcfb2bd1e860152219702c
2018-04-11new loplugin:unusedvariablemoreNoel Grandin
collection of heuristics to look for local variables that are never read from i.e. do not contribute to the surrounding logic This is an expensive plugin, since it walks up the parent tree, so it is off by default. Change-Id: Ib8ba292241bd16adf299e8bba4502cb473513a06 Reviewed-on: https://gerrit.libreoffice.org/52450 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-09use more DBG_UNHANDLED_EXCEPTIONNoel Grandin
so we get nice logs of the exception dynamic type for UNO exceptions. Change-Id: Ic0b10dc14d354a2c9a0591b3a51d2f1640d54bdb Reviewed-on: https://gerrit.libreoffice.org/52465 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-03pass area param to DBG_UNHANDLED_EXCEPTIONNoel Grandin
and update sallogareas plugin to enforce this Change-Id: Id0782c8a1f619372e10d931aec3c6a4743a4c86a Reviewed-on: https://gerrit.libreoffice.org/52249 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-02use https links for api.libreoffice.org and opengrokdennisroczek
Change-Id: I74dd0142562cb8698f19b2715fa1d514f82bd749 Reviewed-on: https://gerrit.libreoffice.org/52262 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2018-04-01remove unused processfactory.hxx includesJochen Nitschke
and fix fallout Change-Id: Id06bf31f2075111e426ba40c84c885ae70697bee Reviewed-on: https://gerrit.libreoffice.org/52206 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2018-03-29Remove bogus assertStephan Bergmann
...that had been added with f0215dcc9e5ba47d4b7d5b9759f1bd774942d388 "unotools: assert if TempFile::GetURL() fails due to missing file UCP". But when SRCDIR is a read-only tree, JunitTest_sc_unoapi_2 fails with that assert firing when TempFile::GetURL is called from SfxMedium::CreateTempFile (sfx2/source/doc/docfile.cxx), which in turn is prepared to handle an empty return value from GetURL, and the test succeeds after removing the assert. So it looks like that assert was not precise enough to only fire in the scenarios where it was intended to fire. Change-Id: I333e9026ee14e9d1140b1b475793a5b15ededd70 Reviewed-on: https://gerrit.libreoffice.org/52085 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-03-26tdf#116315 - Cycle Case including Sentence caseheiko tietze
Sentence case added at position #2 in the sequence Change-Id: I99b5afb44260b1a40c7ceb906f729e339aaefd13 Reviewed-on: https://gerrit.libreoffice.org/51696 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Heiko Tietze <tietze.heiko@gmail.com>
2018-03-19remove unused ucbstreamhelper includesJochen Nitschke
and a few vclunohelper includes Change-Id: I4803605766d155fe5044c2a65c0444631146831c Reviewed-on: https://gerrit.libreoffice.org/51496 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-14tdf#114751 Update the default UI fonts for Japanese localeTakeshi Abe
- give priority to IPA P Gothic and Noto Sans CJK JP - for Windows, try Yu Gothic UI first, then Meiryo UI - look for Hiragino Kaku Gothic ProN/Pro on macOS Thanks to Jun Nogata and AWASHIRO Ikuya for their suggestions. This addresses only part of the issue; another incoming change will take care of the rest. Change-Id: I1491ba63e1447d3b9086dfcfdf3981bee6282661 Reviewed-on: https://gerrit.libreoffice.org/50515 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2018-03-08loplugin:constantparam in svtools..unotoolsNoel Grandin
Change-Id: I6e72fbe44dcb65ee5162448e9a72e6437d56b044 Reviewed-on: https://gerrit.libreoffice.org/50948 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-06Fix typosAndrea Gelmini
Change-Id: I005023337dbe593e0ac1d76f7b10848d24f314a5 Reviewed-on: https://gerrit.libreoffice.org/50785 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-03-02Blind build fix for AndroidStephan Bergmann
Change-Id: Ic1ad524d533d3e27d59dacc3f1233de3e4e3e0dc
2018-03-02iOS, added same limitations as MACOSXjan Iversen
Change-Id: Ic8490fcea37221f580734e7764e90bb21c9cc28f
2018-03-02fix fuzzer buildCaolán McNamara
Change-Id: I24c7e32b3dc63f3b5043e186f6af0ffa4d310198
2018-03-01hook up gettext to native dialogCaolán McNamara
Change-Id: Ie5ca8882c8e4c41a8ee41379edc37c4c07e18033 Reviewed-on: https://gerrit.libreoffice.org/50581 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-24loplugin:constparamsNoel Grandin
Change-Id: I7c695073d9a9d3b7a641d6eb9fe01a47d8c3a504 Reviewed-on: https://gerrit.libreoffice.org/48392 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-22remove some sal_Bool remnantsNoel Grandin
Change-Id: I0a9637aca523a73fbdbbd22f9ad735d6d1ba6898 Reviewed-on: https://gerrit.libreoffice.org/48273 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-15More loplugin:cstylecast: unotoolsStephan Bergmann
Change-Id: I04af756527ff42ad83a1b68730230864233c4fac
2018-01-12More loplugin:cstylecast: unotoolsStephan 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: I40a3ff5a436766f8d16f154eff2726b4873a0eb1