More RTTI needed by UBSan now

Presumably after 7a076dd9a6 "use more concrete UNO
classes in writer", CppunitTest_chart2_export started to fail with

> [_RUN_____] Chart2ExportTest::testStockChart
[...]
> warn:sal.osl:3513253:3513253:sal/osl/unx/module.cxx:152: dlopen(instdir/program/libmswordlo.so, 257): instdir/program/libmswordlo.so: undefined symbol: _ZTI12SwXTextFrame
[...]
> unknown:0:Chart2ExportTest::testStockChart
An uncaught exception of type com.sun.star.io.IOException
- SfxBaseModel::impl_store <file:///tmp/Chart2ExportTest__testStockChart_4uwve4.tmp> failed: 0xc10(Error Area:Io Class:Write Code:16) at sfx2/source/doc/sfxbasemodel.cxx:3205 at sfx2/source/doc/sfxbasemodel.cxx:1783

etc.  (And marking only SwXTextFrame as SAL_DLLPUBLIC_RTTI would then cause

> sw/source/core/unocore/unoframe.cxx:1271:18: error: dynamic_cast from 'com::sun::uno::XInterface' with default type visibility to 'SwXTextFrame' with default type visibility [loplugin:dyncastvisibility]
>         xFrame = dynamic_cast<NameLookupIsHard*>(pFrameFormat->GetXObject().get().get()); // cached?
>                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> workdir/UnoApiHeadersTarget/udkapi/normal/com/sun/star/uno/XInterface.hdl:15:40: note: base class 'com::sun::uno::XInterface' with default type visibility defined here [loplugin:dyncastvisibility]
> class SAL_NO_VTABLE SAL_DLLPUBLIC_RTTI XInterface
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
> sw/inc/unotext.hxx:44:7: note: intermediary class 'SwXText' with hidden type visibility defined here [loplugin:dyncastvisibility]
> class SwXText
> ~~~~~~^~~~~~~
> sw/inc/unoframe.hxx:47:7: note: intermediary class 'SwXFrame' with hidden type visibility defined here [loplugin:dyncastvisibility]
> class SwXFrame : public cppu::WeakImplHelper
> ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> sw/inc/unoframe.hxx:174:26: note: derived class 'SwXTextFrame' with default type visibility defined here [loplugin:dyncastvisibility]
> class SAL_DLLPUBLIC_RTTI SwXTextFrame final : public SwXTextFrameBaseClass,
> ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

in turn.)

Change-Id: I5535853885a471d846458d3c6baf538ef047546b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137300
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann 2022-07-21 14:43:58 +02:00
parent 91809c9050
commit d022e237f1
2 changed files with 5 additions and 3 deletions

View file

@ -29,6 +29,7 @@
#include <com/sun/star/document/XEventsSupplier.hpp>
#include <cppuhelper/implbase.hxx>
#include <sal/types.h>
#include <svl/listener.hxx>
#include "flyenum.hxx"
@ -44,7 +45,7 @@ class SfxItemPropertySet;
namespace com::sun::star::frame { class XModel; }
class BaseFrameProperties_Impl;
class SwXFrame : public cppu::WeakImplHelper
class SAL_DLLPUBLIC_RTTI SwXFrame : public cppu::WeakImplHelper
<
css::lang::XServiceInfo,
css::lang::XUnoTunnel,
@ -171,7 +172,7 @@ typedef cppu::ImplInheritanceHelper
>
SwXTextFrameBaseClass;
class SwXTextFrame final : public SwXTextFrameBaseClass,
class SAL_DLLPUBLIC_RTTI SwXTextFrame final : public SwXTextFrameBaseClass,
public SwXText
{
friend class SwXFrame; // just for CreateXFrame

View file

@ -27,6 +27,7 @@
#include <com/sun/star/text/XRelativeTextContentInsert.hpp>
#include <com/sun/star/text/XRelativeTextContentRemove.hpp>
#include <com/sun/star/text/XTextAppendAndConvert.hpp>
#include <sal/types.h>
#include "unobaseclass.hxx"
@ -41,7 +42,7 @@ class SwDoc;
class SwStartNode;
class SwPaM;
class SwXText
class SAL_DLLPUBLIC_RTTI SwXText
: public css::lang::XTypeProvider
, public css::lang::XUnoTunnel
, public css::beans::XPropertySet