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>
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>
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>
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
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>
...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>
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>
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>
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>
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
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>
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
...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
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
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>
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
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>
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
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>