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 /reportdesign | |
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 'reportdesign')
-rw-r--r-- | reportdesign/inc/RptDef.hxx | 4 | ||||
-rw-r--r-- | reportdesign/source/core/api/FormattedField.cxx | 1 | ||||
-rw-r--r-- | reportdesign/source/core/sdr/RptObject.cxx | 9 | ||||
-rw-r--r-- | reportdesign/source/core/sdr/formatnormalizer.cxx | 1 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/dbloader2.cxx | 1 | ||||
-rw-r--r-- | reportdesign/source/ui/misc/statusbarcontroller.cxx | 1 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ReportController.cxx | 1 |
7 files changed, 11 insertions, 7 deletions
diff --git a/reportdesign/inc/RptDef.hxx b/reportdesign/inc/RptDef.hxx index 2876e97c8c19..92a7c5b6f6d8 100644 --- a/reportdesign/inc/RptDef.hxx +++ b/reportdesign/inc/RptDef.hxx @@ -27,6 +27,7 @@ #include "dllapi.h" #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/style/XStyle.hpp> #include <svx/fmglob.hxx> #include <svx/svdtypes.hxx> @@ -35,9 +36,6 @@ namespace com { namespace sun { namespace star { class XReportComponent; class XReportDefinition; } - namespace style { - class XStyle; - } }}} namespace rptui diff --git a/reportdesign/source/core/api/FormattedField.cxx b/reportdesign/source/core/api/FormattedField.cxx index a4342fad3fbe..28993e861411 100644 --- a/reportdesign/source/core/api/FormattedField.cxx +++ b/reportdesign/source/core/api/FormattedField.cxx @@ -19,6 +19,7 @@ #include <FormattedField.hxx> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/beans/XPropertyState.hpp> +#include <com/sun/star/sdbc/XDataSource.hpp> #include <strings.hxx> #include <strings.hrc> #include <core_resource.hxx> diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx index 157ed10b7ca6..781d16cb0f34 100644 --- a/reportdesign/source/core/sdr/RptObject.cxx +++ b/reportdesign/source/core/sdr/RptObject.cxx @@ -47,6 +47,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/embed/XComponentSupplier.hpp> +#include <com/sun/star/embed/XEmbeddedObject.hpp> #include <com/sun/star/container/XContainer.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/report/XShape.hpp> @@ -1098,7 +1099,7 @@ void OOle2Obj::impl_setUnoShape( const uno::Reference< uno::XInterface >& rxUnoS static uno::Reference< chart2::data::XDatabaseDataProvider > lcl_getDataProvider(const uno::Reference < embed::XEmbeddedObject >& _xObj) { uno::Reference< chart2::data::XDatabaseDataProvider > xSource; - uno::Reference< embed::XComponentSupplier > xCompSupp(_xObj,uno::UNO_QUERY); + uno::Reference< embed::XComponentSupplier > xCompSupp(_xObj); if( xCompSupp.is()) { uno::Reference< chart2::XChartDocument> xChartDoc( xCompSupp->getComponent(), uno::UNO_QUERY ); @@ -1142,7 +1143,7 @@ void OOle2Obj::impl_createDataProvider_nothrow(const uno::Reference< frame::XMod { uno::Reference < embed::XEmbeddedObject > xObj = GetObjRef(); uno::Reference< chart2::data::XDataReceiver > xReceiver; - uno::Reference< embed::XComponentSupplier > xCompSupp( xObj, uno::UNO_QUERY ); + uno::Reference< embed::XComponentSupplier > xCompSupp( xObj ); if( xCompSupp.is()) xReceiver.set( xCompSupp->getComponent(), uno::UNO_QUERY ); OSL_ASSERT( xReceiver.is()); @@ -1168,7 +1169,7 @@ void OOle2Obj::initializeOle() OReportModel& rRptModel(static_cast< OReportModel& >(getSdrModelFromSdrObject())); rRptModel.GetUndoEnv().AddElement(lcl_getDataProvider(xObj)); - uno::Reference< embed::XComponentSupplier > xCompSupp( xObj, uno::UNO_QUERY ); + uno::Reference< embed::XComponentSupplier > xCompSupp( xObj ); if( xCompSupp.is() ) { uno::Reference< beans::XPropertySet > xChartProps( xCompSupp->getComponent(), uno::UNO_QUERY ); @@ -1182,7 +1183,7 @@ void OOle2Obj::initializeChart( const uno::Reference< frame::XModel>& _xModel) { uno::Reference < embed::XEmbeddedObject > xObj = GetObjRef(); uno::Reference< chart2::data::XDataReceiver > xReceiver; - uno::Reference< embed::XComponentSupplier > xCompSupp( xObj, uno::UNO_QUERY ); + uno::Reference< embed::XComponentSupplier > xCompSupp( xObj ); if( xCompSupp.is()) xReceiver.set( xCompSupp->getComponent(), uno::UNO_QUERY ); OSL_ASSERT( xReceiver.is()); diff --git a/reportdesign/source/core/sdr/formatnormalizer.cxx b/reportdesign/source/core/sdr/formatnormalizer.cxx index 7511792eb0d4..0db0bcac38e8 100644 --- a/reportdesign/source/core/sdr/formatnormalizer.cxx +++ b/reportdesign/source/core/sdr/formatnormalizer.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #include <com/sun/star/sdbc/SQLException.hpp> #include <com/sun/star/sdb/XParametersSupplier.hpp> +#include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp> #include <com/sun/star/util/XNumberFormatTypes.hpp> #include <dbaccess/dbsubcomponentcontroller.hxx> diff --git a/reportdesign/source/filter/xml/dbloader2.cxx b/reportdesign/source/filter/xml/dbloader2.cxx index 2f64334d856f..92fcdc8f0342 100644 --- a/reportdesign/source/filter/xml/dbloader2.cxx +++ b/reportdesign/source/filter/xml/dbloader2.cxx @@ -24,6 +24,7 @@ #include <comphelper/types.hxx> #include <cppuhelper/supportsservice.hxx> #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/embed/XStorage.hpp> namespace rptxml { diff --git a/reportdesign/source/ui/misc/statusbarcontroller.cxx b/reportdesign/source/ui/misc/statusbarcontroller.cxx index 4f5e9e1dd12e..bae4a793a6b7 100644 --- a/reportdesign/source/ui/misc/statusbarcontroller.cxx +++ b/reportdesign/source/ui/misc/statusbarcontroller.cxx @@ -31,6 +31,7 @@ #include <vcl/status.hxx> #include <osl/mutex.hxx> #include <toolkit/helper/vclunohelper.hxx> +#include <com/sun/star/awt/XWindow.hpp> #include <com/sun/star/beans/PropertyValue.hpp> namespace rptui diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index bf61da78c8d2..d723bfe70890 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -44,6 +44,7 @@ #include <com/sun/star/style/PageStyleLayout.hpp> #include <com/sun/star/style/ParagraphAdjust.hpp> #include <com/sun/star/util/NumberFormatter.hpp> +#include <com/sun/star/ui/dialogs/XFilePicker3.hpp> #include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp> |