summaryrefslogtreecommitdiff
path: root/connectivity
AgeCommit message (Collapse)Author
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>
2022-02-28cid#1500397 silence Resource leakCaolán McNamara
this reverts commit 1142dc2398de2e2be0e057ecb432ad9c8895313a Date: Sun Feb 27 14:14:18 2022 +0100 cid#1500397: Resource leak with an alternative that hopefully silences coverity and helps show better what is going on Change-Id: Ifb117d65789e80e66419911dbb6b327bdf7ed948 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130707 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-27cid#1500397: Resource leakJulien Nabet
Change-Id: I765df1eef9ccf447cdd0a80497c1ca6f22bb9e42 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130625 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-02-26cid#1500433 Using a moved objectCaolán McNamara
Change-Id: I150cd0f021aeb1aefe411f19dfcac111ac35b295 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130592 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-25tdf#145759 30.6001 -> monthDaysWithoutJanFebHossein
30.6001 shows month days without Jan and Feb. According to the below link, it is calcuated as (365-31-28)/10 = 30.6 but because of a floating point bug, it was used as 30.6001 as a workaround. "30.6001, 25 year old hack?" https://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv011.cgi?read=31650 The value 30.6 is used as i18nutil::monthDaysWithoutJanFeb here instead of 30.6001. The new value is ~30.60000038 which is > 30.6, so the calculations should be correct. In order to make sure, a unit test is added, and part of the values are checked against the values calculated by this website: Julian Day and Civil Date Calculator https://core2.gsfc.nasa.gov/time/julian.html Change-Id: I8cc7e046514dc3de652a1c37399e351cb2b614dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125813 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2022-02-22Fix a ODatabaseMetaDataResultSet type in evoab2Julien Nabet
Change-Id: I974b1ce90d87fb8591eb7d788f884402111b5a21 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130396 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-02-22Fix some ODatabaseMetaDataResultSet types in FirebirdJulien Nabet
Change-Id: I12e579d04b81057d3513dab3459c035b1ae9df42 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130393 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-02-22Add XWeak constructor and operator= to uno::WeakReferenceNoel Grandin
which is faster since we can skip the UNO_QUERY. Change-Id: Id95ad9f3568213e974bd13659d92d4ea94dbfbd6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130282 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-02-21cid#1500693 Resource leakJulien Nabet
Change-Id: Ic560c2079be0b04ce382350390e03e0ec2d8abcc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130303 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-02-18Simplify sequence of Property in connectivity/jdbcJulien Nabet
Change-Id: I703a3adc7203045288e982c4155dfc19a01e414a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130137 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>