diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-04-26 22:07:21 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-04-27 07:19:30 +0200 |
commit | b512ce255f46d90e682634e4dd17e146af7f9080 (patch) | |
tree | da2ce68b775e0e45294920074a1ae8306dbac818 /dbaccess/source | |
parent | 83cf08b1cb2d493a4c12f88eb6bf0daf25fe5beb (diff) |
Make upcasting css::uno::Reference ctor require complete types
The main reason for the "home-grown" UpCast introduced with
904b3d1fceee5827076758ed2a81f80cb73493ca "Up-cast conversion constructor for
css::uno::Reference" in 2013 was probably that we could not yet rely on C++11
std::is_base_of back then. A (welcome) side effect was that the derived class
could be incomplete.
However, specializations of UpCast relying on whether or not T2 is incomplete
are obviously an ODR violation if the type is incomplete in some TUs and
complete (and derived from T1) in others. And even if UpCast had internal
linkage, it would still be brittle that its behavior depends on the completeness
of T2 at the point of the template's instantiation, and not necessarily at the
point of use.
That means we should better base that ctor on std::is_base_of (which we can do
now since 39a1edd6fec902ef378acce8af42c4d7fba280d0 "Make css::uno::Reference
upcast ctor LIBO_INTERNAL_ONLY"), which causes a compilation error at least on
Clang and GCC if the completeness requirements are not met. This change fixes
all the cases where types need to be complete now, plus any resulting
loplugin:referencecasting warnings ("the source reference is already a subtype
of the destination reference").
Change-Id: Ieb9e3552e90adbf2c5a5af933dcb872e20661a2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92950
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'dbaccess/source')
-rw-r--r-- | dbaccess/source/core/api/querycomposer.cxx | 1 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlDatabase.cxx | 1 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlExport.cxx | 1 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlfilter.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/sdbtools/misc/sdbt_services.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/control/sqledit.cxx | 1 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/UserAdmin.cxx | 1 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/adminpages.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/limitboxcontroller.cxx | 1 |
9 files changed, 12 insertions, 2 deletions
diff --git a/dbaccess/source/core/api/querycomposer.cxx b/dbaccess/source/core/api/querycomposer.cxx index 1718e15f5ab3..043b0c083a17 100644 --- a/dbaccess/source/core/api/querycomposer.cxx +++ b/dbaccess/source/core/api/querycomposer.cxx @@ -19,6 +19,7 @@ #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/sdbc/ColumnSearch.hpp> +#include <com/sun/star/sdbc/XConnection.hpp> #include <comphelper/sequence.hxx> #include <cppuhelper/supportsservice.hxx> #include <unotools/configmgr.hxx> diff --git a/dbaccess/source/filter/xml/xmlDatabase.cxx b/dbaccess/source/filter/xml/xmlDatabase.cxx index d76dfbe791ee..9de9bf349810 100644 --- a/dbaccess/source/filter/xml/xmlDatabase.cxx +++ b/dbaccess/source/filter/xml/xmlDatabase.cxx @@ -24,6 +24,7 @@ #include "xmlDataSource.hxx" #include "xmlDocuments.hxx" #include "xmlEnums.hxx" +#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/sdb/XReportDocumentsSupplier.hpp> #include <com/sun/star/sdb/XFormDocumentsSupplier.hpp> #include <com/sun/star/sdbcx/XTablesSupplier.hpp> diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx index b5edc7b4d3e4..299c59eb1dad 100644 --- a/dbaccess/source/filter/xml/xmlExport.cxx +++ b/dbaccess/source/filter/xml/xmlExport.cxx @@ -32,6 +32,7 @@ #include <sal/log.hxx> #include <com/sun/star/beans/XPropertyState.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> +#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/util/XNumberFormatsSupplier.hpp> #include <com/sun/star/sdb/XFormDocumentsSupplier.hpp> #include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp> diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx index 10c28a6d00bc..7de744403d03 100644 --- a/dbaccess/source/filter/xml/xmlfilter.cxx +++ b/dbaccess/source/filter/xml/xmlfilter.cxx @@ -21,6 +21,7 @@ #include <sal/log.hxx> #include <vcl/errinf.hxx> +#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/uri/UriReferenceFactory.hpp> #include <com/sun/star/util/MeasureUnit.hpp> #include <com/sun/star/util/XNumberFormatsSupplier.hpp> @@ -344,7 +345,7 @@ bool ODBFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) uno::Reference< XNumberFormatsSupplier > xNum(m_xDataSource->getPropertyValue(PROPERTY_NUMBERFORMATSSUPPLIER),UNO_QUERY); SetNumberFormatsSupplier(xNum); - uno::Reference<XComponent> xModel(GetModel(),UNO_QUERY); + uno::Reference<XComponent> xModel(GetModel()); ErrCode nRet = ReadThroughComponent( xStorage ,xModel ,"settings.xml" diff --git a/dbaccess/source/sdbtools/misc/sdbt_services.cxx b/dbaccess/source/sdbtools/misc/sdbt_services.cxx index a554611a8475..5023e9fcc2db 100644 --- a/dbaccess/source/sdbtools/misc/sdbt_services.cxx +++ b/dbaccess/source/sdbtools/misc/sdbt_services.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <com/sun/star/lang/XSingleComponentFactory.hpp> #include <connectiontools.hxx> #include <cppuhelper/factory.hxx> diff --git a/dbaccess/source/ui/control/sqledit.cxx b/dbaccess/source/ui/control/sqledit.cxx index 84cfa4ff8878..ccbe210afd5f 100644 --- a/dbaccess/source/ui/control/sqledit.cxx +++ b/dbaccess/source/ui/control/sqledit.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/beans/XMultiPropertySet.hpp> #include <com/sun/star/beans/XPropertiesChangeListener.hpp> +#include <com/sun/star/container/XHierarchicalNameAccess.hpp> #include <officecfg/Office/Common.hxx> #include <sqledit.hxx> #include <QueryTextView.hxx> diff --git a/dbaccess/source/ui/dlg/UserAdmin.cxx b/dbaccess/source/ui/dlg/UserAdmin.cxx index 17f8b4e4e314..3e63f9424fce 100644 --- a/dbaccess/source/ui/dlg/UserAdmin.cxx +++ b/dbaccess/source/ui/dlg/UserAdmin.cxx @@ -20,6 +20,7 @@ #include "UserAdmin.hxx" #include <com/sun/star/sdbc/SQLException.hpp> #include <com/sun/star/sdbc/XDatabaseMetaData.hpp> +#include <com/sun/star/sdbc/XDriver.hpp> #include <com/sun/star/sdbcx/XDataDefinitionSupplier.hpp> #include <com/sun/star/sdbcx/XUsersSupplier.hpp> #include <com/sun/star/sdbcx/XDrop.hpp> diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx index 1b8f70dd49e5..4dbdb3d6afad 100644 --- a/dbaccess/source/ui/dlg/adminpages.cxx +++ b/dbaccess/source/ui/dlg/adminpages.cxx @@ -30,7 +30,7 @@ #include "odbcconfig.hxx" #include "optionalboolitem.hxx" #include <sqlmessage.hxx> - +#include <com/sun/star/sdbc/XConnection.hpp> #include <comphelper/types.hxx> #include <vcl/svapp.hxx> #include <vcl/weld.hxx> diff --git a/dbaccess/source/ui/querydesign/limitboxcontroller.cxx b/dbaccess/source/ui/querydesign/limitboxcontroller.cxx index 5e5c97768cd2..1c4669c17324 100644 --- a/dbaccess/source/ui/querydesign/limitboxcontroller.cxx +++ b/dbaccess/source/ui/querydesign/limitboxcontroller.cxx @@ -12,6 +12,7 @@ #include <uiservices.hxx> #include <com/sun/star/frame/XDispatchProvider.hpp> +#include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/util/XURLTransformer.hpp> |