summaryrefslogtreecommitdiff
path: root/sal
AgeCommit message (Collapse)Author
2017-09-15sal/osl/w32/security.cxx: don't use 8-bit string functionsMike Kaganski
We don't support Windows versions that don't have Unicode support. In all currently-supported Windows versions, all FooA() functions are actually wrappers for FooW() variants. We don't need to fallback to A functions, and also don't need to do useless Unicode<->8-bit conversions that also may result in data loss. Change-Id: Ie21337c150ec0b9b4386c27d46f6596c14c4dd9f Reviewed-on: https://gerrit.libreoffice.org/42281 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-14tdf#103525: a blind fix: try Unicode function firstMike Kaganski
Change-Id: If088efdcbf41807ac8fad2410953abb685c8ea01 Reviewed-on: https://gerrit.libreoffice.org/42274 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-09-13New rtl::isUnicodeScalarValue, rtl::isSurrogateStephan Bergmann
There are apparently various places that want to check for a Unicode scalar value rather than for a Unicode code point. Changed those uses of rtl::isUnicodeCodePoint where that was obvious. (For changing svtools/source/svrtf/svparser.cxx see 8e0fb74dc01927b60d8b868548ef8fe1d7a80ce3 "Revert 'svtools: HTML import: don't put lone surrogates in OUString'".) Other uses of rtl::isUnicodeCodePoint might also want to use rtl::isUnicodeScalarValue instead. As a side effect, this change also introduces rtl::isSurrogate, which is useful in a few places as well. Change-Id: I9245f4f98b83877145a4d392f0ddb7c5d824a535
2017-09-13Silence -Werror,-Wunreachable-code on AndroidStephan Bergmann
Change-Id: Ide7591b4012f23e8a3faa705537937efcac435a2
2017-09-13Silence warning C4701: potentially uninitialized local variableStephan Bergmann
Change-Id: Ia37347108f9fe7094f055a5c6f2ec9511c3aff1d
2017-09-13Make reading UTF-8 strictStephan Bergmann
Consider non-shortest forms, surrogates, and representations of values larger than 0x10FFFF (which can even cover five or six bytes, for historical reasons) as "invalid" (they used to be considered as "undefined" instead). This is in response to fc670f637d4271246691904fd649358ce2e7be59 "svtools: HTML import: don't put lone surrogates in OUString" (which can now be reverted again in a follow-up commit). My fear would have been that some places in the code rely on the original, relaxed handling, but at least 'make check' still succeeded for me. Change-Id: I017e6c04ed3c577c3694b417167f853987a1d1ce
2017-09-06Clean up sal/backtrace.hxxStephan Bergmann
Change-Id: Id78e9c0ca29ff2e52591f3d446431ac23c20ab7a Reviewed-on: https://gerrit.libreoffice.org/41926 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-09-04loplugin:unnecessaryparen include c++ castsNoel Grandin
Change-Id: I132d3c66f0562e2c37a02eaf4c168d06c2b473eb Reviewed-on: https://gerrit.libreoffice.org/41874 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-29loplugin:cstylecast/nullptr (clang-cl)Stephan Bergmann
Change-Id: I04be0f4fe8c98909b37586080096ee05341f956f
2017-08-28Fix type of errno/WSAGetLastError()Stephan Bergmann
...as got broken with 3d5be8cd31bcf6fce8772133298d2ae076361362 "osl: give warning on socket error (win32), move Flag definition (unx)" Change-Id: Ib68540596b0bc2cda3e809e765c7d41ca45dda71
2017-08-28osl: cleanup osl_(acquire|release|close)SocketChris Sherlock
Change-Id: Ifc0b88963bcd28e5709accdf892b2cb16b2b55eb
2017-08-27osl: rename win32 socket internal function namesChris Sherlock
Change-Id: Ie58189e254f31d77cb4adafe599c48e64ef6a1a3 Reviewed-on: https://gerrit.libreoffice.org/41611 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-08-27osl: give warning on socket error (win32), move Flag definition (unx)Chris Sherlock
Change-Id: I34b773f32a055dfe85ec9c42e72a9f51ee8fea10 Reviewed-on: https://gerrit.libreoffice.org/41610 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-08-27osl: remove commented out reversemap functionsChris Sherlock
Change-Id: I0354cf98ba3804505970e881dfff45a4d9a227da Reviewed-on: https://gerrit.libreoffice.org/41609 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-08-27osl: remove extraneous comment cruft from socket.cxxChris Sherlock
Change-Id: I6979493a629874ab38629b655c47c299b24abdcd Reviewed-on: https://gerrit.libreoffice.org/41608 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-08-25ofz#2852 korean table entries start at 0xF not 0x7Caolán McNamara
Change-Id: Iaf3ed48d0eb0e5a57770af057c565a7310bb96d4 Reviewed-on: https://gerrit.libreoffice.org/40761 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-08-22loplugin:unnecessaryparen (clang-cl)Stephan Bergmann
Change-Id: I61b006051e708636f0bba83b16de36f4571b8da7
2017-08-18missing include (--disable-pch)Stephan Bergmann
Change-Id: I4e8ae42e2e0c285d34098bebd637ad6d4abaf6a0
2017-08-18Fix typosAndrea Gelmini
Change-Id: I795059109e23800987cda6f04c58ab18c488ad07 Reviewed-on: https://gerrit.libreoffice.org/41242 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-08-17Fix typosAndrea Gelmini
Change-Id: Iaa9c0aea3ea1a239e378bd714ba335f91bb1faf3 Reviewed-on: https://gerrit.libreoffice.org/41194 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2017-08-17Remove excess SAL_WARNsStephan Bergmann
Each such precondition violation for that URE API function would already result in osl_File_E_INVAL anyway. Change-Id: I279949ae8f341e6272bb4574da712fd693461acd
2017-08-17remove unnecessary use of OUString::getStrNoel Grandin
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-08-17remove UL/L suffixes from integer constants on the RHS of expressionsNoel Grandin
Change-Id: I899a8126c9d971601fea6c77eca165718aea0ac5 Reviewed-on: https://gerrit.libreoffice.org/41237 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-17remove UL/L suffixes from shift-by-constant expressionsNoel Grandin
Change-Id: Ia470f643e3eefeccc14183133603db260460bd53 Reviewed-on: https://gerrit.libreoffice.org/41212 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-16Dead codeStephan Bergmann
...introduced with aeb3853a21435f00f225d751e56184e875bc46ed "osl: (Win32) check allocated pipe succeeded, otherwise needs to fail" Change-Id: Ieeb0b1755e74f583d1b52447eb84f7512eb07914
2017-08-16assert on duplicate listener in SfxListenerNoel Grandin
To enable finding the source of the duplicate calls, I add new SAL API (only for internal use) to retrieve and symbolise stack backtraces. The theory is that it relatively cheap to just store a backtrace, but quite expense to symbolise it to strings. Note that the backtrace() library we use on Linux does not do a particularly good job, but it gives enough information that developers can use the addr2line tool to get more precise info. Explanation of fixes in the code that triggered the assert: In SwFrameHolder, we need to only call StartListening() if the pFrame member is actually changing. We also need to call EndListening() on the old values when pFrame changes. In SwNavigationPI, there is already a StartListening() call in the only place we assign to m_pCreateView. In ImpEditEngine, we need to ignore duplicates, because it is doing a ref-counting thing. By storing duplicates on the listener list, it doesn't need to keep track of which stylesheets its child nodes are using. Given that it therefore will see duplicate events, there is probably some performance optimisation opportunities here. In MasterPageObserver::Implementation::RegisterDocument, we seem to be getting called multiple times with the same SdDrawDocument, so just check if we've been registered already before calling StartListening() In SvxShape::impl_initFromSdrObject, do the same thing we do elsewhere in this class, i.e. only call StartListening() if the model has changed. Change-Id: I7eae5c774e1e8d56f0ad7bec80e4df0017b287ac Reviewed-on: https://gerrit.libreoffice.org/41045 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-11convert std::map::insert to std::map::emplace IINoel Grandin
Change-Id: Ief8bd59c903625ba65b75114b7b52c3b7ecbd331 Reviewed-on: https://gerrit.libreoffice.org/41019 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-07loplugin:unnecessaryparenStephan Bergmann
Change-Id: I840f0638e02819398bae901d799a1882e0045d8e
2017-08-07loplugin:oncevarStephan Bergmann
Change-Id: Id88149b2ebbf869474192cc22b862093db21aeb6
2017-08-02If we are going to warn about an "invalid" URL, at least tell what it isTor Lillqvist
As such the code handles it perfectly fine, and returns an error from the function, but. Change-Id: I356b8140381d3ccd21ff0a7f5c666552571b12f4
2017-07-30osl: cleanup Unix process_impl.cxx - remove comment cruftChris Sherlock
Change-Id: Ia94797159a617ff7c9c2d875e1f51892d5b698b2
2017-07-25tell msvc our source code is written using utf-8Caolán McNamara
Change-Id: I4fb364ceb34e0851f2d04c403333bf428e8cfa98 Reviewed-on: https://gerrit.libreoffice.org/40305 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-07-24fix use after delete in osl::Pipe dtorCaolán McNamara
drop down the the c api so we can truly pass ownership of the handle to xNoAcquirePipe Change-Id: I12acbec81726ae4a451b501bea5492a5865c0cc4
2017-07-23coverity#1415617 Resource leakCaolán McNamara
Change-Id: Ib23bbd9403f44fd7aa3635a3febb6533b1f9edad
2017-07-23rtl: cleanup equality conditions in uuid.cxxChris Sherlock
Change-Id: I8918cd97f9ab89f0a2f7f95cd59b706ca5a55e2b
2017-07-23rtl: cleanup uri.cxxChris Sherlock
Change-Id: Ic9ddcaa7c699830216e157bd9dfc09d30b50b3e6
2017-07-23rtl: cleanup rtl_process.cxxChris Sherlock
Change-Id: I8640da0d5f44d69b9b628ac2076aec50b8e62ceb
2017-07-23rtl: remove comments, cleanup equality conditions in random.cxxChris Sherlock
Change-Id: I915aafe5a0df39b19e1f5bdc701cb9175dabb5ed
2017-07-22osl: Windows pipe converted from OSL_ASSERT to assert/SAL_WARNsChris Sherlock
Explanation for each conversion: - osl_acceptPipe() - don't worry about an invalid oslPipe sent as function parameter, we check for the error returned by ConnectNamedPipe(), and without a valid pipe we just need to return nullptr - warn if INVALID_HANDLE_VALUE for the file handle, should be handled by ConnectNamedPipe() - createPipeImpl() allocates and initializes memory for the oslPipeImpl structure, if it can't do this then something has been done wrongly - osl_receivePipe() - invalid pipe needs to assert because ResetEvent needs valid pPipe->m_ReadEvent - osl_sendPipe() - invalid pipe needs to assert because ResetEvent needs valid pPipe->m_ReadEvent - osl_writePipe() - really just a thin wrapper around osl_sendPipe() - osl_readPipe() - really just a thin wrapper around osl_receivePipe() Change-Id: I581f8aa996375a8691eafaa384d3f63f0c92b0a2 Reviewed-on: https://gerrit.libreoffice.org/40262 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-07-23rtl: cleanup equality conditions in math.cxxChris Sherlock
Change-Id: I13d898479d883f7905d834c82dc778a9e4078375
2017-07-23rtl: cleanup equality conditions in locale.cxxChris Sherlock
Change-Id: I25833b65f89cc24ec2b62d4836f6c7c230c418aa
2017-07-23rtl: remove comment cruft from locale.cxxChris Sherlock
Change-Id: I0db5f31a85e03a0f262f22977dfd7a98090839c7
2017-07-23rtl: cleanup equality conditions in hash.cxxChris Sherlock
Change-Id: I163e1018009d4da49a15457e2cd2f433fd069a73
2017-07-23rtl: fix equality conditions in crc.cxx and digest.cxxChris Sherlock
Change-Id: I3408c2800a5cc41026e5fec8ef99c408e64d69ea
2017-07-23rtl: cleanup cipher.cxx equality conditionsChris Sherlock
Change-Id: I0b8084adea65f8c6a6e5e46b6628297fbd9eda9b
2017-07-23rtl: remove comment cruft from cipher.cxxChris Sherlock
Change-Id: I65d394d2947246b9919e072b06888dd744ef13f0
2017-07-23followup b714ba73c - remove excessive bracesChris Sherlock
Change-Id: I59fe131c6d14d9058fedaf89a2e9d5ceca444aa5
2017-07-22osl: (Win32) check allocated pipe succeeded, otherwise needs to failChris Sherlock
Change-Id: I0e508de4215d92700a9134e422a7b9370f387aea Reviewed-on: https://gerrit.libreoffice.org/40300 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-07-22rtl: fix bootstrap formatting, comparison to nullptrChris Sherlock
Change-Id: I8d00e616a56cc3edac6ba2149fd6f9ae44c23a95
2017-07-22rtl: remove comparisons against nullptr from RTL mem filesChris Sherlock
Change-Id: Ic0ae0378d5b46b3d11c99aef2e845796ad0a9c71