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/.
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
;
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
:
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
);
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
);
56 SAL_WARN("oox", "LockedCanvasContext::createFastChildContext: unhandled element:" << getBaseToken(nElementToken
));
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */