1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
10 #include "extdrawingfragmenthandler.hxx"
12 #include <oox/ppt/pptshapegroupcontext.hxx>
13 #include <oox/token/namespaces.hxx>
14 #include <oox/core/xmlfilterbase.hxx>
17 using namespace ::oox::core
;
18 using namespace ::com::sun::star::xml::sax
;
19 using namespace ::com::sun::star::uno
;
23 ExtDrawingFragmentHandler::ExtDrawingFragmentHandler( XmlFilterBase
& rFilter
,
24 const OUString
& rFragmentPath
,
25 oox::ppt::SlidePersistPtr pSlidePersistPtr
,
26 const oox::ppt::ShapeLocation eShapeLocation
,
27 oox::drawingml::ShapePtr pGroupShapePtr
,
28 oox::drawingml::ShapePtr pShapePtr
)
29 : FragmentHandler2( rFilter
, rFragmentPath
),
30 mpSlidePersistPtr (std::move(pSlidePersistPtr
)),
31 meShapeLocation( eShapeLocation
),
32 mpGroupShapePtr(std::move( pGroupShapePtr
)),
33 mpShapePtr(std::move( pShapePtr
))
37 ExtDrawingFragmentHandler::~ExtDrawingFragmentHandler( ) noexcept
39 // Empty DrawingML fallback, need to warn the user at the end.
40 if (mpShapePtr
&& mpShapePtr
->getChildren().empty())
41 getFilter().setMissingExtDrawing();
45 ExtDrawingFragmentHandler::onCreateContext( ::sal_Int32 aElement
,
46 const AttributeList
& )
50 case DSP_TOKEN( drawing
):
52 case DSP_TOKEN( spTree
):
53 return new PPTShapeGroupContext(
54 *this, mpSlidePersistPtr
, meShapeLocation
, mpGroupShapePtr
,
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */