diff --git a/include/xmloff/settingsstore.hxx b/include/xmloff/settingsstore.hxx index 339e71bbd1a7..8f83a8a0e20a 100644 --- a/include/xmloff/settingsstore.hxx +++ b/include/xmloff/settingsstore.hxx @@ -12,7 +12,10 @@ #ifndef INCLUDED_XMLOFF_SETTINGSSTORE_HXX #define INCLUDED_XMLOFF_SETTINGSSTORE_HXX +#include #include +#include +#include namespace com::sun::star::beans { struct PropertyValue; } namespace com::sun::star::embed { class XStorage; } @@ -20,7 +23,9 @@ namespace com::sun::star::uno { template class Reference; } // Scans list of properties for certain URL properties that could refer // to internal objects, and initializes from these. -class SAL_DLLPUBLIC_RTTI SAL_LOPLUGIN_ANNOTATE("crosscast") DocumentSettingsSerializer { +class XMLOFF_DLLPUBLIC DocumentSettingsSerializer: + public cppu::WeakImplHelper +{ public: // Import objects and update properties (eliding URLs) virtual css::uno::Sequence @@ -34,8 +39,11 @@ public: const css::uno::Reference< css::embed::XStorage > &xStorage, const css::uno::Sequence& aConfigProps ) = 0; + sal_Int64 SAL_CALL getSomething(css::uno::Sequence const & aIdentifier) override; + static css::uno::Sequence const & getUnoTunnelId(); + protected: - ~DocumentSettingsSerializer() {} + ~DocumentSettingsSerializer() override; }; #endif // INCLUDED_XMLOFF_SETTINGSSTORE_HXX diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk index 1a3a87174098..2b907d35bbff 100644 --- a/sd/Library_sd.mk +++ b/sd/Library_sd.mk @@ -97,6 +97,7 @@ $(eval $(call gb_Library_use_libraries,sd,\ ucbhelper \ utl \ vcl \ + xo \ $(if $(ENABLE_NSS),xmlsecurity) \ )) diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx index 331f90b53a50..b4b4baf74ce8 100644 --- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx +++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx @@ -69,9 +69,10 @@ namespace sd { namespace { - class DocumentSettings : public WeakImplHelper< XPropertySet, XMultiPropertySet, XServiceInfo >, - public comphelper::PropertySetHelper, - public DocumentSettingsSerializer + class DocumentSettings : public ImplInheritanceHelper< + DocumentSettingsSerializer, XPropertySet, XMultiPropertySet, + XServiceInfo >, + public comphelper::PropertySetHelper { public: explicit DocumentSettings( SdXImpressDocument* pModel ); @@ -1336,17 +1337,17 @@ DocumentSettings::_getPropertyValues( // XInterface Any SAL_CALL DocumentSettings::queryInterface( const Type& aType ) { - return WeakImplHelper< XPropertySet, XMultiPropertySet, XServiceInfo >::queryInterface( aType ); + return ImplInheritanceHelper::queryInterface( aType ); } void SAL_CALL DocumentSettings::acquire( ) noexcept { - WeakImplHelper< XPropertySet, XMultiPropertySet, XServiceInfo >::acquire(); + ImplInheritanceHelper::acquire(); } void SAL_CALL DocumentSettings::release( ) noexcept { - WeakImplHelper< XPropertySet, XMultiPropertySet, XServiceInfo >::release(); + ImplInheritanceHelper::release(); } // XPropertySet diff --git a/xmloff/Library_xo.mk b/xmloff/Library_xo.mk index 14401f9eea8f..4450b0031c26 100644 --- a/xmloff/Library_xo.mk +++ b/xmloff/Library_xo.mk @@ -154,6 +154,7 @@ $(eval $(call gb_Library_add_exception_objects,xo,\ xmloff/source/draw/sdpropls \ xmloff/source/draw/sdxmlexp \ xmloff/source/draw/sdxmlimp \ + xmloff/source/draw/settingsstore \ xmloff/source/draw/shapeexport \ xmloff/source/draw/shapeimport \ xmloff/source/draw/SignatureLineContext \ diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index 7c336989496b..ac6719868b85 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -2473,7 +2474,8 @@ void SdXMLExport::GetConfigurationSettings(uno::Sequence& Reference< beans::XPropertySet > xProps( xFac->createInstance("com.sun.star.document.Settings"), UNO_QUERY ); if( xProps.is() ) SvXMLUnitConverter::convertPropertySet( rProps, xProps ); - DocumentSettingsSerializer *pFilter(dynamic_cast(xProps.get())); + DocumentSettingsSerializer *pFilter( + comphelper::getFromUnoTunnel(xProps)); if (!pFilter) return; const uno::Reference< embed::XStorage > xStorage(GetTargetStorage()); diff --git a/xmloff/source/draw/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx index 6e556ac84a31..dbdb910775b1 100644 --- a/xmloff/source/draw/sdxmlimp.cxx +++ b/xmloff/source/draw/sdxmlimp.cxx @@ -21,6 +21,7 @@ #include #include #include +#include #include #include "sdxmlimp_impl.hxx" @@ -552,7 +553,7 @@ void SdXMLImport::SetConfigurationSettings(const css::uno::Sequence* pValues = &aConfigProps; DocumentSettingsSerializer *pFilter; - pFilter = dynamic_cast(xProps.get()); + pFilter = comphelper::getFromUnoTunnel(xProps); uno::Sequence aFiltered; if( pFilter ) { diff --git a/xmloff/source/draw/settingsstore.cxx b/xmloff/source/draw/settingsstore.cxx new file mode 100644 index 000000000000..0b41473ea211 --- /dev/null +++ b/xmloff/source/draw/settingsstore.cxx @@ -0,0 +1,28 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#include + +#include +#include + +sal_Int64 DocumentSettingsSerializer::getSomething(css::uno::Sequence const& aIdentifier) +{ + return comphelper::getSomethingImpl(aIdentifier, this); +} + +css::uno::Sequence const& DocumentSettingsSerializer::getUnoTunnelId() +{ + static comphelper::UnoIdInit const id; + return id.getSeq(); +} + +DocumentSettingsSerializer::~DocumentSettingsSerializer() {} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */