Allow copy-construction of Font.
authorCarl Hetherington <cth@carlh.net>
Thu, 11 May 2023 11:44:57 +0000 (13:44 +0200)
committerCarl Hetherington <cth@carlh.net>
Fri, 12 May 2023 20:11:06 +0000 (22:11 +0200)
src/lib/font.cc
src/lib/font.h

index f3fbc68972d0885675ae1d19c1f05773084fee10..955a2ad1ca2821b94ad43df82829d12ba2449b5d 100644 (file)
@@ -44,6 +44,24 @@ Font::Font (cxml::NodePtr node)
 }
 
 
+Font::Font(Font const& other)
+       : _id(other._id)
+       , _content(other._content)
+{
+
+}
+
+
+Font& Font::operator=(Font const& other)
+{
+       if (&other != this) {
+               _id = other._id;
+               _content = other._content;
+       }
+       return *this;
+}
+
+
 void
 Font::as_xml (xmlpp::Node* node)
 {
index 0afd873e1ded8fdd2a02d5a0c69c5534a682531c..12a14aba4e74086dee82c93d3a6464dd6159dee7 100644 (file)
@@ -54,6 +54,9 @@ public:
                _content.data = data;
        }
 
+       Font(Font const& other);
+       Font& operator=(Font const& other);
+
        void as_xml (xmlpp::Node* node);
 
        std::string id () const {