summaryrefslogtreecommitdiff
path: root/sal/osl
AgeCommit message (Collapse)AuthorFilesLines
2018-01-30tdf#49134 tdf#114466 Transfer privilege to become foreground processMike Kaganski1-0/+8
... to already open soffice process from newly spawned one on Windows. When an application takes user input, a timeout is started during which other processes cannot create foreground windows that might steal focus, and thus interrupt user input. The timeout is defined by SPI_SETFOREGROUNDLOCKTIMEOUT (see SystemParametersInfo) and ForegroundLockTimeout registry setting (see https://technet.microsoft.com/en-us/library/cc957208). If an application that currently doesn't have right to become foreground tries to show popups in this interval, the popup will stay on background, and only flash in taskbar. The application that has the right to steal focus (see the list in https://msdn.microsoft.com/en-us/library/ms632668) may transfer its right to another process using AllowSetForegroundWindow function. So, the intended effect is this: 1. User interacts with some foreground process (e.g., Explorer); a timeout is started to prevent non-privileged processes from stealing focus; 2. As the result, the process launches a new soffice process, which has privilege to create foreground windows (as it is started by foreground process); 3. It communicates with already started soffice process, which is currently in background, and so doesn't have privilege to create foreground windows until timeout expires; 4. It transfers its right to the already started soffice process, and then issues the required commands that might lead to need to show popup windows. Change-Id: I4208665c2ae4106fa06e72269f4c3804af40d582 Reviewed-on: https://gerrit.libreoffice.org/48849 Reviewed-by: Aron Budea <aron.budea@collabora.com> Tested-by: Aron Budea <aron.budea@collabora.com>
2018-01-17-Werror=format-truncationStephan Bergmann1-2/+7
Change-Id: I1b27289724389018bd4048573e8c8e4cf28eb983 (cherry picked from commit 280cd27dbdab438e63ecb2599ab5dd20e04d71d5)
2017-12-05remove UL/L suffixes from integer constants on the RHS of expressionsNoel Grandin1-1/+1
Reviewed-on: https://gerrit.libreoffice.org/41237 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 2e8acde112e1c6754df26902e79a78346ba45a2d) Change-Id: I899a8126c9d971601fea6c77eca165718aea0ac5 Reviewed-on: https://gerrit.libreoffice.org/45452 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com> (cherry picked from commit 2887aefa4d4f60ba8b0cd7efd5d3a73ffb209781)
2017-02-01sal: add SAL_NO_ASSERT_DIALOGS variable to redirect...Michael Stahl1-0/+18
... the dialogs that pop up on assert() and abort() to stderr, which should work better in CI builds. Change-Id: I80ec95bae6cc21b8ac27f68ca93aa6c6cce707f4 (cherry picked from commit 2fc5a65a1808ce4304ea55f06c4587a2459b5d52) Reviewed-on: https://gerrit.libreoffice.org/33719 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-11-21fix for 'warning C4702: unreachable code'Jochen Nitschke1-1/+1
on windows vista and higher only Change-Id: I19cc63ad7e96b58fa8eb341801f5ad55260abf85 Reviewed-on: https://gerrit.libreoffice.org/31021 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-08Use the larger stack size for ASan/UBSan builds on macOS, tooStephan Bergmann1-3/+1
At least on my macOS 10.12.1, PTHREAD_STACK_MIN is 8192 (so stacksize was substantially smaller than 12MB), and without this change there were randomly looking failures in e.g. JunitTest_chart2_unoapi with a -fsanitize=address build. Change-Id: Icfe989a0e5097a9a0ae76c6e0f6ffcca18271245
2016-11-02loplugin:unusedfieldsNoel Grandin2-14/+0
Change-Id: I96634c18ba6600f8f7d5d04a162dcd7e1e312923 Reviewed-on: https://gerrit.libreoffice.org/30474 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-26sal::detail::logFormat is no longer neededStephan Bergmann2-47/+9
...since 97354578d7195bce927f0c00c4e2ae9cd7344776 "Remove the obsolete functionality originally underlying osl/diagnose.h" Change-Id: I7c920bca9cdddb37fcbbc15d8629d01c21eb0787
2016-10-19loplugin:expandablemethodds in reportdesign..salNoel Grandin1-5/+0
Change-Id: Idb133e442b881d263fcb83a4858c4a08b451c0f0 Reviewed-on: https://gerrit.libreoffice.org/30032 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-13SOCKET_USE_AUTODIAL is dead codeStephan Bergmann2-231/+55
...ever since 010f71130b0d55079d01fbda38d45901de98b133 "INTEGRATION: CWS sal01: #105958# Remove usage of wininet.dll autodial functions" wrapped its central code in #ifdef SOCKET_USE_AUTODIAL instead of removing it properly. Change-Id: I4c077c71ce8eda3a3f8b83286178d0d7907a6e02 Reviewed-on: https://gerrit.libreoffice.org/29742 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-04At least MSVC 2015 doesn't find sal/osl/w32/time.hStephan Bergmann1-1/+1
...when included as <time.h> (our rather sick convention, for include files other than standard headers) rather than "time.h" Change-Id: I5aacfb81de95ae4254e39badffc9c83c7ac0f58f
2016-10-04clang-cl loplugin: salStephan Bergmann31-907/+1040
Change-Id: If04d3f07dc8bffac8887773b5424c09848cd8f1a Reviewed-on: https://gerrit.libreoffice.org/29404 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-09-30sal: WNT: print errno when oslCreateThread failsMichael Stahl1-0/+20
Change-Id: Iad0a2a7ba68b3f43c22e0b5a3cee646f8baba30e
2016-09-30osl_getSocketOption shall return the new lengthStephan Bergmann1-1/+1
regression introduced with c89f22ffcd4191f7cb8ef0e68adb2a0f0ec6c74e "INTEGRATION: CWS pj72" Change-Id: Icea8bc43e346dbe4cf7cbfdf1176704d52b339f4
2016-09-15Remove outdated commentTor Lillqvist1-1/+0
Change-Id: I8547760d4ea24205e21f215f25f0c58757bd9329
2016-08-18Fix sal log for 32 bit Linux buildGiuseppe Castagno1-1/+1
Change-Id: I2644079cafa46db8689463e1d0abc1cf3bdf49de Reviewed-on: https://gerrit.libreoffice.org/28222 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2016-08-18Move comment block back where it wasTor Lillqvist1-3/+3
Change-Id: I020c1def83d7cc37f9d5e14f2fefacb31a56bbbf
2016-08-18If no WARN in SAL_LOG, use the INFO selection for WARNs, tooTor Lillqvist1-3/+7
Often the choice whether some particular message is displayed with SAL_INFO or SAL_WARN has not necessarily been that well thought through. Many SAL_WARNs are not actually warnings but purely informative. If you want to see the INFOs for an area it makes sense to want to see also the WARNs for it. So make it so, unless a specific WARN selection is specified. Change-Id: I6286c5f856b29e68bedb7f20efadf56953f94b72
2016-08-18Add handling of a +RELATIVETIMER flag in the SAL_LOG environment variableTor Lillqvist1-23/+50
Outputs a timestamp in decimal seconds (with millisecond accuracy). Simplified the handling of SAL_LOG if no "level" is specified. Now just a totally unset (or empty) SAL_LOG causes the default of "+WARN" to be used. Given how the code works, it would have become too unwieldy to check for all combinations of TIMESTAMP and RELATIVETIMER but no WARN or INFO. Change-Id: I7bb5bb665d4e764e7eee447e93486f6467042e97
2016-08-18No need for nested unnamed namespacesTor Lillqvist1-5/+3
Change-Id: I586c11d4fe61b56624ee158c04e365cfb0cc4012
2016-08-18Add handling of a +TIMESTAMP flag in the SAL_LOG environment variableTor Lillqvist1-2/+56
Change-Id: I9bdcd8b2d7b46a087d7f5461b6f7c3d9f02ec084
2016-08-05loplugin:countusersofdefaultparams in oox..sdNoel Grandin1-1/+1
Change-Id: I4504939a3957606979c6ac36af6611e1fe072d01 Reviewed-on: https://gerrit.libreoffice.org/27902 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-13Remove __cplusplus-checks from apparently-C++-only filesStephan Bergmann1-4/+0
Change-Id: I87e9ce45cf945e75e8140a9d4608da8abcddada6 Reviewed-on: https://gerrit.libreoffice.org/27187 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-07-05Clarify calculation precedence tdf#39440Muhammet Kara1-9/+9
Use parentheses to clarify the code. Change-Id: I864dc6dacadb5b9ba9dca8e0abd9fa4e6db1eddc Reviewed-on: https://gerrit.libreoffice.org/25677 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-06-29move #includes to top of fileNoel Grandin1-1/+4
instead of being randomly embedded somewhere deep inside the CXX code. Found with: git grep -nP '^#include' -- *.cxx | sort -g -k 2 -t : Change-Id: I9ee432d3b665ecb6ec600bd51cc4b735a1b1127a Reviewed-on: https://gerrit.libreoffice.org/26764 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-06-23tdf#99589 - tolower / toupper - dangerous to Turks ...Gökhan Gurbetoğlu1-1/+2
Change-Id: I8b0fe9354232a7b60f3605fa6f90f6741f7bf683 Reviewed-on: https://gerrit.libreoffice.org/26537 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-06-20switch to EHs on windowsMarkus Mohrhard3-56/+3
This seems to be a good idea based on several discussions in the project. In the end catching SEH exceptions is just going to cause strange platform dependent bahavior. This patch is based on on http://thread.gmane.org/gmane.comp.documentfoundation.libreoffice.scm/39102/focus=55516 and includes some additional cleanup of the sal signal code. Change-Id: Iedc998e37e6495afec445eccb60fa1c2b1a7defd Reviewed-on: https://gerrit.libreoffice.org/26497 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-06-19loplugin:salbool: Implicit conversions from non-Boolean fundamental typesStephan Bergmann1-12/+23
Change-Id: I67eac95686678e6f5a2d60798535b2c65a9ba5d7
2016-06-18move the code for tdf#99410 to the sal init windows codeMarkus Mohrhard1-0/+6
Change-Id: I4ead30fa1736a3a99fb3379e89367934c8df2809 Reviewed-on: https://gerrit.libreoffice.org/26444 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Jenkins <ci@libreoffice.org>
2016-06-17Revert "fdo#38913: Prevent invalid parameter handler crashes"Stephan Bergmann1-28/+0
This reverts commit a82e532ce006c54b2740de74d1da5d11307da7c1. That hack should no longer be necessary now that the root cause for tdf#38913 has probably been found and fixed with b5876bfcb69a65c87d602bae687b3c0634c0a1e7 "passing a NULL pointer to fileno is not allowed". Conflicts: sal/osl/w32/salinit.cxx Change-Id: Id3a3d3163945acc9b5d5e74a8d357dfa2ce63f37 Reviewed-on: https://gerrit.libreoffice.org/26411 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-05-30tdf#100021 - format argument issue in process.cxxRichard PALO1-1/+1
avoid warning whether pid_t is long or int Change-Id: I533175b53166cb233169902d277906f5ce979421 Signed-off-by: Richard PALO <richard@NetBSD.org> Reviewed-on: https://gerrit.libreoffice.org/25593 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2016-05-25SAL_FALLTRHOUGH in Windows-only codeStephan Bergmann2-0/+4
Change-Id: If35da46c209746a86687e1c3f60f72f2f08aa681
2016-05-18limit scanf string field widthJochen Nitschke1-2/+2
Change-Id: I9070bae914d923171b6eaf8209de00922dc87be7 Reviewed-on: https://gerrit.libreoffice.org/25052 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2016-05-16get breakpad signal handler working on windowsMarkus Mohrhard1-2/+12
The LibreOffice signal handler overwrites the breakpad signal handler. Just store the old handler and call that handler before we do any work in our own handler. Our own handler implementation is just insane as we are even trying to take the SolarMutex which can easily deadlock. Change-Id: I2401bba18701115561d00c7fc11138ead2a48205 Reviewed-on: https://gerrit.libreoffice.org/25022 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-05-16fix typoMarkus Mohrhard1-1/+1
Change-Id: Icfc4b73d5664c205ad642c660af5227f403d20ff Reviewed-on: https://gerrit.libreoffice.org/25021 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-05-12-Werror,-Wimplicit-fallthroughTor Lillqvist1-6/+6
Fix "fallthrough annotation in unreachable code". Clang is clever enough to know that code after assert(false) is unreachable in a non-NDEBUG build. Seriously, micro-optimisation of the case that should never be reached? Change-Id: I10d7ae60895437be52c27aa93539d17e0f091ac4
2016-05-11sal: -Werror,-Wimplicit-fallthroughMichael Stahl1-2/+2
Change-Id: Id8262e735b9f95d8b476a4939c362648e2a4328a
2016-05-10Add SAL_FALLTHROUGH, where apparently appropriateStephan Bergmann1-0/+1
Change-Id: Ib67f7cb71255a32810f09a6b7e528f024bbef9df
2016-05-10Replace fallthrough comments with new SAL_FALLTHROUGH macroStephan Bergmann1-1/+1
...which (in LIBO_INTERNAL_ONLY) for Clang expands to [[clang::fallthrough]] in preparation of enabling -Wimplicit-fallthrough. (This is only relevant for C++11, as neither C nor old C++ has a way to annotate intended fallthroughs.) Could use BOOST_FALLTHROUGH instead of introducing our own SAL_FALLTHROUGH, but that would require adding back in dependencies on boost_headers to many libraries where we carefully removed any remaining Boost dependencies only recently. (At least make SAL_FALLTHROUGH strictly LIBO_INTERNAL_ONLY, so its future evolution will not have any impact on the stable URE interface.) C++17 will have a proper [[fallthroug]], eventually removing the need for a macro altogether. Change-Id: I342a7610a107db7d7a344ea9cbddfd9714d7e9ca
2016-05-05clang-tidy modernize-loop-convert in oox to saxNoel Grandin1-14/+14
Change-Id: If0d87b6679765fc6d1f9300c6972845cf3742b9c Reviewed-on: https://gerrit.libreoffice.org/24674 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-02sal_Bool -> boolStephan Bergmann1-2/+2
Change-Id: I6e86cb7ffbd8c8cbf3cccaef656cf7b7e755e24f
2016-04-22Avoid reserved identifiersStephan Bergmann1-5/+5
Change-Id: I0164df28e2d05f4f73bd640d3ca3cc3220b57df6
2016-04-22Is __OPENTRANSPORTPROVIDERS__ (still) neededStephan Bergmann1-1/+0
...to be set before including Carbon/Carbon.h? Was originally introduced with c34f2e30bbad1a6b92308d0daabe413bd1bc161b "INTEGRATION: CWS pj51: #i61959# patch applied", but might just be cargo cult these days. Change-Id: I20cdc938d28e075614f6711a06ab785700833aff Reviewed-on: https://gerrit.libreoffice.org/24293 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-04-20loplugin:salbool: Automatic rewrite of sal_False/TrueStephan Bergmann10-89/+89
Change-Id: I6c656f991999791469015500aff1905fdb16ba65
2016-04-14Work around -Werror=logical-op (GCC 6)Stephan Bergmann1-34/+33
...when SIG_DFL happens to be defined as nullptr, by initializing the Signals array to SIG_DFL in the first place Change-Id: Ie9183540e2e8fd795aa288bf30266bc5d9af3e69
2016-04-12Avoid reserved identifiersStephan Bergmann1-55/+55
Change-Id: I0a8dc9591c00188d0a31feb784d14ec53f389f27
2016-04-11tdf#94306 replace boost::noncopyable r.. to sdextJochen Nitschke2-4/+7
... in modules reportdesign to sdext Replace with C++11 delete copy-constructur and copy-assignment. Remove boost/noncopyable.hpp includes. Make some overloaded ctors explicit (most in sd slidesorter). Add deleted copy-assignment in sc/inc/chart2uno.hxx. Change-Id: I21d4209f0ddb00063ca827474516a05ab4bb2f9a Reviewed-on: https://gerrit.libreoffice.org/23970 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-07Drop pointless "internal" directory level for already internal include filesTor Lillqvist10-10/+10
Change-Id: I496fdbab3e17c806c2d16513412c4c1b9120bc3c
2016-04-06sal: GetSystemTimePreciseAsFileTime requires Windows 8Michael Stahl1-6/+7
3979afceecb98780549fda60c7f75c8015bb33d8 broke the build on Windows 7. Change-Id: I142208c062d56d6a3daa8213a877411edde45e55
2016-04-04osl_getSystemTime: use high precision timer of W32, if availableLászló Németh1-2/+20
Change-Id: I7029f37639ead7a8b597ff39d1abcd295fab0551