From 3943147ab341f1e4d1c6db34405010085488b0b1 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Fri, 9 Sep 2016 13:00:24 +0300 Subject: tdf#86926 writerfilter prevent PROP_GRID_LINES exception Ensure that only values accepted by MID_GRID_LINES will be inserted, otherwise an exception can be thrown. Change-Id: I7bac5d502034e073d2d9071af952639abb399c3a Reviewed-on: https://gerrit.libreoffice.org/28766 Tested-by: Jenkins Reviewed-by: Justin Luth --- writerfilter/source/dmapper/PropertyMap.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'writerfilter') diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index 2631fbc887ae..6a07e9d3c250 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -1264,7 +1264,9 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) nGridLinePitch = 1; } - Insert(PROP_GRID_LINES, uno::makeAny( static_cast(nTextAreaHeight/nGridLinePitch))); + const sal_Int16 nGridLines = nTextAreaHeight/nGridLinePitch; + if( nGridLines >= 0 ) + Insert(PROP_GRID_LINES, uno::makeAny( nGridLines )); // PROP_GRID_MODE Insert( PROP_GRID_MODE, uno::makeAny( static_cast (m_nGridType) )); -- cgit