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 "WpgContext.hxx"
11 #include <drawingml/shapepropertiescontext.hxx>
12 #include <oox/drawingml/shapegroupcontext.hxx>
13 #include <oox/drawingml/graphicshapecontext.hxx>
15 using namespace com::sun::star
;
22 WpgContext::WpgContext(ContextHandler2Helper
& rParent
)
23 : ContextHandler2(rParent
)
25 mpShape
.reset(new oox::drawingml::Shape("com.sun.star.drawing.GroupShape"));
26 mpShape
->setWps(true);
29 WpgContext::~WpgContext()
33 oox::core::ContextHandlerRef
WpgContext::onCreateContext(sal_Int32 nElementToken
, const oox::AttributeList
& /*rAttribs*/)
35 switch (getBaseToken(nElementToken
))
42 return new oox::drawingml::ShapePropertiesContext(*this, *mpShape
);
46 // Don't set default character height, Writer has its own way to set
47 // the default, and if we don't set it here, editeng properly inherits
49 oox::drawingml::ShapePtr
pShape(new oox::drawingml::Shape("com.sun.star.drawing.CustomShape", /*bDefaultHeight=*/false));
50 return new oox::drawingml::ShapeContext(*this, mpShape
, pShape
);
54 return new oox::drawingml::GraphicShapeContext(*this, mpShape
, oox::drawingml::ShapePtr(new oox::drawingml::Shape("com.sun.star.drawing.GraphicObjectShape")));
58 return new oox::drawingml::ShapeGroupContext(*this, mpShape
, oox::drawingml::ShapePtr(new oox::drawingml::Shape("com.sun.star.drawing.GroupShape")));
61 case XML_graphicFrame
:
64 SAL_WARN("oox", "WpgContext::createFastChildContext: unhandled element: " << getBaseToken(nElementToken
));
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */