Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / oox / source / shape / LockedCanvasContext.cxx
blob35d4aa62c65fbcb563572968d62c39f0d49fe8bd
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 */
11 #include "LockedCanvasContext.hxx"
12 #include <sal/log.hxx>
13 #include <oox/drawingml/shape.hxx>
14 #include <oox/drawingml/shapecontext.hxx>
15 #include <oox/drawingml/shapegroupcontext.hxx>
16 #include <oox/token/namespaces.hxx>
17 #include <oox/token/tokens.hxx>
19 using namespace com::sun::star;
21 namespace oox
23 namespace shape
26 LockedCanvasContext::LockedCanvasContext(ContextHandler2Helper const& rParent)
27 : ContextHandler2(rParent)
31 LockedCanvasContext::~LockedCanvasContext() = default;
33 ::oox::core::ContextHandlerRef LockedCanvasContext::onCreateContext(sal_Int32 nElementToken, const ::oox::AttributeList& /*rAttribs*/)
35 switch (getBaseToken(nElementToken))
37 case XML_lockedCanvas:
38 case XML_nvGrpSpPr:
39 case XML_grpSpPr:
40 break;
41 case XML_sp:
43 oox::drawingml::ShapePtr pMasterShape;
44 mpShape.reset(new oox::drawingml::Shape("com.sun.star.drawing.CustomShape"));
45 mpShape->setLockedCanvas(true);
46 return new oox::drawingml::ShapeContext(*this, pMasterShape, mpShape);
48 case XML_grpSp:
50 oox::drawingml::ShapePtr pMasterShape;
51 mpShape.reset(new oox::drawingml::Shape("com.sun.star.drawing.GroupShape"));
52 mpShape->setLockedCanvas(true);
53 return new oox::drawingml::ShapeGroupContext(*this, pMasterShape, mpShape);
55 default:
56 SAL_WARN("oox", "LockedCanvasContext::createFastChildContext: unhandled element:" << getBaseToken(nElementToken));
57 break;
59 return nullptr;
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */