[Libreoffice-commits] libvisio.git: 8 commits - src/lib src/test

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Aug 4 17:19:04 UTC 2019


 src/lib/Makefile.am          |    1 
 src/lib/VSDParser.cpp        |   18 ---
 src/lib/VSDParser.h          |    5 
 src/lib/VSDStencils.cpp      |   18 ---
 src/lib/VSDStencils.h        |    4 
 src/lib/VSDStyles.cpp        |  224 -------------------------------------------
 src/lib/VSDStyles.h          |   92 ++++-------------
 src/lib/VSDTypes.cpp         |   80 ---------------
 src/lib/VSDTypes.h           |   33 +-----
 src/lib/VSDXMLParserBase.cpp |    6 -
 src/test/importtest.cpp      |   15 +-
 11 files changed, 48 insertions(+), 448 deletions(-)

New commits:
commit df4e769e53fa74929a6606f568abd1b1b76ea312
Author:     David Tardon <dtardon at redhat.com>
AuthorDate: Sun Aug 4 19:14:22 2019 +0200
Commit:     David Tardon <dtardon at redhat.com>
CommitDate: Sun Aug 4 19:14:22 2019 +0200

    cid#1371582 check return value
    
    Change-Id: If6f80449f6ba0584979aade8887d639996bc5e14

diff --git a/src/lib/VSDXMLParserBase.cpp b/src/lib/VSDXMLParserBase.cpp
index b47fae4..bf1ab6a 100644
--- a/src/lib/VSDXMLParserBase.cpp
+++ b/src/lib/VSDXMLParserBase.cpp
@@ -1519,11 +1519,11 @@ void libvisio::VSDXMLParserBase::readParaIX(xmlTextReaderPtr reader)
       break;
     case XML_BULLETFONTSIZE:
       if (XML_READER_TYPE_ELEMENT == tokenType)
-        readDoubleData(bulletFontSize, reader);
+        ret = readDoubleData(bulletFontSize, reader);
       break;
     case XML_TEXTPOSAFTERBULLET:
       if (XML_READER_TYPE_ELEMENT == tokenType)
-        readDoubleData(textPosAfterBullet, reader);
+        ret = readDoubleData(textPosAfterBullet, reader);
       break;
     default:
       break;
commit be7f666de460bd3c89ed51f43039858ca1614c7c
Author:     David Tardon <dtardon at redhat.com>
AuthorDate: Sun Aug 4 19:13:30 2019 +0200
Commit:     David Tardon <dtardon at redhat.com>
CommitDate: Sun Aug 4 19:13:30 2019 +0200

    cid#1371581 check return value
    
    Change-Id: I794e08141e15795ee19edca755e5cbfa4b9ff71d

diff --git a/src/lib/VSDXMLParserBase.cpp b/src/lib/VSDXMLParserBase.cpp
index edbaac4..b47fae4 100644
--- a/src/lib/VSDXMLParserBase.cpp
+++ b/src/lib/VSDXMLParserBase.cpp
@@ -1476,7 +1476,7 @@ void libvisio::VSDXMLParserBase::readParaIX(xmlTextReaderPtr reader)
       break;
     case XML_BULLET:
       if (XML_READER_TYPE_ELEMENT == tokenType)
-        readByteData(bullet, reader);
+        ret = readByteData(bullet, reader);
       break;
     case XML_BULLETSTR:
       if (XML_READER_TYPE_ELEMENT == tokenType && !xmlTextReaderIsEmptyElement(reader))
commit 1972bec9fe34a09399b785204569ca3189039c7e
Author:     David Tardon <dtardon at redhat.com>
AuthorDate: Sun Aug 4 19:07:17 2019 +0200
Commit:     David Tardon <dtardon at redhat.com>
CommitDate: Sun Aug 4 19:07:17 2019 +0200

    cid#1452212 fix memory leak
    
    Change-Id: Idec224a8c688a624c67db07de28add2040f3bc59

