summaryrefslogtreecommitdiff
path: root/offapi
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2022-05-30 11:08:12 +0200
committerMiklos Vajna <vmiklos@collabora.com>2022-05-30 12:08:03 +0200
commitb3f2ae52e381f7d5fa466dc9df7d04d3d13ca4b9 (patch)
treec0e45d2081ffc31c709c104f3784e2c86141cf7b /offapi
parente4e03e79fac598a9fafb0da8ab50da9a67c6978e (diff)
framework: fix crash on Writer startup when using --enable-ext-wiki-publisher
As reported by Julien, once the mediawiki extension is installed, the xHandler in framework::DispatchProvider::implts_searchProtocolHandler() points to an UNO component implemented in Java, and we crash in dynamic_cast<>(), at least on Linux with gcc 7.5 and libstdc++. This dynamic_cast<>() call was added in commit c0fa456436947a5c167c652d19a884064b43c03d (tdf#149261 sdext: fix crash on starting the presenter console for the 2nd time, 2022-05-26), to allow the presenter console to opt out from protocol handler caching. It was expected that the proxy object created for a Java UNO component would simply return nullptr when we try to dynamic_cast<>() it down to a C++ interface. Fix the problem by moving the interface to an UNO one: this side-steps the dynamic_cast<>() crash at the price of introducing an UNO interface, which is not meant to be part of the public UNO API (but at least it's not published). It may still make sense to improve the bridges/ code at some stage to not crash in dynamic_cast<>() on generated Java proxy objects. Change-Id: Iaac44515339e0dc15dddc3be45ef7dee7331e47a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135114 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'offapi')
-rw-r--r--offapi/UnoApi_offapi.mk1
-rw-r--r--offapi/com/sun/star/util/XCacheInfo.idl40
2 files changed, 41 insertions, 0 deletions
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index a9b92639a667..5f0ae2e84d56 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -4157,6 +4157,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/util,\
XAtomServer \
XBinaryDataContainer \
XBroadcaster \
+ XCacheInfo \
XCancellable \
XChainable \
XChangesBatch \
diff --git a/offapi/com/sun/star/util/XCacheInfo.idl b/offapi/com/sun/star/util/XCacheInfo.idl
new file mode 100644
index 000000000000..299d49690246
--- /dev/null
+++ b/offapi/com/sun/star/util/XCacheInfo.idl
@@ -0,0 +1,40 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef __com_sun_star_util_XCacheInfo_idl__
+#define __com_sun_star_util_XCacheInfo_idl__
+
+#include <com/sun/star/uno/XInterface.idl>
+
+module com { module sun { module star { module util {
+
+/** Interface that allows an implementation to opt out from caching.
+
+ @since LibreOffice 7.4
+ */
+interface XCacheInfo: com::sun::star::uno::XInterface
+{
+ boolean isCachingAllowed();
+
+};
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */