summaryrefslogtreecommitdiff
path: root/dbaccess
AgeCommit message (Collapse)Author
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-24modernize and improve PropertySetInfoNoel Grandin
(*) use o3tl::span for the array param, which means we don't need a null entry to terminate the array (*) use std::unordered_map to speed things up (*) mark the array as static at a few more call sites Change-Id: I05b6cae7552f44459e183ec05cb94e60edb3bfe0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134832 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-18no need to take a lock when returning static dataNoel Grandin
Change-Id: I8d836c4a919056e8b600549f82b0d5dee9ab1a47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134536 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-14Add extended tips for Direct SQL dialogOlivier Hallot
Change-Id: I0b46222ed60084544d6271fba258f02955baaa0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134295 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Jenkins
2022-05-14Bump directsqldialog.ui to latest Glade versionOlivier Hallot
No changes in dialog. Change-Id: I478e43aadd5c92363a514e32245a17cbabd17da8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134294 Tested-by: Jenkins Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
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-09Fix typo in codeAndrea Gelmini
I find _rContext not _rContxt Change-Id: Iabc73590cf12112d0071e72b74064788b006e5e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134050 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
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-04Just use Any ctor instead of makeAny in dbaccessStephan Bergmann
Change-Id: I8b20d60d536a8fb3d3396e1ce26bacf309637f40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133829 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-03add o3tl::equalsAsciiNoel Grandin
Change-Id: I042b8dcadbf7581de325c161763fe35aecde5ca2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133694 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-30split comphelper::string::strip functions into String and view versionNoel Grandin
which is more obvious, from the perspective of the caller, and lets us avoid creating a new String if nothing needs to be stripped Change-Id: I66a980eaf4aa818251bec49bdb16c2dddb0745e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133657 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-26officecfg,unotools,framework,sfx2: store ReadOnly for recent docsMichael Stahl
Add Office::Histories::HistoryItem::ReadOnly flag to configuration so that a document that was opened read-only isn't opened as editable from recent documents. Change-Id: I6985da287d3337a53a7e41e8e500421038eedb91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133385 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
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-18tdf#42982 Improved UNO API error reporting.Siddhant Chaudhary
Messages to thrown `RuntimeException` instances have been added to make the error clearer. Change-Id: I566c475bd4ddf891a2cebf15664576cff792c118 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133100 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-17Removed duplicated includeAndrea Gelmini
Change-Id: I09556d8041023f765980d8b5cf953b955545d0b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133023 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-04-14use more string_view in dbaccessNoel Grandin
Change-Id: I256ffe22fa060be6a6fc32e73d845879d71a187d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133007 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-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-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-06tdf#148413: Drop HTML export encoding configuration; use UTF-8Mike Kaganski
Anything else is just a joke today. Change-Id: Ie6a0cec1edcd257cbadef702018e6a919e6a0b44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132628 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-04-04use string_view in comphelper::string::splitNoel Grandin
Change-Id: I4afe8aee85905ee35ba195b00b454aefa0ba38af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132486 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-03-31tdf#147906 Use std::hypot for Pythagorean additionpragat-pandya
Change-Id: I38166d36e9e8518ab86ded7ab630a35f3a0c39d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132268 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2022-03-28-Werror,-Wunused-but-set-variableStephan Bergmann
...since 376cc3ea0fc2e0f209763a2a27c5852136332c86 "dbaccess: delete old paste autoincrement logic" Change-Id: I4ffa3ffbcc1b80091a4a3449362766334b31c5af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132229 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-28-Werror,-Wunused-but-set-variableStephan Bergmann
...since 0b6d0ac41afc72a0043e6ccdc6cdfd8648a5efdc "m_pRowMarker is unused" Change-Id: I68d23a11e4be814a23e8ede87723b9aba208b774 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132228 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-28-Werror,-Wunused-but-set-variableStephan Bergmann
...since 35dce7a06088386f13636bc355bc35e93be6ba5d "INTEGRATION: CWS warnings01" Change-Id: Iaae91d7792348d0bf61173c5839295c8aa1b938f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132225 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
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-24Create OUString from ASCII literal instead of createFromAsciiMike Kaganski
Change-Id: I58d0b49a32edf4d67807c0d67e08a28705d7334e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132026 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-03-24Related tdf#147997: connect directly dialogJulien Nabet
Change-Id: Ic5ee0e3213d1a607d4ac5cb2402ce34e823622c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131885 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
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-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-11loplugin:constparamsNoel Grandin
Change-Id: I5f184f93dbdb414514855c85c9dc1624e7ec8636 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131337 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-11new loplugin:trivialdestructorNoel Grandin
look for potentially trivial destructors that can then be elided Change-Id: I435c251bd4291b5864c20d68f88676faac7c43fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131318 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-10Missing test dependencyStephan Bergmann
> [_RUN_____] HSQLDBTest::testEmptyDBConnection [...] > warn:vcl.builder:997476:997476:vcl/source/window/builder.cxx:479: DBG_UNHANDLED_EXCEPTION in VclBuilder > when: Unable to read .ui file exception: com.sun.star.container.NoSuchElementException message: "file:///.../instdir/share/config/soffice.cfg/dbaccess/ui/appborderwindow.ui at xmlreader/source/xmlreader.cxx:66" Change-Id: I695e19919c66e14852fca2cc23436b463544ec52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131252 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-05remove a workaround that appears to be no longer necessaryLuboš Luňák
Presumably whatever the locking problem was, it's got fixed meanwhile. Change-Id: I7bbd6299a501396f53ed2e8ccaf7d5893744512b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131047 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-05GetComponentServiceName can be constNoel Grandin
Change-Id: Iac61eec0b27660dd2ff45f70c92de5a8cdc2c301 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131044 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-02-28tdf#139734 removing redundant asserts after MacrosTest::loadFromDesktoppragat-pandya
Change-Id: I89ffa387464ce7cc43c1884b031d6fade5b85078 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129581 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
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#1500396 silence Dereference after null checkCaolán McNamara
Change-Id: I284f256637a9e91a8cc5c431565a1ebe946a202c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130272 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-19Simplify sequence of Property in dbaccessJulien Nabet
Change-Id: I270702ad4b4878ee5c1942be3c45eae370f37f8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130189 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-02-17tdf#143148 Use pragma once instead of include guardspsidiumcode
Change-Id: I5a946c9db1b3ca91fa9d59d0d742c9b30782ed00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129978 Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2022-02-11Resolves: tdf#147325 "Edit in SQL View" should accept tabCaolán McNamara
Change-Id: I286281c317c30e5c189747f2d4844a0d5dd0828f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129819 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-07sal_uInt8 is typedefed as unsigned char so this casting isn't neededCaolán McNamara
Change-Id: I190bbcb915664ed0cf803814c399b841ae41c519 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129594 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-05Following simplify a bit ODatabaseDocument::impl_getUntitledHelper_throwJulien Nabet
Change-Id: Iae6eafba5fffb8128526642f67dc932ddd115336 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129486 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-02-04use some more add toId/fromIdCaolán McNamara
Change-Id: I3a21e2aa5a2c482c0bac1d4c9bf84f8b56261408 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129492 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-04add toId/fromId to tidy up some ugly castingCaolán McNamara
Change-Id: I70f34ac5e9b5d2f2d6c0375e823908eaa2e540b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129487 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>