Line data Source code
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 "constraintlistcontext.hxx"
21 : #include "oox/helper/attributelist.hxx"
22 :
23 : using namespace ::oox::core;
24 : using namespace ::com::sun::star::uno;
25 : using namespace ::com::sun::star::xml::sax;
26 :
27 : namespace oox { namespace drawingml {
28 :
29 : // CT_ConstraintLists
30 120 : ConstraintListContext::ConstraintListContext( ContextHandler2Helper& rParent,
31 : const AttributeList&,
32 : const LayoutAtomPtr &pNode )
33 : : ContextHandler2( rParent )
34 120 : , mpNode( pNode )
35 : {
36 : OSL_ENSURE( pNode, "Node must NOT be NULL" );
37 120 : }
38 :
39 240 : ConstraintListContext::~ConstraintListContext()
40 : {
41 240 : }
42 :
43 : ContextHandlerRef
44 414 : ConstraintListContext::onCreateContext( ::sal_Int32 aElement,
45 : const AttributeList& rAttribs )
46 : {
47 414 : switch( aElement )
48 : {
49 : case DGM_TOKEN( constr ):
50 : {
51 414 : ConstraintAtomPtr pNode( new ConstraintAtom() );
52 414 : mpNode->addChild( pNode );
53 :
54 414 : pNode->setFor( rAttribs.getToken( XML_for, XML_none ) );
55 414 : pNode->setForName( rAttribs.getString( XML_forName, "" ) );
56 414 : pNode->setPointType( rAttribs.getToken( XML_ptType, XML_none ) );
57 414 : pNode->setType( rAttribs.getToken( XML_type, XML_none ) );
58 414 : pNode->setRefFor( rAttribs.getToken( XML_refFor, XML_none ) );
59 414 : pNode->setRefForName( rAttribs.getString( XML_refForName, "" ) );
60 414 : pNode->setRefType( rAttribs.getToken( XML_refType, XML_none ) );
61 414 : pNode->setRefPointType( rAttribs.getToken( XML_refPtType, XML_none ) );
62 414 : pNode->setFactor( rAttribs.getDouble( XML_fact, 1.0 ) );
63 414 : pNode->setValue( rAttribs.getDouble( XML_val, 0.0 ) );
64 414 : pNode->setOperator( rAttribs.getToken( XML_op, XML_none ) );
65 414 : break;
66 : }
67 : default:
68 0 : break;
69 : }
70 :
71 414 : return this;
72 : }
73 :
74 408 : } }
75 :
76 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|