diff options
author | Justin Luth <justin_luth@sil.org> | 2016-09-09 13:00:24 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-12 09:57:34 +0000 |
commit | 3943147ab341f1e4d1c6db34405010085488b0b1 (patch) | |
tree | f4cd212b77cb98393b7ea6e07adf34b63cca4287 /writerfilter | |
parent | 27826a91fde08081d15e74b0f3b5b7ef135d4001 (diff) |
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 <ci@libreoffice.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/PropertyMap.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
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<sal_Int16>(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<sal_Int16> (m_nGridType) )); |