svggnode.cxx (01e92ad6) svggnode.cxx (4374d266)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 36 unchanged lines hidden (view full) ---

45
46 SvgGNode::~SvgGNode()
47 {
48 if(mpaTransform) delete mpaTransform;
49 }
50
51 const SvgStyleAttributes* SvgGNode::getSvgStyleAttributes() const
52 {
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 36 unchanged lines hidden (view full) ---

45
46 SvgGNode::~SvgGNode()
47 {
48 if(mpaTransform) delete mpaTransform;
49 }
50
51 const SvgStyleAttributes* SvgGNode::getSvgStyleAttributes() const
52 {
53 static rtl::OUString aClassStr(rtl::OUString::createFromAscii("g"));
53 if(SVGTokenDefs == getType())
54 {
55 // #125258# call parent for SVGTokenDefs
56 return SvgNode::getSvgStyleAttributes();
57 }
58 else
59 {
60 // #125258# for SVGTokenG take CssStyles into account
61 static rtl::OUString aClassStr(rtl::OUString::createFromAscii("g"));
54
62
55 return checkForCssStyle(aClassStr, maSvgStyleAttributes);
63 return checkForCssStyle(aClassStr, maSvgStyleAttributes);
64 }
56 }
57
58 void SvgGNode::parseAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken, const rtl::OUString& aContent)
59 {
60 // call parent
61 SvgNode::parseAttribute(rTokenName, aSVGToken, aContent);
62
63 // read style attributes

--- 21 unchanged lines hidden (view full) ---

85 {
86 break;
87 }
88 }
89 }
90
91 void SvgGNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const
92 {
65 }
66
67 void SvgGNode::parseAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken, const rtl::OUString& aContent)
68 {
69 // call parent
70 SvgNode::parseAttribute(rTokenName, aSVGToken, aContent);
71
72 // read style attributes

--- 21 unchanged lines hidden (view full) ---

94 {
95 break;
96 }
97 }
98 }
99
100 void SvgGNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const
101 {
93 const SvgStyleAttributes* pStyle = getSvgStyleAttributes();
94
95 if(pStyle)
102 if(SVGTokenDefs == getType())
96 {
103 {
97 const double fOpacity(pStyle->getOpacity().getNumber());
104 // #125258# no decompose needed for defs element, call parent for SVGTokenDefs
105 SvgNode::decomposeSvgNode(rTarget, bReferenced);
106 }
107 else
108 {
109 // #125258# for SVGTokenG decompose childs
110 const SvgStyleAttributes* pStyle = getSvgStyleAttributes();
98
111
99 if(fOpacity > 0.0 && Display_none != getDisplay())
112 if(pStyle)
100 {
113 {
101 drawinglayer::primitive2d::Primitive2DSequence aContent;
114 const double fOpacity(pStyle->getOpacity().getNumber());
102
115
103 // decompose childs
104 SvgNode::decomposeSvgNode(aContent, bReferenced);
105
106 if(aContent.hasElements())
116 if(fOpacity > 0.0 && Display_none != getDisplay())
107 {
117 {
108 pStyle->add_postProcess(rTarget, aContent, getTransform());
118 drawinglayer::primitive2d::Primitive2DSequence aContent;
119
120 // decompose childs
121 SvgNode::decomposeSvgNode(aContent, bReferenced);
122
123 if(aContent.hasElements())
124 {
125 pStyle->add_postProcess(rTarget, aContent, getTransform());
126 }
109 }
110 }
111 }
112 }
113 } // end of namespace svgreader
114} // end of namespace svgio
115
116//////////////////////////////////////////////////////////////////////////////
117// eof
127 }
128 }
129 }
130 }
131 } // end of namespace svgreader
132} // end of namespace svgio
133
134//////////////////////////////////////////////////////////////////////////////
135// eof