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 /oox | |
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 'oox')
-rw-r--r-- | oox/source/core/fragmenthandler2.cxx | 3 | ||||
-rw-r--r-- | oox/source/drawingml/chart/converterbase.cxx | 1 | ||||
-rw-r--r-- | oox/source/drawingml/chart/objectformatter.cxx | 1 | ||||
-rw-r--r-- | oox/source/drawingml/chart/typegroupconverter.cxx | 1 | ||||
-rw-r--r-- | oox/source/drawingml/textfield.cxx | 1 | ||||
-rw-r--r-- | oox/source/drawingml/textrun.cxx | 1 | ||||
-rw-r--r-- | oox/source/dump/pptxdumper.cxx | 1 | ||||
-rw-r--r-- | oox/source/export/drawingml.cxx | 1 | ||||
-rw-r--r-- | oox/source/ole/axcontrol.cxx | 2 | ||||
-rw-r--r-- | oox/source/ole/axcontrolfragment.cxx | 1 | ||||
-rw-r--r-- | oox/source/ole/oleobjecthelper.cxx | 1 | ||||
-rw-r--r-- | oox/source/ppt/pptshape.cxx | 2 | ||||
-rw-r--r-- | oox/source/ppt/presPropsfragmenthandler.cxx | 1 | ||||
-rw-r--r-- | oox/source/ppt/presentationfragmenthandler.cxx | 4 | ||||
-rw-r--r-- | oox/source/ppt/slidefragmenthandler.cxx | 1 | ||||
-rw-r--r-- | oox/source/ppt/slidepersist.cxx | 4 | ||||
-rw-r--r-- | oox/source/shape/ShapeFilterBase.cxx | 1 | ||||
-rw-r--r-- | oox/source/vml/vmldrawing.cxx | 3 | ||||
-rw-r--r-- | oox/source/vml/vmltextbox.cxx | 1 |
19 files changed, 28 insertions, 3 deletions
diff --git a/oox/source/core/fragmenthandler2.cxx b/oox/source/core/fragmenthandler2.cxx index a4855c1be8f0..121f3443731f 100644 --- a/oox/source/core/fragmenthandler2.cxx +++ b/oox/source/core/fragmenthandler2.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <com/sun/star/frame/XModel.hpp> #include <oox/core/fragmenthandler2.hxx> #include <oox/core/xmlfilterbase.hxx> #include <oox/helper/attributelist.hxx> diff --git a/oox/source/drawingml/chart/converterbase.cxx b/oox/source/drawingml/chart/converterbase.cxx index e24d6c72821e..59e99289b45e 100644 --- a/oox/source/drawingml/chart/converterbase.cxx +++ b/oox/source/drawingml/chart/converterbase.cxx @@ -27,6 +27,7 @@ #include <com/sun/star/chart2/XChartDocument.hpp> #include <com/sun/star/chart2/RelativePosition.hpp> #include <com/sun/star/chart2/RelativeSize.hpp> +#include <com/sun/star/chart2/XTitle.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <osl/diagnose.h> diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx index b82fdbe6e026..bc3af886c8af 100644 --- a/oox/source/drawingml/chart/objectformatter.cxx +++ b/oox/source/drawingml/chart/objectformatter.cxx @@ -19,6 +19,7 @@ #include <drawingml/chart/objectformatter.hxx> +#include <com/sun/star/chart2/XChartDocument.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/util/XNumberFormatsSupplier.hpp> #include <com/sun/star/util/XNumberFormatTypes.hpp> diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx index f55ac931fb98..4667afdeae02 100644 --- a/oox/source/drawingml/chart/typegroupconverter.cxx +++ b/oox/source/drawingml/chart/typegroupconverter.cxx @@ -31,6 +31,7 @@ #include <com/sun/star/chart2/XChartTypeContainer.hpp> #include <com/sun/star/chart2/XCoordinateSystem.hpp> #include <com/sun/star/chart2/XDataSeriesContainer.hpp> +#include <com/sun/star/chart2/XDiagram.hpp> #include <com/sun/star/chart2/data/XDataSink.hpp> #include <com/sun/star/drawing/LineStyle.hpp> #include <osl/diagnose.h> diff --git a/oox/source/drawingml/textfield.cxx b/oox/source/drawingml/textfield.cxx index ad1d9e61e399..7425e0416fec 100644 --- a/oox/source/drawingml/textfield.cxx +++ b/oox/source/drawingml/textfield.cxx @@ -22,6 +22,7 @@ #include <rtl/ustring.hxx> #include <rtl/string.hxx> #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/text/XTextField.hpp> diff --git a/oox/source/drawingml/textrun.cxx b/oox/source/drawingml/textrun.cxx index 702ac6454cc3..8b34fd99082e 100644 --- a/oox/source/drawingml/textrun.cxx +++ b/oox/source/drawingml/textrun.cxx @@ -19,6 +19,7 @@ #include <drawingml/textrun.hxx> +#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/text/ControlCharacter.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertyState.hpp> diff --git a/oox/source/dump/pptxdumper.cxx b/oox/source/dump/pptxdumper.cxx index e3c9dce330af..fb1b42fb10b5 100644 --- a/oox/source/dump/pptxdumper.cxx +++ b/oox/source/dump/pptxdumper.cxx @@ -19,6 +19,7 @@ #include <oox/dump/pptxdumper.hxx> +#include <com/sun/star/io/XInputStream.hpp> #include <oox/dump/oledumper.hxx> #include <oox/dump/xlsbdumper.hxx> #include <oox/helper/zipstorage.hxx> diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 254bf0d96a6f..6655a21758cf 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -70,6 +70,7 @@ #include <com/sun/star/drawing/XShape.hpp> #include <com/sun/star/drawing/XShapes.hpp> #include <com/sun/star/drawing/FillStyle.hpp> +#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/graphic/XGraphic.hpp> #include <com/sun/star/i18n/ScriptType.hpp> #include <com/sun/star/i18n/BreakIterator.hpp> diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx index 0f7ef9647f85..78cc0b76770d 100644 --- a/oox/source/ole/axcontrol.cxx +++ b/oox/source/ole/axcontrol.cxx @@ -34,6 +34,7 @@ #include <com/sun/star/beans/NamedValue.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/XIndexContainer.hpp> +#include <com/sun/star/drawing/XDrawPage.hpp> #include <com/sun/star/form/XForm.hpp> #include <com/sun/star/form/XFormComponent.hpp> #include <com/sun/star/form/XFormsSupplier.hpp> @@ -41,6 +42,7 @@ #include <com/sun/star/form/binding/XListEntrySink.hpp> #include <com/sun/star/form/binding/XListEntrySource.hpp> #include <com/sun/star/form/binding/XValueBinding.hpp> +#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/sheet/XCellRangeAddressable.hpp> #include <com/sun/star/sheet/XCellRangeReferrer.hpp> diff --git a/oox/source/ole/axcontrolfragment.cxx b/oox/source/ole/axcontrolfragment.cxx index 54020a033e40..a0f0b109669a 100644 --- a/oox/source/ole/axcontrolfragment.cxx +++ b/oox/source/ole/axcontrolfragment.cxx @@ -19,6 +19,7 @@ #include <oox/ole/axcontrolfragment.hxx> +#include <com/sun/star/io/XInputStream.hpp> #include <oox/core/xmlfilterbase.hxx> #include <oox/helper/attributelist.hxx> #include <oox/helper/binaryinputstream.hxx> diff --git a/oox/source/ole/oleobjecthelper.cxx b/oox/source/ole/oleobjecthelper.cxx index 8a0ca5a7c9b4..a77a784af629 100644 --- a/oox/source/ole/oleobjecthelper.cxx +++ b/oox/source/ole/oleobjecthelper.cxx @@ -26,6 +26,7 @@ #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/document/XEmbeddedObjectResolver.hpp> #include <com/sun/star/embed/Aspects.hpp> +#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx index a781aa5e4a6e..0fc486c05a3f 100644 --- a/oox/source/ppt/pptshape.cxx +++ b/oox/source/ppt/pptshape.cxx @@ -23,7 +23,9 @@ #include <drawingml/table/tableproperties.hxx> #include <com/sun/star/container/XNamed.hpp> +#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/drawing/XDrawPage.hpp> #include <com/sun/star/drawing/XShapes.hpp> #include <com/sun/star/text/XText.hpp> #include <basegfx/matrix/b2dhommatrix.hxx> diff --git a/oox/source/ppt/presPropsfragmenthandler.cxx b/oox/source/ppt/presPropsfragmenthandler.cxx index 60ce67133556..53d831b60ae9 100644 --- a/oox/source/ppt/presPropsfragmenthandler.cxx +++ b/oox/source/ppt/presPropsfragmenthandler.cxx @@ -8,6 +8,7 @@ */ #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/presentation/XPresentationSupplier.hpp> #include <oox/core/xmlfilterbase.hxx> diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index 908b13fdc4ab..ea8d692ac2fc 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -28,7 +28,9 @@ #include <com/sun/star/drawing/XDrawPages.hpp> #include <com/sun/star/drawing/XDrawPagesSupplier.hpp> #include <com/sun/star/drawing/XMasterPageTarget.hpp> +#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/io/XInputStream.hpp> +#include <com/sun/star/text/XTextField.hpp> #include <com/sun/star/xml/dom/XDocument.hpp> #include <com/sun/star/xml/sax/XFastSAXSerializable.hpp> #include <com/sun/star/presentation/XPresentationPage.hpp> @@ -143,7 +145,7 @@ static void ResolveTextFields( XmlFilterBase const & rFilter ) Reference< container::XNamed > xNamed( xDrawPage, UNO_QUERY_THROW ); aURL = "#" + xNamed->getName(); xPropSet->setPropertyValue( sURL, Any( aURL ) ); - Reference< text::XTextContent > xContent( rTextField.xTextField, UNO_QUERY); + Reference< text::XTextContent > xContent( rTextField.xTextField); Reference< text::XTextRange > xTextRange = rTextField.xTextCursor; rTextField.xText->insertTextContent( xTextRange, xContent, true ); } diff --git a/oox/source/ppt/slidefragmenthandler.cxx b/oox/source/ppt/slidefragmenthandler.cxx index d316c53f3b49..5feaf8532513 100644 --- a/oox/source/ppt/slidefragmenthandler.cxx +++ b/oox/source/ppt/slidefragmenthandler.cxx @@ -19,6 +19,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/XNamed.hpp> +#include <com/sun/star/drawing/XDrawPage.hpp> #include <tools/diagnose_ex.h> #include <oox/helper/attributelist.hxx> diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx index 65dc198759ea..6f4be017c605 100644 --- a/oox/source/ppt/slidepersist.cxx +++ b/oox/source/ppt/slidepersist.cxx @@ -18,7 +18,9 @@ */ #include <basegfx/matrix/b2dhommatrix.hxx> +#include <com/sun/star/drawing/XDrawPage.hpp> #include <com/sun/star/drawing/XShapes.hpp> +#include <com/sun/star/frame/XModel.hpp> #include <oox/ppt/timenode.hxx> #include <oox/ppt/pptshape.hxx> #include <oox/ppt/slidepersist.hxx> @@ -129,7 +131,7 @@ void SlidePersist::createXShapes( XmlFilterBase& rFilterBase ) { applyTextStyles( rFilterBase ); - Reference< XShapes > xShapes( getPage(), UNO_QUERY ); + Reference< XShapes > xShapes( getPage() ); std::vector< oox::drawingml::ShapePtr >& rShapes( maShapesPtr->getChildren() ); for (auto const& shape : rShapes) diff --git a/oox/source/shape/ShapeFilterBase.cxx b/oox/source/shape/ShapeFilterBase.cxx index 7a32e82c3310..80be6d7fde53 100644 --- a/oox/source/shape/ShapeFilterBase.cxx +++ b/oox/source/shape/ShapeFilterBase.cxx @@ -25,6 +25,7 @@ #include <oox/drawingml/theme.hxx> #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/xml/sax/XFastSAXSerializable.hpp> namespace oox::shape { diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx index f9c36cda758c..cc24d1f10468 100644 --- a/oox/source/vml/vmldrawing.cxx +++ b/oox/source/vml/vmldrawing.cxx @@ -22,6 +22,7 @@ #include <algorithm> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/drawing/XControlShape.hpp> +#include <com/sun/star/drawing/XDrawPage.hpp> #include <com/sun/star/drawing/XShapes.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/text/HoriOrientation.hpp> @@ -145,7 +146,7 @@ void Drawing::finalizeFragmentImport() void Drawing::convertAndInsert() const { - Reference< XShapes > xShapes( mxDrawPage, UNO_QUERY ); + Reference< XShapes > xShapes( mxDrawPage ); mxShapes->convertAndInsert( xShapes ); // Group together form control radio buttons that are in the same groupBox diff --git a/oox/source/vml/vmltextbox.cxx b/oox/source/vml/vmltextbox.cxx index 5b79e8410bf9..ed11aa4ec825 100644 --- a/oox/source/vml/vmltextbox.cxx +++ b/oox/source/vml/vmltextbox.cxx @@ -24,6 +24,7 @@ #include <com/sun/star/awt/FontWeight.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/drawing/TextHorizontalAdjust.hpp> +#include <com/sun/star/drawing/XShape.hpp> #include <com/sun/star/text/XTextAppend.hpp> #include <com/sun/star/text/WritingMode.hpp> #include <com/sun/star/style/ParagraphAdjust.hpp> |