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 /sc/source/ui | |
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 'sc/source/ui')
-rw-r--r-- | sc/source/ui/miscdlgs/solveroptions.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/vba/vbaborders.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/vba/vbahyperlink.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/vba/vbasheetobjects.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/vba/vbatitle.hxx | 3 | ||||
-rw-r--r-- | sc/source/ui/vba/vbavalidation.cxx | 1 |
6 files changed, 6 insertions, 2 deletions
diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx index 2136f4e14ad8..e22647b3d5f9 100644 --- a/sc/source/ui/miscdlgs/solveroptions.cxx +++ b/sc/source/ui/miscdlgs/solveroptions.cxx @@ -30,6 +30,7 @@ #include <algorithm> +#include <com/sun/star/sheet/XSolver.hpp> #include <com/sun/star/sheet/XSolverDescription.hpp> #include <com/sun/star/beans/PropertyValue.hpp> diff --git a/sc/source/ui/vba/vbaborders.cxx b/sc/source/ui/vba/vbaborders.cxx index 35abba15ae12..41e8f03c56d6 100644 --- a/sc/source/ui/vba/vbaborders.cxx +++ b/sc/source/ui/vba/vbaborders.cxx @@ -26,6 +26,7 @@ #include <ooo/vba/excel/XlColorIndex.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/table/TableBorder.hpp> +#include <com/sun/star/table/XCellRange.hpp> #include <com/sun/star/table/XColumnRowRange.hpp> #include "vbapalette.hxx" diff --git a/sc/source/ui/vba/vbahyperlink.cxx b/sc/source/ui/vba/vbahyperlink.cxx index 1a5bd6093485..9dc88cdd06cb 100644 --- a/sc/source/ui/vba/vbahyperlink.cxx +++ b/sc/source/ui/vba/vbahyperlink.cxx @@ -24,6 +24,7 @@ #include <vbahelper/helperdecl.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/XIndexAccess.hpp> +#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/table/XCellRange.hpp> #include <com/sun/star/text/XText.hpp> diff --git a/sc/source/ui/vba/vbasheetobjects.cxx b/sc/source/ui/vba/vbasheetobjects.cxx index 74da487f8518..e0082be6b5a6 100644 --- a/sc/source/ui/vba/vbasheetobjects.cxx +++ b/sc/source/ui/vba/vbasheetobjects.cxx @@ -32,6 +32,7 @@ #include <com/sun/star/form/XFormsSupplier.hpp> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/sheet/XSpreadsheet.hpp> #include "vbasheetobject.hxx" #include <cppuhelper/implbase.hxx> diff --git a/sc/source/ui/vba/vbatitle.hxx b/sc/source/ui/vba/vbatitle.hxx index 6d1c1adf9e01..6b79867d254f 100644 --- a/sc/source/ui/vba/vbatitle.hxx +++ b/sc/source/ui/vba/vbatitle.hxx @@ -24,12 +24,11 @@ #include "vbafont.hxx" #include "vbapalette.hxx" #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/drawing/XShape.hpp> #include <com/sun/star/script/BasicErrorException.hpp> #include <basic/sberrors.hxx> #include <memory> -namespace com { namespace sun { namespace star { namespace drawing { class XShape; } } } } - template< typename... Ifc > class TitleImpl : public InheritedHelperInterfaceImpl< Ifc... > { diff --git a/sc/source/ui/vba/vbavalidation.cxx b/sc/source/ui/vba/vbavalidation.cxx index d3d166643221..65d6f985c343 100644 --- a/sc/source/ui/vba/vbavalidation.cxx +++ b/sc/source/ui/vba/vbavalidation.cxx @@ -22,6 +22,7 @@ #include <com/sun/star/sheet/XSheetCondition.hpp> #include <com/sun/star/sheet/ValidationType.hpp> #include <com/sun/star/sheet/ValidationAlertStyle.hpp> +#include <com/sun/star/table/XCellRange.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <ooo/vba/excel/XlDVType.hpp> #include <ooo/vba/excel/XlDVAlertStyle.hpp> |