diff options
author | cmp@chromium.org <cmp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-21 17:52:20 +0000 |
---|---|---|
committer | cmp@chromium.org <cmp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-21 17:52:20 +0000 |
commit | 7f8b8ea33b9e3ddd9107ee6cbb0a47061daf1904 (patch) | |
tree | e2c142dd38455a41b121f1160a0f610ef63db49a /chrome/renderer/print_web_view_helper.cc | |
parent | 5030416098386143fa314dbfe14fa46acdd34198 (diff) | |
download | chromium_src-7f8b8ea33b9e3ddd9107ee6cbb0a47061daf1904.zip chromium_src-7f8b8ea33b9e3ddd9107ee6cbb0a47061daf1904.tar.gz chromium_src-7f8b8ea33b9e3ddd9107ee6cbb0a47061daf1904.tar.bz2 |
Revert 115245 - Coverity: Fixing pass by value, 101350.
CID=101350
BUG=NONE
TEST=NONE
Review URL: http://codereview.chromium.org/9004036
TBR=dpapad@chromium.org
Review URL: http://codereview.chromium.org/9017020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115354 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/print_web_view_helper.cc')
-rw-r--r-- | chrome/renderer/print_web_view_helper.cc | 22 |
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 e394c47..499b1fd 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()); } |