From 60c22fc853d7db4ff3ffc1661202fb3db537dbd7 Mon Sep 17 00:00:00 2001 From: David Tardon 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(prop); + m_propMap.put(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(IWORK_BASELINE_SUPER); break; case 2 : - prop = IWORK_BASELINE_SUB; + m_propMap.put(IWORK_BASELINE_SUB); break; default : ETONYEK_DEBUG_MSG(("unknown superscript %d\n", get(m_superscript))); } - - m_propMap.put(prop); } } -- 1.9.3