summaryrefslogtreecommitdiff
path: root/pyuno
AgeCommit message (Collapse)Author
2021-03-18we have to keep the original python version number 3.7.7Andras Timar
because MSP creation does not tolerate adding/removing files, or renaming directories Change-Id: Ib997d438add82652d570753a749170f207dc3a80
2020-11-14Fix initialization of Python-3.8--only at-end tp_print memberStephan Bergmann
Until Python 3.7, PyTypeObject had a member tp_print following tp_dealloc, which had then been repurposed as > /* Methods to implement standard operations */ > > destructor tp_dealloc; > - printfunc tp_print; > + Py_ssize_t tp_vectorcall_offset; > getattrfunc tp_getattr; > setattrfunc tp_setattr; > PyAsyncMethods *tp_as_async; /* formerly known as tp_compare (Python 2) in <https://github.com/python/cpython/commit/ aacc77fbd77640a8f03638216fa09372cc21673d> "bpo-36974: implement PEP 590 (GH-13185)" towards Python 3.8. Then only on the 3.8 branch (and prior to tag v3.8.0), <https://github.com/python/cpython/commit/ d917cfe4051d45b2b755c726c096ecfcc4869ceb> "[3.8] bpo-37250: put back tp_print for backwards compatibility (GH-14193)" added > destructor tp_finalize; > vectorcallfunc tp_vectorcall; > > + /* bpo-37250: kept for backwards compatibility in CPython 3.8 only */ > + Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int); > + > #ifdef COUNT_ALLOCS > /* these must be last and never explicitly initialized */ > Py_ssize_t tp_allocs; at the end of PyTypeObject. This was apparently done so that third-party code containing initialization code like X.tp_print = 0; would continue to compile (by just adding back a member with that name, even if at a "random" new---and otherwise unused---location). However, for our way of list-initializing PyTypeObject instances in pyuno that new member caused "missing field 'tp_print' initializer" -Wmissing-field-initializers warnings, so 50ccb7e82b7053306721cbe220323be072306a29 "python 3.8.2 compile: add tp_print to PyTypeObject" added initializers for this new at-end member. But it did so in a way that raises three concerns: 1 The new member was already added in Python 3.8.0 (prior to tag v3.8.0), not only in 3.8.2. 2 The new member was only added to Python 3.8. It has not been added to current master towards 3.9. 3 It is unclear why the comments mention "Py_ssize_t" as the type of that new member, when actually it is of a function pointer type (see above). Probably best to just drop that from the comments, to avoid confusion. Change-Id: Ib44f43befd5f28d4c1ac1e9e14bd55bfb4473507 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94019 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit 23d9966751566028c50ca95ca203d20f36c64f30) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105850 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-06-22tdf#121384 don't leave a bare trailing : in PYTHONPATHCaolán McNamara
and don't insert any empty path entries if that situation was to arise Change-Id: I8d8183485f457c3e4385181fee07390c4bfef603 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96707 Reviewed-by: Tomáš Chvátal <tchvatal@suse.com> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Jenkins
2020-06-12More targeted silencing of -Wdeprecated-declarationsStephan Bergmann
...compared to d1786724b8e8e474e1f7e39012c1f19611841dc0 "prevent warnings in pyuno with latest python". For one it is only the /* bpo-37250: kept for backwards compatibility in CPython 3.8 only */ Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int); member (in /usr/include/python3.8/cpython/object.h) that causes a warning. And for another it is only Clang that emits a warning when initializing a deprecated member that way, <http://lists.llvm.org/pipermail/cfe-dev/2020-May/065392.html> "[cfe-dev] Diagnosing initialization of deprecated data member?" Change-Id: I36625118a6bb26f5468d436da4caa82911181202 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94016 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96195 Tested-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-06-12prevent warnings in pyuno with latest pythonNoel Grandin
which has marked some members deprecated, but we can't stop initialising them or we run the risk of ASAN complaining Change-Id: I8f4ad0ae083fad9c040613ddde7c40f20d68c7d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93580 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96194 Tested-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-05-24python 3.8.2 compile: add tp_print to PyTypeObjectJustin Luth
I couldn't find this documented on the Internet though, as the 3.9 and 3.8.2rc documentation didn't mention it as an added item... I'm using Ubuntu 20.04 alpha with python3 --version Python 3.8.2rc1 This fixes pyuno/source/module/pyuno.cxx:1689:1: error: missing initializer for member ‘_typeobject::tp_print’ [-Werror=missing-field-initializers] Change-Id: Idec5720050572b34628267cd94557dabf7edbf3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89247 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 50ccb7e82b7053306721cbe220323be072306a29)
2020-01-15pyuno: remove racy debug checkMichael Stahl
The use-after-free is easier to trigger than expected; i don't see how it's possible to check this without a race. Change-Id: I4afb7066d1bf6b34f4f56aa0f51be0643ae40a66 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86481 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 777ae8101e23a31bdf806c1d09f0c849e47bb8ef) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86486 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-01-08pyuno: fix build against system-python-3.6Miklos Vajna
pyuno/source/module/pyuno_runtime.cxx:984:57: error: use of undeclared identifier 'PyThread_get_thread_ident' It's only an assert, so simply do it only for >=3.7. Change-Id: Ia3fffc7a9af30780adff9bc7dbabe1727c1f8f54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86410 Reviewed-by: Michael Stahl <michael.stahl@cib.de> Tested-by: Jenkins (cherry picked from commit fb4e15a89d8d8f081c0c152e5047bc0e76870b39) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86421 Tested-by: Michael Stahl <michael.stahl@cib.de>
2020-01-08python3: upgrade to release 3.7.6Michael Stahl
* external/python3/python-3.3.3-aix.patch.1: most of it doesn't apply and AIX port isn't maintained anyway so remove it for now * external/python3/ubsan.patch.0: apparently one of the files was removed * 0001-3.6-bpo-17239-Disable-external-entities-in-SAX-parse.patch.1: fixed upstream * python3-osx-avoid-new-10.13.patch.1: replace with simply passing ac_cv_func_utimensat=no to configure * external/python3/python-3.5.4-ssl.patch.1: project files to build OpenSSL removed upstream * There have been changes to how python locates OpenSSL; new variables OPENSSL_INCLUDES etc; it turns out that you have to pass one directory to --with-openssl, as the variables cannot be passed * libuuid.so.1 is a new dependency of the _uuid module * libffi.so.6 is a new dependency of the _ctypes module (the bundled copy of libffi for non-Darwin platforms was removed) * python-3.3.0-pythreadstate.patch.1: the PyThreadState functions have been changed such that CppunitTest_services asserts when there is a PyThreadAttach on top of PyThreadDetach on top of PyThreadAttach, i.e., 2 PyThreadState per thread (PyGILState_Check() fails). Instead of patching in additional workarounds, change PyThreadAttach so that it re-uses an existing PyThreadState if one exists for the thread. Change-Id: I24c19d79b43a30709261fd9db66312b2e3872fd9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/84765 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit b10be5d48433076f0b7238d818020f708553e114) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86398 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2019-10-15new loplugin:bufferaddNoel Grandin
look for OUStringBuffer append sequences that can be turned into creating an OUString with + operations Change-Id: Ica840dc096000307b4a105fb4d9ec7588a15ade6 Reviewed-on: https://gerrit.libreoffice.org/80809 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-14New loplugin:getstrStephan Bergmann
...to find matches of ... << s.getStr() (for the rtl string classes) that can be written as just ... << s Some notes: * The OUStringToOString(..., RTL_TEXTENCODING_UTF8) is left explicit in desktop/source/app/crashreport.cxx (even though that would also be done internally by the "<< OUString" operator) to clarify that these values are written out as UTF-8 (and not as what that operator << happens to use, which just also happens to be UTF-8). * OUSTRING_TO_CSTR (include/oox/helper/helper.hxx) is no longer used now. * Just don't bother to use osl_getThreadTextEncoding() in the SAL_WARN in lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx. * The toUtf8() in the SAL_DEBUG in pyuno/source/module/pyuno_module.cxx can just go, too. Change-Id: I4602f0379ef816bff310f1e51b57c56b7e3f0136 Reviewed-on: https://gerrit.libreoffice.org/80762 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-09-18tdf#39593 use getUnoTunnelImplementation in pyunoArkadiy Illarionov
Change-Id: I2cbbaad921b0a3d2ea6def4da2a2527dc4d94549 Reviewed-on: https://gerrit.libreoffice.org/79075 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
2019-08-31Add version resource to executables where it was missingMike Kaganski
Change-Id: Iee965c3f720827b20347f6228e891562c8295d22 Reviewed-on: https://gerrit.libreoffice.org/78327 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-08-30loplugin:noexceptmove in pyunoNoel Grandin
needed to make scratch() and get() noexcept Change-Id: I7d50405698557eb9794adc6523d4878675903db2 Reviewed-on: https://gerrit.libreoffice.org/78284 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-20Fix typosAndrea Gelmini
Change-Id: I5db25074d42fa22f3e36969cb561ad64c1e96dc1 Reviewed-on: https://gerrit.libreoffice.org/77760 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-17tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctorJulien Nabet
in hwpfilter, include/test, io, linguistic, oox, pyuno, reportdesign Change-Id: I5c265c4fde85dd6d7faab8ae82809c4a0e6dd69b Reviewed-on: https://gerrit.libreoffice.org/77646 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-17Simplify Sequence iterations in postprocess..saxArkadiy Illarionov
Use range-based loops, STL and comphelper functions Change-Id: If738d8f4e792c4686870183b0c0fdfbb61fd3351 Reviewed-on: https://gerrit.libreoffice.org/77245 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
2019-08-15loplugin:sequenceloop in postprocess..reportdesignNoel Grandin
Change-Id: I86b9174c37e4a347a3a8ac6c2707052167e6fdc0 Reviewed-on: https://gerrit.libreoffice.org/77522 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-31Improved loplugin:stringconstant (now that GCC 7 supports it): pyunoStephan Bergmann
Change-Id: Ia6778188fbc6f5f4acd696f35ef6d86127b9b8e4 Reviewed-on: https://gerrit.libreoffice.org/76659 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-26Fix typo in codeAndrea Gelmini
Not tested with "make check", but for me cleary a mistake. I have "maybeambiguous" in the rest of the code, but no "maybeambigous". Change-Id: I327143b3e6e188fe661846f5d9b6d2806926d492 Reviewed-on: https://gerrit.libreoffice.org/76201 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-20loplugin:referencecasting in oox..pyunoNoel Grandin
Change-Id: Ie920c154aef3074016704c632b15d99110b219aa Reviewed-on: https://gerrit.libreoffice.org/75974 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-25improve loplugin:simplifyconstructNoel Grandin
Change-Id: If863d28c6db470faa0d22273020888d4219e069e Reviewed-on: https://gerrit.libreoffice.org/74559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-10Adapt to upcoming Python 3.8Stephan Bergmann
...which changed PyTypeObject in <https://github.com/python/cpython/commit/ aacc77fbd77640a8f03638216fa09372cc21673d> "bpo-36974: implement PEP 590 (GH-13185)". Change-Id: I687ec38aeda05d0747b9ed08221db75a758bed51 Reviewed-on: https://gerrit.libreoffice.org/73664 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-05-17Use hasElements to check Sequence emptiness in [l-r]*Arkadiy Illarionov
Similar to clang-tidy readability-container-size-empty Change-Id: Idd67f332b04857a39df26bad1733aae21236f105 Reviewed-on: https://gerrit.libreoffice.org/71764 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-05-10an uno -> a unoCaolán McNamara
Change-Id: I538db88f8477dd2d2ad25c372928fec6c11d979d Reviewed-on: https://gerrit.libreoffice.org/72105 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-04-26tdf#42949 Fix IWYU warnings in pyuno/Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I95575d41a822ff7b1ac5bdba03057f6d3fa61b51 Reviewed-on: https://gerrit.libreoffice.org/71141 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-04-13loplugin:sequentialassign in oox..reportdesignNoel Grandin
Change-Id: I59ef0a6da411b8af8bdf8d8efb1d733db7475d9c Reviewed-on: https://gerrit.libreoffice.org/70707 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-02For Python extensions, set __file__ before executing the moduleThomas Viehmann
Previously __file__ was set after executing the module. This meant, however that it was not available during execution. This patch moves setting __file__ before the execution. As __file__ is a string (and not bytes), we remove the encoding. Change-Id: I63fe34b6f5d30f53aab16627d413c87b9de81992 Reviewed-on: https://gerrit.libreoffice.org/70048 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-04-02renamed ssl test to testsslShubham Goyal
Renaming used as it was confusing to assume the .mk file based on the python test case, which was testssl.py. Change-Id: I903b59aecf3b167f75494aefcfcde916febee69e Reviewed-on: https://gerrit.libreoffice.org/69217 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-03-18tdf#124011 Add __ne__ method to UNO typesShubham Goyal
Change-Id: I1dcb41b404d69e7437a2cc6f22d3391bb91f3acc Reviewed-on: https://gerrit.libreoffice.org/69216 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-03-06remove some unnecessary typedef struct... sugarNoel Grandin
Change-Id: I1576282b0a0a3af8ae14c04725d9c4900073f2c4 Reviewed-on: https://gerrit.libreoffice.org/68758 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-26loplugin:indentation (clang-cl)Stephan Bergmann
Change-Id: I94689e4eed290b4505d2caba2d9802ef7fb6cffd Reviewed-on: https://gerrit.libreoffice.org/68378 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-04replace double-checked locking patterns with thread safe local staticsMike Kaganski
Change-Id: I1bf67196e97411aeecc13ed4f91d1088a315e323 Reviewed-on: https://gerrit.libreoffice.org/62839 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-01fix pyuno compile on Fedora29Noel Grandin
'PyUnicode_GetSize' is deprecated [-Werror,-Wdeprecated-declarations] Change-Id: Id298d6a2b0af9ce418f9124c9addda55fcdc0318 Reviewed-on: https://gerrit.libreoffice.org/62687 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-13loplugin:constfields in package..registryNoel Grandin
Change-Id: Ie139490f2b008bf294910d002af711f8f41fe76d Reviewed-on: https://gerrit.libreoffice.org/61727 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-12clang-tidy misc-throw-by-value-catch-by-referenceNoel Grandin
Change-Id: I04750771b63551fd3df522753a4ed21b8d5c42f3 Reviewed-on: https://gerrit.libreoffice.org/61680 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-24loplugin:external (clang-cl)Stephan Bergmann
Including: * expanding STDAPI to its definition (as per <https://msdn.microsoft.com/library/ms686631(vs.85).aspx> "STDAPI"), to add __declspec(dllexport) into its middle, in extensions/source/activex/so_activex.cxx; as discussed in the comments at <https://gerrit.libreoffice.org/#/c/60691/> "Get rid of Windows .def files in setup_native, use __declspec(dllexport)", having a function both listed in a .def file EXPORTS and marking it dllexport is OK, and the latter helps the heuristics of loplugin:external; however, the relevant functions in extensions/source/activex/so_activex.cxx probably don't even need to be exported in the first place? * follow-up loplugin:salcall in sal/osl/w32/file-impl.hxx Change-Id: Ida6e17eba19cfa3d7e5c72dda57409005c0a0191 Reviewed-on: https://gerrit.libreoffice.org/60938 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-17New loplugin:externalStephan Bergmann
...warning about (for now only) functions and variables with external linkage that likely don't need it. The problems with moving entities into unnamed namespacs and breaking ADL (as alluded to in comments in compilerplugins/clang/external.cxx) are illustrated by the fact that while struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } returns 1, both moving just the struct S2 into an nunnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { namespace { struct S2: S1 { int f() { return 1; } }; } int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } as well as moving just the function f overload into an unnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; namespace { int f(S2 s) { return s.f(); } } } int main() { return f(N::S2()); } would each change the program to return 0 instead. Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c Reviewed-on: https://gerrit.libreoffice.org/60539 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-07DeInitVCL in PythonTestStephan Bergmann
After b9757f5cfdb62b24e79eeb4c0ef0c8b98056cecf "loplugin:useuniqueptr in vcl/svdata" ASan/UBSan builds started to fail (like <https://ci.libreoffice.org//job/lo_ubsan/1025/>) at the end of PythonTest_dbaccess_python (and probably other PythonTests), when during exit the static utl::ConfigManager instance already happens to be destroyed by the time the static ImplSVData's mpSettingsConfigItem is destroyed (which would normally be cleared during DeInitVCL, if PythonTests would call that, and which in the past had thus simply been leaked in PythonTests when that mpSettingsConfigItem was a plain pointer instead of std::unique_ptr). So ensure that PythonTests that initialize VCL also call DeInitVCL, via a new private_deinitTestEnvironment, complementing the existing private_initTestEnvironment. However, while private_initTestEnvironment is called once (typically via UnoInProcess.setUp, which internally makes sure to only call it once) as soon as the first executed test needs it, private_deinitTestEnvironment must be called once after the lasts test needing it has executed. The only way that I found to do that is to override unittest.TextTestResult's stopTestRun method, which is called once after all tests have been executed. Hence a new test runner setup in unotest/source/python/org/libreoffice/unittest.py that is now called from solenv/gbuild/PythonTest.mk. That revealed a few places in PythonTests that didn't yet close/delete documents that they had opened, which has now been added. One remaining problem then is that classes like SwXTextDocument and friends call Application::GetSolarMutex from their dtors, via sw::UnoImplPtrDeleter (a "Smart pointer class ensuring that the pointed object is deleted with a locked SolarMutex", sw/inc/unobaseclass.hxx). That means that any PyUNO proxies to such C++ objects that remain alive after private_deinitTestEnvironment will cause issues at exit, when Python does a final garbage collection of those objects. The ultimate fix will be to remove that unhelpful UnoImplPtrDeleter and its locking of SolarMutex from the dtors of UNO objects; until then, the Python code is now sprinkled with some HACKs to make sure all those PyUNO proxies are released in a timely fashion (see the comment in unotest/source/python/org/libreoffice/unittest.py for details). (Also, it would probably help if UnoInProcess didn't keep a local self.xDoc around referencing (just) the last result of calling one of its open* methods, confusingly making it the responsibility of UnoInProcess to close that one document while making it the responsibility of the test code making the other UnoInProcess.open* calls to close any other documents.) Change-Id: Ief27c81e2b763e9be20cbf3234b68924315f13be Reviewed-on: https://gerrit.libreoffice.org/60100 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-07-30Add 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 l10ntools to reportdesign Change-Id: Ia2dc93dd848c2dc0b6a8cb6e19849c614ec55198 Reviewed-on: https://gerrit.libreoffice.org/58205 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-26Related: rhbz#1602589 silence coverity leaked_storageCaolán McNamara
Change-Id: Iae694be40b32cc3821d326bb362e6091dba19a35 Reviewed-on: https://gerrit.libreoffice.org/58079 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-07-03const fixes for python3-devel-3.7.0-1.fc29.x86_64Stephan Bergmann
Change-Id: Ia16a8b828e11ce36e9bb77ecf9e8a1179bd9b90c Reviewed-on: https://gerrit.libreoffice.org/56841 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-06-23[API CHANGE] Add a sal_debug method to pyunoTor Lillqvist
Does the obvious thing. Useful to get debug output from Python code at development time into the same format and in the same output file as from SAL_DEBUG() calls in C++ source code. Especially useful when combined with SAL_LOG=+TIMESTAMP or +RELATIVETIMER. Change-Id: I8c3d4fdf83b06846acb56773438401d467e71062 Reviewed-on: https://gerrit.libreoffice.org/56171 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-08look for unnecessary calls to Reference::is() after an UNO_QUERY_THROWNoel Grandin
Since the previous call would throw if there was nothing to be assigned to the value. Idea from tml. Used the following script to find places: git grep -A3 -n UNO_QUERY_THROW | grep -B3 -F 'is()' Change-Id: I36ba7b00bcd014bdf16c0455ab91056f82194969 Reviewed-on: https://gerrit.libreoffice.org/55417 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-05-25Improve re-throwing of UNO exceptionsNoel Grandin
(*) if we are already throwing a Wrapped*Exception, get the exception using cppu::getCaughtexception. (*) when catching and then immediately throwing UNO exceptions, use cppu::getCaughtException to prevent exception slicing (*) if we are going to catch an exception and then immediately throw a RuntimeException, rather throw a WrappedTargetRuntimeException and preserve the original exception information. Change-Id: Ia7a501a50ae0e6f4d05186333c8517fdcb17d558 Reviewed-on: https://gerrit.libreoffice.org/54692 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-09configure,pyuno: require at least Python 2.7Michael Stahl
Nobody needs to use 2.6 any more, so reduce the maintenance burden. https://lists.freedesktop.org/archives/libreoffice/2018-March/079670.html Change-Id: I101e26fbceffbe6119f4a6484530f27760b03eb4 Reviewed-on: https://gerrit.libreoffice.org/50816 Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> Tested-by: Jenkins <ci@libreoffice.org>
2018-04-05Fix Python file URL construction on WindowsStephan Bergmann
...after d76281864b0e83812c0edf7490b1e8271e89fff5 "Create temp copies of test docs in Python/UITests" Change-Id: I0f331ca9567e9a54842cc35b35628046d29b176d Reviewed-on: https://gerrit.libreoffice.org/52470 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-04-03Create temp copies of test docs in Python/UITestsStephan Bergmann
...where necessary, so the tests will succeed if SRCDIR is a read-only tree. Change-Id: Iea4c52d5982d3eba079088ef1670ff557ce30c3f Reviewed-on: https://gerrit.libreoffice.org/52122 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-03-12loplugin:redundantfcast look for redundant copies in return statementsNoel Grandin
Change-Id: I5f416c865dfe1c36018784246a8007452eb42008 Reviewed-on: https://gerrit.libreoffice.org/50996 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-02pyuno: MSVC: pragma warning: make more specific, remove obsoleteMike Kaganski
Change-Id: Id907f466bc9dc45f3e522fb948488eb35c011bfe Reviewed-on: https://gerrit.libreoffice.org/49041 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>