Bump version to 24.04.3.4
[LibreOffice.git] / oox / source / ppt / extdrawingfragmenthandler.cxx
blob96cc02c1a32b269fed5599878d702ef6c64f55cd
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 "extdrawingfragmenthandler.hxx"
12 #include <oox/ppt/pptshapegroupcontext.hxx>
13 #include <oox/token/namespaces.hxx>
14 #include <oox/core/xmlfilterbase.hxx>
15 #include <utility>
17 using namespace ::oox::core;
18 using namespace ::com::sun::star::xml::sax;
19 using namespace ::com::sun::star::uno;
21 namespace oox::ppt {
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();
44 ContextHandlerRef
45 ExtDrawingFragmentHandler::onCreateContext( ::sal_Int32 aElement,
46 const AttributeList& )
48 switch( aElement )
50 case DSP_TOKEN( drawing ):
51 break;
52 case DSP_TOKEN( spTree ):
53 return new PPTShapeGroupContext(
54 *this, mpSlidePersistPtr, meShapeLocation, mpGroupShapePtr,
55 mpShapePtr );
56 default:
57 break;
60 return this;
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */