summaryrefslogtreecommitdiff
path: root/connectivity
AgeCommit message (Collapse)Author
2022-06-16loplugin:moveitNoel Grandin
Change-Id: Ic593974a44d9e327e0385c7ffaaa6d42576ae01a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135911 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-15Use some more appropriate index variable typesStephan Bergmann
Change-Id: Ife891e8757e3f83d53245dfd04594b0359a897cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135831 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-06-13clang-tidy modernize-pass-by-value in connectivityNoel Grandin
Change-Id: I1f1b609254c7f8cfba14c248167f81b51684d8e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135727 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-08tdf#149470: Firebird, Clob may need several segments to store a very long inputJulien Nabet
Change-Id: I85c7789f46d834d2ae1b251f915382f833bd529d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135480 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2022-05-30Fix linking Library_evoabStephan Bergmann
> ld.lld: error: undefined symbol: LanguageTag::~LanguageTag() > >>> referenced by NResultSet.cxx:82 (connectivity/source/drivers/evoab2/NResultSet.cxx:82) > >>> /home/sbergman/lo3/core/workdir/CxxObject/connectivity/source/drivers/evoab2/NResultSet.o:(connectivity::evoab::ComparisonData::ComparisonData(std::__1::vector<connectivity::evoab::FieldSort, std::__1::allocator<connectivity::evoab::FieldSort>> const&)) > >>> referenced by NResultSet.cxx:82 (connectivity/source/drivers/evoab2/NResultSet.cxx:82) > >>> /home/sbergman/lo3/core/workdir/CxxObject/connectivity/source/drivers/evoab2/NResultSet.o:(connectivity::evoab::ComparisonData::ComparisonData(std::__1::vector<connectivity::evoab::FieldSort, std::__1::allocator<connectivity::evoab::FieldSort>> const&)) after 7b87afa899be289306c709d35eb1d32c0b73b1ed "clang-tidy modernize-pass-by-value in unotools" changed > --- a/include/unotools/intlwrapper.hxx > +++ b/include/unotools/intlwrapper.hxx > @@ -61,7 +61,7 @@ private: > void ImplNewCollator( bool bCaseSensitive ) const; > > public: > - IntlWrapper(const LanguageTag& rLanguageTag); > + IntlWrapper(LanguageTag aLanguageTag); > ~IntlWrapper(); > > const LocaleDataWrapper* getLocaleData() const Change-Id: I29371b27c260c822c427dab70bcb29943e34dfc5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135144 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-24Use o3tl::make_unsigned in some placesStephan Bergmann
...where a signed and an unsigned value are compared, and the signed value has just been proven to be non-negative here Change-Id: I20600d61a5d59d739bc1bee838c0038e4611aec2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134875 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-23Fix typosAndrea Gelmini
Change-Id: I53f00e1914283480600dbe84ee96fb38e3cc8e03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134808 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-05-13add SvStream::ReadLine(OStringBuffer... to reduce OString allocationNoel Grandin
and use it where possible Change-Id: I3efc7a642f73661ce606c917c0323ba9948521c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134265 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-12speed up simple use of NamedValueCollectionNoel Grandin
where instantiating and allocating a whole map just to extract a single key is way inefficient Change-Id: I55248bc71a9e8826cab9b76fa6916bfa888efa0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134226 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-09tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macroPragat Pandya
Change-Id: I54257e87da0cd66da59d820c7960c3e4b020fda3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134027 Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl> Tested-by: Jenkins
2022-05-05loplugin:unusedvariableplusNoel Grandin
Change-Id: Id93086be1224b6f6bf0bdaa1d50b4f289099027e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133876 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-05use more o3tl::getTokenNoel Grandin
found by inspecting call sites of OUString::getToken Change-Id: I4269c7476c7aa46fac39528227e350568f0eb34a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132644 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-05Just use Any ctor instead of makeAny (Linux, sequel)Stephan Bergmann
Change-Id: Idcf537a838bb0e47cfa31db8bc09e477b277ee37 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133875 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-05use more string_viewNoel Grandin
found by examining the call sites of OString::getToken which means I needed to add a new o3tl::equalsAscii function Change-Id: I7dc0ea1cf5ce8090a708d44f2cf7c938fa200c5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133826 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-04Just use Any ctor instead of makeAny in connectivityStephan Bergmann
Change-Id: I68e7354f094ee0e673d105dd8770a658810703d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133838 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-04Just use Any ctor instead of makeAny (macOS)Stephan Bergmann
Change-Id: I6c185eecf943205f78567393f0ef588580ee4dab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133821 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-01use more string_view in variousNoel Grandin
found by examining uses of OUString::copy() for likely places Change-Id: I6ff20e7b273ad6005410b82719183c1122f8c018 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133617 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-29use more string_view in INetURLObjectNoel Grandin
Change-Id: I4462f7cf4740fa4d1b129d76a0775f4250f41bbd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133555 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-27add string_view wrappers for rtl::math::stringToDoubleNoel Grandin
Change-Id: I114bec72cb933238675e539a8388a607226827cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133455 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-25Introduce a better mechanism to suppress false loplugin warningsStephan Bergmann
...by annotating occurrences of false warnings with [-loplugin:<name>] comments in source files and letting individual plugins opt-in to watch out for such suppression annotations, rather than maintaining lists of excluded source files in the individual plugins. (See the new loplugin::Plugin::suppressWarningsAt.) Instead of making all calls to loplugin::Plugin::report check for suppression annotations, the intent is that this check will only be added opt-in to those places in the plugins that are prone to emitting false warnings. In general it is better to have plugins that don't produce false warnings in the first place, or at least let those warnings be addressed with trivial and harmless source code modifications, avoiding the need for any suppression mechanism. As a proof of concept, I have removed the exclude list from loplugin:redundantfcast and instead annotated the relevant source code. (And thereby found that three of the six originally excluded files didn't need to be excluded any more at all?) For now, this mechanism looks for comments (both //... and /*...*/, even documentation-style /**...*/) that overlap the current and/or the preceding line, because at least for code controlled by clang-format it is often easier to move comments to a line of their own, preceding the commented code. Looking also at the current line (and not only at the preceding one) opens the door for erroneous over-eager annotation, where an annotation that was meant to address a false warning on the current line would also silence a potentially true warning on the following line. This probably doesn't cause much trouble in practice, but is up for potential change. Change-Id: I91ce7a0e5248886a60b471b1a153867f16bb5cea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133365 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-21Clean up odd function definitionsStephan Bergmann
...that were like that ever since c25ec0608a167bcf1d891043f02273761c351701 "initial import", but which when called would run into the assert(false)/ "!!br0ken!!" code in rtl::str::newFromSubString (sal/rtl/strtmpl.hxx), as the count argument to OUString::copy is -1. So just return an empty OUString, similar to what the getTimeDateFunctions and getNumericFunctions functions always did. (Stumbled across this when it got flagged by loplugin:stringviewvar with clang-cl.) Change-Id: Ief23c7e0c7712dd65e6213c9e7db3a10d276eaa6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133226 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-20Simplify some code, use o3tl::starts_with rest argumentStephan Bergmann
Change-Id: I3eede83bdea26a6ac8ff81e664c0439b75879ccf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133225 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-20loplugin:passstuffbyrefNoel Grandin
Change-Id: I336fd329b577b6fa141265d8bc7ce67784bd7306 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133210 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-20loplugin:stringviewparamStephan Bergmann
Not sure if the given url is guaranteed to be of a form so that neither of the two url.find(':') could return npos, but lets mimic the original code faithfully for now. Change-Id: Ib525b42ccb5b19b4bc13729f973248cf1c8713de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133192 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-15use more string_view in connectivityNoel Grandin
Change-Id: I916db7599e600ba795e02b7afd29b54d1dc7187e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133073 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-13loplugin:stringviewparam whitelist some more functionsNoel Grandin
for which we have o3tl:: equivalents Change-Id: I4670fd8b703ac47214be213f41e88d1c6ede7032 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132913 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-13Update remaining DevGuide wiki links.Ilmari Lauhakangas
My Kate editor decided to do some whitespace cleanup, but maybe it's fine as the main changes are not targeting functional bits anyway. Change-Id: I5292e77e43055f94a6256a7f72d49fd59287d194 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132928 Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2022-04-12loplugin:stringview more o3tl conversionNoel Grandin
look for call sequences that can use string_view and the new o3tl functions in o3tl/string_view.hxx Also add a few more wrappers to said #include file Change-Id: I05d8752cc67a7b55b0b57e8eed803bd06bfcd9ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132840 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-11use more string_viewNoel Grandin
found by tweaking the loplugin:stringview and making it whitelist getLength Change-Id: Ic41cd4e3026d93b70a76fe1279c6de3abbe6b4a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132820 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-11loplugin:stringview add check for getToken().toInt32Noel Grandin
where we can convert that to o3tl::toInt32(o3tl::getToken( and avoid the heap allocation of a temporary string Change-Id: Ib11c19c6e6cdc0de3e551affd3578d181e292de4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132810 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-10loplugin:stringview check for getToken and trimNoel Grandin
since we now have o3tl versions of those that work on string_view. Also improve those o3tl functions to support both string_view and u16string_view Change-Id: Iacab2996becec62aa78a5597c52d983bb784749a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132755 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-09ofz#46526 AbrtCaolán McNamara
Change-Id: Iaec536b0989c4ec11b39b1534c7798e46715d7a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132751 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-04-08move comphelper::string::toInt32 to o3tlNoel Grandin
so we can use it in places where we cannot include comphelper Change-Id: Iba0ba3e4c0dcf0f9d1f09092a77c3b2010ec4f6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132732 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-08use more subView when converting to Int32Noel Grandin
Change-Id: I54e3ddf79ba793fd4328bf8bda7f949b65349651 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132693 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-08loplugin:stringviewparam convert methods using trimNoel Grandin
for which we add a new o3tl::trim method Change-Id: I9d37b6264eea106aa2f3502bd24b8cccf7850938 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132658 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-02loplugin:stringviewparam convert methods using compareToNoel Grandin
which converts to compare Change-Id: If03c790ea113a7caedbe89f926b29055c9ec1e76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132455 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-02loplugin:stringviewparam convert methods using indexOfNoel Grandin
.. and lastIndexOf, which convert to find and rfind Change-Id: I6c4156cf904774c0d867f85a4c2785dba7593f62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132445 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-01tdf#148310: Firebird: copy complete rows, CLOB field, last character lostJulien Nabet
off by 1 pb. Indeed we got: 610 sal_Int64 nCharWritten = 1; // XClob is indexed from 1 offapi/com/sun/star/sdbc/XClob.idl indeed indicates: 114 The substring begins at position <code>pos</code> and has up 115 to 116 <code>length</code> 117 consecutive characters. 118 </p> 119 @param pos 120 the starting position, 1-based 121 @param length 122 the length of the substring 123 @returns 124 the substring 125 @throws SQLException 126 if a database access error occurs. 127 */ 128 string getSubString([in]hyper pos, [in]long length) raises (SQLException); but if the string to copy has length 1, we never enter: while ( nLen > nCharWritten ) => we must change this into: while ( nLen >= nCharWritten ) also number of remaining characters to take into account at each loop must be adapted too: sal_Int64 nCharRemain = nLen - nCharWritten; => would be 0 into: sal_Int64 nCharRemain = nLen - nCharWritten + 1; Change-Id: I7697c8312024818f73a19c39f694cf209f494d71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132443 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-04-01Remove useless connectivity/source/drivers/mysqlc/DataAccess.xcuJulien Nabet
Perhaps it's a temporary scaffolding during implementation of mysql native connector. I mean the only commit is 26b40fcfc67480e75bd9959b0c5cb9db10fdf6a1 (2018-08-16): " Moving mysqlc into connectivity as a library Additionally I erased the remains of the old mysql C++ connector. Also update the code where the clang plugins were unhappy after moving the mysqlc module. Remove mysql-cpp-connector external. " Also there's already connectivity/registry/mysqlc/org/openoffice/Office/DataAccess/Drivers.xcu Change-Id: I928312a466620d8c194931381c861cf7a5ae9311 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132338 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-03-29loplugin:unusedfieldsNoel Grandin
Change-Id: Iaf3a0a42e94994eab25f5e9ef8c111362e86fb02 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132262 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-25loplugin:unusedmethodsNoel Grandin
Change-Id: I42cd6d52bd6c0759fa0a8b1b91bbf1af7eb70ba8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132117 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-25tdf#132924 - Firebird findColumn: return column alias if specifiedAndreas Heinisch
The function findColumn in a Basic macro should also find aliases for columns specified in an SQL query using a Firebird database. Change-Id: I96adb2564da1e18cee58f1c6803526d8ff4deabb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131990 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2022-03-22Move BSTR wrapper to systools, and fix some wrong BSTR usesMike Kaganski
BSTR is documented [1] to be prefixed by a 32-bit integer specifying its length *in bytes* (not characters), so passing wchar_t* as BSTR is wrong, and the length member of rtl_uString can't substitute the proper BSTR length, since rtl_uString::length specifies length in characters. Any code taking BSTR and using SysStringLen to get its length would only get half of the passed OUString data. In dbaccess/source/ui/dlg/adodatalinks.cxx, the abovementioned error was implemented. OTOH, OLEVariant::getByteSequence() in connectivity/source/drivers/ado/Aolevariant.cxx passed BSTR from tagVARIANT to ctor of OLEString, which resulted in the BSTR being freed in both dtors of OLEString and OLEVariant (the latter calls VariantClear, which itself clears string when vtfield is VT_BSTR). [1] https://docs.microsoft.com/en-us/previous-versions/windows/desktop/automat/bstr Change-Id: Iedbd62b20133644258af3660616add7b63cac258 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131950 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-03-22Simplify CoCreateInstance / CoGetClassObject with COMReferenceMike Kaganski
Change-Id: Ieb1035410c3c6c4b40ea779e829a940460d19b5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131922 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-03-17Remove old mysql_jdbc/mysqlc in drivers.xcuJulien Nabet
and retrieve 2 missing items from it into mysqlc part Change-Id: I7494ca420e89f267659c06ef5f519790d47b3508 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131681 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-03-16tdf#147997: MySQL/MariaDB for dialog for direct connectionJulien Nabet
Expand a bit rebranding to JDBC part and other locations Change-Id: Ia48972996b3eb3be0341d7d93a0ba1dc69fe0057 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131632 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-03-15loplugin:trivialdestructor (macOS)Stephan Bergmann
Change-Id: I4f379f9f5c848e8fb01b05591d8a80a45719b43b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131578 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-13Remove forgotten remnant test codeJulien Nabet
Change-Id: Iffa86449fc2e4946821afea07e22deb355c7fbf4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131507 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2022-03-12tdf#147309: Recreating a view with same name and in the same session fails (FB)Julien Nabet
Since HSQLDB already worked, just do the same. Change-Id: I44929cf36179cc3cdff6e61f05899c9a913c78b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131442 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-03-04cid#1500701 silence Dereference after null checkCaolán McNamara
Change-Id: Iccd159c81011863cd664a2903dd14006bdc3b8a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130988 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>