summaryrefslogtreecommitdiff
path: root/pyuno
AgeCommit message (Collapse)AuthorFilesLines
2018-07-04const fixes for python3-devel-3.7.0-1.fc29.x86_64Stephan Bergmann3-3/+3
Change-Id: Ia16a8b828e11ce36e9bb77ecf9e8a1179bd9b90c Reviewed-on: https://gerrit.libreoffice.org/56841 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit 76a29148be63cb006a7e25e312dc93acc93e071f) Reviewed-on: https://gerrit.libreoffice.org/56883
2018-04-09configure,pyuno: require at least Python 2.7Michael Stahl4-8/+0
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 Bergmann1-10/+3
...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 Bergmann1-3/+2
...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 Grandin1-1/+1
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 Kaganski2-8/+0
Change-Id: Id907f466bc9dc45f3e522fb948488eb35c011bfe Reviewed-on: https://gerrit.libreoffice.org/49041 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-02-01tdf#114815 pyuno: avoid 2 threads initing python in parallelMichael Stahl1-4/+16
According to the crash reports, it's possible for the grammar checking thread to call GetGrammarChecker, instantiating lightproof, at the same time as the main thread instantiates LngSvcMgr, which also instantiates (some?) (all?) grammar checkers. Ensure that pyuno_loader::CreateInstance() initialises Python only once with a C++11 thread safe static. Change-Id: I5b1faba9107355c508831a078366e4a29fdbfadf
2018-01-15More loplugin:cstylecast: pyunoStephan Bergmann4-5/+5
Change-Id: I2d3e2104c63bdff1a18fd32c2db37a565e9380e2
2018-01-12More loplugin:cstylecast: pyunoStephan Bergmann7-20/+20
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: I11e4fde47c5da601e4ffeada31083c3bdb4286f9
2018-01-11loplugin:redundantcast: pyunoStephan Bergmann1-1/+1
(after a to-be-committed improved loplugin:cstylecast would have rewritten the C-style casts into static_casts) Change-Id: If46940b66accb95d82ce9f129b274940086d906e
2017-12-11loplugin:salcall fix functionsNoel Grandin2-3/+3
since cdecl is the default calling convention on Windows for such functions, the annotation is redundant. Change-Id: I1a85fa27e5ac65ce0e04a19bde74c90800ffaa2d Reviewed-on: https://gerrit.libreoffice.org/46164 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-07loplugin:salcall handle static methodsNoel Grandin1-2/+2
Change-Id: Id6820abec4b8ca8bee26d62b333fd30b42a14aec Reviewed-on: https://gerrit.libreoffice.org/46007 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-23loplugin:simplifybool for negation of comparison operatorNoel Grandin1-1/+1
Change-Id: Ie56daf560185274754afbc7a09c432b5c2793791 Reviewed-on: https://gerrit.libreoffice.org/45068 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-04Replace only list by vector in pyunoJulien Nabet1-2/+1
Change-Id: Ic770d1fb8e3735123786a73a7b57f71ad8005d5d Reviewed-on: https://gerrit.libreoffice.org/44301 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-10-27loplugin:includeform: pyuno (Windows)Stephan Bergmann1-1/+1
Change-Id: I07b13573fb45847bd31be6d195d0ebb5943e25bb
2017-10-23loplugin:includeform: pyunoStephan Bergmann2-6/+6
Change-Id: If6090dc77275b4a8cdfeaedb437036801e981a9b
2017-10-23overload std::hash for OUString and OStringNoel Grandin2-6/+4
no need to explicitly specify it anymore Change-Id: I6ad9259cce77201fdd75152533f5151aae83e9ec Reviewed-on: https://gerrit.libreoffice.org/43567 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-04Fix PythonTest_pyuno_pytests_insertremovecells on WindowsStephan Bergmann1-3/+8
...where the original code caused an "Unsupported URL <file://C%3A/...>" error, while just using pathname2url instead of quote caused "Unsupported URL <file:///C://...>", so had to add the silly re.sub. Hopefully keeps working with all sorts of Python 2 and 3 that we want to support. (And is there really no better way to convert a pathname to a file URL in Python?) Change-Id: I43f450707fe5206a1e6b91918962d2d90a880463 Reviewed-on: https://gerrit.libreoffice.org/43092 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-10-03Partially revert c3609f107b16eb888edf284f4637be6cb09234ebMike Kaganski1-2/+3
Change-Id: I92c84d0d0fba1adcd0adfc93e3fe9b5ea6b8cbf2 Reviewed-on: https://gerrit.libreoffice.org/43065 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-30Use SAL_W/SAL_U instead of reinterpret_cast btwn wchar_t* and sal_Unicode*Mike Kaganski1-3/+2
This is type-safe, and allows to catch cases where a source type is changed for some reason, but reinterpret_cast masks that Change-Id: Ib64b6fa2e22d94a6bba890f0ccc3e20325c6f0a1 Reviewed-on: https://gerrit.libreoffice.org/42961 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-27Make these tests part of the regular 'make check'Stephan Bergmann2-35/+1
...instead of the 'make PythonTest_pytests' hack introduced with 4e887567c5b4b06646ab1340376e240d6c5af9cb "A rudimentary framework for additional Python tests not run by default". PythonTest_pyuno_pytests_insertremovecells and PythonTest_pyuno_pytests_testcollections apparently have various dependencies that are not spelled out, so simply add them to subsequentcheck for now (also, the latter appears to take quite some time to execute). Change-Id: Ie9d3c301af28f67ab65c09eba93d9778a3c82c8a Reviewed-on: https://gerrit.libreoffice.org/42822 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-09-26Call pyuno.private_initTestEnvironment() only onceStephan Bergmann1-1/+5
...instead of once for each class derived from CollectionsTestBase (as listed in pyuno/PythonTest_pyuno_pytests_testcollections.mk), causing the assert(!pSVData->maDeInitHook.IsSet()); in Application::setDeInitHook (vcl/source/app/svapp.cxx) to fire. This is probably far from being idiomatic Python code... Change-Id: I8cd1470c085b16b7b82468a308cfd1dead2db034
2017-09-25tdf#57950: Replace chained OUStringBuffer::append() with operator+Muhammet Kara1-14/+14
Change-Id: Ibf9d3b24b0caa6b84f403d7bbbc90912fe64a559 Reviewed-on: https://gerrit.libreoffice.org/42728 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-22loplugin:flatten in pyuno..scNoel Grandin2-44/+43
Change-Id: I7ddc0b76532d26910f78642200750459508c2861 Reviewed-on: https://gerrit.libreoffice.org/42617 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-17remove unnecessary use of OUString::getStrNoel Grandin1-1/+1
Change-Id: I3d13e1c0bb6aa4a7aacc463198747c1368ebc9b4 Reviewed-on: https://gerrit.libreoffice.org/38114 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-31loplugin:constparams in basctlNoel Grandin3-13/+13
Change-Id: If6c2b980a2916c4ee8ac108fbb84b006a35f49c5 Reviewed-on: https://gerrit.libreoffice.org/40570 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-21loplugin:constparams in soltools and variousNoel Grandin1-1/+1
Change-Id: I5e8e4a9a31aa7c3ff54cc7ce137d08770ea297e1 Reviewed-on: https://gerrit.libreoffice.org/40279 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-31clang-tidy readability-redundant-control-flowNoel Grandin1-2/+0
Change-Id: I832f7ef0f1bd55e365db7e49823fe8bc30390c04 Reviewed-on: https://gerrit.libreoffice.org/38215 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-12Clean up uses of SAL_U/SAL_W: pyunoStephan Bergmann1-17/+5
...and clean up MACOSX specific code Change-Id: I1796b4b8f2695359557a5374b5d7592ccf8f86a6
2017-05-12remove unused uno::Reference varsNoel Grandin1-1/+0
found by temporarily marking Reference as SAL_WARN_UNUSED. Change-Id: I18809b62654467f890016adcc92576980ced393b Reviewed-on: https://gerrit.libreoffice.org/37511 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-09cleanup osl/diagnose.h includesJochen Nitschke1-1/+0
with command > git grep -l osl/diagnose.h *.cxx | xargs grep -L -w 'OSL_\w*' | xargs sed -i '/#include *\(<\|\"\)osl\/diagnose.h\(>\|\"\).*/d' headers need more work Change-Id: I906519ebbd47a04703b4fa5943b2f7abea7a97ab Reviewed-on: https://gerrit.libreoffice.org/37350 Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-05-07revert OSL_ASSERT changesChris Sherlock2-2/+2
Change-Id: I365d140446bd2a62cf8256acbfdd53fe72987380
2017-05-07tdf#43157: convert pyuno from OSL_ASSERT to assertChris Sherlock2-2/+2
Change-Id: I2eb634ed3f5403df910371631f42219a9f8744eb
2017-04-04Finally switch MSVC to sal_Unicode = char16_t, tooStephan Bergmann1-2/+2
There is lots of (Windows-only) code that relied on sal_Unicode being the same as wchar_t, and the best change may be different in each case (and doing the changes may be somewhat error prone). So for now add SAL_U/SAL_W scaffolding functions to sal/types.h, remove their uses one by one again, and finally drop those functions again. Change-Id: I2cc791bd941d089901abb5f6fc2f05fbc49e65ea Reviewed-on: https://gerrit.libreoffice.org/36077 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-04-04make UNO enums scoped for internal LO codeNoel Grandin1-23/+22
this modifies codemaker so that, for an UNO enum, we generate code that effectively looks like: #ifdef LIBO_INTERNAL_ONLY && HAVE_CX11_CONSTEXPR enum class XXX { ONE = 1 }; constexpr auto ONE = XXX_ONE; #else ...the old normal way.. #endif which means that for LO internal code, the enums are scoped. The "constexpr auto" trick acts like an alias so we don't have to use scoped naming everywhere. Change-Id: I3054ecb230e8666ce98b4a9cb87b384df5f64fb4 Reviewed-on: https://gerrit.libreoffice.org/34546 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-25Fix typosAndrea Gelmini1-1/+1
Change-Id: I14dca0d55c09187690dc1d94936c40b890ca5cea Reviewed-on: https://gerrit.libreoffice.org/35637 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-03-23loplugins:redundantcast teach it about c-style typedef castsNoel Grandin1-1/+1
Change-Id: I1ac11a2481c0f4d8be1e1fd7c7637ac0ece3d65c Reviewed-on: https://gerrit.libreoffice.org/35558 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-13Revert "comphelper: fix MSVC hang in ThreadPool::shutdown()"Miklos Vajna1-16/+5
As it causes "unopkg.bin: /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/comphelper/source/misc/threadpool.cxx:96: comphelper::ThreadPool::~ThreadPool(): Assertion `mbTerminate' failed." in <https://ci.libreoffice.org/job/lo_gerrit/8283/Config=linux_clang_dbgutil_64/console> and also locally. Revert till it's clear if that assert() should be a SAL_WARN() or unopkg has to be fixed. This reverts commit 9899ffd244dd367ba69dffe1f21f4f0222064a46. Change-Id: I72902f7da410012340aa8231d84c6871a3f7b976
2017-03-11comphelper: fix MSVC hang in ThreadPool::shutdown()Michael Stahl1-5/+16
Commit aa68c99d88fd7abe08c4aee5206c859a0cdba38e added some code using std::condition_variable to comphelper. Built with MSVC 2017, this causes many cppunittester.exe processes to deadlock in ThreadPool::shutdown(): maTasksChanged.notify_all(); This ultimately calls NtReleaseKeyedEvent(), which never returns. The reason appears to be a bug in Windows 7, for which a "hotfix"[1] is avaiable here, but it's apparently not distributed via Windows Update so we likely can't rely on users or even developers having this installed. However, the documentation of DllMain[2] and ExitProcess[3] indicates that during shutdown, by the time global destructors are invoked all threads other than the one that called ExitProcess have already been terminated. Returning from main() implicitly calls ExitProcess [4]. As it turns out the problem only happens for some CppUnitTests because soffice.bin will call ThreadPool::shutdown() from Desktop::doShutdown() while it is still safe. [1] http://support.microsoft.com/kb/2582203 [2] https://msdn.microsoft.com/en-US/library/windows/desktop/ms682583(v=vs.85).aspx [3] https://msdn.microsoft.com/en-us/library/windows/desktop/ms682658(v=vs.85).aspx [4] https://blogs.msdn.microsoft.com/oldnewthing/20100827-00/?p=13023 Change-Id: I6137461ca7efe9a5fbe4f8f8478fb96de3570469 Reviewed-on: https://gerrit.libreoffice.org/35066 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-03-02Fix typosAndrea Gelmini1-1/+1
Change-Id: I35eeb71f4f698e39b7b0d98e3cb30657a64a611a Reviewed-on: https://gerrit.libreoffice.org/34802 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-28new loplugin unoanyNoel Grandin1-2/+2
Change-Id: I5d6c4a67cb2a09e7cd5bd620c6b262d188701b89 Reviewed-on: https://gerrit.libreoffice.org/34714 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-21loplugin:subtlezeroinit: pyunoStephan Bergmann4-5/+5
Change-Id: Id36181c096cbd6f87288fda7f8d37996b538d9bf
2017-02-21remove some unnecessary OUStringBuffer usageNoel Grandin8-77/+32
Change-Id: Iae9146a3be569107019d9c5af404b94e51e76cd5 Reviewed-on: https://gerrit.libreoffice.org/34469 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-15Some simplifications, using UNO_QUERY_THROWStephan Bergmann3-19/+5
Change-Id: Ib973a403a830a3ecf8e57a5e70a581ba06f96a05 Reviewed-on: https://gerrit.libreoffice.org/34264 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-02-10Remove MinGW supportStephan Bergmann6-131/+3
In OOo times, there'd originally been efforts to allow building on Windows with MinGW. Later, in LO times, this has been shifted to an attempt of cross- compiling for Windows on Linux. That attempt can be considered abandoned, and the relevant code rotting. Due to this heritage, there are now three kinds of MinGW-specific code in LO: * Code from the original OOo native Windows effort that is no longer relevant for the LO cross-compilation effort, but has never been removed properly. * Code from the original OOo native Windows effort that is re-purposed for the LO cross-compilation effort. * Code that has been added specifially for the LO cross-compilation effort. All three kinds of code are removed. (An unrelated, remaining use of MinGW is for --enable-build-unowinreg, utilizing --with-mingw-cross-compiler, MINGWCXX, and MINGWSTRIP.) Change-Id: I49daad8669b4cbe49fa923050c4a4a6ff7dda568 Reviewed-on: https://gerrit.libreoffice.org/34127 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-02-06Add missing #includesStephan Bergmann2-0/+2
...and remove some unncessary using directives/declarations, in preparation of removing now-unnecessary #includes from cppumaker-generated files, post e57ca02849c3d87142ff5ff9099a212e72b8139c "Remove dynamic exception specifications". Change-Id: Iaf1f268871e2ee1d1c76cf90f03557527ebc9067
2017-01-26Remove dynamic exception specificationsStephan Bergmann9-74/+32
...(for now, from LIBO_INTERNAL_CODE only). See the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html> "Dynamic Exception Specifications" for details. Most changes have been done automatically by the rewriting loplugin:dynexcspec (after enabling the rewriting mode, to be committed shortly). The way it only removes exception specs from declarations if it also sees a definition, it identified some dead declarations-w/o-definitions (that have been removed manually) and some cases where a definition appeared in multiple include files (which have also been cleaned up manually). There's also been cases of macro paramters (that were used to abstract over exception specs) that have become unused now (and been removed). Furthermore, some code needed to be cleaned up manually (avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no configurations available that would actually build that code. Missing @throws documentation has not been applied in such manual clean-up. Change-Id: I3408691256c9b0c12bc5332de976743626e13960 Reviewed-on: https://gerrit.libreoffice.org/33574 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-01-19New loplugin:dynexcspec: Add @throws documentation, pyunoStephan Bergmann6-2/+24
Change-Id: I1888938e447f8ca115d326d5e4849d6b21904b04
2017-01-09New loplugin:externvar: pyunoStephan Bergmann1-2/+2
Change-Id: Ib6822bf914fe44e8bd590dfe82d25d7c5046ca94
2016-12-25pyuno osx Sierra problem.jan Iversen1-0/+17
On a fresh installed Sierra pyuno fails to build due to a py_UNICODE conversion problem. Py_UNICODE expand to "unsigned short", and OUString expect a form of sal_UNICODE The hack was done locally and not generally expand OUString functionality. Change-Id: Ib7834c423c1c5cd9cd1e8d1ed8393e80bf8a5e5d