b512ce255f
The main reason for the "home-grown" UpCast introduced with904b3d1fce
"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 since39a1edd6fe
"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>
53 lines
1.9 KiB
C++
53 lines
1.9 KiB
C++
/* -*- 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 <com/sun/star/beans/XPropertySet.hpp>
|
|
#include <com/sun/star/frame/XModel.hpp>
|
|
#include <com/sun/star/presentation/XPresentationSupplier.hpp>
|
|
|
|
#include <oox/core/xmlfilterbase.hxx>
|
|
#include <oox/helper/attributelist.hxx>
|
|
#include <oox/ppt/presPropsfragmenthandler.hxx>
|
|
#include <oox/token/namespaces.hxx>
|
|
|
|
namespace oox::ppt
|
|
{
|
|
PresPropsFragmentHandler::PresPropsFragmentHandler(core::XmlFilterBase& rFilter,
|
|
const OUString& rFragmentPath)
|
|
: FragmentHandler2(rFilter, rFragmentPath)
|
|
{
|
|
}
|
|
|
|
PresPropsFragmentHandler::~PresPropsFragmentHandler() = default;
|
|
|
|
void PresPropsFragmentHandler::finalizeImport()
|
|
{
|
|
css::uno::Reference<css::presentation::XPresentationSupplier> xPresentationSupplier(
|
|
getFilter().getModel(), css::uno::UNO_QUERY_THROW);
|
|
css::uno::Reference<css::beans::XPropertySet> xPresentationProps(
|
|
xPresentationSupplier->getPresentation(), css::uno::UNO_QUERY_THROW);
|
|
xPresentationProps->setPropertyValue("IsEndless", css::uno::Any(m_bLoop));
|
|
}
|
|
|
|
core::ContextHandlerRef PresPropsFragmentHandler::onCreateContext(sal_Int32 aElementToken,
|
|
const AttributeList& rAttribs)
|
|
{
|
|
switch (aElementToken)
|
|
{
|
|
case PPT_TOKEN(presentationPr):
|
|
return this;
|
|
case PPT_TOKEN(showPr):
|
|
m_bLoop = rAttribs.getBool(XML_loop, false);
|
|
return this;
|
|
}
|
|
return this;
|
|
}
|
|
} // namespace oox::ppt
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
|