Commit Graph
1462 Commits
Author SHA1 Message Date
Samuel Mehrbrodt 7f9e03fb53 remove bogus assert
A data source can legitimately have a non-empty name but not be
registered in the object cache, e.g. when loading fails before
attachResource is called, or during context disposal.

This removes warnings like:
  warn:legacy.osl:1611319:1611319:dbaccess/source/core/dataaccess/databasecontext.cxx:489: ODatabaseContext::storeTransientProperties: a non-empty data source which I do not know?!

Change-Id: I75e878107396d984f2fcf3d7d6a6e7678bc9b0c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200060
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@collabora.com>
2026-02-26 07:46:47 +01:00
Samuel Mehrbrodt 2a6b0e91fa Remove unnecessary OSL_ENSURE
All callers handle empty storage references, and this is expected
when database components are initialized without a backing file.

Fixes warnings like:
  warn:legacy.osl:1530244:1530244:dbaccess/source/core/dataaccess/ModelImpl.cxx:768: ODatabaseModelImpl::getOrCreateRootStorage: no source to create the storage from!

Change-Id: Ie53b3be6908a2a9b910dd374703237a4aea09794
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200058
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@collabora.com>
2026-02-26 07:46:19 +01:00
Gabor Kelemen 495fa42afa tdf#146619 Use more forward declarations in include/vcl/weld/
after recent split of these headers

This shaves off another 150M input

Change-Id: Ia4e42781cdc6fd6e795c9fb55c6c24dd641b8f0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197339
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
Tested-by: Jenkins
2026-01-31 11:06:42 +01:00
Gabor Kelemen fd2e467ba3 tdf#146619 Run IWYU in fw decl mode on include/[a-c]*
After recent commit 851fb75779
recheck these directories in include/ again
to test drive the new --headersfwd mode of bin/find-unneeded-includes

Change-Id: I0ede437c4f9958cd98210ed1760a5b98ea8bd1ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192377
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
2025-11-08 09:37:19 +01:00
Mike Kaganski a255b04d8d Shorten some names ending with _ASCII
Whatever that was intended to mean: if that meant that the constants
were encoded that way, these are UTF-16 already; is that meant that
they only contained characters in that range, that is unimportant.

Change-Id: I5463f1fca0d552a93d3c9d487ed9912c9e1a989e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191240
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-09-20 19:35:12 +02:00
Gabor Kelemen 2060e38e11 tdf#146619 Run IWYU on dbaccess/
Change-Id: I86a60f94268ee3594c68fe9f1dfb4e2c819ac616
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189784
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2025-09-13 09:23:23 +02:00
Mike Kaganski 6f14e2d0bc dbaccess::tools -> dbaccesstools
At least some IDEs are confused by our multitude of `tools` namespaces,
and show errors like `namespace "tools" is ambiguous`.
This removes one such namespace. The idea is to drop all but the one
in /tools (that has tools::Long and tools::Rectangle).

Change-Id: Ic718fa1be0ca34fc38fda10859f11d5a949b2603
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189951
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-08-20 15:23:30 +02:00
Stephan Bergmann 65fe54ec9a Read of uninitialized ODatabaseModelImpl::m_bAskPassword
...during CppunitTest_dbaccess_dialog_save at

> /dbaccess/source/core/dataaccess/databasecontext.cxx:461:66: runtime error: load of value 190, which is not a valid value for type 'bool'
>     #0 0x7f7563a4f478 in dbaccess::ODatabaseContext::storeTransientProperties(dbaccess::ODatabaseModelImpl&) /dbaccess/source/core/dataaccess/databasecontext.cxx:461:66
>     #1 0x7f7563eb4b06 in dbaccess::ODatabaseModelImpl::release() /dbaccess/source/core/dataaccess/ModelImpl.cxx:1014:22
>     #2 0x7f7563a60ef9 in rtl::Reference<dbaccess::ODatabaseModelImpl>::~Reference() /include/rtl/ref.hxx:126:22
>     #3 0x7f7563a44db9 in dbaccess::ODatabaseContext::disposing() /dbaccess/source/core/dataaccess/databasecontext.cxx:254:5
>     #4 0x7f75b1c465ab in cppu::WeakComponentImplHelperBase::dispose() /cppuhelper/source/implbase.cxx:104:13
>     #5 0x7f7563a6ffc9 in cppu::PartialWeakComponentImplHelper<com::sun::star::lang::XServiceInfo, com::sun::star::sdb::XDatabaseContext>::dispose() /include/cppuhelper/compbase.hxx:90:36
>     #6 0x7f75b1e0a3c2 in cppuhelper::ServiceManager::disposing(std::unique_lock<std::mutex>&) /cppuhelper/source/servicemanager.cxx:919:21
>     #7 0x7f75b1b2e214 in cppuhelper::WeakComponentImplHelperBase2::dispose() /cppuhelper/source/compbase.cxx:27:5
>     #8 0x7f75b1bddd29 in cppuhelper::WeakComponentImplHelper2<com::sun::star::lang::XServiceInfo, com::sun::star::lang::XMultiServiceFactory, com::sun::star::lang::XMultiComponentFactory, com::sun::star::container::XSet, com::sun::star::container::XContentEnumerationAccess, com::sun::star::beans::XPropertySet, com::sun::star::beans::XPropertySetInfo, com::sun::star::lang::XEventListener, com::sun::star::lang::XInitialization>::dispose() /cppuhelper/inc/compbase2.hxx:87:39
>     #9 0x7f75b1b80810 in cppu::try_dispose(std::unique_lock<std::mutex>&, com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&) /cppuhelper/source/component_context.cxx:66:16
>     #10 0x7f75b1b69605 in cppu::(anonymous namespace)::ComponentContext::disposing(std::unique_lock<std::mutex>&) /cppuhelper/source/component_context.cxx:430:5
>     #11 0x7f75b1b2e214 in cppuhelper::WeakComponentImplHelperBase2::dispose() /cppuhelper/source/compbase.cxx:27:5
>     #12 0x7f75b1b9c669 in cppuhelper::WeakComponentImplHelper2<com::sun::star::uno::XComponentContext, com::sun::star::container::XNameContainer>::dispose() /cppuhelper/inc/compbase2.hxx:87:39
>     #13 0x7f75a719ea7c in (anonymous namespace)::Hook::deinitHook((anonymous namespace)::Hook*, LinkParamNone*) /test/source/setupvcl.cxx:67:46
>     #14 0x7f75a719df94 in (anonymous namespace)::Hook::LinkStubdeinitHook(void*, LinkParamNone*) /test/source/setupvcl.cxx:37:1
>     #15 0x7f7597d6104d in Link<LinkParamNone*, void>::Call(LinkParamNone*) const /include/tools/link.hxx:105:45
>     #16 0x7f759b87c56e in DeInitVCL() /vcl/source/app/svmain.cxx:532:35
>     #17 0x7f75bb739454 in (anonymous namespace)::Protector::~Protector() /test/source/vclbootstrapprotector.cxx:29:9
>     #18 0x7f75bb739538 in (anonymous namespace)::Protector::~Protector() /test/source/vclbootstrapprotector.cxx:28:35
>     #19 0x7f75bb2484f3 in CppUnit::ProtectorChain::pop() (/workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.15.so.1+0x2de4f3)
>     #20 0x7f75bb2f16ad in CppUnit::TestResult::popProtector() (/workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.15.so.1+0x3876ad)
>     #21 0x50ac01 in (anonymous namespace)::ProtectedFixtureFunctor::run() const /sal/cppunittester/cppunittester.cxx:337:20
>     #22 0x506d13 in main2() /sal/cppunittester/cppunittester.cxx:482:16
>     #23 0x50512f in sal_main() /sal/cppunittester/cppunittester.cxx:627:14
>     #24 0x504f6e in main /sal/cppunittester/cppunittester.cxx:622:1

(<https://ci.libreoffice.org/job/lo_ubsan/3655/>), reading a member recently
introduced in 04d2a7d2f6 "tdf#167960 The password
of an unknown user is no longer stored", the initial value of which should
presumably be false

Change-Id: Ib46f6f37776688a9853d136adab99263714f0aba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189894
Tested-by: Jenkins
Reviewed-by: Pierre Vacher <prrvchr@gmail.com>
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-08-19 09:12:20 +02:00
prrvchr 04d2a7d2f6 tdf#167960 The password of an unknown user is no longer stored
To resolve this issue, several things were necessary.

- Add a Boolean attribute m_bAskPassword to the data source's Model implementation (i.e., the ModelImpl.hxx file)

- Modify the connectWithCompletion() procedure of the data source (i.e., the datasource.cxx file) that Base calls each time an ODB file is first opened. When opening the connection, it will verify that the connection is indeed made by the user provided by the data source. If this is not the case, the m_bAskPassword attribute of the model will be set to true.

- If this first connection is successful, the DataBaseContext (i.e., the databasecontext.cxx file) will attempt to cache the data source's properties, and if the m_bAskPassword attribute of the model is true, the Password property of the data source will not be cached.

Now if you connect with a user other than the one proposed by default, your password will be constantly requested after disconnecting and reconnecting or until the odb file is saved.

Change-Id: I40960c04fb84604c018374743a735676f556e2b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189732
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-08-18 11:23:26 +02:00
Mike Kaganski d4e478e4b5 Revert "tdf#167960: store also username associated with this password"
This reverts commit 5b064206d8.

Reason for revert:
Let's use https://gerrit.libreoffice.org/c/core/+/189732 instead.
This reportedly doesn't cause tdf#167994.

Change-Id: I47014b0419362d54c75b13ccb299f64ed9e29b4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189837
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-08-18 11:23:20 +02:00
Mike Kaganski 5b064206d8 tdf#167960: store also username associated with this password
The problem was, that the password that got stored as a transient
session-persistent property, could be for one user; but after the
reload, it could be reused for another user, stored in the file.
That resulted in a failed authentication attempt; but since the
password was present, it didn't ask for a new attempt, but failed
the connection.

This change stores the current user name along with the password;
and when loading the document next time, it checks the username
set in the document (i.e., that will be used for logon), and if
it's different from the name used with the stored password, the
password is not reused.

Change-Id: I8f971e641492e3ab93dabfce38d376a06339be3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189828
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-08-17 21:23:50 +02:00
Mike Kaganski e7cc35a41d Drop needless const_casts
Change-Id: I69a77bfe60c4554e71e3b24026d2f856236e3d43
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189814
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-08-17 13:40:18 +02:00
prrvchr 1c2e63ec15 tdf#167495 Base need to close ResultSet after using it.
Change-Id: Ief6eb9c7a12871de33e748d87045f6393faee75f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189328
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-08-11 07:54:20 +02:00
Caolán McNamara c7987c472f cid#1660426 Variable copied when it could be moved
and

cid#1660421 Variable copied when it could be moved
cid#1660419 Variable copied when it could be moved
cid#1660416 Variable copied when it could be moved
cid#1660406 Variable copied when it could be moved
cid#1660405 Variable copied when it could be moved
cid#1660403 Variable copied when it could be moved
cid#1660388 Variable copied when it could be moved
cid#1660380 Variable copied when it could be moved

Change-Id: Ic017abb85bb9b3f9fdb962c0862476f40c0953f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188847
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-08-03 12:18:11 +02:00
Samuel Mehrbrodt 6f37a5ce0c Related tdf#97694 Don't require signed document in Base
Macros were disabled in Base when calls to macros were detected in
the Base document - since the document is not signed.

However, Base does not support document signatures at this stage.

So relax that requirement to require a signed document when detecting
calls to signed macros from an unsigned document - at least for Base.

Change-Id: I129f3ffb2607a1c5eebf4795fcd1638c206aea22
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188458
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-07-31 08:07:56 +02:00
Mike Kaganski 3a4961af43 Use o3tl::{get,set}Environment instead of resp. osl_* functions
Simplifies the code, and avoids OUString internals access.
Also replace some getenv calls.

Change-Id: I5f7dc492fe87ea1fbaad6a61bc54e21f0f0c5aef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187974
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-07-17 07:03:19 +02:00
Michael Weghorn f93e0514c5 connectivity: Drop dbtools::getDataSourceSetting taking const char*
Switch all callers to use the other variant that
takes const OUString&, which the now dropped variant
was also calling internally.

Change-Id: If7d2861dc570744444f25b8124cc04781d7772d6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185536
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-05-19 23:32:22 +02:00
AlexTMFN a347c47ee9 tdf#158237 chart2: use c++20 contains() instead of find() and end()
Change-Id: Id1a128b0c0f8e1e7ec13545240fe6c07637e9ffb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185262
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2025-05-14 14:03:03 +02:00
Noel Grandin b1b6f4f706 use more concrete UNO in dbaccess
Change-Id: I46188654135721d21dd05ac2778224a078e96293
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182623
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-03-07 15:47:08 +01:00
Noel Grandin 6e031fc7d6 improve type-safety in dbaccess::OConnection
Change-Id: I39ebd277431407b65c5c4a80698714399d39330f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182531
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-03-05 17:09:48 +01:00
Noel Grandin 09e2627a83 use more concrete UNO types in some local vars
found by a little plugin I created.

Plugin parked into store/ folder because it needs hand-holding
when run.

Change-Id: I2b4da7378f0becbc5f020ac9e78cd765aa0119b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181768
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-02-26 16:56:56 +01:00
Bogdan Buzea eb8e6ddd6a tdf#158237 dbaccess: use c++20 contains() instead of find() and end()
Change-Id: I03e682093bff3b743b074d0d1dc68994f31ae707
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176800
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-11-29 20:49:15 +01:00
Julien Nabet bf0374b64e tdf#130564: getTableTypes retrieves only table types of the current database
So indicate to LO that at least PostgreSQL and MySQL/MariaDB support views

Change-Id: I241fa3cfc599e11c1f1523a78a1905beadc80307
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176308
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-11-15 16:56:43 +01:00
Stephan Bergmann 86b86ac87e Give DocumentEventHolder (aka EventHolder<DocumentEvent>) a key function
...that is not inline, so that RTTI and vtable are not emitted for each dynamic
library individually.  (Where they would be internal on macOS, which could break
optimized uses of dynamic_cast for that final class just checking vtable pointer
identity, as could happen for the dynamic_cast at
dbaccess/source/core/dataaccess/documenteventnotifier.cxx:232:51,

>   232 |         const DocumentEventHolder& rEventHolder = dynamic_cast< const DocumentEventHolder& >( _rEvent );
>       |                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And with the extern explicit template instantiation, EventHolder needs to be
SAL_DLLPUBLIC_TEMPLATE instead of just SAL_DLLPUBLIC_RTTI now, so that
Library_comphelper will export the DocumentEventHolder ctors and
DocumentEventHolder::getEventObject.)

(This would ideally have been caught by an upcoming improvement of
loplugin:dyncastvisibility, but might be complicated to check there for template
instantiations.)

Change-Id: I1e6280b185535968a870fbfadaff6238d38858e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176547
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Tested-by: Jenkins
2024-11-14 11:10:30 +01:00
Caolán McNamara 92f5913aef cid#1556442 COPY_INSTEAD_OF_MOVE
and

cid#1607753 COPY_INSTEAD_OF_MOVE
cid#1554790 COPY_INSTEAD_OF_MOVE
cid#1556463 COPY_INSTEAD_OF_MOVE
cid#1554838 COPY_INSTEAD_OF_MOVE
cid#1556231 COPY_INSTEAD_OF_MOVE
cid#1556878 COPY_INSTEAD_OF_MOVE
cid#1554913 COPY_INSTEAD_OF_MOVE
cid#1558064 COPY_INSTEAD_OF_MOVE
cid#1557043 COPY_INSTEAD_OF_MOVE
cid#1556985 COPY_INSTEAD_OF_MOVE
cid#1556766 COPY_INSTEAD_OF_MOVE
cid#1557351 COPY_INSTEAD_OF_MOVE
cid#1554863 COPY_INSTEAD_OF_MOVE
cid#1556764 COPY_INSTEAD_OF_MOVE
cid#1556279 COPY_INSTEAD_OF_MOVE
cid#1555970 COPY_INSTEAD_OF_MOVE
cid#1556942 COPY_INSTEAD_OF_MOVE
cid#1557964 COPY_INSTEAD_OF_MOVE
cid#1555166 COPY_INSTEAD_OF_MOVE
cid#1556496 COPY_INSTEAD_OF_MOVE
cid#1557175 COPY_INSTEAD_OF_MOVE
cid#1558054 COPY_INSTEAD_OF_MOVE
cid#1557392 COPY_INSTEAD_OF_MOVE
cid#1557850 COPY_INSTEAD_OF_MOVE
cid#1555118 COPY_INSTEAD_OF_MOVE
cid#1557131 COPY_INSTEAD_OF_MOVE
cid#1556614 COPY_INSTEAD_OF_MOVE
cid#1609650 COPY_INSTEAD_OF_MOVE
cid#1555114 COPY_INSTEAD_OF_MOVE
cid#1555241 COPY_INSTEAD_OF_MOVE
cid#1555442 COPY_INSTEAD_OF_MOVE
cid#1556473 COPY_INSTEAD_OF_MOVE
cid#1557654 COPY_INSTEAD_OF_MOVE
cid#1554689 COPY_INSTEAD_OF_MOVE
cid#1556316 COPY_INSTEAD_OF_MOVE
cid#1557929 COPY_INSTEAD_OF_MOVE
cid#1554807 COPY_INSTEAD_OF_MOVE
cid#1554858 COPY_INSTEAD_OF_MOVE
cid#1555103 COPY_INSTEAD_OF_MOVE
cid#1555517 COPY_INSTEAD_OF_MOVE
cid#1556424 COPY_INSTEAD_OF_MOVE
cid#1557252 COPY_INSTEAD_OF_MOVE
cid#1557566 COPY_INSTEAD_OF_MOVE
cid#1608020 COPY_INSTEAD_OF_MOVE
cid#1557742 COPY_INSTEAD_OF_MOVE
cid#1555884 COPY_INSTEAD_OF_MOVE
cid#1554809 COPY_INSTEAD_OF_MOVE
cid#1555336 COPY_INSTEAD_OF_MOVE
cid#1555173 COPY_INSTEAD_OF_MOVE
cid#1556067 COPY_INSTEAD_OF_MOVE
cid#1557040 COPY_INSTEAD_OF_MOVE
cid#1556235 COPY_INSTEAD_OF_MOVE
cid#1557366 COPY_INSTEAD_OF_MOVE
cid#1555910 COPY_INSTEAD_OF_MOVE
cid#1556716 COPY_INSTEAD_OF_MOVE
cid#1558022 COPY_INSTEAD_OF_MOVE
cid#1555769 COPY_INSTEAD_OF_MOVE
cid#1555940 COPY_INSTEAD_OF_MOVE
cid#1557077 COPY_INSTEAD_OF_MOVE
cid#1555270 COPY_INSTEAD_OF_MOVE
cid#1555660 COPY_INSTEAD_OF_MOVE
cid#1556302 COPY_INSTEAD_OF_MOVE
cid#1555678 COPY_INSTEAD_OF_MOVE
cid#1556538 COPY_INSTEAD_OF_MOVE
cid#1557689 COPY_INSTEAD_OF_MOVE
cid#1555009 COPY_INSTEAD_OF_MOVE
cid#1555433 COPY_INSTEAD_OF_MOVE
cid#1555671 COPY_INSTEAD_OF_MOVE
cid#1555255 COPY_INSTEAD_OF_MOVE
cid#1557681 COPY_INSTEAD_OF_MOVE
cid#1557512 COPY_INSTEAD_OF_MOVE
cid#1554958 COPY_INSTEAD_OF_MOVE
cid#1555758 COPY_INSTEAD_OF_MOVE
cid#1555597 COPY_INSTEAD_OF_MOVE
cid#1558040 COPY_INSTEAD_OF_MOVE
cid#1556476 COPY_INSTEAD_OF_MOVE
cid#1557646 COPY_INSTEAD_OF_MOVE
cid#1557950 COPY_INSTEAD_OF_MOVE
cid#1557019 COPY_INSTEAD_OF_MOVE
cid#1557885 COPY_INSTEAD_OF_MOVE
cid#1556402 COPY_INSTEAD_OF_MOVE
cid#1557906 COPY_INSTEAD_OF_MOVE
cid#1556619 COPY_INSTEAD_OF_MOVE
cid#1554683 COPY_INSTEAD_OF_MOVE
cid#1556549 COPY_INSTEAD_OF_MOVE
cid#1554747 COPY_INSTEAD_OF_MOVE
cid#1554929 COPY_INSTEAD_OF_MOVE
cid#1555362 COPY_INSTEAD_OF_MOVE
cid#1557053 COPY_INSTEAD_OF_MOVE
cid#1557891 COPY_INSTEAD_OF_MOVE
cid#1555043 COPY_INSTEAD_OF_MOVE
cid#1555107 COPY_INSTEAD_OF_MOVE
cid#1557203 COPY_INSTEAD_OF_MOVE
cid#1556728 COPY_INSTEAD_OF_MOVE
cid#1557773 COPY_INSTEAD_OF_MOVE
cid#1556845 COPY_INSTEAD_OF_MOVE

Change-Id: I001fb67e597b096e992fd8a0cd6f3ec577767c33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176098
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-11-06 13:58:54 +01:00
Caolán McNamara 7bbe74b2be cid#1555789 COPY_INSTEAD_OF_MOVE
and

cid#1556865 COPY_INSTEAD_OF_MOVE
cid#1556871 COPY_INSTEAD_OF_MOVE
cid#1556939 COPY_INSTEAD_OF_MOVE
cid#1556951 COPY_INSTEAD_OF_MOVE
cid#1556964 COPY_INSTEAD_OF_MOVE
cid#1556966 COPY_INSTEAD_OF_MOVE
cid#1556968 COPY_INSTEAD_OF_MOVE
cid#1556971 COPY_INSTEAD_OF_MOVE
cid#1556989 COPY_INSTEAD_OF_MOVE
cid#1557001 COPY_INSTEAD_OF_MOVE
cid#1557011 COPY_INSTEAD_OF_MOVE
cid#1557032 COPY_INSTEAD_OF_MOVE
cid#1557038 COPY_INSTEAD_OF_MOVE
cid#1557041 COPY_INSTEAD_OF_MOVE
cid#1557055 COPY_INSTEAD_OF_MOVE
cid#1557056 COPY_INSTEAD_OF_MOVE
cid#1557057 COPY_INSTEAD_OF_MOVE
cid#1557065 COPY_INSTEAD_OF_MOVE
cid#1557068 COPY_INSTEAD_OF_MOVE
cid#1557087 COPY_INSTEAD_OF_MOVE
cid#1557090 COPY_INSTEAD_OF_MOVE
cid#1557093 COPY_INSTEAD_OF_MOVE
cid#1557113 COPY_INSTEAD_OF_MOVE
cid#1557122 COPY_INSTEAD_OF_MOVE
cid#1557126 COPY_INSTEAD_OF_MOVE
cid#1557145 COPY_INSTEAD_OF_MOVE
cid#1557151 COPY_INSTEAD_OF_MOVE
cid#1557152 COPY_INSTEAD_OF_MOVE
cid#1557197 COPY_INSTEAD_OF_MOVE
cid#1557216 COPY_INSTEAD_OF_MOVE
cid#1557245 COPY_INSTEAD_OF_MOVE
cid#1557272 COPY_INSTEAD_OF_MOVE
cid#1557310 COPY_INSTEAD_OF_MOVE
cid#1557314 COPY_INSTEAD_OF_MOVE
cid#1557318 COPY_INSTEAD_OF_MOVE
cid#1557333 COPY_INSTEAD_OF_MOVE
cid#1557340 COPY_INSTEAD_OF_MOVE
cid#1557358 COPY_INSTEAD_OF_MOVE
cid#1557359 COPY_INSTEAD_OF_MOVE
cid#1557365 COPY_INSTEAD_OF_MOVE
cid#1557367 COPY_INSTEAD_OF_MOVE
cid#1557395 COPY_INSTEAD_OF_MOVE
cid#1557418 COPY_INSTEAD_OF_MOVE
cid#1557488 COPY_INSTEAD_OF_MOVE
cid#1557493 COPY_INSTEAD_OF_MOVE
cid#1557506 COPY_INSTEAD_OF_MOVE
cid#1557514 COPY_INSTEAD_OF_MOVE
cid#1557528 COPY_INSTEAD_OF_MOVE
cid#1557534 COPY_INSTEAD_OF_MOVE
cid#1557537 COPY_INSTEAD_OF_MOVE
cid#1557562 COPY_INSTEAD_OF_MOVE
cid#1557563 COPY_INSTEAD_OF_MOVE
cid#1557592 COPY_INSTEAD_OF_MOVE
cid#1557608 COPY_INSTEAD_OF_MOVE
cid#1557615 COPY_INSTEAD_OF_MOVE
cid#1557619 COPY_INSTEAD_OF_MOVE
cid#1557637 COPY_INSTEAD_OF_MOVE
cid#1557648 COPY_INSTEAD_OF_MOVE
cid#1557712 COPY_INSTEAD_OF_MOVE
cid#1557750 COPY_INSTEAD_OF_MOVE
cid#1557762 COPY_INSTEAD_OF_MOVE
cid#1557765 COPY_INSTEAD_OF_MOVE

Change-Id: I10db1910627e04a26e25836c05ad5c2707abd18b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175696
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-10-27 20:19:12 +01:00
Xisco Fauli 990d710bf7 tdf#163486: PVS: fix copy&paste error
Since
commit f02e1a0abc
Author: Kurt Zenker <kz@openoffice.org>
Date:   Thu Mar 6 16:58:17 2008 +0000

    INTEGRATION: CWS odbmacros2 (1.36.2); FILE MERGED

V524 	It is odd that the body of 'removeStorageChangeListener' function is fully equivalent to the body of 'addStorageChangeListener' function.

Change-Id: Ie5456f4ef7397d5f9144ac3167724f6c2ca32c56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175251
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2024-10-20 16:14:47 +02:00
Noel Grandin da8a36b4f4 CID#1607066:Data race condition (MISSING_LOCK)
which means we need to push knowledge
about the locking down into ucbhelper::Result
since the implementation classes there
want to call back into the parent.

and also

CID#1607968:Data race condition (MISSING_LOCK)
CID#1606657:Data race condition (MISSING_LOCK)
CID#1607112:Data race condition (MISSING_LOCK)
CID#1608365:Data race condition (MISSING_LOCK)
CID#1607159:Data race condition (MISSING_LOCK)
CID#1607018:Data race condition (MISSING_LOCK)
CID#1607421:Data race condition (MISSING_LOCK)
CID#1607766:Data race condition (MISSING_LOCK)
CID#1606872:Data race condition (MISSING_LOCK)
CID#1608523:Data race condition (MISSING_LOCK
CID#1607191:Data race condition (MISSING_LOCK)
CID#1608345:Data race condition (MISSING_LOCK)
CID#1608577:(#1 of 1):Data race condition (MISSING_LOCK)
CID#1607210:Data race condition (MISSING_LOCK)
CID#1607132:Data race condition (MISSING_LOCK)
CID#1608256:Data race condition (MISSING_LOCK)
CID#1607482:Data race condition (MISSING_LOCK)
CID#1607935:Data race condition (MISSING_LOCK)
CID#1608070:Data race condition (MISSING_LOCK)
CID#1607901:Data race condition (MISSING_LOCK)
CID#1608013:Data race condition (MISSING_LOCK)
CID#1607506:Data race condition (MISSING_LOCK)
CID#1607526:Data race condition (MISSING_LOCK)
CID#1607044:Data race condition (MISSING_LOCK)
CID#1607708:Data race condition (MISSING_LOCK)
CID#1608041:Data race condition (MISSING_LOCK)
CID#1608207:Data race condition (MISSING_LOCK)
CID#1608028:Data race condition (MISSING_LOCK)
CID#1608168:Data race condition (MISSING_LOCK)
CID#1607561:Data race condition (MISSING_LOCK)

CID#1607689:Check of thread-shared field evades lock acquisition (LOCK_EVASION)
CID#1607689:Check of thread-shared field evades lock acquisition (LOCK_EVASION)
CID#1607689:Check of thread-shared field evades lock acquisition (LOCK_EVASION)
CID#1607689:Check of thread-shared field evades lock acquisition (LOCK_EVASION)
CID#1607689:Check of thread-shared field evades lock acquisition (LOCK_EVASION)
CID#1607689:Check of thread-shared field evades lock acquisition (LOCK_EVASION)
CID#1607689:Check of thread-shared field evades lock acquisition (LOCK_EVASION)
CID#1607689:Check of thread-shared field evades lock acquisition (LOCK_EVASION)
CID#1607689:Check of thread-shared field evades lock acquisition (LOCK_EVASION)
CID#1607689:Check of thread-shared field evades lock acquisition (LOCK_EVASION)

Change-Id: Ifbe908a4a86ab8c5fa1c4ed3b6f9466508e4900e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174204
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-09-30 18:24:30 +02:00
Xisco Fauli b617ac7322 ODF 1.4: add ODFVER_014_TEXT constant
Change-Id: I219c854b11a5bd4be3d789b93a96e045e3dca29f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173991
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2024-09-26 19:14:29 +02:00
Noel Grandin fff43a2e76 use more concrete UNO types in dbaccess
Change-Id: Ibcf54e3bbdad4888c5da1f52f636951356e0aa51
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173818
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-09-24 12:13:47 +02:00
Noel Grandin 5ceff2c65c use more concrete UNO types in dbaccess
Change-Id: If34294e2db4dc3365a7308c90658d5fa0c0e6532
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173817
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-09-24 08:18:18 +02:00
Noel Grandin 87039e3e77 use more concrete UNO types in dbaccess
Change-Id: I3f689e6ec296fe0c8876ba5cc68133f28902b3fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173816
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-09-23 18:32:24 +02:00
Noel Grandin f7354e1873 remove OSubComponent from OStatementBase
which attempts to implement a very dodgy and almost but not actually
thread-safe dispose function. Rather just hold a weak reference to the
connection that created us.

Change-Id: I01e4f5fc0a8aeb33adc14a2981ce09522a0306bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173572
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-09-18 08:06:47 +02:00
Noel Grandin e877d6ae74 use more concrete UNO types in dbaccess
Change-Id: I6cb15b347dae28878110f76064645095d5771e3c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173382
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-09-15 16:35:16 +02:00
Mike Kaganski 1091e04fbd Simplify use of connectivity::OConnectionWrapper
Make it use cppu::WeakComponentImplHelper, because all its derived
classes used that template. In the derived classes, switch to use
of cppu::ImplInheritanceHelper. That simplifies the hierarchy, and
doesn't require to re-implement many basic methods.

Change-Id: I40ec05a471af4437098586d20540f9a815677952
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173370
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-09-15 06:27:30 +02:00
Noel Grandin a3afc0e38b remove OSubComponent from OConnection
which attempts to implement a very dodgy and almost but not actually
thread-safe dispose function. Rather just hold a weak reference to the
data source that created us.

Change-Id: I431bb43aef1d6ce92d7987e7d731b724b64a9767
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173341
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-09-14 09:21:37 +02:00
Noel Grandin d50f3fa9f5 tsan: data race
Read of size 1 at 0x7250000be3fd by thread T19:
 0 dbaccess::ODatabaseDocument::queryInterface(com::sun::star::uno::Type const&)
 1 non-virtual thunk to dbaccess::ODatabaseDocument::queryInterface(com::sun::star::uno::Type const&)
 2 com::sun::star::uno::BaseReference::iquery(com::sun::star::uno::XInterface*, com::sun::star::uno::Type const&)
 3 com::sun::star::uno::Reference<com::sun::star::frame::XFrame>::iquery(com::sun::star::uno::XInterface*)

Previous write of size 1 at 0x7250000be3fd by thread T8 (mutexes: write M0):
 0 dbaccess::ODatabaseDocument::storeAsURL(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)
 1 non-virtual thunk to dbaccess::ODatabaseDocument::storeAsURL(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)
 2 gcc3::callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, double*)

