summaryrefslogtreecommitdiff
path: root/sal
AgeCommit message (Collapse)Author
2018-03-07Intermediate dir may come into existence during osl_createDirectoryPathStephan Bergmann
...when some other entity creates it in parallel. This used to stop creating any subsequent sub-directories in the chain, and instead return a misleading osl_File_E_EXIST. I assume this is the underlying issue of the sporadic Jenkins "Daily Screenshot Build on Windows" failures. (After the previous attempt at getting at that, d15ff312ad80e4d1f210636e3374a81c14c229a2 "Normalize computation of directory and file-in-directory URLs", <https://ci.libreoffice.org/job/lo_tb_master_win_screenshot/333/console> now failed for a different file after all, workdir/screenshots/modules/schart/ui/datarangedialog/DataRangeDialog.png during CppunitTest_chart2_dialogs_test.) Change-Id: I00ee67c1ef634c5390c677693e143c26266eeda7 Reviewed-on: https://gerrit.libreoffice.org/50892 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-03-07Deduplicate includesMike Kaganski
Change-Id: I16a77d0701b42bcf9d751834f0eae4decedd9176 Reviewed-on: https://gerrit.libreoffice.org/50858 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-03-05Make LibreOffice buildable on Haiku.Kacper Kasper
* Obviously VCL wiring is missing, but most components do build. Change-Id: Ie853ada1423a8f4c2b647be59cd47a7730c42978 Reviewed-on: https://gerrit.libreoffice.org/50293 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2018-03-02Make SAL_LOG_FILE work on Windows also without logging.iniStephan Bergmann
...as used by solenv/gbuild/UITest.mk Change-Id: Iefc1c1dc2f775c6872a5075a16e049f00d60273a Reviewed-on: https://gerrit.libreoffice.org/50618 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-03-02Disable -fsanitize=float-divide-by-zero in rtl_math_atanhStephan Bergmann
...which relies on division by zero producing inf, for atanh(1) = inf. (As tested by CppunitTest_sal_rtl.) Change-Id: I0e5de8850ab4cbd05f83027c1eb548e2e0c9a9b2 Reviewed-on: https://gerrit.libreoffice.org/50613 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-02-24Fix typosAndrea Gelmini
Change-Id: Ie1cff6b690e69d23c16a1a60ef4271d6cf48c13b Reviewed-on: https://gerrit.libreoffice.org/50260 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2018-02-22Use long path prefix in osl_getFileStatusSamuel Mehrbrodt
When installing an extension e.g., paths can get very long and they hit the 255 char limit, thus the installation fails. So we need to prefix the path with the long file name prefix when its longer than MAX_PATH for windows api calls to succeed. Change-Id: Ie62644192ba40a9d4802772cd9837fc84fae947a Reviewed-on: https://gerrit.libreoffice.org/50079 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-02-21New loplugin:nestedunnamedStephan Bergmann
Change-Id: Ifb434589ef08428ce609bc7a40b015d4df13224c Reviewed-on: https://gerrit.libreoffice.org/50048 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-02-12sal android: fix -Werror,-Wimplicit-function-declarationMiklos Vajna
Change-Id: If19dbb654d473e8785dc69f96775c78cc95a7bd6
2018-02-08ofz#6112 wrong start off sets for korean KSC5601 tableCaolán McNamara
Change-Id: If986352478f34f54015f1969c97c26e2ef05c06c Reviewed-on: https://gerrit.libreoffice.org/49444 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-02sal: MSVC: pragma warning: make more specific, remove obsoleteMike Kaganski
Change-Id: Ib7ad23257a966447d627b4f73698d9298790f759 Reviewed-on: https://gerrit.libreoffice.org/49042 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-02-01osl: change osl_psz_removeFile() -> osl_unlinkFile()Chris Sherlock
Also a few cleanups. Change-Id: I3269d623917efda3a873f745dbce8bb25dce79be Reviewed-on: https://gerrit.libreoffice.org/48792 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-30Typ-o negativIlmari Lauhakangas
Fixed some typos and translated a couple of German words Change-Id: I24ae28dd537ba283a9480413659f85bd6711acad Reviewed-on: https://gerrit.libreoffice.org/48892 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-29tdf#49134 tdf#114466 Transfer privilege to become foreground processMike Kaganski
... 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/48839 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-01-29Translate German variable nameJohnny_M
Korr -> Corr in math Change-Id: I33c3d0fa62aa0c4b6fd418ba2e49b90b019b8714 Reviewed-on: https://gerrit.libreoffice.org/48782 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-01-25Remove stdlib.h from sal/config.hStephan Bergmann
This reverts 5da3337c007e0572028283d70bad43e9a29d45c1 "readded include stdlib.h, because of missing NULL definition in many headers, #100000, #101685", which is no longer relevant. Change-Id: I544ed9a7afbf7b611bc481b8d50acca3193d93de Reviewed-on: https://gerrit.libreoffice.org/48131 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-25Fix typosAndrea Gelmini
Change-Id: Ieef0e3f21eb12cb5b72d39da4bc0a8c60dd0d5ce Reviewed-on: https://gerrit.libreoffice.org/48545 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-25Fix typosAndrea Gelmini
Change-Id: I13acf050d83099be8874514688936bb4ddbb1a26 Reviewed-on: https://gerrit.libreoffice.org/48543 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-23Silence upcoming GCC 8 -Werror=sizeof-pointer-memaccessStephan Bergmann
...("error: argument to ‘sizeof’ in ‘char* strncpy(char*, const char*, size_t)’ call is the same expression as the source; did you mean to use the size of the destination?") in a place where the use of strncpy instead of strcpy (introduced with 9276f7d5740a28b342db2a9bcd8644ff2f4f5742 "fdo#32263") doesn't help prevent any buffer overflows anyway (the target's size already having been checked to be sufficiently large). Change-Id: I70773538f4092f1306fb00f1fa7f9138e06894e5 Reviewed-on: https://gerrit.libreoffice.org/48391 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-23Add unit tests for rtl::math's inverse hyperbolic functionsTakeshi Abe
based on i#97605's test cases. Change-Id: Id7e57914553ba8801a624f667979badc191108e5 Reviewed-on: https://gerrit.libreoffice.org/46152 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2018-01-23More loplugin:cstylecast on WindowsStephan Bergmann
Automatic rewrite (of loplugin:cstylecast and loplugin:unnecessaryparen) after cab0427cadddb3aaf1349c66f2fa13a4234ba4b2 "Enable loplugin:cstylecast for some more cases" and a409d32e7f6fc09e041079d6dbc3c927497adfed "More loplugin:cstylecast" Change-Id: Ib3355159dd08333e1b7a8d091caf2069cdcc7862 Reviewed-on: https://gerrit.libreoffice.org/48317 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-22loplugin:nullptr (clang-cl)Stephan Bergmann
Change-Id: Ie60f2cc7c3b0bcba7ddf2e7a0f6837c821b33dcc Reviewed-on: https://gerrit.libreoffice.org/48313 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-20More loplugin:cstylecast on macOSStephan Bergmann
Automatic rewrite (of loplugin:cstylecast and loplugin:unnecessaryparen) after cab0427cadddb3aaf1349c66f2fa13a4234ba4b2 "Enable loplugin:cstylecast for some more cases" and a409d32e7f6fc09e041079d6dbc3c927497adfed "More loplugin:cstylecast" Change-Id: Iff4877e8a42804c952c48c13332caf0a83c92870 Reviewed-on: https://gerrit.libreoffice.org/48216 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-19coverity#1427647 acknowledge Resource leak is deliberateCaolán McNamara
Change-Id: I9d4beccfa7ca8953360d67d08a3b2f04d2ccfed9 Reviewed-on: https://gerrit.libreoffice.org/48178 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-19Remove include of config_global.h from sal/config.hStephan Bergmann
(where it is not actually needed), and instead include it where needed Change-Id: I107f8d4002d3001393b89834dd30a30b0c53a792 Reviewed-on: https://gerrit.libreoffice.org/48152 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-19SAL_W32 is just an alias for _WIN32Stephan Bergmann
...so consistently use the latter instead of the former Change-Id: I144d5e7c472632f93b2258461510346bc85892d9 Reviewed-on: https://gerrit.libreoffice.org/48135 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-18Include android/compatibility.hxx from ubiquitous sal/config.hStephan Bergmann
...instead of having to add it to more and more individual .cxx files, as the need arises. Change-Id: If1e893c79abf1c1bb7fb7b89dcb9bd423a7f1b94 Reviewed-on: https://gerrit.libreoffice.org/48108 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-18android: use unified headers and llvm-c++ STL (x86) with NDK 16Christian Lohmaier
gnustl (and others) are to be removed in future versions of the ndk also bump gradle and build-tools to current versions along with it arm unfortunately crashes with llvm-c++, so keep with gnustl for now/fix that later Change-Id: Ic794c3293b599b77ec48096bf3283a99c09cbb79 Reviewed-on: https://gerrit.libreoffice.org/45163 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2018-01-17sal: use snprintf for sal logThorsten Behrens
Change-Id: I0fe7029991052a59ee56cef1897cf6688bfa24b9 Reviewed-on: https://gerrit.libreoffice.org/48083 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-01-17WNT: allow to set log level/path from fileSamuel Mehrbrodt
Expects a file logging.ini in the program/ directory with the keys LogFilePath and LogLevel, e.g.: LogFilePath=C:\log.txt LogLevel=info Note: This is Windows-only for now. En passant remove extraneous newlines from syslog and android log calls. Change-Id: I35c730469e4079139da908aa287b989dc98e0f9d
2018-01-17tdf#114939: Verify rtl_digest_SHA1 computes broken results, by designStephan Bergmann
This replaces the known-failing test from 8d2da0b94ac5d679ef697683cacb2c83498cc497 "sal: Add rtl_digest_SHA1 which shows wrong sha1 calculation" with the known-succeeding one (though producing wrong results) from tdf#114939 "rtl_digest SHA1 and MD5 code both have an off by 1 bug". Change-Id: Ib4e8210e1889e5ebf4979d7b1f28f1cfb13ebab9 Reviewed-on: https://gerrit.libreoffice.org/48033 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2018-01-17tdf#114939 sal: document the bug in endSHA()Michael Stahl
Change-Id: I58df3705c1e07737747b6f8e3ce91d5278018cbb
2018-01-17Missing includes (Windows --disable-pch)Stephan Bergmann
Change-Id: I5cd3297cff31b88c53cd04232bed40cbf04fa2f6 Reviewed-on: https://gerrit.libreoffice.org/48028 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-16sal: try to fix Android build, no std::roundMichael Stahl
Change-Id: I58bc7c9099cd2a3a90f92efbd179d0f3abce02a6
2018-01-16tdf#114939 sal: fix endMD5() off-by-oneMichael Stahl
Because of the odd non-standard rtl_digest_rawMD5() API that is apparently necessary for MS Office interop, and there not being any good reason for bug-compatibility here, just fix the bug. Change-Id: Iaa0f0af4e24a5ddb9113c1ebd126f9822b5af1f6
2018-01-16tdf#96821 fix corner cases for Calc function ROUND.Winfried Donkers
For very large integer numbers, e.g. 2^52+1, ROUND produced incorrect results because rtl::math::round uses floor( number + 0.5 + small_correction_value ), which reduces the maximum possible mantissa resolution.a Correction of several unit test documents (Calc functions) with rounding errors that only became apparent with this fix. Change-Id: I1769c9939a3d6118d3bfbfdf8e41dd4619997232 Reviewed-on: https://gerrit.libreoffice.org/47179 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2018-01-16Missing includeStephan Bergmann
Change-Id: I3bcc4ff11e37afe29b847ff65f722c7b0ba2c0b0 Reviewed-on: https://gerrit.libreoffice.org/47929 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-15More loplugin:cstylecast: salStephan Bergmann
Change-Id: I1ca982dc8c35c7a2762572d7bb47066ead8e6c89
2018-01-15fix android buildNoel Grandin
Change-Id: Id53f9d2a5adf126db9abeab620bb92b8720425f7
2018-01-15convert a<b?a:b to std::min(a,b)Noel Grandin
with something like git grep -nP '(.*)\s*<\s*(.*)\s*\?\s*\g1\s*:\s*\g2' -- *.?xx Change-Id: Id5078b35961847feb78a66204fdb7598ee63fd23 Note: we also convert a>b?b:a Reviewed-on: https://gerrit.libreoffice.org/47736 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-13sal: remove no longer needed CheckTokenMembership_StubChris Sherlock
CheckTokenMembership_Stub was added in commit ce20f0702 because there was a problem with patching/replacing UWINAPI on Windows ME. To resolve this, CheckTokenMembership was not exported to stay compatible which is no longer an issue. Change-Id: I654a5f5ececa918f844eca541942b9d552fcfa7f Reviewed-on: https://gerrit.libreoffice.org/47217 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-01-12More loplugin:cstylecast: salStephan 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: I7d89b011464ba5d2dd12e04d5fc9f65cb4daebde
2018-01-11convert (a>b?a:b) to std::max(a,b)Noel Grandin
with something like: git grep -nP '(.*)\s*>\s*(.*)\s*\?\s*\g1\s*:\s*\g2' Change-Id: I60b9a3a2a09162bc0de4c13fdde2c209696e5413 Reviewed-on: https://gerrit.libreoffice.org/47602 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-09loplugin:convertlong in ucb,sotNoel Grandin
Change-Id: I6fa355448834701f11b84584649dfcdecd0f7b2c Reviewed-on: https://gerrit.libreoffice.org/47596 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-04ofz#4886 Integer-overflowCaolán McNamara
sal/rtl/math.cxx:1106:29: runtime error: signed integer overflow: 15 - -2147483648 cannot be represented in type 'int' Change-Id: Ia81eca9da1fe7cc1a5c5319742b32bd742fb817e Reviewed-on: https://gerrit.libreoffice.org/47329 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-02Remove broken testStephan Bergmann
...introduced with 26be5f21cebfe9acad088a1086f97eebdb437b7c "unotools: don't go belly-up if temp dir is wrong or empty". At least Flatpak builds can create a /not/found/dir directory just fine. Change-Id: I73115ac99498ac584be77153ef66bba3036392c3 Reviewed-on: https://gerrit.libreoffice.org/47267 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-02Unused return value of rtl_cache_constructorStephan Bergmann
Change-Id: I1e8b8ae65d9989683dde8f642f3c19355d10a571 Reviewed-on: https://gerrit.libreoffice.org/47238 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-01sal: (win32) readd comment explaining about buffer size decisionChris Sherlock
Readd comment explaining why we allocate a large buffer for GetEnvironmentVariableW which was removed in commit f78a2bcce88dd5c12052ae3e55c561cdd48b05fe: re-base on ALv2 code. Includes: Patch contributed by Herbert Duerr: #i118662# remove berkeleyDB from module xmlhelp (author=orwitt) http://svn.apache.org/viewvc?view=revision&revision=1213188 #i119141# remove ISCII converter for now http://svn.apache.org/viewvc?view=revision&revision=1306246 make exceptions for cppunittester verbose http://svn.apache.org/viewvc?view=revision&revision=1174831 Patches contributed by Pedro Giffuni: Avoid some uses of non portable #!/bin/bash in shell scripts. http://svn.apache.org/viewvc?view=revision&revision=1235297 Patch contributed by Oliver-Rainer Wittmann 88652: applied patch, remove unicows deps http://svn.apache.org/viewvc?view=revision&revision=1177585 drop OS/2 code, remove in-line assembler ARM atomics, and obsolete armarch header. Change-Id: I75a222393e202e40d78f10fc97f5eb4aad2df743 Reviewed-on: https://gerrit.libreoffice.org/47018 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-30Support for tcmalloc and jemalloc is long deadStephan Bergmann
When it was originally added to --with-alloc (tcmalloc: f63ffaf3667e218be3538e84e6becc18d5de4334, 54efc5ed83890f0a1166ece3b1e4942bb7922ff7, 0abd71b44144220d2aeec58601929fd0cd1914d6 708b6d4246de915ac960c7b90ee8bb2d966c7d17 "INTEGRATION: CWS configure14: #i59160# allow usage of tcmalloc and system-malloc"; jemalloc: 826a90d68a4dc458585c6d2e647bec17971e9193 "configure25: #i111045# jemalloc"), the old build system's solenv/inc/unxlng*.mk added corresponding -l switches to linker command lines, but it appears that was never carried over into the new build system. And even if the AC_CHECL_LIB calls in configure.ac prior to e612f026de6ca1153c57fb10f0fa75725425a301 "Ensure AC_CHECK_LIB/AC_SEARCH_LIBS do not poison LIBS" would have extended LIBS with the correpsonding -l switches, there appears to be no mechanism in the new build system that would have depended on letting that have any effect on which alloc lib to link against. So the only remaining effect of --with-alloc={tcmalloc,jemalloc} is to set FORCE_SYSALLOC in Library_sal.mk, same as --with-alloc=system does. So whoever still uses the former configure switches should just switch to the latter. (Also adapt the documentation of --with-alloc to reality, "internal" instead of "oo".) Change-Id: Iac0e302c5f9602daf5f8452a0fc1887dc55ee27b Reviewed-on: https://gerrit.libreoffice.org/47178 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-29loplugin:unnecessaryparen improve return checkNoel Grandin
Change-Id: I8128aa4b5fc60efd1dbf5971cdde11e588f5f64b Reviewed-on: https://gerrit.libreoffice.org/47167 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>