diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-05-05 22:05:46 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-05-10 21:37:25 +0200 |
commit | 3e0044057846819fe9a4836063e6ca70206329d5 (patch) | |
tree | 040891f2636e502808f74463b206cbb01d2817db /writerfilter/source | |
parent | ofz check against expected struct size (diff) | |
download | core-3e0044057846819fe9a4836063e6ca70206329d5.tar.gz core-3e0044057846819fe9a4836063e6ca70206329d5.zip |
tdf#104407 writerfilter: fix crash with null xRangeProperties
The m_xStartingRange is null at this point for whatever reason,
and the block immediately above this one already checks
xRangeProperties, so let's just do the same here. (Also IsNewDoc(),
where the logic between PageDescName and PageNumberOffset presumably
shouldn't differ?).
(started to crash with abaf6bde4ee91c628bd55a7ec2e876a5d0ecff6e
as previously that code was unreachable in RTF import)
Change-Id: I20539c3a753ecea357e556ea556c3c26983ce1d1
(cherry picked from commit e4da2e5dfa9e462e0d9c23a1a60caf4b3ef2dc56)
Reviewed-on: https://gerrit.libreoffice.org/37305
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 8521f4c8fb08aa37912f73a73ba1a34c2ccc97ed)
Diffstat (limited to 'writerfilter/source')
-rw-r--r-- | writerfilter/source/dmapper/PropertyMap.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index 0e7f0678aed3..ec79cb1ba653 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -1416,16 +1416,18 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) } if (xRangeProperties.is() && rDM_Impl.IsNewDoc()) + { xRangeProperties->setPropertyValue( getPropertyName( PROP_PAGE_DESC_NAME ), uno::makeAny( m_bTitlePage ? m_sFirstPageStyleName : m_sFollowPageStyleName )); - if(m_bPageNoRestart || m_nPageNumber >= 0) - { - sal_Int16 nPageNumber = m_nPageNumber >= 0 ? static_cast< sal_Int16 >(m_nPageNumber) : 1; - xRangeProperties->setPropertyValue(getPropertyName( PROP_PAGE_NUMBER_OFFSET ), - uno::makeAny( nPageNumber )); + if (m_bPageNoRestart || 0 <= m_nPageNumber) + { + sal_Int16 nPageNumber = m_nPageNumber >= 0 ? static_cast< sal_Int16 >(m_nPageNumber) : 1; + xRangeProperties->setPropertyValue(getPropertyName(PROP_PAGE_NUMBER_OFFSET), + uno::makeAny(nPageNumber)); + } } } } |