summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2016-09-09 13:00:24 +0300
committerAndras Timar <andras.timar@collabora.com>2016-10-10 17:34:23 +0200
commitae1f7a09d5f9e54bceff926c6a0ddbf778353e20 (patch)
treef999874e7057f4c9895c3c8f265294ae7301480e /writerfilter
parent0174b9473021e6628924f38ba34dc2415e270cc8 (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> (cherry picked from commit 3943147ab341f1e4d1c6db34405010085488b0b1)
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 5833b9c92bc9..cc20bb45d713 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1292,7 +1292,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) ));