summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvisvgm/dvisvgm-src/src/SVGCharHandler.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/dvisvgm/dvisvgm-src/src/SVGCharHandler.hpp')
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/src/SVGCharHandler.hpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/SVGCharHandler.hpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/SVGCharHandler.hpp
index c527ee26655..48d24496fab 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/src/SVGCharHandler.hpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/SVGCharHandler.hpp
@@ -31,7 +31,7 @@
template <typename T>
class CharProperty {
public:
- CharProperty (const T &v) : _value(v), _changed(false) {}
+ CharProperty (const T &v) : _value(v) {}
void set (const T &v) {
if (v != _value) {
@@ -47,20 +47,20 @@ class CharProperty {
private:
T _value;
- bool _changed;
+ bool _changed=false;
};
-class XMLElementNode;
+class XMLElement;
/** Base class for all character handlers. These handlers create SVG representations
* for the added characters and append them to the SVG tree. */
class SVGCharHandler {
public:
- SVGCharHandler () : _color(Color::BLACK), _font(0), _fontnum(0), _matrix(1), _vertical(false), _initialContextNode(0) {}
+ SVGCharHandler () : _matrix(1) {}
virtual ~SVGCharHandler() =default;
- virtual void setInitialContextNode (XMLElementNode *node);
+ virtual void setInitialContextNode (XMLElement *node);
virtual void appendChar (uint32_t c, double x, double y) =0;
virtual void notifyXAdjusted () {}
virtual void notifyYAdjusted () {}
@@ -74,32 +74,32 @@ class SVGCharHandler {
protected:
virtual void resetContextNode ();
- XMLElementNode* pushContextNode (std::unique_ptr<XMLElementNode> &&node);
+ XMLElement* pushContextNode (std::unique_ptr<XMLElement> node);
void popContextNode ();
- XMLElementNode* contextNode () const {
+ XMLElement* contextNode () const {
return _contextNodeStack.empty() ? _initialContextNode : _contextNodeStack.top();
}
- CharProperty<Color> _color; ///< current color
- CharProperty<const Font*> _font; ///< current font
- int _fontnum; ///< current font ID
- CharProperty<Matrix> _matrix; ///< current transformation
- CharProperty<bool> _vertical; ///< current writing mode
+ CharProperty<Color> _color=Color::BLACK; ///< current color
+ CharProperty<const Font*> _font=0; ///< current font
+ int _fontnum=0; ///< current font ID
+ CharProperty<Matrix> _matrix; ///< current transformation
+ CharProperty<bool> _vertical=false; ///< current writing mode
private:
- XMLElementNode *_initialContextNode; ///< SVG element the generated character nodes are attached to
- std::stack<XMLElementNode*> _contextNodeStack;
+ XMLElement *_initialContextNode= nullptr; ///< SVG element the generated character nodes are attached to
+ std::stack<XMLElement*> _contextNodeStack;
};
/** Base class for all character handlers that create SVG <text> elements. */
class SVGCharTextHandler : public SVGCharHandler {
public:
- SVGCharTextHandler (bool selectFontByClass) : _selectFontByClass(selectFontByClass) {}
+ explicit SVGCharTextHandler (bool selectFontByClass) : _selectFontByClass(selectFontByClass) {}
protected:
- std::unique_ptr<XMLElementNode> createTextNode (double x, double y) const;
+ std::unique_ptr<XMLElement> createTextNode (double x, double y) const;
private:
bool _selectFontByClass;