summaryrefslogtreecommitdiff
path: root/sal
AgeCommit message (Collapse)Author
2018-04-20loplugin:constantparamNoel Grandin
Change-Id: Ia58d8950b3b9e48bbe9f075b9fe1eed62d9abf0d Reviewed-on: https://gerrit.libreoffice.org/53188 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-19cppcheck - fix variableScope in some filesGökhan Gurbetoğlu
Reduced the scope of some variables in source. Change-Id: I705e7f2587fd81015f06fb301eb8d4a270668d73 Reviewed-on: https://gerrit.libreoffice.org/53042 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Gökhan Gurbetoğlu <gokhan.gurbetoglu@pardus.org.tr> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-16loplugin:useuniqueptr in sal/qa/Noel Grandin
Change-Id: I20b5cfe2fd95da3f37a6812af5683bcc4d918b06 Reviewed-on: https://gerrit.libreoffice.org/52882 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-16cppcheck: variableScope & unreadVariableMuhammet Kara
Change-Id: Iaa3adc54d547e243b977a562fa4dbc2b9b9c6592 Reviewed-on: https://gerrit.libreoffice.org/52905 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Muhammet Kara <muhammet.kara@pardus.org.tr>
2018-04-08Properly filter(out) - pattern words are the first argumentMike Kaganski
https://www.gnu.org/software/make/manual/html_node/Text-Functions.html Change-Id: Ifb1d92cd9c7b59360d296026f01aa54ed83ed9c3 Reviewed-on: https://gerrit.libreoffice.org/52604 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-04-08While at it, combine the check for ANDROID with the ones for WNT and HAIKUTor Lillqvist
Also, order them alphabetically. Change-Id: I144331d71455c1c794d300f9a4f4e2e21fcd5e1b
2018-04-08GNU Make's filter-out is hard to useTor Lillqvist
Change-Id: I99ec6176c0876b948e35880f02d54905d26e7280
2018-04-06osl: Remember the last error before returning osl_Socket_ErrorTakeshi Abe
This prevents from e.g. com.sun.star.bridge.UnoUrlResolver's emitting confusing messages, when trying to connect to a port on which no LibreOffice process is listening, like: > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > __main__.NoConnectException: Connector : couldn't connect to socket (Success) ^^^^^^^ After applying this patch: > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > __main__.NoConnectException: Connector : couldn't connect to socket (Connection refused) You can see the above behavior with the following python code: import uno x = uno.getComponentContext() y = x.ServiceManager z = y.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", x) url = "uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext" a = z.resolve(url) ... provided that no process is waiting on port 2002. Change-Id: Id094cf9271fe77d84f2284d91a0e452448de2bc2 Reviewed-on: https://gerrit.libreoffice.org/52018 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-06fflush() followed by fclose() is redundantTakeshi Abe
Change-Id: Iacb9332635cb6afa90ec1a72e96388b3b5b7b56c Reviewed-on: https://gerrit.libreoffice.org/52420 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-03osl: Fix possible memleakTakeshi Abe
Change-Id: I162993df6b802bd51e4e079b3dc530476b220e4e Reviewed-on: https://gerrit.libreoffice.org/52325 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-28Revert "Temporary hack for iOS: open files read-only if read-write open fails"Stephan Bergmann
This reverts commit bdbb0d1cc13a11c8c857ee2d387771a8c2622488. Assumed to no longer be necessary after 9906c6d2a55b6f8a27903f0ef08aa8949d7a71c2 "rhbz#1559633: Treat EPERM same as EACCES when opening files". Conflicts: sal/osl/unx/file.cxx Change-Id: I9f7ef544da3fec00810cd1d55bb52bf0470d1054 Reviewed-on: https://gerrit.libreoffice.org/51979 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Jenkins <ci@libreoffice.org>
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