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 using namespace ::oox::core
;
13 using namespace ::com::sun::star::xml::sax
;
14 using namespace ::com::sun::star::uno
;
16 namespace oox
{ namespace ppt
{
18 ExtDrawingFragmentHandler::ExtDrawingFragmentHandler( XmlFilterBase
& rFilter
,
19 const OUString
& rFragmentPath
,
20 const oox::ppt::SlidePersistPtr pSlidePersistPtr
,
21 const oox::ppt::ShapeLocation eShapeLocation
,
22 oox::drawingml::ShapePtr pMasterShapePtr
,
23 oox::drawingml::ShapePtr pGroupShapePtr
,
24 oox::drawingml::ShapePtr pShapePtr
)
26 : FragmentHandler( rFilter
, rFragmentPath
),
27 mpSlidePersistPtr (pSlidePersistPtr
),
28 meShapeLocation( eShapeLocation
),
29 mpMasterShapePtr( pMasterShapePtr
),
30 mpGroupShapePtr( pGroupShapePtr
),
31 mpOrgShapePtr( pShapePtr
)
35 ExtDrawingFragmentHandler::~ExtDrawingFragmentHandler( ) throw ()
40 Reference
< XFastContextHandler
> SAL_CALL
41 ExtDrawingFragmentHandler::createFastChildContext( ::sal_Int32 aElement
,
42 const Reference
< XFastAttributeList
>& )
43 throw ( SAXException
, RuntimeException
)
45 Reference
< XFastContextHandler
> xRet
;
49 case DSP_TOKEN( drawing
):
51 case DSP_TOKEN( spTree
):
52 mpShapePtr
= oox::drawingml::ShapePtr( new PPTShape( meShapeLocation
, "com.sun.star.drawing.GroupShape" ) );
53 xRet
.set( new PPTShapeGroupContext(
54 *this, mpSlidePersistPtr
, meShapeLocation
, mpSlidePersistPtr
->getShapes(),
62 xRet
= getFastContextHandler();
66 void SAL_CALL
ExtDrawingFragmentHandler::endDocument() throw (::com::sun::star::xml::sax::SAXException
, ::com::sun::star::uno::RuntimeException
)
70 mpShapePtr
->moveAllToPosition( mpOrgShapePtr
->getPosition() );
71 mpShapePtr
->setName( mpOrgShapePtr
->getName() );
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */