summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-08-19 08:40:20 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-08-19 08:40:54 +0100
commit28df98abeca9774868cadef29b81559fd325d865 (patch)
tree7913f0b7588c893ca3004fabc42ff7a03a114e86
parent7b33dbb25394a88b8eb2c826d951ce578605e895 (diff)
empty m_aStates
valgrind + bff Change-Id: I7b45e10471de77bd0481adf0bccdbf852c36d815
-rw-r--r--writerfilter/qa/cppunittests/rtftok/data/pass/sf_508f4e169fb76c80745d3541bd01b0a2-73462-minimized.rtfbin0 -> 11289 bytes
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx23
2 files changed, 13 insertions, 10 deletions
diff --git a/writerfilter/qa/cppunittests/rtftok/data/pass/sf_508f4e169fb76c80745d3541bd01b0a2-73462-minimized.rtf b/writerfilter/qa/cppunittests/rtftok/data/pass/sf_508f4e169fb76c80745d3541bd01b0a2-73462-minimized.rtf
new file mode 100644
index 000000000000..e8e27ee7d637
--- /dev/null
+++ b/writerfilter/qa/cppunittests/rtftok/data/pass/sf_508f4e169fb76c80745d3541bd01b0a2-73462-minimized.rtf
Binary files differ
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 3cbc6385a509..f2bea77fa970 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -5743,16 +5743,19 @@ int RTFDocumentImpl::popState()
case DESTINATION_FLYMAINCONTENT:
case DESTINATION_SHPPICT:
case DESTINATION_SHAPE:
- m_aStates.top().aFrame = aState.aFrame;
- if (aState.nDestinationState == DESTINATION_SHPPICT && !m_aStates.empty() && m_aStates.top().nDestinationState == DESTINATION_LISTPICTURE)
+ if (!m_aStates.empty())
{
- RTFSprms aAttributes;
- aAttributes.set(NS_ooxml::LN_CT_NumPicBullet_numPicBulletId, RTFValue::Pointer_t(new RTFValue(m_nListPictureId++)));
- RTFSprms aSprms;
- // Dummy value, real picture is already sent to dmapper.
- aSprms.set(NS_ooxml::LN_CT_NumPicBullet_pict, RTFValue::Pointer_t(new RTFValue(0)));
- RTFValue::Pointer_t pValue(new RTFValue(aAttributes, aSprms));
- m_aListTableSprms.set(NS_ooxml::LN_CT_Numbering_numPicBullet, pValue, OVERWRITE_NO_APPEND);
+ m_aStates.top().aFrame = aState.aFrame;
+ if (aState.nDestinationState == DESTINATION_SHPPICT && m_aStates.top().nDestinationState == DESTINATION_LISTPICTURE)
+ {
+ RTFSprms aAttributes;
+ aAttributes.set(NS_ooxml::LN_CT_NumPicBullet_numPicBulletId, RTFValue::Pointer_t(new RTFValue(m_nListPictureId++)));
+ RTFSprms aSprms;
+ // Dummy value, real picture is already sent to dmapper.
+ aSprms.set(NS_ooxml::LN_CT_NumPicBullet_pict, RTFValue::Pointer_t(new RTFValue(0)));
+ RTFValue::Pointer_t pValue(new RTFValue(aAttributes, aSprms));
+ m_aListTableSprms.set(NS_ooxml::LN_CT_Numbering_numPicBullet, pValue, OVERWRITE_NO_APPEND);
+ }
}
break;
case DESTINATION_SHAPETEXT:
@@ -5780,7 +5783,7 @@ int RTFDocumentImpl::popState()
break;
default:
{
- if (m_aStates.size() && m_aStates.top().nDestinationState == DESTINATION_PICT)
+ if (!m_aStates.empty() && m_aStates.top().nDestinationState == DESTINATION_PICT)
m_aStates.top().aPicture = aState.aPicture;
}
break;