summaryrefslogtreecommitdiff
path: root/libvisio
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2011-10-23 03:21:35 +0200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2011-10-23 03:25:21 +0200
commit7420da1e95f394d4f0e97ddf14a8886da991bfe0 (patch)
tree7401278287dd503ae87f836cddcdd56bc6831eda /libvisio
parentffcc6a284a2907bb33c96423f86e12a8d5e86d32 (diff)
Fix valgrind errors
Diffstat (limited to 'libvisio')
-rw-r--r--libvisio/libvisio-0.0.9-valgrind.patch190
-rw-r--r--libvisio/makefile.mk1
2 files changed, 191 insertions, 0 deletions
diff --git a/libvisio/libvisio-0.0.9-valgrind.patch b/libvisio/libvisio-0.0.9-valgrind.patch
new file mode 100644
index 000000000000..39442a91918c
--- /dev/null
+++ b/libvisio/libvisio-0.0.9-valgrind.patch
@@ -0,0 +1,190 @@
+--- misc/libvisio-0.0.9/src/lib/VSDXStyles.cpp 2011-10-22 15:25:55.000000000 +0200
++++ misc/build/libvisio-0.0.9/src/lib/VSDXStyles.cpp 2011-10-23 03:18:45.209282989 +0200
+@@ -37,8 +37,151 @@
+ {
+ }
+
++libvisio::VSDXStyles::VSDXStyles(const libvisio::VSDXStyles &styles) :
++ m_lineStyles(), m_fillStyles(), m_textBlockStyles(), m_charStyles(), m_paraStyles(),
++ m_lineStyleMasters(styles.m_lineStyleMasters), m_fillStyleMasters(styles.m_fillStyleMasters),
++ m_textStyleMasters(styles.m_textStyleMasters)
++{
++ for (std::map<unsigned, VSDXFillStyle *>::const_iterator iterFillStyle = styles.m_fillStyles.begin();
++ iterFillStyle != styles.m_fillStyles.end(); iterFillStyle++)
++ {
++ if (iterFillStyle->second)
++ m_fillStyles[iterFillStyle->first] = new VSDXFillStyle(*(iterFillStyle->second));
++ }
++ for (std::map<unsigned, VSDXLineStyle *>::const_iterator iterLineStyle = styles.m_lineStyles.begin();
++ iterLineStyle != styles.m_lineStyles.end(); iterLineStyle++)
++ {
++ if (iterLineStyle->second)
++ m_lineStyles[iterLineStyle->first] = new VSDXLineStyle(*(iterLineStyle->second));
++ }
++ for (std::map<unsigned, VSDXTextBlockStyle *>::const_iterator iterTextBlockStyle = styles.m_textBlockStyles.begin();
++ iterTextBlockStyle != styles.m_textBlockStyles.end(); iterTextBlockStyle++)
++ {
++ if (iterTextBlockStyle->second)
++ m_textBlockStyles[iterTextBlockStyle->first] = new VSDXTextBlockStyle(*(iterTextBlockStyle->second));
++ }
++ for (std::map<unsigned, VSDXCharStyle *>::const_iterator iterCharStyle = styles.m_charStyles.begin();
++ iterCharStyle != styles.m_charStyles.end(); iterCharStyle++)
++ {
++ if (iterCharStyle->second)
++ m_charStyles[iterCharStyle->first] = new VSDXCharStyle(*(iterCharStyle->second));
++ }
++ for (std::map<unsigned, VSDXParaStyle *>::const_iterator iterParaStyle = styles.m_paraStyles.begin();
++ iterParaStyle != styles.m_paraStyles.end(); iterParaStyle++)
++ {
++ if (iterParaStyle->second)
++ m_paraStyles[iterParaStyle->first] = new VSDXParaStyle(*(iterParaStyle->second));
++ }
++}
++
+ libvisio::VSDXStyles::~VSDXStyles()
+ {
++ for (std::map<unsigned, VSDXFillStyle *>::iterator iterFillStyle = m_fillStyles.begin();
++ iterFillStyle != m_fillStyles.end(); iterFillStyle++)
++ {
++ if (iterFillStyle->second)
++ delete iterFillStyle->second;
++ }
++ for (std::map<unsigned, VSDXLineStyle *>::iterator iterLineStyle = m_lineStyles.begin();
++ iterLineStyle != m_lineStyles.end(); iterLineStyle++)
++ {
++ if (iterLineStyle->second)
++ delete iterLineStyle->second;
++ }
++ for (std::map<unsigned, VSDXTextBlockStyle *>::iterator iterTextBlockStyle = m_textBlockStyles.begin();
++ iterTextBlockStyle != m_textBlockStyles.end(); iterTextBlockStyle++)
++ {
++ if (iterTextBlockStyle->second)
++ delete (iterTextBlockStyle->second);
++ }
++ for (std::map<unsigned, VSDXCharStyle *>::iterator iterCharStyle = m_charStyles.begin();
++ iterCharStyle != m_charStyles.end(); iterCharStyle++)
++ {
++ if (iterCharStyle->second)
++ delete (iterCharStyle->second);
++ }
++ for (std::map<unsigned, VSDXParaStyle *>::iterator iterParaStyle = m_paraStyles.begin();
++ iterParaStyle != m_paraStyles.end(); iterParaStyle++)
++ {
++ if (iterParaStyle->second)
++ delete iterParaStyle->second;
++ }
++}
++
++libvisio::VSDXStyles & libvisio::VSDXStyles::operator=(const libvisio::VSDXStyles &styles)
++{
++ for (std::map<unsigned, VSDXFillStyle *>::iterator iterFillStyle = m_fillStyles.begin();
++ iterFillStyle != m_fillStyles.end(); iterFillStyle++)
++ {
++ if (iterFillStyle->second)
++ delete iterFillStyle->second;
++ }
++ m_fillStyles.clear();
++ for (std::map<unsigned, VSDXLineStyle *>::iterator iterLineStyle = m_lineStyles.begin();
++ iterLineStyle != m_lineStyles.end(); iterLineStyle++)
++ {
++ if (iterLineStyle->second)
++ delete iterLineStyle->second;
++ }
++ m_lineStyles.clear();
++ for (std::map<unsigned, VSDXTextBlockStyle *>::iterator iterTextBlockStyle = m_textBlockStyles.begin();
++ iterTextBlockStyle != m_textBlockStyles.end(); iterTextBlockStyle++)
++ {
++ if (iterTextBlockStyle->second)
++ delete (iterTextBlockStyle->second);
++ }
++ m_textBlockStyles.clear();
++ for (std::map<unsigned, VSDXCharStyle *>::iterator iterCharStyle = m_charStyles.begin();
++ iterCharStyle != m_charStyles.end(); iterCharStyle++)
++ {
++ if (iterCharStyle->second)
++ delete (iterCharStyle->second);
++ }
++ m_charStyles.clear();
++ for (std::map<unsigned, VSDXParaStyle *>::iterator iterParaStyle = m_paraStyles.begin();
++ iterParaStyle != m_paraStyles.end(); iterParaStyle++)
++ {
++ if (iterParaStyle->second)
++ delete iterParaStyle->second;
++ }
++ m_paraStyles.clear();
++
++ for (std::map<unsigned, VSDXFillStyle *>::const_iterator iterFillStyle = styles.m_fillStyles.begin();
++ iterFillStyle != styles.m_fillStyles.end(); iterFillStyle++)
++ {
++ if (iterFillStyle->second)
++ m_fillStyles[iterFillStyle->first] = new VSDXFillStyle(*(iterFillStyle->second));
++ }
++ for (std::map<unsigned, VSDXLineStyle *>::const_iterator iterLineStyle = styles.m_lineStyles.begin();
++ iterLineStyle != styles.m_lineStyles.end(); iterLineStyle++)
++ {
++ if (iterLineStyle->second)
++ m_lineStyles[iterLineStyle->first] = new VSDXLineStyle(*(iterLineStyle->second));
++ }
++ for (std::map<unsigned, VSDXTextBlockStyle *>::const_iterator iterTextBlockStyle = styles.m_textBlockStyles.begin();
++ iterTextBlockStyle != styles.m_textBlockStyles.end(); iterTextBlockStyle++)
++ {
++ if (iterTextBlockStyle->second)
++ m_textBlockStyles[iterTextBlockStyle->first] = new VSDXTextBlockStyle(*(iterTextBlockStyle->second));
++ }
++ for (std::map<unsigned, VSDXCharStyle *>::const_iterator iterCharStyle = styles.m_charStyles.begin();
++ iterCharStyle != styles.m_charStyles.end(); iterCharStyle++)
++ {
++ if (iterCharStyle->second)
++ m_charStyles[iterCharStyle->first] = new VSDXCharStyle(*(iterCharStyle->second));
++ }
++ for (std::map<unsigned, VSDXParaStyle *>::const_iterator iterParaStyle = styles.m_paraStyles.begin();
++ iterParaStyle != styles.m_paraStyles.end(); iterParaStyle++)
++ {
++ if (iterParaStyle->second)
++ m_paraStyles[iterParaStyle->first] = new VSDXParaStyle(*(iterParaStyle->second));
++ }
++
++ m_lineStyleMasters = styles.m_lineStyleMasters;
++ m_fillStyleMasters = styles.m_fillStyleMasters;
++ m_textStyleMasters = styles.m_textStyleMasters;
++
++ return *this;
+ }
+
+ void libvisio::VSDXStyles::addLineStyle(unsigned lineStyleIndex, VSDXLineStyle *lineStyle)
+--- misc/libvisio-0.0.9/src/lib/VSDXStyles.h 2011-10-21 17:53:42.000000000 +0200
++++ misc/build/libvisio-0.0.9/src/lib/VSDXStyles.h 2011-10-23 03:18:45.209282989 +0200
+@@ -119,6 +119,7 @@
+ superscript(super),
+ subscript(sub),
+ face(f) {}
++ ~VSDXCharStyle() {}
+ unsigned charCount;
+ unsigned short faceID;
+ Colour colour;
+@@ -158,6 +159,7 @@
+ spBefore(sb),
+ spAfter(sa),
+ align(a) {}
++ ~VSDXParaStyle() {}
+ unsigned charCount;
+ double indFirst;
+ double indLeft;
+@@ -190,6 +192,7 @@
+ textBkgndColour(bgClr),
+ defaultTabStop(defTab),
+ textDirection(td) {}
++ ~VSDXTextBlockStyle() {}
+ double leftMargin;
+ double rightMargin;
+ double topMargin;
+@@ -205,7 +208,9 @@
+ {
+ public:
+ VSDXStyles();
++ VSDXStyles(const VSDXStyles &styles);
+ ~VSDXStyles();
++ VSDXStyles &operator=(const VSDXStyles &styles);
+ void addLineStyle(unsigned lineStyleIndex, VSDXLineStyle *lineStyle);
+ void addFillStyle(unsigned fillStyleIndex, VSDXFillStyle *fillStyle);
+ void addTextBlockStyle(unsigned textStyleIndex, VSDXTextBlockStyle *textBlockStyle);
diff --git a/libvisio/makefile.mk b/libvisio/makefile.mk
index f0bd586a9e72..a10a5bd99307 100644
--- a/libvisio/makefile.mk
+++ b/libvisio/makefile.mk
@@ -58,6 +58,7 @@ TARFILE_NAME=libvisio-0.0.9
TARFILE_MD5=6b44e084c84c721423bf855ebe674e76
PATCH_FILES=\
+ libvisio-0.0.9-valgrind.patch \
libvisio-0.0.9.patch