Make upcasting css::uno::Reference ctor require complete types

Desktop / LibreOffice - Stephan Bergmann [redhat.com] - 27 April 2020 05:19 EDT

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

b512ce255f46 Make upcasting css::uno::Reference ctor require complete types
accessibility/source/extended/accessibletabbar.cxx | 1 +
.../source/standard/accessiblemenucomponent.cxx | 1 +
avmedia/source/framework/mediaitem.cxx | 1 +
avmedia/source/viewer/mediawindow.cxx | 1 +
basctl/source/basicide/baside2b.cxx | 1 +
canvas/source/tools/canvastools.cxx | 1 +
.../controller/chartapiwrapper/AxisWrapper.cxx | 3 ++
.../WrappedAxisAndGridExistenceProperties.cxx | 2 +
.../chartapiwrapper/WrappedSymbolProperties.cxx | 1 +
.../source/controller/dialogs/TitleDialogData.cxx | 4 ++
.../source/controller/dialogs/dlg_DataEditor.cxx | 1 +
.../controller/dialogs/dlg_InsertErrorBars.cxx | 1 +
chart2/source/controller/dialogs/dlg_View3D.cxx | 2 +
.../controller/dialogs/tp_3D_SceneAppearance.cxx | 2 +
chart2/source/controller/dialogs/tp_DataSource.cxx | 3 ++
.../controller/drawinglayer/DrawViewWrapper.cxx | 1 +
.../itemsetwrapper/AxisItemConverter.cxx | 1 +
.../itemsetwrapper/DataPointItemConverter.cxx | 2 +-
.../itemsetwrapper/MultipleChartConverters.cxx | 2 +
.../itemsetwrapper/TextLabelItemConverter.cxx | 1 +
.../controller/main/DragMethod_PieSegment.cxx | 1 +
.../controller/main/DragMethod_RotateDiagram.cxx | 1 +
chart2/source/controller/main/ObjectHierarchy.cxx | 1 +
.../controller/main/PositionAndSizeHelper.cxx | 3 +-
chart2/source/controller/main/SelectionHelper.cxx | 1 +
chart2/source/controller/main/ShapeController.cxx | 2 +-
.../source/controller/main/UndoCommandDispatch.cxx | 1 +
.../source/model/template/BarChartTypeTemplate.cxx | 1 +
chart2/source/tools/ChartViewHelper.cxx | 1 +
chart2/source/tools/DataSeriesHelper.cxx | 1 +
chart2/source/tools/LifeTime.cxx | 1 +
chart2/source/tools/RangeHighlighter.cxx | 1 +
chart2/source/tools/ReferenceSizeProvider.cxx | 2 +-
chart2/source/tools/StatisticsHelper.cxx | 2 +-
chart2/source/tools/WrappedDefaultProperty.cxx | 3 +-
chart2/source/view/axes/VAxisBase.cxx | 1 +
chart2/source/view/axes/VCartesianAxis.cxx | 2 +-
chart2/source/view/axes/VPolarAngleAxis.cxx | 1 +
chart2/source/view/charttypes/CandleStickChart.cxx | 1 +
chart2/source/view/charttypes/PieChart.cxx | 1 +
comphelper/source/misc/componentmodule.cxx | 3 ++
.../source/processfactory/processfactory.cxx | 2 +-
connectivity/source/commontools/dbtools2.cxx | 2 +
connectivity/source/commontools/paramwrapper.cxx | 1 +
connectivity/source/drivers/mork/MColumnAlias.cxx | 1 +
.../source/drivers/writer/WDatabaseMetaData.cxx | 1 +
connectivity/source/drivers/writer/WTable.cxx | 1 +
cui/source/customize/cfg.cxx | 1 +
cui/source/options/optasian.cxx | 1 +
cui/source/options/optlingu.cxx | 3 +-
cui/source/tabpages/numfmt.cxx | 1 +
dbaccess/source/core/api/querycomposer.cxx | 1 +
dbaccess/source/filter/xml/xmlDatabase.cxx | 1 +
dbaccess/source/filter/xml/xmlExport.cxx | 1 +
dbaccess/source/filter/xml/xmlfilter.cxx | 3 +-
dbaccess/source/sdbtools/misc/sdbt_services.cxx | 3 ++
dbaccess/source/ui/control/sqledit.cxx | 1 +
dbaccess/source/ui/dlg/UserAdmin.cxx | 1 +
dbaccess/source/ui/dlg/adminpages.cxx | 2 +-
.../source/ui/querydesign/limitboxcontroller.cxx | 1 +
desktop/source/deployment/misc/dp_ucb.cxx | 1 +
.../source/primitive2d/textlayoutdevice.cxx | 1 +
extensions/source/abpilot/datasourcehandling.cxx | 1 +
.../source/propctrlr/formcomponenthandler.cxx | 1 +
extensions/source/propctrlr/formlinkdialog.cxx | 2 +-
filter/source/graphic/GraphicExportFilter.cxx | 2 +
filter/source/msfilter/msocximex.cxx | 1 +
filter/source/msfilter/mstoolbar.cxx | 1 +
filter/source/msfilter/svdfppt.cxx | 1 +
forms/source/component/ImageControl.cxx | 1 +
forms/source/runtime/formoperations.cxx | 1 +
framework/source/services/substitutepathvars.cxx | 1 +
.../source/uielement/controlmenucontroller.cxx | 1 +
framework/source/uielement/fontmenucontroller.cxx | 1 +
.../source/uielement/toolbarmodemenucontroller.cxx | 1 +
include/com/sun/star/uno/Reference.h | 53 +++-------------------
include/com/sun/star/uno/Reference.hxx | 4 +-
include/vbahelper/vbahelperinterface.hxx | 5 +-
oox/source/core/fragmenthandler2.cxx | 3 ++
oox/source/drawingml/chart/converterbase.cxx | 1 +
oox/source/drawingml/chart/objectformatter.cxx | 1 +
oox/source/drawingml/chart/typegroupconverter.cxx | 1 +
oox/source/drawingml/textfield.cxx | 1 +
oox/source/drawingml/textrun.cxx | 1 +
oox/source/dump/pptxdumper.cxx | 1 +
oox/source/export/drawingml.cxx | 1 +
oox/source/ole/axcontrol.cxx | 2 +
oox/source/ole/axcontrolfragment.cxx | 1 +
oox/source/ole/oleobjecthelper.cxx | 1 +
oox/source/ppt/pptshape.cxx | 2 +
oox/source/ppt/presPropsfragmenthandler.cxx | 1 +
oox/source/ppt/presentationfragmenthandler.cxx | 4 +-
oox/source/ppt/slidefragmenthandler.cxx | 1 +
oox/source/ppt/slidepersist.cxx | 4 +-
oox/source/shape/ShapeFilterBase.cxx | 1 +
oox/source/vml/vmldrawing.cxx | 3 +-
oox/source/vml/vmltextbox.cxx | 1 +
pyuno/source/module/pyuno_runtime.cxx | 1 +
reportdesign/inc/RptDef.hxx | 4 +-
reportdesign/source/core/api/FormattedField.cxx | 1 +
reportdesign/source/core/sdr/RptObject.cxx | 9 ++--
reportdesign/source/core/sdr/formatnormalizer.cxx | 1 +
reportdesign/source/filter/xml/dbloader2.cxx | 1 +
.../source/ui/misc/statusbarcontroller.cxx | 1 +
reportdesign/source/ui/report/ReportController.cxx | 1 +
sc/source/core/tool/addincol.cxx | 1 +
sc/source/core/tool/formulaparserpool.cxx | 1 +
sc/source/core/tool/interpr4.cxx | 1 +
sc/source/filter/excel/excdoc.cxx | 1 +
sc/source/filter/excel/excimp8.cxx | 1 +
sc/source/filter/excel/expop2.cxx | 1 +
sc/source/filter/excel/xecontent.cxx | 1 +
sc/source/filter/excel/xeescher.cxx | 1 +
sc/source/filter/excel/xistyle.cxx | 1 +
sc/source/filter/excel/xlchart.cxx | 1 +
sc/source/filter/ftools/fapihelper.cxx | 1 +
sc/source/filter/html/htmlexp.cxx | 1 +
sc/source/filter/html/htmlpars.cxx | 1 +
sc/source/filter/oox/defnamesbuffer.cxx | 1 +
sc/source/filter/oox/drawingfragment.cxx | 1 +
sc/source/filter/oox/excelchartconverter.cxx | 1 +
sc/source/filter/oox/externallinkbuffer.cxx | 1 +
sc/source/filter/oox/numberformatsbuffer.cxx | 1 +
sc/source/filter/oox/pagesettings.cxx | 2 +
sc/source/filter/oox/querytablebuffer.cxx | 1 +
sc/source/filter/oox/sheetdatabuffer.cxx | 3 ++
sc/source/filter/oox/stylesbuffer.cxx | 2 +
sc/source/filter/oox/tablebuffer.cxx | 1 +
sc/source/filter/oox/unitconverter.cxx | 1 +
sc/source/filter/oox/viewsettings.cxx | 3 ++
sc/source/filter/oox/workbooksettings.cxx | 1 +
sc/source/filter/oox/worksheetsettings.cxx | 1 +
sc/source/filter/xcl97/xcl97esc.cxx | 3 +-
sc/source/filter/xcl97/xcl97rec.cxx | 1 +
.../filter/xml/XMLCalculationSettingsContext.cxx | 1 +
sc/source/filter/xml/XMLExportDDELinks.cxx | 1 +
sc/source/filter/xml/XMLExportDatabaseRanges.cxx | 1 +
sc/source/filter/xml/XMLExportIterator.cxx | 5 +-
sc/source/filter/xml/XMLTableSourceContext.cxx | 1 +
sc/source/filter/xml/xmlexprt.cxx | 2 +-
sc/source/filter/xml/xmltabi.cxx | 1 +
sc/source/ui/miscdlgs/solveroptions.cxx | 1 +
sc/source/ui/vba/vbaborders.cxx | 1 +
sc/source/ui/vba/vbahyperlink.cxx | 1 +
sc/source/ui/vba/vbasheetobjects.cxx | 1 +
sc/source/ui/vba/vbatitle.hxx | 3 +-
sc/source/ui/vba/vbavalidation.cxx | 1 +
sd/source/core/drawdoc.cxx | 1 +
sd/source/filter/eppt/eppt.cxx | 1 +
sd/source/filter/eppt/epptso.cxx | 1 +
sd/source/filter/eppt/pptexanimations.cxx | 1 +
sd/source/filter/eppt/pptx-epptbase.cxx | 1 +
sd/source/filter/html/htmlex.cxx | 1 +
sd/source/filter/ppt/pptin.cxx | 2 +-
sd/source/filter/ppt/pptinanimations.cxx | 1 +
.../accessibility/AccessibleDrawDocumentView.cxx | 2 +
sd/source/ui/app/sdxfer.cxx | 3 ++
sd/source/ui/dlg/filedlg.cxx | 1 +
sd/source/ui/dlg/sdtreelb.cxx | 1 +
.../ConfigurationControllerBroadcaster.cxx | 2 +
sd/source/ui/framework/factories/Pane.cxx | 3 +-
.../ui/framework/module/SlideSorterModule.cxx | 1 +
sd/source/ui/framework/module/ViewTabBarModule.cxx | 1 +
sd/source/ui/func/fuinsfil.cxx | 3 +-
sd/source/ui/func/futempl.cxx | 1 +
sd/source/ui/presenter/PresenterHelper.cxx | 1 +
sd/source/ui/slideshow/PaneHider.cxx | 1 +
.../controller/SlsCurrentSlideManager.cxx | 1 +
sd/source/ui/unoidl/unodoc.cxx | 1 +
sd/source/ui/view/PresentationViewShellBase.cxx | 1 +
sd/source/ui/view/sdview2.cxx | 1 +
sfx2/source/appl/opengrf.cxx | 1 +
sfx2/source/control/statcach.cxx | 1 +
sfx2/source/dialog/documentfontsdialog.cxx | 1 +
sfx2/source/dialog/versdlg.cxx | 1 +
sfx2/source/doc/Metadatable.cxx | 1 +
sfx2/source/doc/docfilt.cxx | 2 +-
sfx2/source/doc/docinsert.cxx | 1 +
sfx2/source/doc/guisaveas.cxx | 1 +
sfx2/source/doc/iframe.cxx | 1 +
sfx2/source/sidebar/ResourceManager.cxx | 1 +
sfx2/source/sidebar/SidebarPanelBase.cxx | 2 +-
sfx2/source/sidebar/Tools.cxx | 1 +
sfx2/source/view/ipclient.cxx | 3 ++
sfx2/source/view/sfxbasecontroller.cxx | 2 +-
sfx2/source/view/userinputinterception.cxx | 1 +
.../source/engine/rehearsetimingsactivity.cxx | 1 +
starmath/source/unodoc.cxx | 1 +
svtools/source/dialogs/addresstemplate.cxx | 1 +
svtools/source/misc/bindablecontrolhelper.cxx | 1 +
.../accessibility/AccessibleGraphicShape.cxx | 3 +-
svx/source/accessibility/AccessibleOLEShape.cxx | 3 +-
svx/source/accessibility/DescriptionGenerator.cxx | 1 +
svx/source/core/graphichelper.cxx | 1 +
svx/source/dialog/langbox.cxx | 3 +-
svx/source/fmcomp/gridctrl.cxx | 1 +
svx/source/form/fmmodel.cxx | 5 +-
svx/source/form/fmtools.cxx | 5 +-
svx/source/form/formcontrolfactory.cxx | 1 +
svx/source/gallery2/galbrws2.cxx | 1 +
svx/source/gallery2/galobj.cxx | 2 +
svx/source/svdraw/svdmrkv.cxx | 1 +
svx/source/table/accessibletableshape.cxx | 1 +
sw/source/core/access/AccessibilityCheck.cxx | 1 +
sw/source/core/doc/DocumentStatisticsManager.cxx | 1 +
sw/source/core/doc/doccomp.cxx | 1 +
sw/source/core/doc/docglbl.cxx | 1 +
sw/source/core/doc/docglos.cxx | 2 +-
sw/source/core/doc/rdfhelper.cxx | 1 +
sw/source/core/draw/dpage.cxx | 1 +
sw/source/core/draw/drawdoc.cxx | 1 +
sw/source/core/fields/docufld.cxx | 1 +
sw/source/core/text/txtftn.cxx | 1 +
sw/source/core/unocore/unodraw.cxx | 1 +
sw/source/core/unocore/unoredline.cxx | 2 +-
sw/source/core/unocore/unorefmk.cxx | 1 +
sw/source/core/unocore/unostyle.cxx | 1 +
sw/source/filter/docx/swdocxreader.cxx | 1 +
sw/source/filter/html/htmlfld.cxx | 2 +-
sw/source/filter/html/htmlforw.cxx | 1 +
sw/source/filter/html/wrthtml.cxx | 1 +
sw/source/filter/rtf/swparrtf.cxx | 1 +
sw/source/filter/ww8/docxtablestyleexport.cxx | 1 +
sw/source/filter/ww8/rtfexport.cxx | 1 +
sw/source/filter/ww8/wrtww8.cxx | 1 +
sw/source/filter/xml/xmlfmt.cxx | 1 +
sw/source/filter/xml/xmlmeta.cxx | 1 +
sw/source/filter/xml/xmltbli.cxx | 1 +
sw/source/filter/xml/xmltexti.cxx | 1 +
sw/source/ui/dbui/dbinsdlg.cxx | 1 +
sw/source/ui/fldui/fldedt.cxx | 1 +
sw/source/ui/fldui/fldtdlg.cxx | 1 +
sw/source/ui/frmdlg/cption.cxx | 1 +
sw/source/ui/misc/bookmark.cxx | 1 +
sw/source/ui/vba/vbaframes.cxx | 1 +
sw/source/ui/vba/vbarevision.cxx | 1 +
sw/source/ui/vba/vbarevisions.cxx | 1 +
sw/source/ui/vba/vbasections.cxx | 1 +
sw/source/uibase/app/docst.cxx | 2 +-
sw/source/uibase/dbui/dbtree.cxx | 1 +
sw/source/uibase/docvw/srcedtw.cxx | 1 +
sw/source/uibase/fldui/xfldui.cxx | 1 +
sw/source/uibase/misc/glshell.cxx | 3 ++
sw/source/uibase/uiview/srcview.cxx | 1 +
sw/source/uibase/uiview/view2.cxx | 1 +
sw/source/uibase/uno/dlelstnr.cxx | 1 +
sw/source/uibase/uno/unodispatch.cxx | 1 +
sw/source/uibase/uno/unodoc.cxx | 3 ++
sw/source/uibase/utlui/uitool.cxx | 1 +
testtools/source/bridgetest/bridgetest.cxx | 1 +
toolkit/source/awt/vclxfont.cxx | 1 +
ucbhelper/source/provider/getcomponentcontext.cxx | 3 +-
ucbhelper/source/provider/simpleioerrorrequest.cxx | 1 +
unotools/source/config/moduleoptions.cxx | 1 +
vbahelper/source/vbahelper/vbahelper.cxx | 1 +
vbahelper/source/vbahelper/vbatextframe.cxx | 1 +
vcl/qa/cppunit/lifecycle.cxx | 1 +
vcl/source/app/salvtables.cxx | 1 +
vcl/source/graphic/UnoGraphicDescriptor.cxx | 1 +
vcl/source/window/accessibility.cxx | 1 +
vcl/source/window/window.cxx | 2 +
writerfilter/source/dmapper/SmartTagHandler.cxx | 2 +
writerperfect/qa/unit/ImportTest.cxx | 1 +
writerperfect/source/writer/EPUBPackage.cxx | 1 +
.../chart/SchXMLCalculationSettingsContext.cxx | 1 +
xmloff/source/core/DocumentSettingsContext.cxx | 1 +
xmloff/source/core/RDFaExportHelper.cxx | 1 +
xmloff/source/core/xmlexp.cxx | 1 +
xmloff/source/core/xmluconv.cxx | 1 +
xmloff/source/draw/SignatureLineContext.cxx | 1 +
xmloff/source/draw/XMLGraphicsDefaultStyle.cxx | 1 +
xmloff/source/draw/XMLImageMapContext.cxx | 1 +
xmloff/source/draw/layerexp.cxx | 1 +
xmloff/source/draw/layerimp.cxx | 1 +
xmloff/source/draw/sdxmlimp.cxx | 1 +
xmloff/source/draw/ximppage.cxx | 3 ++
xmloff/source/draw/ximpshow.cxx | 1 +
xmloff/source/draw/ximpstyl.cxx | 2 +-
xmloff/source/forms/layerexport.cxx | 1 +
xmloff/source/forms/officeforms.cxx | 1 +
xmloff/source/style/PageMasterImportContext.cxx | 1 +
xmloff/source/style/XMLFontAutoStylePool.cxx | 1 +
xmloff/source/style/XMLPageExport.cxx | 1 +
xmloff/source/style/prstylei.cxx | 1 +
xmloff/source/style/styleexp.cxx | 1 +
xmloff/source/style/xmlnume.cxx | 2 +
xmloff/source/style/xmlnumi.cxx | 2 +
xmloff/source/style/xmlstyle.cxx | 3 ++
xmloff/source/table/XMLTableExport.cxx | 2 +-
xmloff/source/table/XMLTableImport.cxx | 3 ++
xmloff/source/text/XMLAutoMarkFileContext.cxx | 1 +
.../text/XMLFootnoteConfigurationImportContext.cxx | 1 +
xmloff/source/text/XMLFootnoteImportContext.cxx | 1 +
.../XMLIndexBibliographyConfigurationContext.cxx | 1 +
xmloff/source/text/XMLIndexTOCContext.cxx | 1 +
xmloff/source/text/XMLLineNumberingExport.cxx | 1 +
.../source/text/XMLLineNumberingImportContext.cxx | 1 +
xmloff/source/text/XMLRedlineExport.cxx | 1 +
xmloff/source/text/XMLSectionExport.cxx | 3 +-
xmloff/source/text/XMLSectionImportContext.cxx | 1 +
xmloff/source/text/XMLTextColumnsContext.cxx | 3 ++
xmloff/source/text/XMLTextFrameContext.cxx | 1 +
xmloff/source/text/XMLTextListAutoStylePool.cxx | 1 +
xmloff/source/text/XMLTextMarkImportContext.cxx | 1 +
xmloff/source/text/XMLTextMasterPageContext.cxx | 3 ++
xmloff/source/text/XMLTextNumRuleInfo.cxx | 1 +
xmloff/source/text/XMLTextShapeImportHelper.cxx | 1 +
xmloff/source/text/XMLTextShapeStyleContext.cxx | 1 +
xmloff/source/text/txtexppr.cxx | 1 +
xmloff/source/text/txtflde.cxx | 2 +-
xmloff/source/text/txtfldi.cxx | 1 +
xmloff/source/text/txtimp.cxx | 1 +
xmloff/source/text/txtparai.cxx | 2 +-
xmloff/source/text/txtstyle.cxx | 2 +
xmloff/source/text/txtstyli.cxx | 1 +
xmloff/source/text/txtvfldi.cxx | 1 +
xmloff/source/xforms/xformsapi.cxx | 1 +
xmloff/source/xforms/xformsexport.cxx | 1 +
xmlscript/source/xmldlg_imexp/xmldlg_export.cxx | 1 +
xmlscript/source/xmldlg_imexp/xmldlg_import.cxx | 1 +
.../source/helper/documentsignaturemanager.cxx | 1 +
xmlsecurity/source/helper/ooxmlsecexporter.cxx | 1 +
322 files changed, 408 insertions(+), 104 deletions(-)

Upstream: cgit.freedesktop.org


  • Share