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 "constraintlistcontext.hxx"
21 #include "oox/helper/attributelist.hxx"
23 using namespace ::oox::core
;
24 using namespace ::com::sun::star::uno
;
25 using namespace ::com::sun::star::xml::sax
;
27 namespace oox
{ namespace drawingml
{
30 ConstraintListContext::ConstraintListContext( ContextHandler
& rParent
,
31 const Reference
< XFastAttributeList
>&,
32 const LayoutAtomPtr
&pNode
)
33 : ContextHandler( rParent
)
36 OSL_ENSURE( pNode
, "Node must NOT be NULL" );
40 ConstraintListContext::~ConstraintListContext()
44 void SAL_CALL
ConstraintListContext::endFastElement( ::sal_Int32
)
45 throw (SAXException
, RuntimeException
)
49 Reference
< XFastContextHandler
> SAL_CALL
50 ConstraintListContext::createFastChildContext( ::sal_Int32 aElement
,
51 const Reference
< XFastAttributeList
>& xAttribs
)
52 throw (SAXException
, RuntimeException
)
54 Reference
< XFastContextHandler
> xRet
;
60 case DGM_TOKEN( constr
):
62 ConstraintAtomPtr
pNode( new ConstraintAtom() );
63 mpNode
->addChild( pNode
);
65 AttributeList
aAttribs( xAttribs
);
66 pNode
->setFor( aAttribs
.getToken( XML_for
, XML_none
) );
67 pNode
->setForName( aAttribs
.getString( XML_forName
, aEmptyStr
) );
68 pNode
->setPointType( aAttribs
.getToken( XML_ptType
, XML_none
) );
69 pNode
->setType( aAttribs
.getToken( XML_type
, XML_none
) );
70 pNode
->setRefFor( aAttribs
.getToken( XML_refFor
, XML_none
) );
71 pNode
->setRefForName( aAttribs
.getString( XML_refForName
, aEmptyStr
) );
72 pNode
->setRefType( aAttribs
.getToken( XML_refType
, XML_none
) );
73 pNode
->setRefPointType( aAttribs
.getToken( XML_refPtType
, XML_none
) );
74 pNode
->setFactor( aAttribs
.getDouble( XML_fact
, 1.0 ) );
75 pNode
->setValue( aAttribs
.getDouble( XML_val
, 0.0 ) );
76 pNode
->setOperator( aAttribs
.getToken( XML_op
, XML_none
) );
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */