summaryrefslogtreecommitdiff
path: root/connectivity
AgeCommit message (Collapse)Author
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>
2022-02-18Simplify sequence of Property in connectivity/firebirdJulien Nabet
Change-Id: Ie45d5418e474cfeb2ac3ac62edbaa1e5bd688d9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130136 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-02-18Simplify sequence of Property in connectivity/adoJulien Nabet
Change-Id: I1b1e183b053d98139ca5b45f3642d252252da14a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130142 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-02-18Simplify sequence of Property in connectivity/macabJulien Nabet
Change-Id: Id0ed3ab3d66dfb8b76030fad7cd0b2bc3ea010fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130139 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-02-18Simplify sequence of Property in connectivity/mysqlcJulien Nabet
Change-Id: Ib4e1c47262c42db92226be5f84742799c3a1cbb7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130138 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-02-18Simplify even more sequence of Property in connectivity/odbcJulien Nabet
Change-Id: I8dd75cf5c41aa879efe740f48bcb305901742804 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130135 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-02-18Simplify sequence of Property in connectivity/odbcJulien Nabet
Change-Id: Iaa2b908d63899c2e1141602b26d6da6b064f63e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130119 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-02-17Revert "ODBC: fix signatures of Bulk, SpecialColumns et NativeSQL"Julien Nabet
This reverts partly commit 8942956e05f2208ffb666a2118f5db092c30ce6a. Reason, Lionel indicates: In general UnixODBC has to deal with more portability to more platforms, so I would tend to more follow their signatures than the ones of Microsoft, that has to deal with only Windows OS on less CPU ABIs. Change-Id: I8b8924d35aa86ac23a8191baa8584463941eddc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130084 Reviewed-by: Lionel Mamane <lionel@mamane.lu> Tested-by: Jenkins
2022-02-17ODBC: fix signatures of Bulk, SpecialColumns et NativeSQLJulien Nabet
I compared with https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/odbc-api-reference?view=sql-server-ver15 Change-Id: Iac38c2305fbf3ace502f9e75802510f76a6bd700 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130055 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-02-15tdf#145759 Using M_PI from cmath instead of magic constants.pragat-pandya
Replace the instances of Pi's value as magic number by M_PI Use M_PI_2 and 2_M_PI instead of calculating these values in code. Use basegfx functions to convert angle units. Change-Id: I6cca7cc93704a70ccf3a0571a56a789bc9df51ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129479 Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com> Reviewed-by: Hossein <hossein@libreoffice.org> Tested-by: Jenkins
2022-02-08Drop some methods returning just a string and only used onceJulien Nabet
Change-Id: Idccc6edea7dabc79135d49ffe69c1a13f2990b76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129684 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2022-02-08cid#1497933 suppress Macro compares unsigned to 0Caolán McNamara
Change-Id: I7f06f889f2bd687028c00d79bdcf9e2edacc5c82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129601 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-07fix big-endian hsql to firebird migrationCaolán McNamara
Change-Id: I047d2366ad80eca701924cb0f66b6b1bcfdcac5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129597 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-06We know the length hereMike Kaganski
Change-Id: I630b7fbda7c9ebf578e74260a0d67eea32e9e429 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129549 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-05tdf#138691: avoid buffer overflowMike Kaganski
Change-Id: Ib5eaf6c658e1185c1e3eec7ce34f0ce54d6ce771 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129441 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>