Kaydet (Commit) a7859d08 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Work around unfortunate libstdc++ interpretation of C++ cmath requirements

...that causes a call to std::abs with a short argument to effectively select
the double overload (via a template added with <http://gcc.gnu.org/git/
?p=gcc.git;a=commit;h=8c0edf5c2aad076cbc805299ed82845ae049f4f6>
"include/c_std/cmath (abs(_Tp)): Add"), see
<http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-toc.html#2192> "Validity and
return type of std::abs(0u) is unclear" for details.

The workaround is to use int instead of short arguments (and make sure the
integral overloads of std::abs from cstdlib are available).

Change-Id: If95363f9a54abb9cb1a57fd4828c4b91c12bc4be
üst cf1878f5
......@@ -19,7 +19,7 @@
#include <ctype.h>
#include <stdlib.h>
#include <cstdlib>
#include <float.h>
#include <errno.h>
#include <comphelper/string.hxx>
......
......@@ -104,7 +104,7 @@ private:
static const sal_uInt8 nMatchedUsedAsReturn; // 0x10
int nSign; // Sign of number
short nMonth; // Month (1..x) if date
int nMonth; // Month (1..x) if date
// negative => short format
short nMonthPos; // 1 = front, 2 = middle
// 3 = end
......
......@@ -53,6 +53,7 @@
#include <unicode/ubidi.h>
#include <cstdlib>
#include <set>
#include <vector>
#include <boost/foreach.hpp>
......@@ -2183,7 +2184,7 @@ bool TextEngine::CreateLines( sal_uLong nPara )
pTEParaPortion->GetLines().push_back( pL );
}
const short nInvalidDiff = pTEParaPortion->GetInvalidDiff();
const int nInvalidDiff = pTEParaPortion->GetInvalidDiff();
const sal_uInt16 nInvalidStart = pTEParaPortion->GetInvalidPosStart();
const sal_uInt16 nInvalidEnd = nInvalidStart + std::abs( nInvalidDiff );
bool bQuickFormat = false;
......
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