[Libreoffice-commits] libvisio.git: src/lib
David Tardon
dtardon at redhat.com
Tue Apr 11 10:07:41 UTC 2017
src/lib/VSDFieldList.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
New commits:
commit d8ee1ffbf7b2918e927a96502fd182cfcf50e1f6
Author: David Tardon <dtardon at redhat.com>
Date: Fri Apr 7 16:10:38 2017 +0200
ofz#989 do not leak existing field with the same ID
Change-Id: Iac76df2ae09965732ae5fd42036fdb59886f071f
diff --git a/src/lib/VSDFieldList.cpp b/src/lib/VSDFieldList.cpp
index 3f436b4..2f470a5 100644
--- a/src/lib/VSDFieldList.cpp
+++ b/src/lib/VSDFieldList.cpp
@@ -216,12 +216,14 @@ void libvisio::VSDFieldList::addFieldList(unsigned id, unsigned level)
void libvisio::VSDFieldList::addTextField(unsigned id, unsigned level, int nameId, int formatStringId)
{
- m_elements[id] = new VSDTextField(id, level, nameId, formatStringId);
+ if (m_elements.find(id) == m_elements.end())
+ m_elements[id] = new VSDTextField(id, level, nameId, formatStringId);
}
void libvisio::VSDFieldList::addNumericField(unsigned id, unsigned level, unsigned short format, double number, int formatStringId)
{
- m_elements[id] = new VSDNumericField(id, level, format, number, formatStringId);
+ if (m_elements.find(id) == m_elements.end())
+ m_elements[id] = new VSDNumericField(id, level, format, number, formatStringId);
}
void libvisio::VSDFieldList::handle(VSDCollector *collector) const
More information about the Libreoffice-commits
mailing list