Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / oox / source / ppt / presPropsfragmenthandler.cxx
blobeffee38dfaa0dfa4c19660bdf8d9df27dab74002
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include <com/sun/star/beans/XPropertySet.hpp>
11 #include <com/sun/star/presentation/XPresentationSupplier.hpp>
13 #include <oox/helper/attributelist.hxx>
14 #include <oox/ppt/pptimport.hxx>
15 #include <oox/ppt/presPropsfragmenthandler.hxx>
16 #include <oox/token/namespaces.hxx>
18 namespace oox
20 namespace ppt
22 PresPropsFragmentHandler::PresPropsFragmentHandler(core::XmlFilterBase& rFilter,
23 const OUString& rFragmentPath)
24 : FragmentHandler2(rFilter, rFragmentPath)
28 PresPropsFragmentHandler::~PresPropsFragmentHandler() = default;
30 void PresPropsFragmentHandler::finalizeImport()
32 css::uno::Reference<css::presentation::XPresentationSupplier> xPresentationSupplier(
33 getFilter().getModel(), css::uno::UNO_QUERY_THROW);
34 css::uno::Reference<css::beans::XPropertySet> xPresentationProps(
35 xPresentationSupplier->getPresentation(), css::uno::UNO_QUERY_THROW);
36 xPresentationProps->setPropertyValue("IsEndless", css::uno::Any(m_bLoop));
39 core::ContextHandlerRef PresPropsFragmentHandler::onCreateContext(sal_Int32 aElementToken,
40 const AttributeList& rAttribs)
42 switch (aElementToken)
44 case PPT_TOKEN(presentationPr):
45 return this;
46 case PPT_TOKEN(showPr):
47 m_bLoop = rAttribs.getBool(XML_loop, false);
48 return this;
50 return this;
52 } // namespace ppt
53 } // namespace oox
55 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */