diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-12-10 15:44:28 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-12-10 21:03:26 +0100 |
commit | e068d96feceff19977454da6ad3390ad7f7ce507 (patch) | |
tree | a94620b7b39d6aac3f11d16125d2eaba1819e421 | |
parent | 31dcf60fc8e6bd2f49728e157319af3204f7f1a1 (diff) |
ofz#4581 Integer-overflow
Change-Id: I7c4e19981c8ef6016f44680657d872102f00f6d3
Reviewed-on: https://gerrit.libreoffice.org/46190
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | svx/source/table/tablemodel.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/svx/source/table/tablemodel.cxx b/svx/source/table/tablemodel.cxx index 2f8c94dc4636..bbe6c42edebd 100644 --- a/svx/source/table/tablemodel.cxx +++ b/svx/source/table/tablemodel.cxx @@ -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& ) |