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 /vbahelper/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 'vbahelper/source')
-rw-r--r-- | vbahelper/source/vbahelper/vbahelper.cxx | 1 | ||||
-rw-r--r-- | vbahelper/source/vbahelper/vbatextframe.cxx | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index 1f2dea7bcfa0..f99701866e3d 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -26,6 +26,7 @@ #include <com/sun/star/frame/XModel2.hpp> #include <com/sun/star/script/BasicErrorException.hpp> #include <com/sun/star/script/XDefaultProperty.hpp> +#include <com/sun/star/script/XInvocation.hpp> #include <com/sun/star/script/Converter.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> diff --git a/vbahelper/source/vbahelper/vbatextframe.cxx b/vbahelper/source/vbahelper/vbatextframe.cxx index 23c79f43bd61..6e19734cd0e5 100644 --- a/vbahelper/source/vbahelper/vbatextframe.cxx +++ b/vbahelper/source/vbahelper/vbatextframe.cxx @@ -19,6 +19,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/drawing/TextFitToSizeType.hpp> +#include <com/sun/star/drawing/XShape.hpp> #include <vbahelper/vbatextframe.hxx> using namespace ::ooo::vba; |