Teach symstore more duplicated DLLs
[LibreOffice.git] / svgio / source / svgreader / svganode.cxx
blobd2d64d04c359b65ec0bfd405852a27718a31fcdc
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
22 namespace svgio
24 namespace svgreader
26 SvgANode::SvgANode(
27 SvgDocument& rDocument,
28 SvgNode* pParent)
29 : SvgNode(SVGTokenA, rDocument, pParent),
30 maSvgStyleAttributes(*this)
34 SvgANode::~SvgANode()
38 const SvgStyleAttributes* SvgANode::getSvgStyleAttributes() const
40 return checkForCssStyle("a", maSvgStyleAttributes);
43 void SvgANode::parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent)
45 // call parent
46 SvgNode::parseAttribute(rTokenName, aSVGToken, aContent);
48 // read style attributes
49 maSvgStyleAttributes.parseStyleAttribute(aSVGToken, aContent, false);
51 // parse own
52 switch(aSVGToken)
54 case SVGTokenStyle:
56 readLocalCssStyle(aContent);
57 break;
59 case SVGTokenTransform:
61 const basegfx::B2DHomMatrix aMatrix(readTransform(aContent, *this));
63 if(!aMatrix.isIdentity())
65 setTransform(&aMatrix);
67 break;
69 case SVGTokenXlinkHref:
70 //TODO: add support for xlink:href
71 break;
72 default:
74 break;
79 void SvgANode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const
81 // #i125258# for SVGTokenA decompose children
82 const SvgStyleAttributes* pStyle = getSvgStyleAttributes();
84 if(!pStyle)
85 return;
87 const double fOpacity(pStyle->getOpacity().getNumber());
89 if(fOpacity > 0.0 && Display_none != getDisplay())
91 drawinglayer::primitive2d::Primitive2DContainer aContent;
93 // decompose children
94 SvgNode::decomposeSvgNode(aContent, bReferenced);
96 if(!aContent.empty())
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: */