diff --git a/src/test/importtest.cpp b/src/test/importtest.cpp
index 6ee1689..9a01473 100644
--- a/src/test/importtest.cpp
+++ b/src/test/importtest.cpp
@@ -45,7 +45,7 @@ xmlXPathObjectPtr getXPathNode(xmlDocPtr doc, const librevenge::RVNGString &xpat
 librevenge::RVNGString getXPath(xmlDocPtr doc, const librevenge::RVNGString &xpath, const librevenge::RVNGString &attribute)
 {
   CPPUNIT_ASSERT(doc);
-  xmlXPathObjectPtr xpathobject = getXPathNode(doc, xpath);
+  std::unique_ptr<xmlXPathObject, void(*)(xmlXPathObjectPtr)> xpathobject{getXPathNode(doc, xpath), xmlXPathFreeObject};
   xmlNodeSetPtr nodeset = xpathobject->nodesetval;
 
   librevenge::RVNGString message("XPath '");
@@ -58,7 +58,6 @@ librevenge::RVNGString getXPath(xmlDocPtr doc, const librevenge::RVNGString &xpa
   xmlChar *prop = xmlGetProp(node, BAD_CAST(attribute.cstr()));
   librevenge::RVNGString s((const char *)prop);
   xmlFree(prop);
-  xmlXPathFreeObject(xpathobject);
   return s;
 }
 
commit 19401333010f5874b70373282c1c4ed29870f659
Author:     David Tardon <dtardon at redhat.com>
AuthorDate: Sun Aug 4 19:05:48 2019 +0200
Commit:     David Tardon <dtardon at redhat.com>
CommitDate: Sun Aug 4 19:05:48 2019 +0200

    sort includes
    
    Change-Id: Idf362dcc4ede95dceb80de5a5c2e6ac7dff5ff21

diff --git a/src/test/importtest.cpp b/src/test/importtest.cpp
index 52c6a04..6ee1689 100644
--- a/src/test/importtest.cpp
+++ b/src/test/importtest.cpp
@@ -7,10 +7,15 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#include <libvisio/libvisio.h>
-#include <libxml/xpath.h>
 #include <iostream>
+#include <memory>
+
 #include <cppunit/extensions/HelperMacros.h>
+
+#include <libvisio/libvisio.h>
+
+#include <libxml/xpath.h>
+
 #include "xmldrawinggenerator.h"
 
 namespace librevenge
commit f6c48b831afdea999ed68a9b717c78d728a0e677
Author:     David Tardon <dtardon at redhat.com>
AuthorDate: Sun Aug 4 19:05:05 2019 +0200
Commit:     David Tardon <dtardon at redhat.com>
CommitDate: Sun Aug 4 19:05:05 2019 +0200

    cid#1452210 fix memory leak
    
    Change-Id: Ifda9cbb926993364ddb68fcb96dc66e0c765d2ef

diff --git a/src/test/importtest.cpp b/src/test/importtest.cpp
index 0e54d41..52c6a04 100644
--- a/src/test/importtest.cpp
+++ b/src/test/importtest.cpp
@@ -114,7 +114,7 @@ void assertBmpDataOffset(xmlDocPtr doc, const librevenge::RVNGString &xpath, con
 /// Same as the assertXPathContent(), but don't assert: return the string instead.
 librevenge::RVNGString getXPathContent(xmlDocPtr doc, const librevenge::RVNGString &xpath)
 {
-  xmlXPathObjectPtr xpathobject = getXPathNode(doc, xpath);
+  std::unique_ptr<xmlXPathObject, void(*)(xmlXPathObjectPtr)> xpathobject{getXPathNode(doc, xpath), xmlXPathFreeObject};
   switch (xpathobject->type)
   {
   case XPATH_UNDEFINED:
@@ -135,7 +135,6 @@ librevenge::RVNGString getXPathContent(xmlDocPtr doc, const librevenge::RVNGStri
       xmlchild = xmlchild->next;
     if (xmlchild && xmlchild->type == XML_TEXT_NODE)
       s = (reinterpret_cast<char *>((xmlnode->children[0]).content));
-    xmlXPathFreeObject(xpathobject);
     return s;
   }
   case XPATH_BOOLEAN:
commit 0a62d06de2462b6be9f086b5997a99eb2feb7246
Author:     David Tardon <dtardon at redhat.com>
AuthorDate: Sun Aug 4 18:58:54 2019 +0200
Commit:     David Tardon <dtardon at redhat.com>
CommitDate: Sun Aug 4 18:58:54 2019 +0200

    make trivial copy ctors default too
    
    Change-Id: I9d1359ea3867add91eb9c86eea6b25c6c98abc44

diff --git a/src/lib/VSDParser.h b/src/lib/VSDParser.h
index d368c36..07c04e3 100644
--- a/src/lib/VSDParser.h
+++ b/src/lib/VSDParser.h
@@ -35,8 +35,7 @@ struct Pointer
 {
   Pointer()
     : Type(0), Offset(0), Length(0), Format(0), ListSize(0) {}
-  Pointer(const Pointer &ptr)
-    : Type(ptr.Type), Offset(ptr.Offset), Length(ptr.Length), Format(ptr.Format), ListSize(ptr.ListSize) {}
+  Pointer(const Pointer &ptr) = default;
   Pointer &operator=(const Pointer &ptr) = default;
   unsigned Type;
   unsigned Offset;
diff --git a/src/lib/VSDStencils.cpp b/src/lib/VSDStencils.cpp
index 7c1d4dc..73af5ed 100644
--- a/src/lib/VSDStencils.cpp
+++ b/src/lib/VSDStencils.cpp
@@ -117,12 +117,6 @@ libvisio::VSDStencil::VSDStencil()
 {
 }
 
-libvisio::VSDStencil::VSDStencil(const libvisio::VSDStencil &stencil)
-  : m_shapes(stencil.m_shapes), m_shadowOffsetX(stencil.m_shadowOffsetX),
-    m_shadowOffsetY(stencil.m_shadowOffsetY), m_firstShapeId(stencil.m_firstShapeId)
-{
-}
-
 libvisio::VSDStencil::~VSDStencil()
 {
 }
diff --git a/src/lib/VSDStencils.h b/src/lib/VSDStencils.h
index 6552595..964a933 100644
--- a/src/lib/VSDStencils.h
+++ b/src/lib/VSDStencils.h
@@ -63,7 +63,7 @@ class VSDStencil
 {
 public:
   VSDStencil();
-  VSDStencil(const VSDStencil &stencil);
+  VSDStencil(const VSDStencil &stencil) = default;
   ~VSDStencil();
   VSDStencil &operator=(const VSDStencil &stencil) = default;
   void addStencilShape(unsigned id, const VSDShape &shape);
diff --git a/src/lib/VSDStyles.cpp b/src/lib/VSDStyles.cpp
index 97913b5..59e2802 100644
--- a/src/lib/VSDStyles.cpp
+++ b/src/lib/VSDStyles.cpp
@@ -61,13 +61,6 @@ libvisio::VSDStyles::VSDStyles() :
 {
 }
 
-libvisio::VSDStyles::VSDStyles(const libvisio::VSDStyles &styles) :
-  m_lineStyles(styles.m_lineStyles), m_fillStyles(styles.m_fillStyles), m_textBlockStyles(styles.m_textBlockStyles),
-  m_charStyles(styles.m_charStyles), m_paraStyles(styles.m_paraStyles), m_lineStyleMasters(styles.m_lineStyleMasters),
-  m_fillStyleMasters(styles.m_fillStyleMasters), m_textStyleMasters(styles.m_textStyleMasters)
-{
-}
-
 libvisio::VSDStyles::~VSDStyles()
 {
 }
diff --git a/src/lib/VSDStyles.h b/src/lib/VSDStyles.h
index 6a68598..542b952 100644
--- a/src/lib/VSDStyles.h
+++ b/src/lib/VSDStyles.h
@@ -32,10 +32,7 @@ struct VSDOptionalLineStyle
                        const boost::optional<long> &qlm) :
     width(w), colour(col), pattern(p), startMarker(sm), endMarker(em), cap(c), rounding(r),
     qsLineColour(qlc), qsLineMatrix(qlm) {}
-  VSDOptionalLineStyle(const VSDOptionalLineStyle &style) :
-    width(style.width), colour(style.colour), pattern(style.pattern), startMarker(style.startMarker),
-    endMarker(style.endMarker), cap(style.cap), rounding(style.rounding), qsLineColour(style.qsLineColour),
-    qsLineMatrix(style.qsLineMatrix) {}
+  VSDOptionalLineStyle(const VSDOptionalLineStyle &style) = default;
   ~VSDOptionalLineStyle() {}
   VSDOptionalLineStyle &operator=(const VSDOptionalLineStyle &style) = default;
   void override(const VSDOptionalLineStyle &style)
@@ -71,11 +68,7 @@ struct VSDLineStyle
                unsigned char em, unsigned char c, double r, long qlc, long qlm) :
     width(w), colour(col), pattern(p), startMarker(sm), endMarker(em), cap(c),
     rounding(r), qsLineColour(qlc), qsLineMatrix(qlm) {}
-  VSDLineStyle(const VSDLineStyle &style) :
-    width(style.width), colour(style.colour), pattern(style.pattern),
-    startMarker(style.startMarker), endMarker(style.endMarker), cap(style.cap),
-    rounding(style.rounding), qsLineColour(style.qsLineColour),
-    qsLineMatrix(style.qsLineMatrix) {}
+  VSDLineStyle(const VSDLineStyle &style) = default;
   ~VSDLineStyle() {}
   VSDLineStyle &operator=(const VSDLineStyle &style) = default;
   void override(const VSDOptionalLineStyle &style, const VSDXTheme *theme)
@@ -122,13 +115,7 @@ struct VSDOptionalFillStyle
     fgColour(fgc), bgColour(bgc), pattern(p), fgTransparency(fga), bgTransparency(bga),
     shadowFgColour(sfgc), shadowPattern(shp), shadowOffsetX(shX), shadowOffsetY(shY),
     qsFillColour(qsFc), qsShadowColour(qsSc), qsFillMatrix(qsFm) {}
-  VSDOptionalFillStyle(const VSDOptionalFillStyle &style) :
-    fgColour(style.fgColour), bgColour(style.bgColour), pattern(style.pattern),
-    fgTransparency(style.fgTransparency), bgTransparency(style.bgTransparency),
-    shadowFgColour(style.shadowFgColour), shadowPattern(style.shadowPattern),
-    shadowOffsetX(style.shadowOffsetX), shadowOffsetY(style.shadowOffsetY),
-    qsFillColour(style.qsFillColour), qsShadowColour(style.qsShadowColour),
-    qsFillMatrix(style.qsFillMatrix) {}
+  VSDOptionalFillStyle(const VSDOptionalFillStyle &style) = default;
   ~VSDOptionalFillStyle() {}
   VSDOptionalFillStyle &operator=(const VSDOptionalFillStyle &style) = default;
   void override(const VSDOptionalFillStyle &style)
@@ -173,13 +160,7 @@ struct VSDFillStyle
     : fgColour(fgc), bgColour(bgc), pattern(p), fgTransparency(fga), bgTransparency(bga),
       shadowFgColour(sfgc), shadowPattern(shp), shadowOffsetX(shX), shadowOffsetY(shY),
       qsFillColour(qsFc), qsShadowColour(qsSc), qsFillMatrix(qsFm) {}
-  VSDFillStyle(const VSDFillStyle &style) :
-    fgColour(style.fgColour), bgColour(style.bgColour), pattern(style.pattern),
-    fgTransparency(style.fgTransparency), bgTransparency(style.bgTransparency),
-    shadowFgColour(style.shadowFgColour), shadowPattern(style.shadowPattern),
-    shadowOffsetX(style.shadowOffsetX), shadowOffsetY(style.shadowOffsetY),
-    qsFillColour(style.qsFillColour), qsShadowColour(style.qsShadowColour),
-    qsFillMatrix(style.qsFillMatrix) {}
+  VSDFillStyle(const VSDFillStyle &style) = default;
   ~VSDFillStyle() {}
   VSDFillStyle &operator=(const VSDFillStyle &style) = default;
   void override(const VSDOptionalFillStyle &style, const VSDXTheme *theme)
@@ -243,13 +224,7 @@ struct VSDOptionalCharStyle
     underline(u), doubleunderline(du), strikeout(so), doublestrikeout(dso),
     allcaps(ac), initcaps(ic), smallcaps(sc), superscript(super),
     subscript(sub), scaleWidth(sw) {}
-  VSDOptionalCharStyle(const VSDOptionalCharStyle &style) :
-    charCount(style.charCount), font(style.font), colour(style.colour),
-    size(style.size), bold(style.bold), italic(style.italic),
-    underline(style.underline), doubleunderline(style.doubleunderline),
-    strikeout(style.strikeout), doublestrikeout(style.doublestrikeout),
-    allcaps(style.allcaps), initcaps(style.initcaps), smallcaps(style.smallcaps),
-    superscript(style.superscript), subscript(style.subscript), scaleWidth(style.scaleWidth) {}
+  VSDOptionalCharStyle(const VSDOptionalCharStyle &style) = default;
   ~VSDOptionalCharStyle() {}
   VSDOptionalCharStyle &operator=(const VSDOptionalCharStyle &style) = default;
   void override(const VSDOptionalCharStyle &style)
@@ -304,14 +279,7 @@ struct VSDCharStyle
     underline(u), doubleunderline(du), strikeout(so), doublestrikeout(dso),
     allcaps(ac), initcaps(ic), smallcaps(sc), superscript(super),
     subscript(sub), scaleWidth(sw) {}
-  VSDCharStyle(const VSDCharStyle &style) :
-    charCount(style.charCount), font(style.font), colour(style.colour),
-    size(style.size), bold(style.bold), italic(style.italic),
-    underline(style.underline), doubleunderline(style.doubleunderline),
-    strikeout(style.strikeout), doublestrikeout(style.doublestrikeout),
-    allcaps(style.allcaps), initcaps(style.initcaps),
-    smallcaps(style.smallcaps), superscript(style.superscript),
-    subscript(style.subscript), scaleWidth(style.scaleWidth) {}
+  VSDCharStyle(const VSDCharStyle &style) = default;
   ~VSDCharStyle() {}
   VSDCharStyle &operator=(const VSDCharStyle &style) = default;
   void override(const VSDOptionalCharStyle &style, const VSDXTheme * /* theme */)
@@ -366,12 +334,7 @@ struct VSDOptionalParaStyle
     charCount(cc), indFirst(ifst), indLeft(il), indRight(ir), spLine(sl), spBefore(sb), spAfter(sa),
     align(a), bullet(b), bulletStr(bs), bulletFont(bf), bulletFontSize(bfs),
     textPosAfterBullet(tpab), flags(f) {}
-  VSDOptionalParaStyle(const VSDOptionalParaStyle &style) :
-    charCount(style.charCount), indFirst(style.indFirst), indLeft(style.indLeft),
-    indRight(style.indRight), spLine(style.spLine), spBefore(style.spBefore), spAfter(style.spAfter),
-    align(style.align), bullet(style.bullet), bulletStr(style.bulletStr), bulletFont(style.bulletFont),
-    bulletFontSize(style.bulletFontSize), textPosAfterBullet(style.textPosAfterBullet),
-    flags(style.flags) {}
+  VSDOptionalParaStyle(const VSDOptionalParaStyle &style) = default;
   ~VSDOptionalParaStyle() {}
   VSDOptionalParaStyle &operator=(const VSDOptionalParaStyle &style) = default;
   void override(const VSDOptionalParaStyle &style)
@@ -417,11 +380,7 @@ struct VSDParaStyle
                const VSDName &bf, double bfs, double tpab, unsigned f) :
     charCount(cc), indFirst(ifst), indLeft(il), indRight(ir), spLine(sl), spBefore(sb), spAfter(sa), align(a),
     bullet(b), bulletStr(bs), bulletFont(bf), bulletFontSize(bfs), textPosAfterBullet(tpab), flags(f) {}
-  VSDParaStyle(const VSDParaStyle &style) :
-    charCount(style.charCount), indFirst(style.indFirst), indLeft(style.indLeft), indRight(style.indRight),
-    spLine(style.spLine), spBefore(style.spBefore), spAfter(style.spAfter), align(style.align),
-    bullet(style.bullet), bulletStr(style.bulletStr), bulletFont(style.bulletFont),
-    bulletFontSize(style.bulletFontSize), textPosAfterBullet(style.textPosAfterBullet), flags(style.flags) {}
+  VSDParaStyle(const VSDParaStyle &style) = default;
   ~VSDParaStyle() {}
   VSDParaStyle &operator=(const VSDParaStyle &style) = default;
   void override(const VSDOptionalParaStyle &style, const VSDXTheme * /* theme */)
@@ -469,11 +428,7 @@ struct VSDOptionalTextBlockStyle
                             const boost::optional<unsigned char> &td) :
     leftMargin(lm), rightMargin(rm), topMargin(tm), bottomMargin(bm), verticalAlign(va),
     isTextBkgndFilled(isBgFilled), textBkgndColour(bgClr), defaultTabStop(defTab), textDirection(td) {}
-  VSDOptionalTextBlockStyle(const VSDOptionalTextBlockStyle &style) :
-    leftMargin(style.leftMargin), rightMargin(style.rightMargin), topMargin(style.topMargin),
-    bottomMargin(style.bottomMargin), verticalAlign(style.verticalAlign),
-    isTextBkgndFilled(style.isTextBkgndFilled), textBkgndColour(style.textBkgndColour),
-    defaultTabStop(style.defaultTabStop), textDirection(style.textDirection) {}
+  VSDOptionalTextBlockStyle(const VSDOptionalTextBlockStyle &style) = default;
   ~VSDOptionalTextBlockStyle() {}
   VSDOptionalTextBlockStyle &operator=(const VSDOptionalTextBlockStyle &style) = default;
   void override(const VSDOptionalTextBlockStyle &style)
@@ -509,10 +464,7 @@ struct VSDTextBlockStyle
                     bool isBgFilled, Colour bgClr, double defTab, unsigned char td) :
     leftMargin(lm), rightMargin(rm), topMargin(tm), bottomMargin(bm), verticalAlign(va),
     isTextBkgndFilled(isBgFilled), textBkgndColour(bgClr), defaultTabStop(defTab), textDirection(td) {}
-  VSDTextBlockStyle(const VSDTextBlockStyle &style) :
-    leftMargin(style.leftMargin), rightMargin(style.rightMargin), topMargin(style.topMargin),
-    bottomMargin(style.bottomMargin), verticalAlign(style.verticalAlign), isTextBkgndFilled(style.isTextBkgndFilled),
-    textBkgndColour(style.textBkgndColour), defaultTabStop(style.defaultTabStop), textDirection(style.textDirection) {}
+  VSDTextBlockStyle(const VSDTextBlockStyle &style) = default;
   ~VSDTextBlockStyle() {}
   VSDTextBlockStyle &operator=(const VSDTextBlockStyle &style) = default;
   void override(const VSDOptionalTextBlockStyle &style, const VSDXTheme * /* theme */)
@@ -543,7 +495,7 @@ class VSDStyles
 {
 public:
   VSDStyles();
-  VSDStyles(const VSDStyles &styles);
+  VSDStyles(const VSDStyles &styles) = default;
   ~VSDStyles();
   VSDStyles &operator=(const VSDStyles &styles) = default;
   void addLineStyle(unsigned lineStyleIndex, const VSDOptionalLineStyle &lineStyle);
diff --git a/src/lib/VSDTypes.h b/src/lib/VSDTypes.h
index 6628edc..08ece99 100644
--- a/src/lib/VSDTypes.h
+++ b/src/lib/VSDTypes.h
@@ -35,9 +35,7 @@ struct XForm
   XForm() : pinX(0.0), pinY(0.0), height(0.0), width(0.0),
     pinLocX(0.0), pinLocY(0.0), angle(0.0),
     flipX(false), flipY(false), x(0.0), y(0.0) {}
-  XForm(const XForm &xform) : pinX(xform.pinX), pinY(xform.pinY), height(xform.height),
-    width(xform.width), pinLocX(xform.pinLocX), pinLocY(xform.pinLocY), angle(xform.angle),
-    flipX(xform.flipX), flipY(xform.flipY), x(xform.x), y(xform.y) {}
+  XForm(const XForm &xform) = default;
   XForm &operator=(const XForm &xform) = default;
 };
 
@@ -109,14 +107,7 @@ struct NURBSData
       knots(),
       weights(),
       points() {}
-  NURBSData(const NURBSData &data)
-    : lastKnot(data.lastKnot),
-      degree(data.degree),
-      xType(data.xType),
-      yType(data.yType),
-      knots(data.knots),
-      weights(data.weights),
-      points(data.points) {}
+  NURBSData(const NURBSData &data) = default;
   NURBSData &operator=(const NURBSData &data) = default;
 };
 
@@ -183,7 +174,7 @@ public:
     : m_data(data),
       m_format(format) {}
   VSDName() : m_data(), m_format(VSD_TEXT_ANSI) {}
-  VSDName(const VSDName &name) : m_data(name.m_data), m_format(name.m_format) {}
+  VSDName(const VSDName &name) = default;
   VSDName &operator=(const VSDName &name) = default;
   bool empty() const
   {
@@ -213,7 +204,7 @@ struct VSDMisc
 {
   bool m_hideText;
   VSDMisc() : m_hideText(false) {}
-  VSDMisc(const VSDMisc &misc) : m_hideText(misc.m_hideText) {}
+  VSDMisc(const VSDMisc &misc) = default;
   VSDMisc &operator=(const VSDMisc &misc) = default;
 };
 
@@ -248,11 +239,7 @@ struct VSDBullet
       m_bulletFont(),
       m_bulletFontSize(0.0),
       m_textPosAfterBullet(0.0) {}
-  VSDBullet(const VSDBullet &bullet) :
-    m_bulletStr(bullet.m_bulletStr),
-    m_bulletFont(bullet.m_bulletFont),
-    m_bulletFontSize(bullet.m_bulletFontSize),
-    m_textPosAfterBullet(bullet.m_textPosAfterBullet) {}
+  VSDBullet(const VSDBullet &bullet) = default;
   VSDBullet &operator=(const VSDBullet &bullet) = default;
   inline bool operator==(const VSDBullet &bullet) const
   {
commit 829afb86ef093446cfb624cc492902eb36013bd1
Author:     David Tardon <dtardon at redhat.com>
AuthorDate: Sun Aug 4 18:48:23 2019 +0200
Commit:     David Tardon <dtardon at redhat.com>
CommitDate: Sun Aug 4 18:52:50 2019 +0200

    make trivial assignment operators default
    
    Change-Id: Ibb939f38dbe4ff0a0a61aad29a4a4da58efcb743

diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index e6212e8..d8a798e 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -65,7 +65,6 @@ libvisio_internal_la_SOURCES = \
 	VSDStyles.h \
 	VSDStylesCollector.cpp \
 	VSDStylesCollector.h \
-	VSDTypes.cpp \
 	VSDTypes.h \
 	VSDXMLHelper.cpp \
 	VSDXMLHelper.h \
diff --git a/src/lib/VSDParser.cpp b/src/lib/VSDParser.cpp
index 2305c79..03b24fd 100644
--- a/src/lib/VSDParser.cpp
+++ b/src/lib/VSDParser.cpp
@@ -23,24 +23,6 @@
 #include "VSDStylesCollector.h"
 #include "VSDMetaData.h"
 
-namespace libvisio
-{
-
-Pointer &Pointer::operator=(const Pointer &ptr)
-{
-  if (this != &ptr)
-  {
-    Type = ptr.Type;
-    Offset = ptr.Offset;
-    Length = ptr.Length;
-    Format = ptr.Format;
-    ListSize = ptr.ListSize;
-  }
-  return *this;
-}
-
-}
-
 libvisio::VSDParser::VSDParser(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter, librevenge::RVNGInputStream *container)
   : m_input(input), m_painter(painter), m_container(container), m_header(), m_collector(nullptr), m_shapeList(), m_currentLevel(0),
     m_stencils(), m_currentStencil(nullptr), m_shape(), m_isStencilStarted(false), m_isInStyles(false),
diff --git a/src/lib/VSDParser.h b/src/lib/VSDParser.h
index 827ea6e..d368c36 100644
--- a/src/lib/VSDParser.h
+++ b/src/lib/VSDParser.h
@@ -37,7 +37,7 @@ struct Pointer
     : Type(0), Offset(0), Length(0), Format(0), ListSize(0) {}
   Pointer(const Pointer &ptr)
     : Type(ptr.Type), Offset(ptr.Offset), Length(ptr.Length), Format(ptr.Format), ListSize(ptr.ListSize) {}
-  Pointer &operator=(const Pointer &ptr);
+  Pointer &operator=(const Pointer &ptr) = default;
   unsigned Type;
   unsigned Offset;
   unsigned Length;
diff --git a/src/lib/VSDStencils.cpp b/src/lib/VSDStencils.cpp
index 7037f2f..7c1d4dc 100644
--- a/src/lib/VSDStencils.cpp
+++ b/src/lib/VSDStencils.cpp
@@ -127,18 +127,6 @@ libvisio::VSDStencil::~VSDStencil()
 {
 }
 
-libvisio::VSDStencil &libvisio::VSDStencil::operator=(const libvisio::VSDStencil &stencil)
-{
-  if (this != &stencil)
-  {
-    m_shapes = stencil.m_shapes;
-    m_shadowOffsetX = stencil.m_shadowOffsetX;
-    m_shadowOffsetY = stencil.m_shadowOffsetY;
-    m_firstShapeId = stencil.m_firstShapeId;
-  }
-  return *this;
-}
-
 void libvisio::VSDStencil::addStencilShape(unsigned id, const VSDShape &shape)
 {
   m_shapes[id] = shape;
diff --git a/src/lib/VSDStencils.h b/src/lib/VSDStencils.h
index 01d2f4f..6552595 100644
--- a/src/lib/VSDStencils.h
+++ b/src/lib/VSDStencils.h
@@ -65,7 +65,7 @@ public:
   VSDStencil();
   VSDStencil(const VSDStencil &stencil);
   ~VSDStencil();
-  VSDStencil &operator=(const VSDStencil &stencil);
+  VSDStencil &operator=(const VSDStencil &stencil) = default;
   void addStencilShape(unsigned id, const VSDShape &shape);
   void setFirstShape(unsigned id);
   const VSDShape *getStencilShape(unsigned id) const;
diff --git a/src/lib/VSDStyles.cpp b/src/lib/VSDStyles.cpp
index 88c0169..97913b5 100644
--- a/src/lib/VSDStyles.cpp
+++ b/src/lib/VSDStyles.cpp
@@ -53,206 +53,6 @@ T getOptionalStyle(const std::map<unsigned, unsigned> &styleMasters, const std::
 
 }
 
-VSDOptionalLineStyle &VSDOptionalLineStyle::operator=(const VSDOptionalLineStyle &style)
-{
-  if (this != &style)
-  {
-    width = style.width;
-    colour = style.colour;
-    pattern = style.pattern;
-    startMarker = style.startMarker;
-    endMarker = style.endMarker;
-    cap = style.cap;
-    rounding = style.rounding;
-    qsLineColour = style.qsLineColour;
-    qsLineMatrix = style.qsLineMatrix;
-  }
-  return *this;
-}
-
-VSDLineStyle &VSDLineStyle::operator=(const VSDLineStyle &style)
-{
-  if (this != &style)
-  {
-    width = style.width;
-    colour = style.colour;
-    pattern = style.pattern;
-    startMarker = style.startMarker;
-    endMarker = style.endMarker;
-    cap = style.cap;
-    rounding = style.rounding;
-    qsLineColour = style.qsLineColour;
-    qsLineMatrix = style.qsLineMatrix;
-  }
-  return *this;
-}
-
-VSDOptionalFillStyle &VSDOptionalFillStyle::operator=(const VSDOptionalFillStyle &style)
-{
-  if (this != &style)
-  {
-    fgColour = style.fgColour;
-    bgColour = style.bgColour;
-    pattern = style.pattern;
-    fgTransparency = style.fgTransparency;
-    bgTransparency = style.bgTransparency;
-    shadowFgColour = style.shadowFgColour;
-    shadowPattern = style.shadowPattern;
-    shadowOffsetX = style.shadowOffsetX;
-    shadowOffsetY = style.shadowOffsetY;
-    qsFillColour = style.qsFillColour;
-    qsShadowColour = style.qsShadowColour;
-    qsFillMatrix = style.qsFillMatrix;
-  }
-  return *this;
-}
-
-VSDFillStyle &VSDFillStyle::operator=(const VSDFillStyle &style)
-{
-  if (this != &style)
-  {
-    fgColour = style.fgColour;
-    bgColour = style.bgColour;
-    pattern = style.pattern;
-    fgTransparency = style.fgTransparency;
-    bgTransparency = style.bgTransparency;
-    shadowFgColour = style.shadowFgColour;
-    shadowPattern = style.shadowPattern;
-    shadowOffsetX = style.shadowOffsetX;
-    shadowOffsetY = style.shadowOffsetY;
-    qsFillColour = style.qsFillColour;
-    qsShadowColour = style.qsShadowColour;
-    qsFillMatrix = style.qsFillMatrix;
-  }
-  return *this;
-}
-
-VSDOptionalCharStyle &VSDOptionalCharStyle::operator=(const VSDOptionalCharStyle &style)
-{
-  if (this != &style)
-  {
-    charCount = style.charCount;
-    font = style.font;
-    colour = style.colour;
-    size = style.size;
-    bold = style.bold;
-    italic = style.italic;
-    underline = style.underline;
-    doubleunderline = style.doubleunderline;
-    strikeout = style.strikeout;
-    doublestrikeout = style.doublestrikeout;
-    allcaps = style.allcaps;
-    initcaps = style.initcaps;
-    smallcaps = style.smallcaps;
-    superscript = style.superscript;
-    subscript = style.subscript;
-    scaleWidth = style.scaleWidth;
-  }
-  return *this;
-}
-
-VSDCharStyle &VSDCharStyle::operator=(const VSDCharStyle &style)
-{
-  if (this != &style)
-  {
-    charCount = style.charCount;
-    font = style.font;
-    colour = style.colour;
-    size = style.size;
-    bold = style.bold;
-    italic = style.italic;
-    underline = style.underline;
-    doubleunderline = style.doubleunderline;
-    strikeout = style.strikeout;
-    doublestrikeout = style.doublestrikeout;
-    allcaps = style.allcaps;
-    initcaps = style.initcaps;
-    smallcaps = style.smallcaps;
-    superscript = style.superscript;
-    subscript = style.subscript;
-    scaleWidth = style.scaleWidth;
-  }
-  return *this;
-}
-
-VSDOptionalParaStyle &VSDOptionalParaStyle::operator=(const VSDOptionalParaStyle &style)
-{
-  if (this != &style)
-  {
-    charCount = style.charCount;
-    indFirst = style.indFirst;
-    indLeft = style.indLeft;
-    indRight = style.indRight;
-    spLine = style.spLine;
-    spBefore = style.spBefore;
-    spAfter = style.spAfter;
-    align = style.align;
-    bullet = style.bullet;
-    bulletStr = style.bulletStr;
-    bulletFont = style.bulletFont;
-    bulletFontSize = style.bulletFontSize;
-    textPosAfterBullet = style.textPosAfterBullet;
-    flags = style.flags;
-  }
-  return *this;
-}
-
-VSDParaStyle &VSDParaStyle::operator=(const VSDParaStyle &style)
-{
-  if (this != &style)
-  {
-    charCount = style.charCount;
-    indFirst = style.indFirst;
-    indLeft = style.indLeft;
-    indRight = style.indRight;
-    spLine = style.spLine;
-    spBefore = style.spBefore;
-    spAfter = style.spAfter;
-    align = style.align;
-    bullet = style.bullet;
-    bulletStr = style.bulletStr;
-    bulletFont = style.bulletFont;
-    bulletFontSize = style.bulletFontSize;
-    textPosAfterBullet = style.textPosAfterBullet;
-    flags = style.flags;
-  }
-  return *this;
-}
-
-VSDOptionalTextBlockStyle &VSDOptionalTextBlockStyle::operator=(const VSDOptionalTextBlockStyle &style)
-{
-  if (this != &style)
-  {
-    leftMargin = style.leftMargin;
-    rightMargin = style.rightMargin;
-    topMargin = style.topMargin;
-    bottomMargin = style.bottomMargin;
-    verticalAlign = style.verticalAlign;
-    isTextBkgndFilled = style.isTextBkgndFilled;
-    textBkgndColour = style.textBkgndColour;
-    defaultTabStop = style.defaultTabStop;
-    textDirection = style.textDirection;
-  }
-  return *this;
-}
-
-VSDTextBlockStyle &VSDTextBlockStyle::operator=(const VSDTextBlockStyle &style)
-{
-  if (this != &style)
-  {
-    leftMargin = style.leftMargin;
-    rightMargin = style.rightMargin;
-    topMargin = style.topMargin;
-    bottomMargin = style.bottomMargin;
-    verticalAlign = style.verticalAlign;
-    isTextBkgndFilled = style.isTextBkgndFilled;
-    textBkgndColour = style.textBkgndColour;
-    defaultTabStop = style.defaultTabStop;
-    textDirection = style.textDirection;
-  }
-  return *this;
-}
-
 }
 
 libvisio::VSDStyles::VSDStyles() :
@@ -272,23 +72,6 @@ libvisio::VSDStyles::~VSDStyles()
 {
 }
 
-libvisio::VSDStyles &libvisio::VSDStyles::operator=(const libvisio::VSDStyles &styles)
-{
-  if (this != &styles)
-  {
-    m_lineStyles = styles.m_lineStyles;
-    m_fillStyles = styles.m_fillStyles;
-    m_textBlockStyles = styles.m_textBlockStyles;
-    m_charStyles = styles.m_charStyles;
-    m_paraStyles = styles.m_paraStyles;
-
-    m_lineStyleMasters = styles.m_lineStyleMasters;
-    m_fillStyleMasters = styles.m_fillStyleMasters;
-    m_textStyleMasters = styles.m_textStyleMasters;
-  }
-  return *this;
-}
-
 void libvisio::VSDStyles::addLineStyle(unsigned lineStyleIndex, const VSDOptionalLineStyle &lineStyle)
 {
   m_lineStyles[lineStyleIndex] = lineStyle;
diff --git a/src/lib/VSDStyles.h b/src/lib/VSDStyles.h
index 894bbd2..6a68598 100644
--- a/src/lib/VSDStyles.h
+++ b/src/lib/VSDStyles.h
@@ -37,7 +37,7 @@ struct VSDOptionalLineStyle
     endMarker(style.endMarker), cap(style.cap), rounding(style.rounding), qsLineColour(style.qsLineColour),
     qsLineMatrix(style.qsLineMatrix) {}
   ~VSDOptionalLineStyle() {}
-  VSDOptionalLineStyle &operator=(const VSDOptionalLineStyle &style);
+  VSDOptionalLineStyle &operator=(const VSDOptionalLineStyle &style) = default;
   void override(const VSDOptionalLineStyle &style)
   {
     ASSIGN_OPTIONAL(style.width, width);
@@ -77,7 +77,7 @@ struct VSDLineStyle
     rounding(style.rounding), qsLineColour(style.qsLineColour),
     qsLineMatrix(style.qsLineMatrix) {}
   ~VSDLineStyle() {}
-  VSDLineStyle &operator=(const VSDLineStyle &style);
+  VSDLineStyle &operator=(const VSDLineStyle &style) = default;
   void override(const VSDOptionalLineStyle &style, const VSDXTheme *theme)
   {
     ASSIGN_OPTIONAL(style.width, width);
@@ -130,7 +130,7 @@ struct VSDOptionalFillStyle
     qsFillColour(style.qsFillColour), qsShadowColour(style.qsShadowColour),
     qsFillMatrix(style.qsFillMatrix) {}
   ~VSDOptionalFillStyle() {}
-  VSDOptionalFillStyle &operator=(const VSDOptionalFillStyle &style);
+  VSDOptionalFillStyle &operator=(const VSDOptionalFillStyle &style) = default;
   void override(const VSDOptionalFillStyle &style)
   {
     ASSIGN_OPTIONAL(style.pattern, pattern);
@@ -181,7 +181,7 @@ struct VSDFillStyle
     qsFillColour(style.qsFillColour), qsShadowColour(style.qsShadowColour),
     qsFillMatrix(style.qsFillMatrix) {}
   ~VSDFillStyle() {}
-  VSDFillStyle &operator=(const VSDFillStyle &style);
+  VSDFillStyle &operator=(const VSDFillStyle &style) = default;
   void override(const VSDOptionalFillStyle &style, const VSDXTheme *theme)
   {
     ASSIGN_OPTIONAL(style.pattern, pattern);
@@ -251,7 +251,7 @@ struct VSDOptionalCharStyle
     allcaps(style.allcaps), initcaps(style.initcaps), smallcaps(style.smallcaps),
     superscript(style.superscript), subscript(style.subscript), scaleWidth(style.scaleWidth) {}
   ~VSDOptionalCharStyle() {}
-  VSDOptionalCharStyle &operator=(const VSDOptionalCharStyle &style);
+  VSDOptionalCharStyle &operator=(const VSDOptionalCharStyle &style) = default;
   void override(const VSDOptionalCharStyle &style)
   {
     ASSIGN_OPTIONAL(style.font, font);
@@ -313,7 +313,7 @@ struct VSDCharStyle
     smallcaps(style.smallcaps), superscript(style.superscript),
     subscript(style.subscript), scaleWidth(style.scaleWidth) {}
   ~VSDCharStyle() {}
-  VSDCharStyle &operator=(const VSDCharStyle &style);
+  VSDCharStyle &operator=(const VSDCharStyle &style) = default;
   void override(const VSDOptionalCharStyle &style, const VSDXTheme * /* theme */)
   {
     ASSIGN_OPTIONAL(style.font, font);
@@ -373,7 +373,7 @@ struct VSDOptionalParaStyle
     bulletFontSize(style.bulletFontSize), textPosAfterBullet(style.textPosAfterBullet),
     flags(style.flags) {}
   ~VSDOptionalParaStyle() {}
-  VSDOptionalParaStyle &operator=(const VSDOptionalParaStyle &style);
+  VSDOptionalParaStyle &operator=(const VSDOptionalParaStyle &style) = default;
   void override(const VSDOptionalParaStyle &style)
   {
     ASSIGN_OPTIONAL(style.indFirst, indFirst);
@@ -423,7 +423,7 @@ struct VSDParaStyle
     bullet(style.bullet), bulletStr(style.bulletStr), bulletFont(style.bulletFont),
     bulletFontSize(style.bulletFontSize), textPosAfterBullet(style.textPosAfterBullet), flags(style.flags) {}
   ~VSDParaStyle() {}
-  VSDParaStyle &operator=(const VSDParaStyle &style);
+  VSDParaStyle &operator=(const VSDParaStyle &style) = default;
   void override(const VSDOptionalParaStyle &style, const VSDXTheme * /* theme */)
   {
     ASSIGN_OPTIONAL(style.indFirst, indFirst);
@@ -475,7 +475,7 @@ struct VSDOptionalTextBlockStyle
     isTextBkgndFilled(style.isTextBkgndFilled), textBkgndColour(style.textBkgndColour),
     defaultTabStop(style.defaultTabStop), textDirection(style.textDirection) {}
   ~VSDOptionalTextBlockStyle() {}
-  VSDOptionalTextBlockStyle &operator=(const VSDOptionalTextBlockStyle &style);
+  VSDOptionalTextBlockStyle &operator=(const VSDOptionalTextBlockStyle &style) = default;
   void override(const VSDOptionalTextBlockStyle &style)
   {
     ASSIGN_OPTIONAL(style.leftMargin, leftMargin);
@@ -514,7 +514,7 @@ struct VSDTextBlockStyle
     bottomMargin(style.bottomMargin), verticalAlign(style.verticalAlign), isTextBkgndFilled(style.isTextBkgndFilled),
     textBkgndColour(style.textBkgndColour), defaultTabStop(style.defaultTabStop), textDirection(style.textDirection) {}
   ~VSDTextBlockStyle() {}
-  VSDTextBlockStyle &operator=(const VSDTextBlockStyle &style);
+  VSDTextBlockStyle &operator=(const VSDTextBlockStyle &style) = default;
   void override(const VSDOptionalTextBlockStyle &style, const VSDXTheme * /* theme */)
   {
     ASSIGN_OPTIONAL(style.leftMargin, leftMargin);
@@ -545,7 +545,7 @@ public:
   VSDStyles();
   VSDStyles(const VSDStyles &styles);
   ~VSDStyles();
-  VSDStyles &operator=(const VSDStyles &styles);
+  VSDStyles &operator=(const VSDStyles &styles) = default;
   void addLineStyle(unsigned lineStyleIndex, const VSDOptionalLineStyle &lineStyle);
   void addFillStyle(unsigned fillStyleIndex, const VSDOptionalFillStyle &fillStyle);
   void addTextBlockStyle(unsigned textStyleIndex, const VSDOptionalTextBlockStyle &textBlockStyle);
diff --git a/src/lib/VSDTypes.cpp b/src/lib/VSDTypes.cpp
deleted file mode 100644
index e7ddc6e..0000000
--- a/src/lib/VSDTypes.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/*
- * This file is part of the libvisio project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#include "VSDTypes.h"
-
-namespace libvisio
-{
-
-XForm &XForm::operator=(const XForm &xform)
-{
-  if (this != &xform)
-  {
-    pinX = xform.pinX;
-    pinY = xform.pinY;
-    height = xform.height;
-    width = xform.width;
-    pinLocX = xform.pinLocX;
-    pinLocY = xform.pinLocY;
-    angle = xform.angle;
-    flipX = xform.flipX;
-    flipY = xform.flipY;
-    x = xform.x;
-    y = xform.y;
-  }
-  return *this;
-}
-
-NURBSData &NURBSData::operator=(const NURBSData &data)
-{
-  if (this != &data)
-  {
-    lastKnot = data.lastKnot;
-    degree = data.degree;
-    xType = data.xType;
-    yType = data.yType;
-    knots = data.knots;
-    weights = data.weights;
-    points = data.points;
-  }
-  return *this;
-}
-
-VSDName &VSDName::operator=(const VSDName &name)
-{
-  if (this != &name)
-  {
-    m_data = name.m_data;
-    m_format = name.m_format;
-  }
-  return *this;
-}
-
-VSDMisc &VSDMisc::operator=(const VSDMisc &misc)
-{
-  if (this != &misc)
-    m_hideText = misc.m_hideText;
-  return *this;
-}
-
-VSDBullet &VSDBullet::operator=(const VSDBullet &bullet)
-{
-  if (this != &bullet)
-  {
-    m_bulletStr = bullet.m_bulletStr;
-    m_bulletFont = bullet.m_bulletFont;
-    m_bulletFontSize = bullet.m_bulletFontSize;
-    m_textPosAfterBullet = bullet.m_textPosAfterBullet;
-  }
-  return *this;
-}
-
-} // namespace libvisio
-
-/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
diff --git a/src/lib/VSDTypes.h b/src/lib/VSDTypes.h
index 83be800..6628edc 100644
--- a/src/lib/VSDTypes.h
+++ b/src/lib/VSDTypes.h
@@ -38,7 +38,7 @@ struct XForm
   XForm(const XForm &xform) : pinX(xform.pinX), pinY(xform.pinY), height(xform.height),
     width(xform.width), pinLocX(xform.pinLocX), pinLocY(xform.pinLocY), angle(xform.angle),
     flipX(xform.flipX), flipY(xform.flipY), x(xform.x), y(xform.y) {}
-  XForm &operator=(const XForm &xform);
+  XForm &operator=(const XForm &xform) = default;
 };
 
 struct XForm1D
@@ -117,7 +117,7 @@ struct NURBSData
       knots(data.knots),
       weights(data.weights),
       points(data.points) {}
-  NURBSData &operator=(const NURBSData &data);
+  NURBSData &operator=(const NURBSData &data) = default;
 };
 
 struct PolylineData
@@ -184,7 +184,7 @@ public:
       m_format(format) {}
   VSDName() : m_data(), m_format(VSD_TEXT_ANSI) {}
   VSDName(const VSDName &name) : m_data(name.m_data), m_format(name.m_format) {}
-  VSDName &operator=(const VSDName &name);
+  VSDName &operator=(const VSDName &name) = default;
   bool empty() const
   {
     return !m_data.size();
@@ -214,7 +214,7 @@ struct VSDMisc
   bool m_hideText;
   VSDMisc() : m_hideText(false) {}
   VSDMisc(const VSDMisc &misc) : m_hideText(misc.m_hideText) {}
-  VSDMisc &operator=(const VSDMisc &misc);
+  VSDMisc &operator=(const VSDMisc &misc) = default;
 };
 
 struct VSDTabStop
@@ -253,7 +253,7 @@ struct VSDBullet
     m_bulletFont(bullet.m_bulletFont),
     m_bulletFontSize(bullet.m_bulletFontSize),
     m_textPosAfterBullet(bullet.m_textPosAfterBullet) {}
-  VSDBullet &operator=(const VSDBullet &bullet);
+  VSDBullet &operator=(const VSDBullet &bullet) = default;
   inline bool operator==(const VSDBullet &bullet) const
   {
     return ((m_bulletStr == bullet.m_bulletStr) &&
commit 75360a312918780ed5e34a44e3b8b0da5716c5bc
Author:     David Tardon <dtardon at redhat.com>
AuthorDate: Sun Aug 4 18:39:27 2019 +0200
Commit:     David Tardon <dtardon at redhat.com>
CommitDate: Sun Aug 4 18:39:27 2019 +0200

    un-constify return value of operator=
    
    Change-Id: Ib72d1f92e6b080e5c2dd17cc57b2c7f48c917a77

diff --git a/src/lib/VSDParser.cpp b/src/lib/VSDParser.cpp
index 5ad8aa3..2305c79 100644
--- a/src/lib/VSDParser.cpp
+++ b/src/lib/VSDParser.cpp
@@ -26,7 +26,7 @@
 namespace libvisio
 {
 
-const Pointer &Pointer::operator=(const Pointer &ptr)
+Pointer &Pointer::operator=(const Pointer &ptr)
 {
   if (this != &ptr)
   {
diff --git a/src/lib/VSDParser.h b/src/lib/VSDParser.h
index e8fd64c..827ea6e 100644
--- a/src/lib/VSDParser.h
+++ b/src/lib/VSDParser.h
@@ -37,7 +37,7 @@ struct Pointer
     : Type(0), Offset(0), Length(0), Format(0), ListSize(0) {}
   Pointer(const Pointer &ptr)
     : Type(ptr.Type), Offset(ptr.Offset), Length(ptr.Length), Format(ptr.Format), ListSize(ptr.ListSize) {}
-  const Pointer &operator=(const Pointer &ptr);
+  Pointer &operator=(const Pointer &ptr);
   unsigned Type;
   unsigned Offset;
   unsigned Length;
diff --git a/src/lib/VSDStyles.cpp b/src/lib/VSDStyles.cpp
index c04ea1a..88c0169 100644
--- a/src/lib/VSDStyles.cpp
+++ b/src/lib/VSDStyles.cpp
@@ -53,7 +53,7 @@ T getOptionalStyle(const std::map<unsigned, unsigned> &styleMasters, const std::
 
 }
 
-const VSDOptionalLineStyle &VSDOptionalLineStyle::operator=(const VSDOptionalLineStyle &style)
+VSDOptionalLineStyle &VSDOptionalLineStyle::operator=(const VSDOptionalLineStyle &style)
 {
   if (this != &style)
   {
@@ -70,7 +70,7 @@ const VSDOptionalLineStyle &VSDOptionalLineStyle::operator=(const VSDOptionalLin
   return *this;
 }
 
-const VSDLineStyle &VSDLineStyle::operator=(const VSDLineStyle &style)
+VSDLineStyle &VSDLineStyle::operator=(const VSDLineStyle &style)
 {
   if (this != &style)
   {
@@ -87,7 +87,7 @@ const VSDLineStyle &VSDLineStyle::operator=(const VSDLineStyle &style)
   return *this;
 }
 
-const VSDOptionalFillStyle &VSDOptionalFillStyle::operator=(const VSDOptionalFillStyle &style)
+VSDOptionalFillStyle &VSDOptionalFillStyle::operator=(const VSDOptionalFillStyle &style)
 {
   if (this != &style)
   {
@@ -107,7 +107,7 @@ const VSDOptionalFillStyle &VSDOptionalFillStyle::operator=(const VSDOptionalFil
   return *this;
 }
 
-const VSDFillStyle &VSDFillStyle::operator=(const VSDFillStyle &style)
+VSDFillStyle &VSDFillStyle::operator=(const VSDFillStyle &style)
 {
   if (this != &style)
   {
@@ -127,7 +127,7 @@ const VSDFillStyle &VSDFillStyle::operator=(const VSDFillStyle &style)
   return *this;
 }
 
-const VSDOptionalCharStyle &VSDOptionalCharStyle::operator=(const VSDOptionalCharStyle &style)
+VSDOptionalCharStyle &VSDOptionalCharStyle::operator=(const VSDOptionalCharStyle &style)
 {
   if (this != &style)
   {
@@ -151,7 +151,7 @@ const VSDOptionalCharStyle &VSDOptionalCharStyle::operator=(const VSDOptionalCha
   return *this;
 }
 
-const VSDCharStyle &VSDCharStyle::operator=(const VSDCharStyle &style)
+VSDCharStyle &VSDCharStyle::operator=(const VSDCharStyle &style)
 {
   if (this != &style)
   {
@@ -175,7 +175,7 @@ const VSDCharStyle &VSDCharStyle::operator=(const VSDCharStyle &style)
   return *this;
 }
 
-const VSDOptionalParaStyle &VSDOptionalParaStyle::operator=(const VSDOptionalParaStyle &style)
+VSDOptionalParaStyle &VSDOptionalParaStyle::operator=(const VSDOptionalParaStyle &style)
 {
   if (this != &style)
   {
@@ -197,7 +197,7 @@ const VSDOptionalParaStyle &VSDOptionalParaStyle::operator=(const VSDOptionalPar
   return *this;
 }
 
-const VSDParaStyle &VSDParaStyle::operator=(const VSDParaStyle &style)
+VSDParaStyle &VSDParaStyle::operator=(const VSDParaStyle &style)
 {
   if (this != &style)
   {
@@ -219,7 +219,7 @@ const VSDParaStyle &VSDParaStyle::operator=(const VSDParaStyle &style)
   return *this;
 }
 
-const VSDOptionalTextBlockStyle &VSDOptionalTextBlockStyle::operator=(const VSDOptionalTextBlockStyle &style)
+VSDOptionalTextBlockStyle &VSDOptionalTextBlockStyle::operator=(const VSDOptionalTextBlockStyle &style)
 {
   if (this != &style)
   {
@@ -236,7 +236,7 @@ const VSDOptionalTextBlockStyle &VSDOptionalTextBlockStyle::operator=(const VSDO
   return *this;
 }
 
-const VSDTextBlockStyle &VSDTextBlockStyle::operator=(const VSDTextBlockStyle &style)
+VSDTextBlockStyle &VSDTextBlockStyle::operator=(const VSDTextBlockStyle &style)
 {
   if (this != &style)
   {
diff --git a/src/lib/VSDStyles.h b/src/lib/VSDStyles.h
index dc229af..894bbd2 100644
--- a/src/lib/VSDStyles.h
+++ b/src/lib/VSDStyles.h
@@ -37,7 +37,7 @@ struct VSDOptionalLineStyle
     endMarker(style.endMarker), cap(style.cap), rounding(style.rounding), qsLineColour(style.qsLineColour),
     qsLineMatrix(style.qsLineMatrix) {}
   ~VSDOptionalLineStyle() {}
-  const VSDOptionalLineStyle &operator=(const VSDOptionalLineStyle &style);
+  VSDOptionalLineStyle &operator=(const VSDOptionalLineStyle &style);
   void override(const VSDOptionalLineStyle &style)
   {
     ASSIGN_OPTIONAL(style.width, width);
@@ -77,7 +77,7 @@ struct VSDLineStyle
     rounding(style.rounding), qsLineColour(style.qsLineColour),
     qsLineMatrix(style.qsLineMatrix) {}
   ~VSDLineStyle() {}
-  const VSDLineStyle &operator=(const VSDLineStyle &style);
+  VSDLineStyle &operator=(const VSDLineStyle &style);
   void override(const VSDOptionalLineStyle &style, const VSDXTheme *theme)
   {
     ASSIGN_OPTIONAL(style.width, width);
@@ -130,7 +130,7 @@ struct VSDOptionalFillStyle
     qsFillColour(style.qsFillColour), qsShadowColour(style.qsShadowColour),
     qsFillMatrix(style.qsFillMatrix) {}
   ~VSDOptionalFillStyle() {}
-  const VSDOptionalFillStyle &operator=(const VSDOptionalFillStyle &style);
+  VSDOptionalFillStyle &operator=(const VSDOptionalFillStyle &style);
   void override(const VSDOptionalFillStyle &style)
   {
     ASSIGN_OPTIONAL(style.pattern, pattern);
@@ -181,7 +181,7 @@ struct VSDFillStyle
     qsFillColour(style.qsFillColour), qsShadowColour(style.qsShadowColour),
     qsFillMatrix(style.qsFillMatrix) {}
   ~VSDFillStyle() {}
-  const VSDFillStyle &operator=(const VSDFillStyle &style);
+  VSDFillStyle &operator=(const VSDFillStyle &style);
   void override(const VSDOptionalFillStyle &style, const VSDXTheme *theme)
   {
     ASSIGN_OPTIONAL(style.pattern, pattern);
@@ -251,7 +251,7 @@ struct VSDOptionalCharStyle
     allcaps(style.allcaps), initcaps(style.initcaps), smallcaps(style.smallcaps),
     superscript(style.superscript), subscript(style.subscript), scaleWidth(style.scaleWidth) {}
   ~VSDOptionalCharStyle() {}
-  const VSDOptionalCharStyle &operator=(const VSDOptionalCharStyle &style);
+  VSDOptionalCharStyle &operator=(const VSDOptionalCharStyle &style);
   void override(const VSDOptionalCharStyle &style)
   {
     ASSIGN_OPTIONAL(style.font, font);
@@ -313,7 +313,7 @@ struct VSDCharStyle
     smallcaps(style.smallcaps), superscript(style.superscript),
     subscript(style.subscript), scaleWidth(style.scaleWidth) {}
   ~VSDCharStyle() {}
-  const VSDCharStyle &operator=(const VSDCharStyle &style);
+  VSDCharStyle &operator=(const VSDCharStyle &style);
   void override(const VSDOptionalCharStyle &style, const VSDXTheme * /* theme */)
   {
     ASSIGN_OPTIONAL(style.font, font);
@@ -373,7 +373,7 @@ struct VSDOptionalParaStyle
     bulletFontSize(style.bulletFontSize), textPosAfterBullet(style.textPosAfterBullet),
     flags(style.flags) {}
   ~VSDOptionalParaStyle() {}
-  const VSDOptionalParaStyle &operator=(const VSDOptionalParaStyle &style);
+  VSDOptionalParaStyle &operator=(const VSDOptionalParaStyle &style);
   void override(const VSDOptionalParaStyle &style)
   {
     ASSIGN_OPTIONAL(style.indFirst, indFirst);
@@ -423,7 +423,7 @@ struct VSDParaStyle
     bullet(style.bullet), bulletStr(style.bulletStr), bulletFont(style.bulletFont),
     bulletFontSize(style.bulletFontSize), textPosAfterBullet(style.textPosAfterBullet), flags(style.flags) {}
   ~VSDParaStyle() {}
-  const VSDParaStyle &operator=(const VSDParaStyle &style);
+  VSDParaStyle &operator=(const VSDParaStyle &style);
   void override(const VSDOptionalParaStyle &style, const VSDXTheme * /* theme */)
   {
     ASSIGN_OPTIONAL(style.indFirst, indFirst);
@@ -475,7 +475,7 @@ struct VSDOptionalTextBlockStyle
     isTextBkgndFilled(style.isTextBkgndFilled), textBkgndColour(style.textBkgndColour),
     defaultTabStop(style.defaultTabStop), textDirection(style.textDirection) {}
   ~VSDOptionalTextBlockStyle() {}
-  const VSDOptionalTextBlockStyle &operator=(const VSDOptionalTextBlockStyle &style);
+  VSDOptionalTextBlockStyle &operator=(const VSDOptionalTextBlockStyle &style);
   void override(const VSDOptionalTextBlockStyle &style)
   {
     ASSIGN_OPTIONAL(style.leftMargin, leftMargin);
@@ -514,7 +514,7 @@ struct VSDTextBlockStyle
     bottomMargin(style.bottomMargin), verticalAlign(style.verticalAlign), isTextBkgndFilled(style.isTextBkgndFilled),
     textBkgndColour(style.textBkgndColour), defaultTabStop(style.defaultTabStop), textDirection(style.textDirection) {}
   ~VSDTextBlockStyle() {}
-  const VSDTextBlockStyle &operator=(const VSDTextBlockStyle &style);
+  VSDTextBlockStyle &operator=(const VSDTextBlockStyle &style);
   void override(const VSDOptionalTextBlockStyle &style, const VSDXTheme * /* theme */)
   {
     ASSIGN_OPTIONAL(style.leftMargin, leftMargin);
diff --git a/src/lib/VSDTypes.cpp b/src/lib/VSDTypes.cpp
index 7b75fac..e7ddc6e 100644
--- a/src/lib/VSDTypes.cpp
+++ b/src/lib/VSDTypes.cpp
@@ -12,7 +12,7 @@
 namespace libvisio
 {
 
-const XForm &XForm::operator=(const XForm &xform)
+XForm &XForm::operator=(const XForm &xform)
 {
   if (this != &xform)
   {
@@ -31,7 +31,7 @@ const XForm &XForm::operator=(const XForm &xform)
   return *this;
 }
 
-const NURBSData &NURBSData::operator=(const NURBSData &data)
+NURBSData &NURBSData::operator=(const NURBSData &data)
 {
   if (this != &data)
   {
@@ -46,7 +46,7 @@ const NURBSData &NURBSData::operator=(const NURBSData &data)
   return *this;
 }
 
-const VSDName &VSDName::operator=(const VSDName &name)
+VSDName &VSDName::operator=(const VSDName &name)
 {
   if (this != &name)
   {
@@ -56,14 +56,14 @@ const VSDName &VSDName::operator=(const VSDName &name)
   return *this;
 }
 
-const VSDMisc &VSDMisc::operator=(const VSDMisc &misc)
+VSDMisc &VSDMisc::operator=(const VSDMisc &misc)
 {
   if (this != &misc)
     m_hideText = misc.m_hideText;
   return *this;
 }
 
-const VSDBullet &VSDBullet::operator=(const VSDBullet &bullet)
+VSDBullet &VSDBullet::operator=(const VSDBullet &bullet)
 {
   if (this != &bullet)
   {
diff --git a/src/lib/VSDTypes.h b/src/lib/VSDTypes.h
index 75b9fdd..83be800 100644
--- a/src/lib/VSDTypes.h
+++ b/src/lib/VSDTypes.h
@@ -38,7 +38,7 @@ struct XForm
   XForm(const XForm &xform) : pinX(xform.pinX), pinY(xform.pinY), height(xform.height),
     width(xform.width), pinLocX(xform.pinLocX), pinLocY(xform.pinLocY), angle(xform.angle),
     flipX(xform.flipX), flipY(xform.flipY), x(xform.x), y(xform.y) {}
-  const XForm &operator=(const XForm &xform);
+  XForm &operator=(const XForm &xform);
 };
 
 struct XForm1D
@@ -117,7 +117,7 @@ struct NURBSData
       knots(data.knots),
       weights(data.weights),
       points(data.points) {}
-  const NURBSData &operator=(const NURBSData &data);
+  NURBSData &operator=(const NURBSData &data);
 };
 
 struct PolylineData
@@ -184,7 +184,7 @@ public:
       m_format(format) {}
   VSDName() : m_data(), m_format(VSD_TEXT_ANSI) {}
   VSDName(const VSDName &name) : m_data(name.m_data), m_format(name.m_format) {}
-  const VSDName &operator=(const VSDName &name);
+  VSDName &operator=(const VSDName &name);
   bool empty() const
   {
     return !m_data.size();
@@ -214,7 +214,7 @@ struct VSDMisc
   bool m_hideText;
   VSDMisc() : m_hideText(false) {}
   VSDMisc(const VSDMisc &misc) : m_hideText(misc.m_hideText) {}
-  const VSDMisc &operator=(const VSDMisc &misc);
+  VSDMisc &operator=(const VSDMisc &misc);
 };
 
 struct VSDTabStop
@@ -253,7 +253,7 @@ struct VSDBullet
     m_bulletFont(bullet.m_bulletFont),
     m_bulletFontSize(bullet.m_bulletFontSize),
     m_textPosAfterBullet(bullet.m_textPosAfterBullet) {}
-  const VSDBullet &operator=(const VSDBullet &bullet);
+  VSDBullet &operator=(const VSDBullet &bullet);
   inline bool operator==(const VSDBullet &bullet) const
   {
     return ((m_bulletStr == bullet.m_bulletStr) &&


More information about the Libreoffice-commits mailing list