diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-10-31 08:54:42 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-11-01 00:25:55 +0100 |
commit | 013618308c2d24702de18c12922931b130b6fade (patch) | |
tree | f70af86abdc8eea17471c1c1767986ce68c21834 /sw | |
parent | aab1018339fba9e6c618a17dfb2a01464555c4dc (diff) |
ofz#3934 Integer-overflow
Change-Id: I2c58cca6f01d7c50244dfec6acdfaa988cdbaa07
Reviewed-on: https://gerrit.libreoffice.org/44102
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/xml/xmlimp.cxx | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index f2f583fbf63e..f46cf200a416 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -70,6 +70,7 @@ #include <xmloff/xmluconv.hxx> #include <unotools/saveopt.hxx> #include <unotools/streamwrap.hxx> +#include <tools/helpers.hxx> #include <tools/diagnose_ex.h> #include <vcl/svapp.hxx> @@ -972,25 +973,6 @@ SvXMLImportContext *SwXMLImport::CreateFontDeclsContext( return pFSContext; } -namespace -{ - // return (n >= 0)? (n*72+63)/127: (n*72-63)/127; - sal_Int64 sanitiseMm100ToTwip(sal_Int64 n) - { - if (n >= 0) - { - if (o3tl::checked_multiply<sal_Int64>(n, 72, n) || o3tl::checked_add<sal_Int64>(n, 63, n)) - n = SAL_MAX_INT64; - } - else - { - if (o3tl::checked_multiply<sal_Int64>(n, 72, n) || o3tl::checked_sub<sal_Int64>(n, 63, n)) - n = SAL_MIN_INT64; - } - return n / 127; - } -} - void SwXMLImport::SetViewSettings(const Sequence < PropertyValue > & aViewProps) { if (IsInsertMode() || IsStylesOnlyMode() || IsBlockMode() || m_bOrganizerMode || !GetModel().is() ) |