summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/print_web_view_helper.cc
diff options
context:
space:
mode:
authordpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-21 00:59:08 +0000
committerdpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-21 00:59:08 +0000
commit5fa1458d6be3c4be144308232c9ca75c17e7e071 (patch)
tree819c4ab6454df6a79b8505cce8e0eaf96c47ed24 /chrome/renderer/print_web_view_helper.cc
parentf84cedac2fa39e1d7643b457a3d51d88e1fc861b (diff)
downloadchromium_src-5fa1458d6be3c4be144308232c9ca75c17e7e071.zip
chromium_src-5fa1458d6be3c4be144308232c9ca75c17e7e071.tar.gz
chromium_src-5fa1458d6be3c4be144308232c9ca75c17e7e071.tar.bz2
Coverity: Fixing pass by value, 101350.
CID=101350 BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/9004036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115245 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/print_web_view_helper.cc')
-rw-r--r--chrome/renderer/print_web_view_helper.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/chrome/renderer/print_web_view_helper.cc b/chrome/renderer/print_web_view_helper.cc
index 499b1fd..e394c47 100644
--- a/chrome/renderer/print_web_view_helper.cc
+++ b/chrome/renderer/print_web_view_helper.cc
@@ -217,7 +217,7 @@ SkPoint GetHeaderFooterPosition(
void PrintHeaderFooterText(
string16 text,
WebKit::WebCanvas* canvas,
- HeaderFooterPaint paint,
+ HeaderFooterPaint* paint,
float webkit_scale_factor,
const PageSizeMargins& page_layout,
printing::HorizontalHeaderFooterPosition horizontal_position,
@@ -225,20 +225,20 @@ void PrintHeaderFooterText(
double offset_to_baseline) {
#if defined(USE_SKIA)
size_t text_byte_length = text.length() * sizeof(char16);
- double text_width_in_points = SkScalarToDouble(paint.measureText(
+ double text_width_in_points = SkScalarToDouble(paint->measureText(
text.c_str(), text_byte_length));
SkPoint point = GetHeaderFooterPosition(webkit_scale_factor, page_layout,
horizontal_position,
vertical_position, offset_to_baseline,
text_width_in_points);
- paint.setTextSize(SkDoubleToScalar(
- paint.getTextSize() / webkit_scale_factor));
+ paint->setTextSize(SkDoubleToScalar(
+ paint->getTextSize() / webkit_scale_factor));
canvas->drawText(text.c_str(), text_byte_length, point.x(), point.y(),
- paint);
+ *paint);
#elif defined(OS_MACOSX)
ScopedCFTypeRef<CFStringRef> cf_text(base::SysUTF16ToCFStringRef(text));
ScopedCFTypeRef<CFAttributedStringRef> cf_attr_text(
- CFAttributedStringCreate(NULL, cf_text, paint));
+ CFAttributedStringCreate(NULL, cf_text, *paint));
ScopedCFTypeRef<CTLineRef> line(CTLineCreateWithAttributedString(
cf_attr_text));
double text_width_in_points =
@@ -322,10 +322,10 @@ void PrintWebViewHelper::PrintHeaderAndFooter(
double text_height = printing::kSettingHeaderFooterInterstice +
header_vertical_bounds.height();
if (text_height <= page_layout.margin_top) {
- PrintHeaderFooterText(date, canvas, paint, webkit_scale_factor, page_layout,
- printing::LEFT, printing::TOP,
+ PrintHeaderFooterText(date, canvas, &paint, webkit_scale_factor,
+ page_layout, printing::LEFT, printing::TOP,
header_vertical_bounds.top());
- PrintHeaderFooterText(title, canvas, paint, webkit_scale_factor,
+ PrintHeaderFooterText(title, canvas, &paint, webkit_scale_factor,
page_layout, printing::CENTER, printing::TOP,
header_vertical_bounds.top());
}
@@ -354,10 +354,10 @@ void PrintWebViewHelper::PrintHeaderAndFooter(
text_height = printing::kSettingHeaderFooterInterstice +
footer_vertical_bounds.height();
if (text_height <= page_layout.margin_bottom) {
- PrintHeaderFooterText(page_of_total_pages, canvas, paint,
+ PrintHeaderFooterText(page_of_total_pages, canvas, &paint,
webkit_scale_factor, page_layout, printing::RIGHT,
printing::BOTTOM, footer_vertical_bounds.bottom());
- PrintHeaderFooterText(url, canvas, paint, webkit_scale_factor, page_layout,
+ PrintHeaderFooterText(url, canvas, &paint, webkit_scale_factor, page_layout,
printing::LEFT, printing::BOTTOM,
footer_vertical_bounds.bottom());
}