avoid uninitialized value

f41
David Tardon 10 years ago
parent 77ff6bf8c5
commit f2bd38b638

@ -0,0 +1,75 @@
From 60c22fc853d7db4ff3ffc1661202fb3db537dbd7 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Sat, 30 May 2015 15:19:32 +0200
Subject: [PATCH] avoid use of uninitialized value
Change-Id: I61c695ca8366ac366d3d450ef8e45cd4eba33fda
---
src/lib/contexts/IWORKPropertyMapElement.cpp | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/src/lib/contexts/IWORKPropertyMapElement.cpp b/src/lib/contexts/IWORKPropertyMapElement.cpp
index 6788137..5d94134 100644
--- a/src/lib/contexts/IWORKPropertyMapElement.cpp
+++ b/src/lib/contexts/IWORKPropertyMapElement.cpp
@@ -264,10 +264,10 @@ IWORKXMLContextPtr_t AlignmentElement::element(const int name)
void AlignmentElement::endOfElement()
{
- IWORKAlignment prop;
-
if (m_value)
{
+ IWORKAlignment prop(IWORK_ALIGNMENT_LEFT);
+
switch (get(m_value))
{
case 0 :
@@ -285,9 +285,9 @@ void AlignmentElement::endOfElement()
default :
ETONYEK_DEBUG_MSG(("unknown alignment %d\n", get(m_value)));
}
- }
- m_propMap.put<property::Alignment>(prop);
+ m_propMap.put<property::Alignment>(prop);
+ }
}
}
@@ -373,7 +373,8 @@ void CapitalizationElement::endOfElement()
{
if (m_capitalization)
{
- IWORKCapitalization prop;
+ IWORKCapitalization prop(IWORK_CAPITALIZATION_NONE);
+
switch (get(m_capitalization))
{
case 0 :
@@ -624,20 +625,17 @@ void SuperscriptElement::endOfElement()
{
if (m_superscript)
{
- IWORKBaseline prop;
switch (get(m_superscript))
{
case 1 :
- prop = IWORK_BASELINE_SUPER;
+ m_propMap.put<property::Baseline>(IWORK_BASELINE_SUPER);
break;
case 2 :
- prop = IWORK_BASELINE_SUB;
+ m_propMap.put<property::Baseline>(IWORK_BASELINE_SUB);
break;
default :
ETONYEK_DEBUG_MSG(("unknown superscript %d\n", get(m_superscript)));
}
-
- m_propMap.put<property::Baseline>(prop);
}
}
--
1.9.3

@ -22,6 +22,7 @@ BuildRequires: pkgconfig(zlib)
Patch0: 0001-fix-test-on-i386.patch
Patch1: 0001-add-missing-breaks.patch
Patch2: 0002-remove-surplus-breaks.patch
Patch3: 0001-avoid-use-of-uninitialized-value.patch
%description
%{name} is library for import of documents from Apple iWork applications

Loading…
Cancel
Save