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 <svganode.hxx>
27 SvgDocument
& rDocument
,
29 : SvgNode(SVGTokenA
, rDocument
, pParent
),
30 maSvgStyleAttributes(*this)
38 const SvgStyleAttributes
* SvgANode::getSvgStyleAttributes() const
40 return checkForCssStyle("a", maSvgStyleAttributes
);
43 void SvgANode::parseAttribute(const OUString
& rTokenName
, SVGToken aSVGToken
, const OUString
& aContent
)
46 SvgNode::parseAttribute(rTokenName
, aSVGToken
, aContent
);
48 // read style attributes
49 maSvgStyleAttributes
.parseStyleAttribute(aSVGToken
, aContent
, false);
56 readLocalCssStyle(aContent
);
59 case SVGTokenTransform
:
61 const basegfx::B2DHomMatrix
aMatrix(readTransform(aContent
, *this));
63 if(!aMatrix
.isIdentity())
65 setTransform(&aMatrix
);
69 case SVGTokenXlinkHref
:
70 //TODO: add support for xlink:href
79 void SvgANode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer
& rTarget
, bool bReferenced
) const
81 // #i125258# for SVGTokenA decompose children
82 const SvgStyleAttributes
* pStyle
= getSvgStyleAttributes();
87 const double fOpacity(pStyle
->getOpacity().getNumber());
89 if(fOpacity
> 0.0 && Display_none
!= getDisplay())
91 drawinglayer::primitive2d::Primitive2DContainer aContent
;
94 SvgNode::decomposeSvgNode(aContent
, bReferenced
);
98 pStyle
->add_postProcess(rTarget
, aContent
, getTransform());
102 } // end of namespace svgreader
103 } // end of namespace svgio
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */