From d592954e3cf968c9e78c1b63828f0d31fe04a220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Mon, 29 Apr 2013 19:49:13 +0200 Subject: [PATCH] app_server: avoids referencing a temporary IntRect instance. * GCC lets us use a const reference to a temporary, but using it after it disappeared is incorrect. * reverts hrev45576 as this patch seems more correct. --- src/servers/app/IntRect.cpp | 9 --------- src/servers/app/IntRect.h | 10 ++++++++++ src/servers/app/drawing/Painter/AGGTextRenderer.cpp | 6 ++++-- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/servers/app/IntRect.cpp b/src/servers/app/IntRect.cpp index c72433bc67..7c9a53d4c0 100644 --- a/src/servers/app/IntRect.cpp +++ b/src/servers/app/IntRect.cpp @@ -12,15 +12,6 @@ #include -IntRect::IntRect(const BRect &r) -{ - left = (int32)r.left; - top = (int32)r.top; - right = (int32)r.right; - bottom = (int32)r.bottom; -} - - void IntRect::SetLeftTop(const IntPoint& p) { diff --git a/src/servers/app/IntRect.h b/src/servers/app/IntRect.h index a6f01f3f10..f273bb8172 100644 --- a/src/servers/app/IntRect.h +++ b/src/servers/app/IntRect.h @@ -149,6 +149,16 @@ IntRect::IntRect(const IntRect &r) } +inline +IntRect::IntRect(const BRect &r) +{ + left = (int32)r.left; + top = (int32)r.top; + right = (int32)r.right; + bottom = (int32)r.bottom; +} + + inline IntRect::IntRect(const IntPoint& leftTop, const IntPoint& rightBottom) { diff --git a/src/servers/app/drawing/Painter/AGGTextRenderer.cpp b/src/servers/app/drawing/Painter/AGGTextRenderer.cpp index 754ea5172f..0bbc0ad0d1 100644 --- a/src/servers/app/drawing/Painter/AGGTextRenderer.cpp +++ b/src/servers/app/drawing/Painter/AGGTextRenderer.cpp @@ -334,8 +334,9 @@ AGGTextRenderer::RenderString(const char* string, uint32 length, // for when we bypass the transformation pipeline BPoint transformOffset(0.0, 0.0); transform.Transform(&transformOffset); + IntRect clippingIntFrame(clippingFrame); - StringRenderer renderer(clippingFrame, dryRun, + StringRenderer renderer(clippingIntFrame, dryRun, gSubpixelAntialiasing && fAntialias, transformedOutline, transformedContourOutline, transform, transformOffset, nextCharPos, *this); @@ -369,8 +370,9 @@ AGGTextRenderer::RenderString(const char* string, uint32 length, // for when we bypass the transformation pipeline BPoint transformOffset(0.0, 0.0); transform.Transform(&transformOffset); + IntRect clippingIntFrame(clippingFrame); - StringRenderer renderer(clippingFrame, dryRun, + StringRenderer renderer(clippingIntFrame, dryRun, gSubpixelAntialiasing && fAntialias, transformedOutline, transformedContourOutline, transform, transformOffset, nextCharPos, *this);