summaryrefslogtreecommitdiff
path: root/chart2/source/tools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-04-26 22:07:21 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-04-27 07:19:30 +0200
commitb512ce255f46d90e682634e4dd17e146af7f9080 (patch)
treeda2ce68b775e0e45294920074a1ae8306dbac818 /chart2/source/tools
parent83cf08b1cb2d493a4c12f88eb6bf0daf25fe5beb (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 'chart2/source/tools')
-rw-r--r--chart2/source/tools/ChartViewHelper.cxx1
-rw-r--r--chart2/source/tools/DataSeriesHelper.cxx1
-rw-r--r--chart2/source/tools/LifeTime.cxx1
-rw-r--r--chart2/source/tools/RangeHighlighter.cxx1
-rw-r--r--chart2/source/tools/ReferenceSizeProvider.cxx2
-rw-r--r--chart2/source/tools/StatisticsHelper.cxx2
-rw-r--r--chart2/source/tools/WrappedDefaultProperty.cxx3
7 files changed, 7 insertions, 4 deletions
diff --git a/chart2/source/tools/ChartViewHelper.cxx b/chart2/source/tools/ChartViewHelper.cxx
index 872960f17e41..a341f8894f14 100644
--- a/chart2/source/tools/ChartViewHelper.cxx
+++ b/chart2/source/tools/ChartViewHelper.cxx
@@ -20,6 +20,7 @@
#include <ChartViewHelper.hxx>
#include <servicenames.hxx>
+#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/util/XModifyListener.hpp>
diff --git a/chart2/source/tools/DataSeriesHelper.cxx b/chart2/source/tools/DataSeriesHelper.cxx
index 3dbcd65f70a2..a772f11c5fb1 100644
--- a/chart2/source/tools/DataSeriesHelper.cxx
+++ b/chart2/source/tools/DataSeriesHelper.cxx
@@ -29,6 +29,7 @@
#include <com/sun/star/chart2/AxisType.hpp>
#include <com/sun/star/chart2/SymbolStyle.hpp>
#include <com/sun/star/chart2/Symbol.hpp>
+#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
diff --git a/chart2/source/tools/LifeTime.cxx b/chart2/source/tools/LifeTime.cxx
index 5ac9ba648e60..5817db73a2e1 100644
--- a/chart2/source/tools/LifeTime.cxx
+++ b/chart2/source/tools/LifeTime.cxx
@@ -23,6 +23,7 @@
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/util/CloseVetoException.hpp>
#include <com/sun/star/util/XCloseListener.hpp>
+#include <com/sun/star/util/XCloseable.hpp>
#include <tools/diagnose_ex.h>
#include <sal/log.hxx>
diff --git a/chart2/source/tools/RangeHighlighter.cxx b/chart2/source/tools/RangeHighlighter.cxx
index ea49fc64a07f..9efdbc5d439b 100644
--- a/chart2/source/tools/RangeHighlighter.cxx
+++ b/chart2/source/tools/RangeHighlighter.cxx
@@ -26,6 +26,7 @@
#include <com/sun/star/chart2/ScaleData.hpp>
#include <com/sun/star/chart2/XAxis.hpp>
+#include <com/sun/star/chart2/XDataSeries.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/drawing/XShape.hpp>
diff --git a/chart2/source/tools/ReferenceSizeProvider.cxx b/chart2/source/tools/ReferenceSizeProvider.cxx
index 7cd07d911703..865acc660c08 100644
--- a/chart2/source/tools/ReferenceSizeProvider.cxx
+++ b/chart2/source/tools/ReferenceSizeProvider.cxx
@@ -22,7 +22,7 @@
#include <ChartModelHelper.hxx>
#include <DiagramHelper.hxx>
#include <AxisHelper.hxx>
-
+#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XTitled.hpp>
#include <com/sun/star/chart2/XTitle.hpp>
#include <com/sun/star/chart2/XDataSeries.hpp>
diff --git a/chart2/source/tools/StatisticsHelper.cxx b/chart2/source/tools/StatisticsHelper.cxx
index f90edf2fe15a..02dab3b9bd89 100644
--- a/chart2/source/tools/StatisticsHelper.cxx
+++ b/chart2/source/tools/StatisticsHelper.cxx
@@ -25,7 +25,7 @@
#include <rtl/math.hxx>
#include <rtl/ustrbuf.hxx>
#include <comphelper/processfactory.hxx>
-
+#include <com/sun/star/chart2/XDataSeries.hpp>
#include <com/sun/star/chart2/data/LabeledDataSequence.hpp>
#include <com/sun/star/chart2/data/XNumericalDataSequence.hpp>
#include <com/sun/star/chart2/data/XDataProvider.hpp>
diff --git a/chart2/source/tools/WrappedDefaultProperty.cxx b/chart2/source/tools/WrappedDefaultProperty.cxx
index 6638654e76c1..74d2b4b0aae0 100644
--- a/chart2/source/tools/WrappedDefaultProperty.cxx
+++ b/chart2/source/tools/WrappedDefaultProperty.cxx
@@ -21,8 +21,7 @@
#include <tools/diagnose_ex.h>
#include <com/sun/star/beans/XPropertySet.hpp>
-
-namespace com::sun::star::beans { class XPropertyState; }
+#include <com/sun/star/beans/XPropertyState.hpp>
using namespace ::com::sun::star;