Change-Id: I40ce0b5995f94455b5d9ca1d652a58df96b5f553
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172873
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-09-05 11:29:59 +02:00
Noel Grandin 0572ef356b loplugin:ostr in various
Change-Id: I7aa8ed716998a185996482dc561219b398a1c919
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169080
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-06-18 13:16:23 +02:00
Gabor Kelemen e3ca92bcfd Drop unneeded 'using' instances
found with bin/find-unused-using.sh

Change-Id: I647f493ee313e79e7a9967960ea089b729de59a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167637
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
Tested-by: Jenkins
2024-05-16 08:35:11 +02:00
Noel Grandin 9e8fd61044 replace createFromAscii with OUString literals in ResourceManager
Change-Id: Iea6430d5f56a1f30a5dd168fcf2fee2ba7198f18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167499
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-05-11 12:43:02 +02:00
Noel Grandin e0635101b4 replace createFromAscii with OUString literals in ODatabaseModelImpl
Change-Id: I861bf52bb49a54ec546a4465fb9053a5ebdaa641
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167491
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-11 09:22:49 +02:00
Noel Grandin d1f3e9af6a replace createFromAscii with OUString literals in DocumentEvents
Change-Id: I5cf5401afafc1c6d2d72445e898903c95288531b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167494
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-05-11 09:22:40 +02:00
Noel Grandin 589d35da30 replace createFromAscii with OUString literals in ODatabaseDocument
Change-Id: I57f1de3781ee413ad987222b8b960a266ef21e5a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167492
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-11 09:22:32 +02:00
Noel Grandin 14f65dc1ad replace createFromAscii with OUString literals in DocumentEventNotifier
Change-Id: I6987033a461ec91b59de8e2aabef513471f887f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167493
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-05-10 21:53:55 +02:00
Noel Grandin d52a4dba6a loplugin:ostr in dbaccess
Change-Id: I6d720ef94d9f29c120f292b844721621e6630856
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167259
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-07 12:53:22 +02:00
Mike Kaganski af5a1b5925 Drop uses of css::uno::Sequence::getConstArray in dbaccess
where it was obsoleted by commits 2484de6728
(Remove non-const Sequence::begin()/end() in internal code, 2021-10-15) and
fb3c04bd19 (Drop non-const Sequence::operator[]
in internal code 2021-11-05).

