summaryrefslogtreecommitdiff
path: root/connectivity/source
AgeCommit message (Collapse)Author
2021-10-25loplugin:indentation (macOS)Stephan Bergmann
Change-Id: I7a180a79dff11816e1504bdd1803102325aa365d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124149 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-20loplugin:indentation check for indent inside blockNoel Grandin
look for places where the statements inside a block are not indented Change-Id: I0cbfa7e0b6fb194b2aff6fa7e070fb907d70ca2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123885 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-19tdf#145203: FIREBIRD cannot create a tableJulien Nabet
Regression from: https://cgit.freedesktop.org/libreoffice/core/commit/?id=1cf57765dd9a66982ecf9cd33687005a70c70c3f 2021-10-08 loplugin:moveparam in connectivity Change-Id: Iec0fa1597e63d42ee3a905bf55eff798b3f46177 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123787 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-19Use MsLangId::getConfiguredSystemLanguage()Eike Rathke
Change-Id: I298f762ac7f3298aa9cb9621ad1f8cae50527b24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123790 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2021-10-15Simplify vector initialization in connectivityJulien Nabet
Change-Id: I4eb3ca5b1a45e585f076c7e11f616be4614d972a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123662 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-15Remove non-const Sequence::begin()/end() in internal codeMike Kaganski
... to avoid hidden cost of multiple COW checks, because they call getArray() internally. This obsoletes [loplugin:sequenceloop]. Also rename toNonConstRange to asNonConstRange, to reflect that the result is a view of the sequence, not an independent object. TODO: also drop non-const operator[], but introduce operator[] in SequenceRange. Change-Id: Idd5fd7a3400fe65274d2a6343025e2ef8911635d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123518 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-14use std::vector::insert instead of push_backNoel Grandin
because it will pre-allocate space and often is optimised to memcpy Change-Id: I03ed7915f2762d3d27e378638052a47a28bbf096 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123588 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-14Avoid COW overhead using css::uno::SequenceMike Kaganski
The scenarios are: 1. Calling sequence's begin() and end() in pairs to pass to algorithms (both calls use getArray(), which does the COW checks) 2. In addition to #1, calling end() again when checking result of find algorithms, and/or begin() to calculate result's distance 3. Using non-const sequences in range-based for loops, which internally do #1 4. Assigning sequence to another sequence variable, and then modifying one of them In many cases, the sequences could be made const, or treated as const for the purposes of the algorithms (using std::as_const, std::cbegin, and std::cend). Where algorithm modifies the sequence, it was changed to only call getArray() once. For that, css::uno::toNonConstRange was introduced, which returns a struct (sublclass of std::pair) with two iterators [begin, end], that are calculated using one call to begin() and one call to getLength(). To handle #4, css::uno::Sequence::swap was introduced, that swaps the internal pointer to uno_Sequence. So when a local Sequence variable should be assigned to another variable, and the latter will be modified further, it's now possible to use swap instead, so the two sequences are kept independent. The modified places were found by temporarily removing non-const end(). Change-Id: I8fe2787f200eecb70744e8b77fbdf7a49653f628 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123542 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-12loplugin:moveparam in variousNoel Grandin
Change-Id: Ifa7c8ff2b21f63d234c29c28303d0bacd376c1e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123434 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-11In O[U]StringBuffer, make string_view params replacements for OUString onesStephan Bergmann
...for LIBO_INTERNAL_ONLY, instead of having them as additional overloads. That way, loplugin:bufferadd and loplugin:stringviewparam found many further opportunities for simplification (all addressed here). Some notes: * There is no longer an implicit conversion from O[U]String to O[U]StringBuffer (as that goes via user-defined conversions through string_view now), which was most noticeable in copy initializations like OStringBuffer buf = someStr; that had to be changed to direct initialization, OStringBuffer buf(someStr); But then again, it wasn't too many places that were affected and I think we can live with that. * I made the O[U]StringBuffer ctors taking string_view non-explicit, mainly to get them in line with their counterparts taking O[U]String. * I added an OUStringBuffer::lastIndexOf string_view overload that was missing (relative to OUStringBuffer::indexOf). * loplugin:stringconstant needed some addition to keep the compilerplugins/clang/test/stringconstant.cxx checks related to OStringBuffer::append and OStringBuffer::insert working. * loplugin:stringviewparam no longer needs the special O[U]StringBuffer-related code that had been introduced in 1250aecd71fabde4dba990bfceb61bbe8e06b8ea "loplugin:stringviewparam extend to new.." Change-Id: Ib1bb8c4632d99b744e742605a9fef6eae959fd72 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122904 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-08loplugin:moveparam in connectivityNoel Grandin
Change-Id: Ie5c2f6ec1573ab2c47218dd4da8c9150b23bcd2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123247 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-07ofz: Integer-overflowCaolán McNamara
Change-Id: Ib0c1863c5fed92622b4bd601021a1174cf6ee68d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123213 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-10-06loplugin:moveparam in connectivityNoel Grandin
Change-Id: Iaf3a64effb69fd82c6303d8fa75723ccc5ced543 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123183 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-03A more lightweight O[U]StringConcatenationStephan Bergmann
...compared to a full-blown O[U]String, for temporary objects holding an O[U]StringConcat result that can then be used as a std::[u16]string_view. It's instructive to see how some invocations of operator ==, operator !=, and O[U]StringBuffer::insert with an O[U]StringConcat argument required implicit materialization of an O[U]String temporary, and how that expensive operation has now been made explicit with the explicit O[U]StringConcatenation ctor. (The additional operator == and operator != overloads are necessary because the overloads taking two std::[u16]string_view parameters wouldn't even be found here with ADL. And the OUString-related ones would cause ambiguities in at least sal/qa/rtl/strings/test_oustring_stringliterals.cxx built with RTL_STRING_UNITTEST, so have simply been disabled for that special test-code case.) Change-Id: Id29799fa8da21a09ff9794cbc7cc9b366e6803b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122890 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-02ofz#39515 avoid Integer-overflowCaolán McNamara
Change-Id: I8bef8e19f066883d5fc731a1c7b7cd85948ae5c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122968 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-10-01loplugin:constmethodNoel Grandin
Change-Id: I3ed657c5c5e6840e38e3c8505505b4b372125df0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122910 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-30loplugin:constparams improve handling of pointer paramsNoel Grandin
Change-Id: I4c0002e72703eded435bfe4985f5b0121bf8524b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122843 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-29"is missing" has gone missingStephan Bergmann
...in 4c1bf9d7790ca037933c3c6825d48736572a1886 "Make loplugin:bufferadd look through O[U]String::operator std::[u16]string_view" (thanks to Ming Hua for spotting it) Change-Id: I0fa18b0a5c824cb77988edda1ba8971d2ab86366 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122798 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-09-29this scoping detracts from readabilityCaolán McNamara
Change-Id: I99a51bf68ef1c98e4023413b9274c4361f8a9b96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122797 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-29ofz#39403 avoid Integer-overflowCaolán McNamara
Change-Id: I3471e2fbd2b47dbc681aa3069794184eb9ab33e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122796 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-28Make loplugin:bufferadd look through O[U]String::operator std::[u16]string_viewStephan Bergmann
Change-Id: I79a32f64541a90b0b824f7721e8815c1e7c873ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122788 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-09-28Fix typosAndrea Gelmini
Change-Id: I05fdb2378f48b7e2c7373c16c66065111c5d2f73 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122716 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-09-28ofz: Integer-overflow in lcl_CalDateCaolán McNamara
FWIW we have another similar implementation of this as Calendar_hijri::getGregorianDay Change-Id: I785f739d8f69ed0e596c27411cc8c7c58c631866 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122757 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-27fetch the column names once and keep it up to date as new names insertedCaolán McNamara
Change-Id: Ic865c82c2bbf8cb3be730158c823bd8769038bbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122661 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-27pass the column names in as an external argumentCaolán McNamara
Change-Id: I14ab9e6de0a704076a1c632b6b33aaeabdfc23d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122660 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-27split getUniqueColumnNameCaolán McNamara
Change-Id: Ibcac473463c02e7ce6f853ac2dcdf953c13c14e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122659 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-27appendColumns is always called with m_aSelectColumns as 1st argCaolán McNamara
Change-Id: I791c0eef1fda97d21ba9efb170ef226c9a495eed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122658 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-27setSelectColumnName is always called with m_aSelectColumns as 1st argCaolán McNamara
Change-Id: If86c4f48ed7eb6860f461fe905c0628cb9b73043 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122657 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-27ofz#39309 collect the names just onceCaolán McNamara
Change-Id: Iad8a6c80ecac7b8dc380a4c16ccd82650ecc10f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122656 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-26ofz#39304 short timestamp recordCaolán McNamara
Change-Id: I8f783473dd5d4679846c7c866cd1853ef7d919fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122628 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-26ofz#39301 month has to be in range [1-12]Caolán McNamara
Change-Id: I5a4ca534b24098342d8f465a32bc1887f40f5b63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122629 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-24for fuzzing hardcode a case sensitive file system result for detectionCaolán McNamara
rather than throwing ucb exceptions continously Change-Id: Ia3545619fe9a7c4c8f0470179eca68f0ae4bf4de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122588 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-24use a min of 1 as 0 triggers refreshHeader to reloadCaolán McNamara
Change-Id: Iecc6adcce7e32a205f0c9cc6d634d703ea88de06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122573 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-24make SQLExceptionInfo utilities available for external useCaolán McNamara
Change-Id: I6561fa433f6619d8de97983fa962f874cbf5b536 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122570 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-24split SQLExceptionInfo::append moreCaolán McNamara
Change-Id: Id6dd8dfc3dc072f573e3a1a750428cb149be8e83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122569 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-24refactor getting the last exception of a SQLException chainCaolán McNamara
Change-Id: Ia60766709e5093f5cc60d44697343e5a63f7ba03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122568 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-24split SQLExceptionInfo::appendCaolán McNamara
Change-Id: I4e86e580843042e482e8732843a45a9eedfad320 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122567 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-24some prerequisites to use dbase import with config unavailableCaolán McNamara
Change-Id: I0a7f32a69112d7ce9ffc39481154c9da346c8d24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122544 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-24do some sanity checks on the number of records claimedCaolán McNamara
while retaining the fix of #i83401# to recovered a broken case Change-Id: I283c45b10aaa24004a34bfe6faee517d4a443b98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122543 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-23check if headersize is greater than available dataCaolán McNamara
Change-Id: I5d78da49436c7dfbe7cfb50e52549b61abc00ee9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122542 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-23leaks of OCollection in dbase importCaolán McNamara
presumably since... commit 5c7b954935369cbbd22a6f43be63ac7c0ddbbfdc Date: Mon Jan 29 13:28:44 2018 +0200 loplugin:useuniqueptr in OTable OCollection has a unique and nonstandard acquire/release which forwards to a parent cppu::OWeakObject. So when it would appear to a casual observer, who assumes that it has an internal refcount, that its refcount would drop to zero and then get auto-deleted, nothing of the kind occurs. Change-Id: Ic292663a61b4d7dbf7636be7ad4c00aed0b5a7fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122528 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-23check claimed number of records against max possible with available dataCaolán McNamara
Change-Id: I50d9354da00137c64c83970eb66792b37d7e545a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122536 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-23EOF isn't an error from SvStream::GetError perspectiveCaolán McNamara
Change-Id: Ib2bc2c35d78d92728d592676def300e28a8b9e2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122534 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-23don't looks for dbt memo files when fuzzingCaolán McNamara
Change-Id: I483606a36d8a91fe7af73f1c6dba740b2475e95d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122533 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-23Extend loplugin:stringviewparam to starts/endsWith: connectivityStephan Bergmann
Change-Id: I10a6f919034a83d134c92f3c510641c10c7c133d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122506 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-09-17Use OUString::unacquiredStephan Bergmann
Change-Id: I9264291ba55accbb07401e29499b99e9765b3f63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122220 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-09-15Use <comphelper/servicehelper.hxx> implementing XUnoTunnel part 5Mike Kaganski
- Revise uses of getSomething to use getFromUnoTunnel Where that is impossible, use getSomething_cast to unify casting, and minimize number of places doing low-level transformations. The change keeps the existing tunnel references that last for the duration of the pointers' life, because sometimes destroying such reference may destroy the pointed object, and result in use after free. Change-Id: I291c33223582c34cd2c763aa8aacf0ae899ca4c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122101 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-15Use <comphelper/servicehelper.hxx> implementing XUnoTunnel part 4Mike Kaganski
- Change implementations of getSomething to use getSomethingImpl Or where that's impossible, use getSomething_cast to unify this and reduce number of places where we reinterpret_cast. All static methods getting tunnel ids were renamed to getUnoTunnelId, to comply with the convention used in <comphelper/servicehelper.hxx>. TODO (in separate commits): - Revise uses of getSomething to use getFromUnoTunnel Change-Id: Ifde9e214b52e5df678de71fcc32d2199c82e85cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122100 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-15Use <comphelper/servicehelper.hxx> implementing XUnoTunnel part 3 [API CHANGE]Mike Kaganski
- Replace all uses of OImplementationId in core with UnoIdInit - Deprecate OImplementationId in <cppuhelper/typeprovider.hxx> OImplementationId uses broken double checked locking; additionally, it uses it at the first call to getImplementationId, not when the object is constructed. This implementation can't be changed, cince it's part of published API; it can't rely on C++11, which would be required for use of thread-safe statics and move the initialization to ctor. The class has obsolete _bUseEthernetAddress member, that is unused and ignored since 4e9fa7e339a1cd6cb2fec643715991bcf5057cec. No need to implement it when replacing its uses to UnoIdInit. The deprecation is the API CHANGE. No published API is introduced to replace it; 3rd-party code should seek alternative solutions, or just keep using the deprecated functionality. TODO (in separate commits): - Change implementations of getSomething to use getSomethingImpl - Revise uses of getSomething to use getFromUnoTunnel Change-Id: I8b6e684e5389bc0d5bb3b7f21f72a4c8f684107d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122077 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-15Use <comphelper/servicehelper.hxx> implementing XUnoTunnel part 1Mike Kaganski
The header got some changes: 1. Move UnoTunnelIdInit and isUnoTunnelId into 'comphelper' namespace 2. Rename UnoTunnelIdInit to UnoIdInit, as a precondition to replace of uses of OImplementationId with it, including in XTypeProvider 3. Introduce convenience functions 'getSomething_cast' to cast between sal_Int64 and object pointers uniformly. 4. Rename getUnoTunnelImplementation to getFromUnoTunnel, both to make it a bit shorter, and to reflect its function better. Templatize it to take also css::uno::Any for convenience. 5. Introduce getSomethingImpl, inspired by sw::UnoTunnelImpl; allow it handle cases both with and without fallback to parent. 6. Adjust UNO3_GETIMPLEMENTATION_* macros TODO (in separate commits): - Drop sw::UnoTunnelImpl and sw::UnoTunnelGetImplementation - Replace all uses of OImplementationId in core with UnoIdInit - Deprecate OImplementationId in <cppuhelper/typeprovider.hxx> - Change implementations of getSomething to use getSomethingImpl - Revise uses of getSomething to use getFromUnoTunnel Change-Id: If4a3cb024130f1f552f988f0479589da1cd066e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122022 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>