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

Side by Side Diff: xfa/fxfa/app/xfa_ffwidget.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 | « xfa/fxfa/app/xfa_ffdoc.cpp ('k') | xfa/fxfa/fm2js/xfa_fm2jscontext.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 "xfa/fxfa/include/xfa_ffwidget.h" 7 #include "xfa/fxfa/include/xfa_ffwidget.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 CFX_ByteString bsContent; 984 CFX_ByteString bsContent;
985 uint8_t* pImageBuffer = NULL; 985 uint8_t* pImageBuffer = NULL;
986 IFX_FileRead* pImageFileRead = NULL; 986 IFX_FileRead* pImageFileRead = NULL;
987 if (wsImage.GetLength() > 0) { 987 if (wsImage.GetLength() > 0) {
988 XFA_ATTRIBUTEENUM iEncoding = 988 XFA_ATTRIBUTEENUM iEncoding =
989 (XFA_ATTRIBUTEENUM)pImage->GetTransferEncoding(); 989 (XFA_ATTRIBUTEENUM)pImage->GetTransferEncoding();
990 if (iEncoding == XFA_ATTRIBUTEENUM_Base64) { 990 if (iEncoding == XFA_ATTRIBUTEENUM_Base64) {
991 CFX_ByteString bsData = wsImage.UTF8Encode(); 991 CFX_ByteString bsData = wsImage.UTF8Encode();
992 int32_t iLength = bsData.GetLength(); 992 int32_t iLength = bsData.GetLength();
993 pImageBuffer = FX_Alloc(uint8_t, iLength); 993 pImageBuffer = FX_Alloc(uint8_t, iLength);
994 int32_t iRead = XFA_Base64Decode((const FX_CHAR*)bsData, pImageBuffer); 994 int32_t iRead = XFA_Base64Decode(bsData.c_str(), pImageBuffer);
995 if (iRead > 0) { 995 if (iRead > 0) {
996 pImageFileRead = FX_CreateMemoryStream(pImageBuffer, iRead); 996 pImageFileRead = FX_CreateMemoryStream(pImageBuffer, iRead);
997 } 997 }
998 } else { 998 } else {
999 bsContent = CFX_ByteString::FromUnicode(wsImage); 999 bsContent = CFX_ByteString::FromUnicode(wsImage);
1000 pImageFileRead = FX_CreateMemoryStream( 1000 pImageFileRead = FX_CreateMemoryStream(
1001 const_cast<uint8_t*>(bsContent.raw_str()), bsContent.GetLength()); 1001 const_cast<uint8_t*>(bsContent.raw_str()), bsContent.GetLength());
1002 } 1002 }
1003 } else { 1003 } else {
1004 CFX_WideString wsURL = wsHref; 1004 CFX_WideString wsURL = wsHref;
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after
1958 iType != XFA_ELEMENT_Rectangle) { 1958 iType != XFA_ELEMENT_Rectangle) {
1959 return; 1959 return;
1960 } 1960 }
1961 CXFA_StrokeArray strokes; 1961 CXFA_StrokeArray strokes;
1962 if (!(dwFlags & XFA_DRAWBOX_ForceRound) && iType != XFA_ELEMENT_Arc) { 1962 if (!(dwFlags & XFA_DRAWBOX_ForceRound) && iType != XFA_ELEMENT_Arc) {
1963 box.GetStrokes(strokes); 1963 box.GetStrokes(strokes);
1964 } 1964 }
1965 XFA_BOX_Fill(box, strokes, pGS, rtWidget, pMatrix, dwFlags); 1965 XFA_BOX_Fill(box, strokes, pGS, rtWidget, pMatrix, dwFlags);
1966 XFA_BOX_Stroke(box, strokes, pGS, rtWidget, pMatrix, dwFlags); 1966 XFA_BOX_Stroke(box, strokes, pGS, rtWidget, pMatrix, dwFlags);
1967 } 1967 }
OLDNEW
« no previous file with comments | « xfa/fxfa/app/xfa_ffdoc.cpp ('k') | xfa/fxfa/fm2js/xfa_fm2jscontext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698