writerfilter/source/dmapper/PropertyMap.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 3943147ab341f1e4d1c6db34405010085488b0b1
Author: Justin Luth <justin_l...@sil.org>
Date:   Fri Sep 9 13:00:24 2016 +0300

    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 <c...@libreoffice.org>
    Reviewed-by: Justin Luth <justin_l...@sil.org>

diff --git a/writerfilter/source/dmapper/PropertyMap.cxx 
b/writerfilter/source/dmapper/PropertyMap.cxx
index 2631fbc..6a07e9d 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) ));
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to