Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Side by Side Diff: core/fpdfapi/fpdf_render/fpdf_render_text.cpp

Issue 1885973002: Remove implicit cast from CFX_ByteString to (const char*). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Typo Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp ('k') | core/fpdfdoc/doc_basic.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "core/fpdfapi/fpdf_render/render_int.h" 7 #include "core/fpdfapi/fpdf_render/render_int.h"
8 8
9 #include "core/fpdfapi/fpdf_font/cpdf_cidfont.h" 9 #include "core/fpdfapi/fpdf_font/cpdf_cidfont.h"
10 #include "core/fpdfapi/fpdf_font/cpdf_type3char.h" 10 #include "core/fpdfapi/fpdf_font/cpdf_type3char.h"
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 FX_FLOAT origin_x, 630 FX_FLOAT origin_x,
631 FX_FLOAT origin_y, 631 FX_FLOAT origin_y,
632 CPDF_Font* pFont, 632 CPDF_Font* pFont,
633 FX_FLOAT font_size, 633 FX_FLOAT font_size,
634 const CFX_Matrix* pMatrix, 634 const CFX_Matrix* pMatrix,
635 const CFX_ByteString& str, 635 const CFX_ByteString& str,
636 FX_ARGB fill_argb, 636 FX_ARGB fill_argb,
637 FX_ARGB stroke_argb, 637 FX_ARGB stroke_argb,
638 const CFX_GraphStateData* pGraphState, 638 const CFX_GraphStateData* pGraphState,
639 const CPDF_RenderOptions* pOptions) { 639 const CPDF_RenderOptions* pOptions) {
640 int nChars = pFont->CountChar(str, str.GetLength()); 640 int nChars = pFont->CountChar(str.c_str(), str.GetLength());
641 if (nChars == 0) { 641 if (nChars == 0) {
642 return; 642 return;
643 } 643 }
644 uint32_t charcode; 644 uint32_t charcode;
645 int offset = 0; 645 int offset = 0;
646 uint32_t* pCharCodes; 646 uint32_t* pCharCodes;
647 FX_FLOAT* pCharPos; 647 FX_FLOAT* pCharPos;
648 if (nChars == 1) { 648 if (nChars == 1) {
649 charcode = pFont->GetNextChar(str, str.GetLength(), offset); 649 charcode = pFont->GetNextChar(str.c_str(), str.GetLength(), offset);
650 pCharCodes = (uint32_t*)(uintptr_t)charcode; 650 pCharCodes = (uint32_t*)(uintptr_t)charcode;
651 pCharPos = NULL; 651 pCharPos = NULL;
652 } else { 652 } else {
653 pCharCodes = FX_Alloc(uint32_t, nChars); 653 pCharCodes = FX_Alloc(uint32_t, nChars);
654 pCharPos = FX_Alloc(FX_FLOAT, nChars - 1); 654 pCharPos = FX_Alloc(FX_FLOAT, nChars - 1);
655 FX_FLOAT cur_pos = 0; 655 FX_FLOAT cur_pos = 0;
656 for (int i = 0; i < nChars; i++) { 656 for (int i = 0; i < nChars; i++) {
657 pCharCodes[i] = pFont->GetNextChar(str, str.GetLength(), offset); 657 pCharCodes[i] = pFont->GetNextChar(str.c_str(), str.GetLength(), offset);
658 if (i) { 658 if (i) {
659 pCharPos[i - 1] = cur_pos; 659 pCharPos[i - 1] = cur_pos;
660 } 660 }
661 cur_pos += pFont->GetCharWidthF(pCharCodes[i]) * font_size / 1000; 661 cur_pos += pFont->GetCharWidthF(pCharCodes[i]) * font_size / 1000;
662 } 662 }
663 } 663 }
664 CFX_Matrix matrix; 664 CFX_Matrix matrix;
665 if (pMatrix) 665 if (pMatrix)
666 matrix = *pMatrix; 666 matrix = *pMatrix;
667 667
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 matrix.Concat(font_size, 0, 0, font_size, charpos.m_OriginX, 779 matrix.Concat(font_size, 0, 0, font_size, charpos.m_OriginX,
780 charpos.m_OriginY); 780 charpos.m_OriginY);
781 path.m_Path.New()->Append(pPath, &matrix); 781 path.m_Path.New()->Append(pPath, &matrix);
782 path.m_Matrix = *pTextMatrix; 782 path.m_Matrix = *pTextMatrix;
783 path.m_bStroke = bStroke; 783 path.m_bStroke = bStroke;
784 path.m_FillType = bFill ? FXFILL_WINDING : 0; 784 path.m_FillType = bFill ? FXFILL_WINDING : 0;
785 path.CalcBoundingBox(); 785 path.CalcBoundingBox();
786 ProcessPath(&path, pObj2Device); 786 ProcessPath(&path, pObj2Device);
787 } 787 }
788 } 788 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp ('k') | core/fpdfdoc/doc_basic.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698