[Libreoffice-commits] core.git: writerfilter/source

Justin Luth justin_luth at sil.org
Mon Sep 12 09:58:07 UTC 2016


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

New commits:
commit 3943147ab341f1e4d1c6db34405010085488b0b1
Author: Justin Luth <justin_luth at 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 <ci at libreoffice.org>
    Reviewed-by: Justin Luth <justin_luth at 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) ));


More information about the Libreoffice-commits mailing list