Change-Id: I4f8dc4f430dc49fa29012b8f064094daceb5e1b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166818
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-04-29 23:15:48 +02:00
Noel Grandin 6adef53aa9 use more OUString literal
convert some functions which merely create an OUString on the fly
from a char literal to 'constexpr OUString' literals

Change-Id: I617490baf2d976291b324cc991b59cd18f4b242c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166392
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-04-22 12:10:18 +02:00
Gabor Kelemen 69303d5d09 tdf#146619 Drop unused 'using namespace' in: dbaccess/
Change-Id: If006c5f0002b9d5981220efa22873bf0adb169bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165543
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-04-03 08:57:28 +02:00
Mike Kaganski 0fa827dbb2 Drop std::as_const from css::uno::Sequence iterations
Obsoleted by commit 2484de6728 (Remove
non-const Sequence::begin()/end() in internal code, 2021-10-15) and
commit fb3c04bd19 (Drop non-const
Sequence::operator[] in internal code, 2021-11-05).

Change-Id: Idbafef5d34c0d4771cbbf75b9db9712e504164cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162640
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-27 12:43:48 +01:00
Caolán McNamara 8ccd386b07 default to ignoring libreoffice special-purpose protocols in calc hyperlink
Change-Id: Ib9f62be3acc05f24ca234dec0fec21e24579e9de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158911
Tested-by: Jenkins
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-11-09 13:29:50 +01:00