summaryrefslogtreecommitdiff
path: root/sal
AgeCommit message (Collapse)Author
2014-03-07Stick to a single O[U]String hash function.Stephan Bergmann
Ported from 98554820e6109c3e3f4ea83bf036d9f20ef1685e Change-Id: I22a6ffd71828295e92798fb1201133c0a5e25eda
2014-03-07String cleanups.Muthu Subramanian
Ported from 4cf0d8edaf1581c42949ad2cbb40183a2f657ddd Change-Id: I4aa32fdeafdd17135c56b9f113f1abd06df892cf
2014-03-07Move string hash function into String class.Muthu Subramanian
hashCode() seems to do sampling while creating the hash. hashCode64() will not. Change-Id: Id30f5a2a774cf5244dbc00da9649e95a532484be
2014-01-28Fix "Save As" when sandboxed on OS XTor Lillqvist
Change-Id: Ibe2ea21265a0bb9c4fedcef137626df2a8019116
2014-01-28More work on a sandboxed LibreOffice on OS XTor Lillqvist
In particular, surround also the ftruncate() operation that osl_setFileSize() does with access through a security scope bookmark for the file, if available. This fixes file saving in a sandboxed LibreOffice. (But oh boy, does simply saving an ODT document go though a weird dance of file operations.) Luckily the C++ oslFileHandle abstraction keeps the pathname that the file was opened with, so even if ftruncate() as such takes only the file descriptor, we can get at the pathname to retrieve our security scope bookmark. Change-Id: I8acb1b2f3fb3ec0cea833697b7f1d4a1912ed551
2014-01-28Do more syscalls using a security scope bookmark on OS X when sandboxedTor Lillqvist
Move the handling of the bookmarks to the wrappers in uunxapi.cxx, and add wrappers for open() and utime(). Change-Id: I92f9941152b567545eea60f2aaae6a3b8d35e792
2014-01-28Bypass the alias resolving completely when sandboxedTor Lillqvist
Attempting to look up the bookmark data for a file will try acessing its resource fork, causing messages like: soffice(83685) deny file-read-data /Users/tml/Documents/b.odt/..namedfork/rsrc Change-Id: I1b2b0b493a46aa629581b921c94c5014f994e75c
2014-01-28Make our File>Recent Documents work better when sandboxedTor Lillqvist
Store security scope bookmarks for files selected in the file picker in the user data. (I looked into storing it in the LO "registry" in the Histories/PickList thingies, but that was horribly complex.) When opening a file, if we have stored a security scope bookmark for it, use that while opening the file. Change-Id: I347ae2dd815299441c17467d9b66a226061d0ed2
2014-01-28Bypass the O_NONBLOCK resetting for now when sandboxed on OS XTor Lillqvist
The fcntl fails. Will have to check later whether we should also drop using O_NONBLOCK when opening then. Change-Id: I529a4d728563eb323e35487782f7fee88b2faa0c
2014-01-28Be a bit more lax when resolving bookmarks when sandboxedTor Lillqvist
Change-Id: I6ada3e660ee58f7937425eea40a4bbd82754f4b1
2014-01-28Don't use deprecated API for OS X alias resolvingTor Lillqvist
Change-Id: Ifaaec1863f12cd73d0a77c3367935f57675157e2
2013-10-24fdo#70319 "exponent followed by at least on digit" also for special case 0.0Stephan Bergmann
Change-Id: I07e7917417b8a22cf6d64f2b7a447f9084b9fa2d (cherry picked from commit 7bbd58eafc3146abcefc73d2d1ca6869bb47ef5a) Reviewed-on: https://gerrit.libreoffice.org/6294 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2013-10-15resolved fdo#70319 exponent must be followed by at least one digitEike Rathke
(cherry picked from commit f20feba4c43c34fd2ee05b4658b0de0248c08eb9) work around crappy SbiScanner::NextSym(), fdo#70319 just to make test not fail that was wrong anyway (cherry picked from commit 472ad8ba7ef99982025b37aba562f2135ca8a999) Change-Id: Icdd22fa0f1efcdd18cfea7cb48e1cbf2cf8d3533 Reviewed-on: https://gerrit.libreoffice.org/6241 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2013-10-10Fail fast at least in debug buildsStephan Bergmann
Change-Id: I266d5cf5b98827617f7ed65c94a772e28808f386 (cherry picked from commit 57a28dc9556b4e6fff337e0eb9d0d8abc5223161) Reviewed-on: https://gerrit.libreoffice.org/6186 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2013-08-30fdo#67313: Use "lo" suffix for private URE libsStephan Bergmann
...(like is done for most of LO's non-URE libs already) to reduce likelihood of name clashes, esp. on Windows where URE libs are found via PATH. This introduces PRIVATELIBS_URE, and [does not remove not-yet]-unused UNOLIBS_URE. (cherry picked from commit 644c33a857c46d540202189228f519946dc33833) Conflicts: Repository.mk solenv/gbuild/Helper.mk solenv/gbuild/platform/IOS_ARM_GCC.mk solenv/gbuild/platform/WNT_INTEL_GCC.mk solenv/gbuild/platform/android.mk solenv/gbuild/platform/com_MSC_class.mk solenv/gbuild/platform/macosx.mk solenv/gbuild/platform/mingw.mk solenv/gbuild/platform/solaris.mk solenv/gbuild/platform/unxgcc.mk Change-Id: Ib95dd45f18de140a54e62d632dbf2239f83c232e Reviewed-on: https://gerrit.libreoffice.org/5667 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2013-07-30Avoid crash on OS X: guarded fd exceptionTor Lillqvist
On OS X, a file descriptor that shows up as being of type "KQUEUE" in lsof output is apparently created behind the scenes when starting a thread. (Related to BSD kernel event queues: see man kqueue.) When we re-exec ourselves on OS X, and then close all file descriptors >= 3, closing such a KQUEUE fd causes a crash. Guard against this by closing only regular files. (cherry picked from commit 73a508f574995f09559c003cb810e5d2ff2691c2) Change-Id: I5011bfbaed156b04248b6bddb2a1a58624bee3d4 Reviewed-on: https://gerrit.libreoffice.org/5173 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
2013-07-08API change: osl/time.h take const pointers where appropriateLionel Elie Mamane
Should be backwards-compatible... Change-Id: I6b04bec2c032ff8c57a1b5192b2d3962dcc96c84 Reviewed-on: https://gerrit.libreoffice.org/4736 Reviewed-by: Michael Stahl <mstahl@redhat.com> Reviewed-by: Eike Rathke <erack@redhat.com> Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
2013-06-10fdo#41226 Add error handling of recursed GetCaseCorrectPathNameEx()Isamu Mogi
This is a cherry-pick of 6d2e3bdac27ade56031d930c85e906c0d35877bc . GetCaseCorrectPathNameEx() with bCheckExistence = true doesn't support windows share path but occasionally it doesn't return failure and returns broken result. For example, when we call with "\\USER-PC\Users\foo" then it converts the path to "\Users\foo". And when "\Users\foo" exists, it returns "\Users\foo". It is caused by missing error handling of searching for file "\\USER-PC". Also similar bug possibly occurs even for local file path. This commit fixes these bugs. Change-Id: If4e390fa99f27fcc2d458bc0f2f53d83bd03719b Reviewed-on: https://gerrit.libreoffice.org/4211 Reviewed-by: Miklos Vajna <vmiklos@suse.cz> Tested-by: Miklos Vajna <vmiklos@suse.cz>
2013-06-06Revert overflow checks in O[U]String::toInt{32,64} againStephan Bergmann
...originally introduced with bd60d41176da540b01d7583cfe00637431967f39 "Handle oveflow in O(U)String::toInt() functions." As pointed out by Noel Power, there is existing code using toInt32(16) to read an effectively unsigned hex string into a sal_Int32, which used to work fine with the wrap-around overflow but now fails when toInt32 explicitly returns 0 for large values. See, e.g., use of oox::AttributeList::getIntegerHex (indirectly calling OUString::toInt32) in ColorScaleRule::importColor (sc/source/filter/oox/condformatbuffer.cxx). To prevent any regressions in LO 4.1, remove the explicit checks from toInt{32,64} again for now. (They were "merely" added as a general safety measure, not to address some specific problem, IIRC.) On master, the approach will rather be to introduce toUInt32 and adapt client code as necessary. Change-Id: Id332cff18a99b8bd2dcccd7988b7aad3a9e98c4c
2013-05-22Revert "Thread-safe version of osl_getGlobalTime"Norbert Thiebaud
This reverts commit d8d55787b81cdc955b73c8befa4ab608f46e32aa. and 9b76439dff638d6fd773f2b63c377c2124810a39 as the change failed to work correctly on MacOSX causing a CPU-Loop in UpdateCheckThread::run() Change-Id: Ide86a5b7dce9550bbc15dfe691d4ed6199a88cc3 Reviewed-on: https://gerrit.libreoffice.org/4002 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2013-05-20WaE: variable ´res´ set but not usedTor Lillqvist
Change-Id: I5f252f75d22f041c76c7d3cfcdd36f69becf086f
2013-05-20sal osl_getGlobalTimer: Don't confuse start and current time.Mark Wielaard
Change-Id: I575dd70d6b80d4f3279476037e509550cfa23fde Reviewed-on: https://gerrit.libreoffice.org/3979 Reviewed-by: Tor Lillqvist <tml@iki.fi> Tested-by: Tor Lillqvist <tml@iki.fi>
2013-05-20Also iOS has tm_gmtoffTor Lillqvist
Change-Id: Ic0f883672b4bde3142ac257a57464bdbb90df96b
2013-05-20iOS is based on Mach, tooTor Lillqvist
Change-Id: I9b6bdc374c9e92af754094f31e1ff212fb386f9e
2013-05-20Thread-safe version of osl_getGlobalTimeNorbert Thiebaud
Change-Id: Ibb9d23780600437f607d866ff3d396b96879245d Reviewed-on: https://gerrit.libreoffice.org/3960 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
2013-05-15Spelling "separate" (etc) correctly is hardTor Lillqvist
2013-05-14Fix syntax errorTor Lillqvist
Change-Id: I161cf0fb2c5bd071a963ece61928efb7938de6c2
2013-05-14Include PID and TID in SAL_DEBUG outputStephan Bergmann
...and clean up log.cxx somewhat. Change-Id: I657cf6c938cafa61959a8dc59c9f95dba5183d9f
2013-05-13clock_gettime requires -lrt at least on Fedora 18Stephan Bergmann
Change-Id: Id01c86517a89dffd560440d333a37eaa80738b56
2013-05-13Use clock_gettime instead of gettimeofday to have more precise timeArnaud Versini
Change-Id: I8e568368e7626789dee21d4823dbedec6257a231 Reviewed-on: https://gerrit.libreoffice.org/3841 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2013-05-10soltools: remove Package_inc and empty unistd.h nonsenseMichael Stahl
Change-Id: Ic05de69951b28b9cc8d62f0a534b507c424e6b25
2013-05-06fix typos (wich instead of which)Philipp Riemer
2013-05-06remove usage of RTL_CONSTASCII_USTRINGPARAMLuboš Luňák
Mechanical removal of usage together with OUString ctor, done by compiler plugin. Change-Id: I554227f76df0dac620b1b46fca32516f78b462c5
2013-04-30Move to MPLv2 license headers, with ESC decision and author's permission.Michael Meeks
2013-04-26This *is* C codeTor Lillqvist
Change-Id: I4461b7a38862ad2c9861861fad8d6bf4bafd01ab
2013-04-26fdo#63154: Remove all usages of the macro EXTERN_CMarcos Paulo de Souza
Change-Id: I25b7f509ba5d1007a16c84ad05870a8174c094ec Reviewed-on: https://gerrit.libreoffice.org/3621 Reviewed-by: Tor Lillqvist <tml@iki.fi> Tested-by: Tor Lillqvist <tml@iki.fi> Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2013-04-25update pchThomas Arnhold
Change-Id: I67e73438312f2a672e71762ee6707ec5d425bb47
2013-04-24gbuild: drop empty use_packages callsDavid Tardon
Change-Id: I8e9f70eb5d929c98b4379416c2259a74e31d587f Reviewed-on: https://gerrit.libreoffice.org/3503 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2013-04-24gbuild: drop uses of removed packagesDavid Tardon
Change-Id: I400fad08c0ae7b6b34bad63693f54856867e4dac Reviewed-on: https://gerrit.libreoffice.org/3502 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2013-04-24move sal_inc headers to include/David Tardon
Change-Id: I840c681b7c500640d3983e05e9895f3fa8bb1313 Reviewed-on: https://gerrit.libreoffice.org/3501 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2013-04-24move URE headers to include/David Tardon
Change-Id: Ib48a12e902f2311c295b2007f08f44dee28f431d Reviewed-on: https://gerrit.libreoffice.org/3499 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2013-04-22Avoid warnings from compilerplugins/clang/sallogareas.cxxStephan Bergmann
Change-Id: Icce3ffd29398a3488e7704562a4e9064f106b393
2013-04-22Move to MPLv2 license headers, with ESC decision and author's permission.Michael Meeks
2013-04-22Revert "fdo#62096: Replaced some compareTo with =="Fridrich Štrba
This reverts commit dd47994722eaead16099145e593fbf878072d52b.
2013-04-22fdo#62096: Replaced some compareTo with ==Sameer Deshmukh
Change-Id: I1151dafcef91abdb2ce08abe3547a49fe3f4a67c Reviewed-on: https://gerrit.libreoffice.org/3509 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
2013-04-19sal: remove obsolete test/unloadingMatúš Kukan
Change-Id: I76ede5abd4662aaa2f5b01739da07cf3169ddb69 Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2013-04-19better use SAL_LOG_INFO as triggerBjoern Michaelsen
Change-Id: I37635f9bd86d194b303705a58d81502d7d586692
2013-04-19Add pan gesture handlingTor Lillqvist
I get exactly the same kind of artefacts as in the Android app, which I guess is good as it is at least consistent, as the implementation at the LO layer is identical... Change-Id: Icf0690fd2c48a133cb66de2ab7977b7088d2199e
2013-04-18forward RTL_CONTEXT_foo logging to SAL_INFO in default debuggingBjoern Michaelsen
* RTL_CONTEXT_foo is originally intended to be used for performance measurement, but mostly unused right now * however its macros are sprinkled all over the codebase and might provide good help for ad-hoc debugging, and prevent SAL_INFO duplication * if there is no performance logging, these macros are now forwarded to SAL_INFO with logarea "logfile" or "$AREA.logfile" Change-Id: I495c8924e5b55124f7eac68eccda074d0740c117 Reviewed-on: https://gerrit.libreoffice.org/3421 Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com> Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2013-04-17fdo#62096 - replace some O(U)String compareTo with ==Artur Dryomov
Change-Id: I98d04d7da4c2b7ea0b769df9c2bfa8c1ad86bf2d Reviewed-on: https://gerrit.libreoffice.org/3422 Reviewed-by: Thomas Arnhold <thomas@arnhold.org> Tested-by: Thomas Arnhold <thomas@arnhold.org>