/src/libreoffice/xmloff/source/draw/ximpgrp.cxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
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 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
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 . |
18 | | */ |
19 | | |
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" |
26 | | |
27 | | using namespace ::com::sun::star; |
28 | | using namespace ::xmloff::token; |
29 | | |
30 | | |
31 | | SdXMLGroupShapeContext::SdXMLGroupShapeContext( |
32 | | SvXMLImport& rImport, |
33 | | const uno::Reference< xml::sax::XFastAttributeList>& xAttrList, |
34 | | uno::Reference< drawing::XShapes > const & rShapes, |
35 | | bool bTemporaryShape) |
36 | 462 | : SdXMLShapeContext( rImport, xAttrList, rShapes, bTemporaryShape ) |
37 | 462 | { |
38 | 462 | } |
39 | | |
40 | | SdXMLGroupShapeContext::~SdXMLGroupShapeContext() |
41 | 462 | { |
42 | 462 | } |
43 | | |
44 | | css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLGroupShapeContext::createFastChildContext( |
45 | | sal_Int32 nElement, |
46 | | const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) |
47 | 1.04k | { |
48 | | // #i68101# |
49 | 1.04k | if( nElement == XML_ELEMENT(SVG, XML_TITLE) || |
50 | 1.04k | nElement == XML_ELEMENT(SVG, XML_DESC ) || |
51 | 1.04k | nElement == XML_ELEMENT(SVG_COMPAT, XML_TITLE) || |
52 | 1.04k | nElement == XML_ELEMENT(SVG_COMPAT, XML_DESC ) ) |
53 | 31 | { |
54 | 31 | return new SdXMLDescriptionContext( GetImport(), nElement, mxShape ); |
55 | 31 | } |
56 | 1.00k | else if( nElement == XML_ELEMENT(OFFICE, XML_EVENT_LISTENERS) ) |
57 | 0 | { |
58 | 0 | return new SdXMLEventsContext( GetImport(), mxShape ); |
59 | 0 | } |
60 | 1.00k | else if( nElement == XML_ELEMENT(DRAW, XML_GLUE_POINT) ) |
61 | 0 | { |
62 | 0 | addGluePoint( xAttrList ); |
63 | 0 | } |
64 | 1.00k | else |
65 | 1.00k | { |
66 | | // call GroupChildContext function at common ShapeImport |
67 | 1.00k | return XMLShapeImportHelper::CreateGroupChildContext( |
68 | 1.00k | GetImport(), nElement, xAttrList, mxChildren); |
69 | 1.00k | } |
70 | 0 | return nullptr; |
71 | 1.04k | } |
72 | | |
73 | | void SdXMLGroupShapeContext::startFastElement (sal_Int32 /*nElement*/, |
74 | | const css::uno::Reference< css::xml::sax::XFastAttributeList >& /*xAttrList*/) |
75 | 462 | { |
76 | | // create new group shape and add it to rShapes, use it |
77 | | // as base for the new group import |
78 | 462 | AddShape( u"com.sun.star.drawing.GroupShape"_ustr ); |
79 | | |
80 | 462 | if(mxShape.is()) |
81 | 462 | { |
82 | 462 | SetStyle( false ); |
83 | | |
84 | 462 | mxChildren.set( mxShape, uno::UNO_QUERY ); |
85 | 462 | if( mxChildren.is() ) |
86 | 462 | GetImport().GetShapeImport()->pushGroupForPostProcessing( mxChildren ); |
87 | 462 | } |
88 | | |
89 | 462 | GetImport().GetShapeImport()->finishShape( mxShape, mxAttrList, mxShapes ); |
90 | 462 | } |
91 | | |
92 | | void SdXMLGroupShapeContext::endFastElement(sal_Int32 nElement) |
93 | 397 | { |
94 | 397 | if( mxChildren.is() ) |
95 | 397 | GetImport().GetShapeImport()->popGroupAndPostProcess(); |
96 | | |
97 | 397 | SdXMLShapeContext::endFastElement(nElement); |
98 | 397 | } |
99 | | |
100 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |