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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include<xmloff/xmlnamespace.hxx>
21 #include "ximpgrp.hxx"
22 #include <xmloff/xmltoken.hxx>
23 #include "ximpshap.hxx"
24 #include "eventimp.hxx"
25 #include "descriptionimp.hxx"
27 using namespace ::com::sun::star
;
28 using namespace ::xmloff::token
;
31 SdXMLGroupShapeContext::SdXMLGroupShapeContext(
33 const uno::Reference
< xml::sax::XAttributeList
>& xAttrList
,
34 uno::Reference
< drawing::XShapes
> const & rShapes
,
36 : SdXMLShapeContext( rImport
, xAttrList
, rShapes
, bTemporaryShape
)
40 SdXMLGroupShapeContext::~SdXMLGroupShapeContext()
44 SvXMLImportContextRef
SdXMLGroupShapeContext::CreateChildContext( sal_uInt16 nPrefix
,
45 const OUString
& rLocalName
,
46 const uno::Reference
< xml::sax::XAttributeList
>& xAttrList
)
48 SvXMLImportContextRef xContext
;
51 if( nPrefix
== XML_NAMESPACE_SVG
&&
52 (IsXMLToken( rLocalName
, XML_TITLE
) || IsXMLToken( rLocalName
, XML_DESC
) ) )
54 xContext
= new SdXMLDescriptionContext( GetImport(), nPrefix
, rLocalName
, xAttrList
, mxShape
);
56 else if( nPrefix
== XML_NAMESPACE_OFFICE
&& IsXMLToken( rLocalName
, XML_EVENT_LISTENERS
) )
58 xContext
= new SdXMLEventsContext( GetImport(), nPrefix
, rLocalName
, xAttrList
, mxShape
);
60 else if( nPrefix
== XML_NAMESPACE_DRAW
&& IsXMLToken( rLocalName
, XML_GLUE_POINT
) )
62 addGluePoint( xAttrList
);
66 // call GroupChildContext function at common ShapeImport
67 xContext
= GetImport().GetShapeImport()->CreateGroupChildContext(
68 GetImport(), nPrefix
, rLocalName
, xAttrList
, mxChildren
);
74 void SdXMLGroupShapeContext::StartElement(const uno::Reference
< xml::sax::XAttributeList
>&)
76 // create new group shape and add it to rShapes, use it
77 // as base for the new group import
78 AddShape( "com.sun.star.drawing.GroupShape" );
84 mxChildren
.set( mxShape
, uno::UNO_QUERY
);
86 GetImport().GetShapeImport()->pushGroupForPostProcessing( mxChildren
);
89 GetImport().GetShapeImport()->finishShape( mxShape
, mxAttrList
, mxShapes
);
92 void SdXMLGroupShapeContext::endFastElement(sal_Int32 nElement
)
95 GetImport().GetShapeImport()->popGroupAndPostProcess();
97 SdXMLShapeContext::endFastElement(nElement
);
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */