summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-09-06 15:57:30 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-09-08 15:34:31 +0000
commitf5bbdd05582a0a6fa9a3db399f97df18373215ad (patch)
treef8beb8eac91f3fb4e480dd384c5e2d2829ec1659
parent02b6a8ae5a0ad4ebb0c929ebf079e01eb76762f8 (diff)
fftester: missing ValueLast
Reviewed-on: https://gerrit.libreoffice.org/28693 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 30af3971d826d55426f51a7beb14c24ac3880250) Change-Id: I8e881871b1ae4dea757263d04796779e62e168dc Reviewed-on: https://gerrit.libreoffice.org/28712 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--writerfilter/qa/cppunittests/rtftok/data/pass/valuelist-1.rtfbin0 -> 1408 bytes
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx3
2 files changed, 2 insertions, 1 deletions
diff --git a/writerfilter/qa/cppunittests/rtftok/data/pass/valuelist-1.rtf b/writerfilter/qa/cppunittests/rtftok/data/pass/valuelist-1.rtf
new file mode 100644
index 000000000000..847e165c5dfa
--- /dev/null
+++ b/writerfilter/qa/cppunittests/rtftok/data/pass/valuelist-1.rtf
Binary files differ
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 8b2efd622b6d..1910baf9dd96 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2328,7 +2328,8 @@ RTFError RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
if ((m_nCellxMax - m_nTopLevelCurrentCellX) >= MINLAY)
{
auto pXValueLast = m_aStates.top().aTableRowSprms.find(NS_ooxml::LN_CT_TblGridBase_gridCol, false);
- auto pXValue = std::make_shared<RTFValue>(pXValueLast->getInt() + m_nCellxMax - m_nTopLevelCurrentCellX);
+ const int nXValueLast = pXValueLast ? pXValueLast->getInt() : 0;
+ auto pXValue = std::make_shared<RTFValue>(nXValueLast + m_nCellxMax - m_nTopLevelCurrentCellX);
m_aStates.top().aTableRowSprms.eraseLast(NS_ooxml::LN_CT_TblGridBase_gridCol);
m_aStates.top().aTableRowSprms.set(NS_ooxml::LN_CT_TblGridBase_gridCol, pXValue, RTFOverwrite::NO_APPEND);
m_nTopLevelCurrentCellX = m_nCellxMax;