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/token/namespaces.hxx>
13 #include <oox/token/tokens.hxx>
14 #include <oox/core/xmlfilterbase.hxx>
16 using namespace ::oox::core
;
17 using namespace ::com::sun::star::xml::sax
;
18 using namespace ::com::sun::star::uno
;
20 namespace oox
{ namespace ppt
{
22 ExtDrawingFragmentHandler::ExtDrawingFragmentHandler( XmlFilterBase
& rFilter
,
23 const OUString
& rFragmentPath
,
24 const oox::ppt::SlidePersistPtr
& rSlidePersistPtr
,
25 const oox::ppt::ShapeLocation eShapeLocation
,
26 oox::drawingml::ShapePtr
const & pGroupShapePtr
,
27 oox::drawingml::ShapePtr
const & pShapePtr
)
28 : FragmentHandler2( rFilter
, rFragmentPath
),
29 mpSlidePersistPtr (rSlidePersistPtr
),
30 meShapeLocation( eShapeLocation
),
31 mpGroupShapePtr( pGroupShapePtr
),
32 mpShapePtr( pShapePtr
)
36 ExtDrawingFragmentHandler::~ExtDrawingFragmentHandler( ) throw ()
38 // Empty DrawingML fallback, need to warn the user at the end.
39 if (mpShapePtr
&& mpShapePtr
->getChildren().empty())
40 getFilter().setMissingExtDrawing();
44 ExtDrawingFragmentHandler::onCreateContext( ::sal_Int32 aElement
,
45 const AttributeList
& )
49 case DSP_TOKEN( drawing
):
51 case DSP_TOKEN( spTree
):
52 return new PPTShapeGroupContext(
53 *this, mpSlidePersistPtr
, meShapeLocation
, mpGroupShapePtr
,
64 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */