Kaydet (Commit) e068d96f authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz#4581 Integer-overflow

Change-Id: I7c4e19981c8ef6016f44680657d872102f00f6d3
Reviewed-on: https://gerrit.libreoffice.org/46190Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 31dcf60f
......@@ -36,6 +36,7 @@
#include "tablecolumn.hxx"
#include "tablecolumns.hxx"
#include "tableundo.hxx"
#include <o3tl/safeint.hxx>
#include <svx/svdotable.hxx>
#include <svx/svdmodel.hxx>
#include <svx/strings.hrc>
......@@ -1004,7 +1005,7 @@ void TableModel::optimize()
Reference< XPropertySet > xSet2( static_cast< XCellRange* >( maColumns[nCol-1].get() ), UNO_QUERY_THROW );
xSet1->getPropertyValue( sWidth ) >>= nWidth1;
xSet2->getPropertyValue( sWidth ) >>= nWidth2;
nWidth1 += nWidth2;
nWidth1 = o3tl::saturating_add(nWidth1, nWidth2);
xSet2->setPropertyValue( sWidth, Any( nWidth1 ) );
}
catch( Exception& )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment