[Libreoffice-commits] core.git: 2 commits - svl/source svx/source vcl/source
Stephan Bergmann
sbergman at redhat.com
Wed Mar 5 08:46:28 PST 2014
svl/source/numbers/zforfind.cxx | 2 +-
svl/source/numbers/zforfind.hxx | 2 +-
svx/source/customshapes/EnhancedCustomShape2d.cxx | 4 ++--
vcl/source/edit/texteng.cxx | 3 ++-
4 files changed, 6 insertions(+), 5 deletions(-)
New commits:
commit 0e78ce148371f8ae27f4660403dd057a1f632ecf
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Mar 5 13:27:17 2014 +0100
Operators for Point are only overloaded for long, not double
...so no use giving double arguments that are implicitly cast to long anyway.
Change-Id: I26b9059fc5ab0d55c3f320e2b2f55502423541a9
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index b1bd8d8..3ed2605 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -1737,8 +1737,8 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
const Point aPreviousEndPoint(GetPoint( seqCoordinates[ rSrcPt - 1 ], true, true));
const Point aControlQ(GetPoint( seqCoordinates[ rSrcPt++ ], true, true ));
const Point aEnd(GetPoint( seqCoordinates[ rSrcPt++ ], true, true ));
- const Point aControlA((aPreviousEndPoint + (aControlQ * 2.0)) / 3.0);
- const Point aControlB(((aControlQ * 2.0) + aEnd) / 3.0);
+ const Point aControlA((aPreviousEndPoint + (aControlQ * 2)) / 3);
+ const Point aControlB(((aControlQ * 2) + aEnd) / 3);
DBG_ASSERT(aNewB2DPolygon.count(), "EnhancedCustomShape2d::CreateSubPath: Error in adding Q control point (!)");
aNewB2DPolygon.appendBezierSegment(
commit a7859d08ab3f4c214e83d311a5db7aeed2f707b5
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Mar 5 13:07:31 2014 +0100
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
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 6119ca2..4bb4c18 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -19,7 +19,7 @@
#include <ctype.h>
-#include <stdlib.h>
+#include <cstdlib>
#include <float.h>
#include <errno.h>
#include <comphelper/string.hxx>
diff --git a/svl/source/numbers/zforfind.hxx b/svl/source/numbers/zforfind.hxx
index 6e24040..5738ce6 100644
--- a/svl/source/numbers/zforfind.hxx
+++ b/svl/source/numbers/zforfind.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
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index 0fdaa68..5567c90 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -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;
More information about the Libreoffice-commits
mailing list