summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-02-05 23:30:22 +0100
committerMichael Stahl <mstahl@redhat.com>2015-02-05 23:33:35 +0100
commit004304eb2fd1703d22dec0abf0170bb2ce493d0c (patch)
tree2cc68735fa3eb215f043fa6f175f3fcb0e03f88f /sc
parentb0ef5cf258f3a84054c052f0a09a208dbc17fdf3 (diff)
try to avoid overflows in some compare functions
Change-Id: I6144d7d6527dc401b7f1b577d1a227361e39e7bb
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/table3.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 61b8059a6e9c..d673583e5554 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -197,7 +197,7 @@ short Compare( const OUString &sInput1, const OUString &sInput2,
if ( nNum1 != nNum2 )
{
if ( nNum1 < nNum2 ) return -1;
- return static_cast<short>( nNum1 > nNum2 );
+ return (nNum1 > nNum2) ? 1 : 0;
}
// The prefix and the first numerical elements are equal, but the suffix