summaryrefslogtreecommitdiff
path: root/dbaccess/source
AgeCommit message (Collapse)AuthorFilesLines
2018-01-12More loplugin:cstylecast: dbaccessStephan Bergmann52-158/+157
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I96df8923f7791288bbd350d75582a9220006ece6
2018-01-11tdf#114955: Fix primary key management in copy tableJulien Nabet1-0/+4
When we chose to create a primary key, be sure the other existing columns won't be in primary key Change-Id: I523f1b3a4b56c92d48b65cb3d83793b5459c630c Reviewed-on: https://gerrit.libreoffice.org/47732 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
2018-01-11Use for-range loops in dbaccess (part2)Julien Nabet7-100/+71
Change-Id: I7a247584a88fa516c7d28068b3d860499f090c92 Reviewed-on: https://gerrit.libreoffice.org/47189 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-11convert (a>b?a:b) to std::max(a,b)Noel Grandin1-3/+3
with something like: git grep -nP '(.*)\s*>\s*(.*)\s*\?\s*\g1\s*:\s*\g2' Change-Id: I60b9a3a2a09162bc0de4c13fdde2c209696e5413 Reviewed-on: https://gerrit.libreoffice.org/47602 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-10tdf#113923: don't use twice a new column in table copyJulien Nabet1-3/+13
In the case where: 1: we enabled the creation of a primary key 2: we come back here from the "Back" button of the next page, we want to avoid to list the new column generated in the next page So we must check added columns in right panel must exist in the table Change-Id: I467007941b03811381a216c1ab3de8fe729f9b9b Reviewed-on: https://gerrit.libreoffice.org/47684 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
2018-01-03loplugin:passstuffbyref more return improvementsNoel Grandin6-9/+9
slightly less restrictive check when calling functions Change-Id: I35e268ac611797b1daa83777cda02288a635aa32 Reviewed-on: https://gerrit.libreoffice.org/47259 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-31tdf#114755: Remove extra parenthesisJulien Nabet1-1/+1
from SELECT block of INSERT INTO <> SELECT <> Change-Id: Ibe3c3f5f2fbc15388c716ae262e87137958c1a7e Reviewed-on: https://gerrit.libreoffice.org/47218 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-30loplugin:passstuffbyref improved return in cui,dbaccessNoel Grandin17-22/+22
Change-Id: I1193ff91ccd548acf9492d9701b6411a24d6763e Reviewed-on: https://gerrit.libreoffice.org/47194 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-30Incrementing end iterator has undefined behavior (dbaccess/cacheset)Julien Nabet1-1/+1
Change-Id: I9f4cdacd87cc4802b13c99c15e1d24d11285a375 Reviewed-on: https://gerrit.libreoffice.org/47188 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-29Fix typosAndrea Gelmini1-1/+1
Change-Id: I0e56430afa65b6b5826d56212ac501c0244fce9b Reviewed-on: https://gerrit.libreoffice.org/47145 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-28Use returned iterator (dbaccess/rowsetcache)Julien Nabet1-2/+1
Change-Id: If53bbc8e3cdbbf71bed0d343f1ff358b72c46d21 Reviewed-on: https://gerrit.libreoffice.org/47147 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-28Optimize a bit RowSetCache (dbacess)Julien Nabet1-20/+29
Change-Id: I051cb40b5dd854a4a104eae7124564cab8a35de1 Reviewed-on: https://gerrit.libreoffice.org/47151 Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu> Tested-by: Jenkins <ci@libreoffice.org>
2017-12-28Use for-range loops in dbaccessJulien Nabet4-21/+12
Change-Id: I0be3aba4f03dcaba188670548901e4aef59c5ec0 Reviewed-on: https://gerrit.libreoffice.org/47148 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-28tdf#114702 don't use XMultipleResultset unless DatabaseMetaData says we canLionel Elie Mamane1-1/+3
Change-Id: Icec98d35c2f60adf4a31e492c6cb708e82e47a58 Reviewed-on: https://gerrit.libreoffice.org/47080 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-28dbaccess OStatementBase: correctly check database metadataLionel Elie Mamane1-9/+9
the previous test didn't make any sense: * if xMeta.is(), then the test evaluated to false * if !xMeta.is(), then it called supportsMultipleResultSets (or supportsBatchUpdates, respectively) on a NULL pointer, which guaranteed a segfault / assert. Change-Id: I6d6b93350557936b924a286732ae6d4f5ab2ce56 Reviewed-on: https://gerrit.libreoffice.org/47118 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-27Use for-range loops in dbaccess/RowSetJulien Nabet1-13/+11
Change-Id: I27c280eaaf5ff6a4c1970e91ae227206bb712cea Reviewed-on: https://gerrit.libreoffice.org/47073 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-27Use for-range loops in dbaccess/OptimisticSetJulien Nabet1-98/+74
Change-Id: Iccd0848e772867ece243444dc697e264907b28d4 Reviewed-on: https://gerrit.libreoffice.org/47072 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-26Use for-range loops in dbaccess/KeySet (2nd pass)Julien Nabet1-82/+58
+ remove an unused var Change-Id: I62659f4ca5ac734f46d00e59b12fb6f54a177ecb Reviewed-on: https://gerrit.libreoffice.org/47071 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-22Use for-range loops in dbaccess/KeySet (1st pass)Julien Nabet1-54/+36
+ remove an unused var + fix a slight indent pb Change-Id: Ie6e801c9d2b7ce6e7f5d352b2175fa9d7d6b9c7d Reviewed-on: https://gerrit.libreoffice.org/46995 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-22lokdialog: Allow switching language of some of the ResMgr's.Jan Holesovsky1-2/+1
This way, it is possible to have all the strings translated in dialogs even when different users use different languages. [It was already possible to have different languages previously, but not everything in the dialog has switched - like the buttons at the bottom of the dialogs etc.] Change-Id: I29a5ae6d31a370eec60397884200b684ec1bf5b9 Reviewed-on: https://gerrit.libreoffice.org/46417 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/46979 Tested-by: Jenkins <ci@libreoffice.org>
2017-12-20inline typedefs in connectivity/StdTypeDefsNoel Grandin3-8/+8
Change-Id: I614833ed2418ff99057c7d496ddb64f06e8395db Reviewed-on: https://gerrit.libreoffice.org/46809 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-19wrap scoped enum around css::util::NumberFormatNoel Grandin1-1/+1
Change-Id: Icab5ded8bccdb95f79b3fa35ea164f47919c68fa Reviewed-on: https://gerrit.libreoffice.org/46339 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-12-19loplugin:unusedmethodsNoel Grandin2-51/+0
Change-Id: I3ffd9142fed98e4df75c2c28f8a025be3e8eb803 Reviewed-on: https://gerrit.libreoffice.org/46687 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-19remove unused typedefsNoel Grandin4-6/+0
Change-Id: I6fd7a9fed3a80c91a3766fceefd43c5db0aa5275 Reviewed-on: https://gerrit.libreoffice.org/46763 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-19inline use-once typedefsNoel Grandin12-34/+12
Change-Id: I5c3ffc03c26b3428f1f336e6ecba7838a1cf1157 Reviewed-on: https://gerrit.libreoffice.org/46764 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-19loplugin:unusedenumconstantsNoel Grandin1-1/+0
Change-Id: I9dc4b369872a7c6c076ae9be1dcdf2f8385af8a7 Reviewed-on: https://gerrit.libreoffice.org/46684 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-19Fix typosAndrea Gelmini1-2/+2
Change-Id: Ibffe19c1dfda9d0f4ba8d2a0761ad1222491007f Reviewed-on: https://gerrit.libreoffice.org/46599 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-18loplugin:unusedindexMike Kaganski16-165/+102
Change-Id: I256a807dd2a4c81126b5a76f3d472e31b8224146 Reviewed-on: https://gerrit.libreoffice.org/46652 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-15CONTAINER_ENTRY_NOTFOUND not needed anymoreNoel Grandin3-4/+4
after we make dbaccess consistently use COLUMN_POSITION_NOT_FOUND Change-Id: Ia22c17196e8d651201c04239505d28e54369a8a4 Reviewed-on: https://gerrit.libreoffice.org/46501 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-15use ColumnPositions name more consistentlyNoel Grandin7-42/+41
mostly so I can track down more accurately what values are being stored in this vector<pair<>> Change-Id: I3755a098a577facef1c1af62c5583f0e2f7ca90b Reviewed-on: https://gerrit.libreoffice.org/46500 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-15sal_Bool -> boolStephan Bergmann14-16/+16
Change-Id: If2e527d915d07b3b44d2a36e10704665ab8c7320 Reviewed-on: https://gerrit.libreoffice.org/46502 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-14No need to keep these whitelisted functions decorated with SAL_CALLStephan Bergmann52-108/+108
The only effect SAL_CALL effectively has on LO-internal code is to change non- static member functions from __thiscall to __cdecl in MSVC (where all other functions are __cdecl by default, anyway). (For 3rd-party code, it could be argued that SAL_CALL is useful on function declarations in the URE stable interface other than non-static member functions, too, in case 3rd-party code uses a compiler switch to change the default calling convention to something other than __cdecl. But loplugin:salcall exempts the URE stable interface, anyway.) One could argue that SAL_CALL, even if today it effectively only affects non- static member functions in MSVC, could be extended in the future to affect more functions on more platforms. However, the current code would already not support that. For example, 3af500580b1c82eabd60335c9ebc458a3f68850c "loplugin:salcall fix functions" changed FrameControl_createInstance in UnoControls/source/base/registercontrols.cxx to no longer be SAL_CALL, even though its address (in ctl_component_getFacrory, in the same file) is passed to cppuhelper::createSingleFactory as an argument of type cppu::ComponentInstantiation, which is a pointer to SAL_CALL function. Change-Id: I3acbf7314a3d7868ed70e35bb5c47bc11a0b7ff6 Reviewed-on: https://gerrit.libreoffice.org/46436 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-13Make loplugin:salcall look into macros tooStephan Bergmann1-2/+2
"Indirect" calls to isSallCallFunction (for canonic and overridden FunctionDecls) already needed to handle many cases of FunctionDecls spanning macros, so it isn't that much more work to make that also work for cases called directly from VisitFunctionDecl. Change-Id: I529f148c8872b86aa1ef082c6cb73db8ab1866e7 Reviewed-on: https://gerrit.libreoffice.org/46367 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-13Remove traces of Report Builder's former status as extensionLionel Elie Mamane1-1/+1
Change-Id: I63730632933cbb1d6e655f70d222ffaaabd3fa08 Reviewed-on: https://gerrit.libreoffice.org/46361 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-11loplugin:salcall fix functionsNoel Grandin40-74/+74
since cdecl is the default calling convention on Windows for such functions, the annotation is redundant. Change-Id: I1a85fa27e5ac65ce0e04a19bde74c90800ffaa2d Reviewed-on: https://gerrit.libreoffice.org/46164 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-08Fix isSalCallFunction so it also works on WindowsStephan Bergmann1-1/+1
...where FunctionDecl::getReturnTypeSourceRange returns an invalid range because it fails to take AttributedTypeLoc (as caused by SAL_CALL -> __cdecl) into account. Change-Id: I7835dfca7b890ba1bfdb99adaad78a627b6e0e17 Reviewed-on: https://gerrit.libreoffice.org/45909 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-08loplugin:salcall vcl builder methodsNoel Grandin2-2/+2
these don't need to be SAL_CALL, and the function pointer definition was not annotated SAL_CALL either Change-Id: I3082d3d34c53dc723ad8d2083010fd0de0e89a1e Reviewed-on: https://gerrit.libreoffice.org/46067 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-07loplugin:countusersofdefaultparams in connectivityNoel Grandin2-9/+9
Change-Id: Ia613257f2de1395c6629c1c37026ed48d4b927c8 Reviewed-on: https://gerrit.libreoffice.org/45854 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-06Remove unused #include <vcl/metaact.hxx> from vcl/outdev.hxxStephan Bergmann1-0/+1
...and fix the fallout Change-Id: Ie514bd95d5a9f990a887566619031e9844c40b92 Reviewed-on: https://gerrit.libreoffice.org/45195 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-06tdf#113413 dbaccess: only use SolarMutex in ODatabaseDocumentMichael Stahl4-41/+11
The classes ODatabaseDocument, ODatabaseModelImpl and ODatabaseSource share a single mutex declared as ModelDependentComponent::m_aMutex. Commit 403eefe81b8a0afe888c60452c17d6b2c5d8343f introduced a new deadlock here: in case Yield is called, such as when the user doesn't have a JRE and a dialog requesting to install one is displayed, the SolarMutex is released but the ModelDependentComponent mutex is still locked; now another thread (such as the AsyncEventNotifier) can lock the SolarMutex but not the other mutex, while the main thread can't lock the SolarMutex again. So the SolarMutex must be on the one hand be locked before the other mutex, to ensure the behaviour is the same whether the thread already holds it or not, and locked after the other mutex, to prevent the Yield deadlock. One option would be to revisit fca62934f492125ea6728fd6d09f0c66c9e4fa69 and add back the SfxLibraryContainer mutex, but the code there is a mess, naively assuming that locking the mutex on UNO entry points is sufficient, taking no care to temporarily release it while calling other UNO components or event listeners; since there's about 5kLOC in all the related classes it would take some time to rewrite all that. An easier fix is to remove the ModelDependentComponent::m_aMutex. This patch removes all locking of that m_aMutex, but it still exists as a non-shared Mutex because it's needed for the WeakComponentImplHelper base classes, which shouldn't cause issues. Change-Id: I94aaa0ae8698188c98633c638100a309b20976cc Reviewed-on: https://gerrit.libreoffice.org/45914 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-12-06loplugin:salcall handle virtual methodsNoel Grandin27-180/+180
Change-Id: Iab95db31188ea2914a46d63a7ebef3d825e6ec42 Reviewed-on: https://gerrit.libreoffice.org/45851 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-05Replace deprecated std::bin2nd with lambda in dbaccessStephan Bergmann3-7/+6
(as std::bind2nd is gone by default at least from recent libc++ in C++17 mode) Change-Id: Ib54bc40889aa45b5b9d4d3ab54baafbd260d3b25 Reviewed-on: https://gerrit.libreoffice.org/45861 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-05Replace deprecated std::mem_fun et al in dbaccessStephan Bergmann5-14/+14
(as std::mem_fun is gone by default at least from recent libc++ in C++17 mode) Change-Id: I98fabd88212001ac6f2cfe66f2c75a41a4cb4a3e Reviewed-on: https://gerrit.libreoffice.org/45860 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-05loplugin:countusersofdefaultparams in dbaccessNoel Grandin15-20/+20
Change-Id: Ic372096785f9f6ead569b34dcc7e97f78ab9ddf8 Reviewed-on: https://gerrit.libreoffice.org/45837 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-05loplugin:salcall fix non-virtual methodsNoel Grandin7-14/+14
first, since those are safer to change than virtual methods Change-Id: Ie3b624019d75ee2b793cee33b3c5f64e994e8bfe Reviewed-on: https://gerrit.libreoffice.org/45798 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-01Don't prevent ODatabaseDocument refcount from dropping to zeroStephan Bergmann1-1/+2
...preventing the dtor from ever being called. (DocumentEvents forwards its acquire/release calls to its m_pData->rParent, i.e., the ODatabaseDocument, for better or worse.) This caused ODatabaseDocument instances to be leaked during e.g. JunitTest_dbaccess_complex. Regression introduced with de2ac128da025502c533f8cede5862e054dd9c44 "loplugin:useuniqueptr in dbaccess". Change-Id: Ida073c7e576b88e0d1d1a90253445e946e6eac99 Reviewed-on: https://gerrit.libreoffice.org/45652 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-30dbaccess: -Werror,-Wimplicit-fallthroughMichael Stahl1-0/+1
Change-Id: I0580a4aec9762e774679ad3d6a567ec4e74c1908
2017-11-30xmloff: turn SvXMLImportContext into a no-op base classMichael Stahl2-3/+3
Fix the non-obvious and potentially dangerous recursion that is implicit in xmloff's context code. SvXMLImportContext::CreateChildContext() now always creates a SvXMLImportContext, does not delegate to SvXMLImport. Rename CreateContext to CreateDocumentContext, to make its purpose of creating only the top-level context more obvious. With the previous changes to CreateContext overrides in sw, reportdesign and dbaccess, this hopefully shouldn't break anything. Change-Id: I9e147bf6297bbac9e8470454881da73f6e39db0a
2017-11-30dbaccess: split up ODBFilter::CreateContext()Michael Stahl3-24/+173
This was handling XML elements at 3 different levels; add some more context classes to handle the nesting better. Change-Id: I05d7b2b7dc2d797acd4e97eacb54fa07e32d88e2
2017-11-27loplugin:unnecessaryparen check for (f1()).f2Noel Grandin1-3/+3
Change-Id: I93257b0ddd41c649875124d6d5c5faeaa431bae3 Reviewed-on: https://gerrit.libreoffice.org/45218 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>