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 /sfx2 | |
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 'sfx2')
-rw-r--r-- | sfx2/source/appl/opengrf.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/control/statcach.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/dialog/documentfontsdialog.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/dialog/versdlg.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/doc/Metadatable.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/doc/docfilt.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/docinsert.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/doc/guisaveas.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/doc/iframe.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/sidebar/ResourceManager.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/sidebar/SidebarPanelBase.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/sidebar/Tools.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/view/ipclient.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/view/sfxbasecontroller.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/view/userinputinterception.cxx | 1 |
15 files changed, 17 insertions, 3 deletions
diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx index 6ef8ecdf4b61..fd547986d0da 100644 --- a/sfx2/source/appl/opengrf.cxx +++ b/sfx2/source/appl/opengrf.cxx @@ -26,6 +26,7 @@ #include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp> +#include <com/sun/star/ui/dialogs/XFilePicker3.hpp> #include <o3tl/any.hxx> #include <vcl/stdtext.hxx> #include <vcl/graphicfilter.hxx> diff --git a/sfx2/source/control/statcach.cxx b/sfx2/source/control/statcach.cxx index fa8817f5eb8e..dfdc10f83687 100644 --- a/sfx2/source/control/statcach.cxx +++ b/sfx2/source/control/statcach.cxx @@ -24,6 +24,7 @@ #include <framework/dispatchhelper.hxx> #include <com/sun/star/frame/DispatchResultState.hpp> +#include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <cppuhelper/weak.hxx> #include <svl/eitem.hxx> diff --git a/sfx2/source/dialog/documentfontsdialog.cxx b/sfx2/source/dialog/documentfontsdialog.cxx index e64e0c5bba80..8e48a4a12f9d 100644 --- a/sfx2/source/dialog/documentfontsdialog.cxx +++ b/sfx2/source/dialog/documentfontsdialog.cxx @@ -22,6 +22,7 @@ #include <sfx2/objsh.hxx> #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> using namespace ::com::sun::star; diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx index 7492e4e43aff..68abca31ba61 100644 --- a/sfx2/source/dialog/versdlg.cxx +++ b/sfx2/source/dialog/versdlg.cxx @@ -20,6 +20,7 @@ #include <sal/config.h> #include <com/sun/star/document/XCmisDocument.hpp> +#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/util/RevisionTag.hpp> #include <com/sun/star/beans/NamedValue.hpp> diff --git a/sfx2/source/doc/Metadatable.cxx b/sfx2/source/doc/Metadatable.cxx index 6eecf322ba43..22aeb427703d 100644 --- a/sfx2/source/doc/Metadatable.cxx +++ b/sfx2/source/doc/Metadatable.cxx @@ -25,6 +25,7 @@ #include <sfx2/XmlIdRegistry.hxx> #include <vcl/svapp.hxx> +#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <comphelper/random.hxx> diff --git a/sfx2/source/doc/docfilt.cxx b/sfx2/source/doc/docfilt.cxx index 953b60a5ec68..2e71007b3129 100644 --- a/sfx2/source/doc/docfilt.cxx +++ b/sfx2/source/doc/docfilt.cxx @@ -25,7 +25,7 @@ #include <sot/storage.hxx> #include <comphelper/fileformat.h> #include <com/sun/star/beans/XPropertySet.hpp> - +#include <com/sun/star/embed/XStorage.hpp> #include <sfx2/docfilt.hxx> #include <sfx2/fcontnr.hxx> #include <sfx2/objsh.hxx> diff --git a/sfx2/source/doc/docinsert.cxx b/sfx2/source/doc/docinsert.cxx index 3d585992307b..19649cc26ff9 100644 --- a/sfx2/source/doc/docinsert.cxx +++ b/sfx2/source/doc/docinsert.cxx @@ -30,6 +30,7 @@ #include <com/sun/star/ui/dialogs/ControlActions.hpp> #include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> +#include <com/sun/star/ui/dialogs/XFilePicker3.hpp> #include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <tools/urlobj.hxx> diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index bcb058770d33..eb94e0873e6e 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -18,6 +18,7 @@ */ #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> +#include <com/sun/star/ui/dialogs/XFilePicker3.hpp> #include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp> #include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp> #include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp> diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx index aad8ca85fdbb..d722ac987b33 100644 --- a/sfx2/source/doc/iframe.cxx +++ b/sfx2/source/doc/iframe.cxx @@ -19,6 +19,7 @@ #include <sal/config.h> +#include <com/sun/star/awt/XWindowPeer.hpp> #include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/frame/Frame.hpp> #include <com/sun/star/frame/XFrame2.hpp> diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx index 45976530a9d3..f3440e6dcb46 100644 --- a/sfx2/source/sidebar/ResourceManager.cxx +++ b/sfx2/source/sidebar/ResourceManager.cxx @@ -35,6 +35,7 @@ #include <vcl/EnumContext.hxx> #include <com/sun/star/frame/ModuleManager.hpp> +#include <com/sun/star/ui/XSidebarPanel.hpp> #include <com/sun/star/ui/XUpdateModel.hpp> #include <map> diff --git a/sfx2/source/sidebar/SidebarPanelBase.cxx b/sfx2/source/sidebar/SidebarPanelBase.cxx index 3f9d00fe59ba..666a573f627b 100644 --- a/sfx2/source/sidebar/SidebarPanelBase.cxx +++ b/sfx2/source/sidebar/SidebarPanelBase.cxx @@ -23,7 +23,7 @@ #include <sfx2/sidebar/SidebarModelUpdate.hxx> #include <vcl/layout.hxx> #include <comphelper/processfactory.hxx> - +#include <com/sun/star/awt/XWindowPeer.hpp> #include <com/sun/star/ui/ContextChangeEventMultiplexer.hpp> #include <com/sun/star/ui/UIElementType.hpp> diff --git a/sfx2/source/sidebar/Tools.cxx b/sfx2/source/sidebar/Tools.cxx index 7811c9c7c82d..eb936c4ff412 100644 --- a/sfx2/source/sidebar/Tools.cxx +++ b/sfx2/source/sidebar/Tools.cxx @@ -26,6 +26,7 @@ #include <vcl/gradient.hxx> #include <com/sun/star/frame/XDispatchProvider.hpp> +#include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/frame/ModuleManager.hpp> diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx index fe17638fe599..5dc6267e5c94 100644 --- a/sfx2/source/view/ipclient.cxx +++ b/sfx2/source/view/ipclient.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <com/sun/star/awt/XWindowPeer.hpp> #include <com/sun/star/embed/Aspects.hpp> #include <com/sun/star/embed/EmbedStates.hpp> #include <com/sun/star/embed/UnreachableStateException.hpp> diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index cf6f2485425d..1ad856065b8e 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -19,7 +19,7 @@ #include <time.h> #include <sfx2/sfxbasecontroller.hxx> - +#include <com/sun/star/awt/XWindowPeer.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/util/XCloseable.hpp> #include <com/sun/star/util/XCloseBroadcaster.hpp> diff --git a/sfx2/source/view/userinputinterception.cxx b/sfx2/source/view/userinputinterception.cxx index e507a16a9ff9..ad605627f63f 100644 --- a/sfx2/source/view/userinputinterception.cxx +++ b/sfx2/source/view/userinputinterception.cxx @@ -27,6 +27,7 @@ #include <com/sun/star/awt/KeyModifier.hpp> #include <com/sun/star/awt/XKeyHandler.hpp> #include <com/sun/star/awt/XMouseClickHandler.hpp> +#include <com/sun/star/awt/XWindowPeer.hpp> #include <com/sun/star/uno/XInterface.hpp> #include <comphelper/interfacecontainer2.hxx> |