LibreOffice Module svgio (master) 1
svgsymbolnode.cxx
Go to the documentation of this file.
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 <svgsymbolnode.hxx>
21
22namespace svgio::svgreader
23{
25 SvgDocument& rDocument,
26 SvgNode* pParent)
27 : SvgNode(SVGToken::Symbol, rDocument, pParent),
28 maSvgStyleAttributes(*this)
29 {
30 }
31
33 {
34 }
35
37 {
39 }
40
41 void SvgSymbolNode::parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent)
42 {
43 // call parent
44 SvgNode::parseAttribute(rTokenName, aSVGToken, aContent);
45
46 // read style attributes
47 maSvgStyleAttributes.parseStyleAttribute(aSVGToken, aContent);
48
49 // parse own
50 switch(aSVGToken)
51 {
52 case SVGToken::Style:
53 {
54 readLocalCssStyle(aContent);
55 break;
56 }
58 {
59 readViewBox(aContent, *this);
60 break;
61 }
63 {
65 break;
66 }
67 default:
68 {
69 break;
70 }
71 }
72 }
73
74} // end of namespace svgio::svgreader
75
76/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void parseAttribute(const OUString &rTokenName, SVGToken aSVGToken, const OUString &aContent)
Definition: svgnode.cxx:534
void readLocalCssStyle(std::u16string_view aContent)
scan helper to read and interpret a local CssStyle to mpLocalCssStyle
Definition: svgnode.cxx:412
void parseStyleAttribute(SVGToken aSVGToken, const OUString &rContent)
local attribute scanner
SvgStyleAttributes maSvgStyleAttributes
use styles
SvgSymbolNode(SvgDocument &rDocument, SvgNode *pParent)
virtual void parseAttribute(const OUString &rTokenName, SVGToken aSVGToken, const OUString &aContent) override
virtual const SvgStyleAttributes * getSvgStyleAttributes() const override
virtual ~SvgSymbolNode() override
SvgAspectRatio readSvgAspectRatio(std::u16string_view rCandidate)
Definition: svgtools.cxx:1197
basegfx::B2DRange readViewBox(std::u16string_view rCandidate, InfoProvider const &rInfoProvider)
Definition: svgtools.cxx:808