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

Side by Side Diff: xfa/fxfa/app/xfa_ffimageedit.cpp

Issue 1882043004: Remove implicit cast from CFX_WideString to (const wchar_t*) (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: win error #2 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_ffdocview.cpp ('k') | xfa/fxfa/app/xfa_fftextedit.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/app/xfa_ffimageedit.h" 7 #include "xfa/fxfa/app/xfa_ffimageedit.h"
8 8
9 #include "xfa/fwl/core/cfwl_message.h" 9 #include "xfa/fwl/core/cfwl_message.h"
10 #include "xfa/fwl/core/ifwl_app.h" 10 #include "xfa/fwl/core/ifwl_app.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 return TRUE; 124 return TRUE;
125 } 125 }
126 CFX_WideString wsContentType(L"image/"); 126 CFX_WideString wsContentType(L"image/");
127 wsContentType += wsFilePath.Right(nLen - nIndex - 1); 127 wsContentType += wsFilePath.Right(nLen - nIndex - 1);
128 wsContentType.MakeLower(); 128 wsContentType.MakeLower();
129 FXCODEC_IMAGE_TYPE eImageType = XFA_GetImageType(wsContentType); 129 FXCODEC_IMAGE_TYPE eImageType = XFA_GetImageType(wsContentType);
130 if (eImageType == FXCODEC_IMAGE_UNKNOWN) { 130 if (eImageType == FXCODEC_IMAGE_UNKNOWN) {
131 return TRUE; 131 return TRUE;
132 } 132 }
133 CFX_WideString wsImage; 133 CFX_WideString wsImage;
134 IFX_FileRead* pFileRead = FX_CreateFileRead(wsFilePath); 134 IFX_FileRead* pFileRead = FX_CreateFileRead(wsFilePath.c_str());
135 if (pFileRead) { 135 if (pFileRead) {
136 int32_t nDataSize = pFileRead->GetSize(); 136 int32_t nDataSize = pFileRead->GetSize();
137 if (nDataSize > 0) { 137 if (nDataSize > 0) {
138 CFX_ByteString bsBuf; 138 CFX_ByteString bsBuf;
139 FX_CHAR* pImageBuffer = bsBuf.GetBuffer(nDataSize); 139 FX_CHAR* pImageBuffer = bsBuf.GetBuffer(nDataSize);
140 pFileRead->ReadBlock(pImageBuffer, 0, nDataSize); 140 pFileRead->ReadBlock(pImageBuffer, 0, nDataSize);
141 bsBuf.ReleaseBuffer(); 141 bsBuf.ReleaseBuffer();
142 if (!bsBuf.IsEmpty()) { 142 if (!bsBuf.IsEmpty()) {
143 FX_CHAR* pData = XFA_Base64Encode(bsBuf.raw_str(), nDataSize); 143 FX_CHAR* pData = XFA_Base64Encode(bsBuf.raw_str(), nDataSize);
144 wsImage = CFX_WideString::FromLocal(pData); 144 wsImage = CFX_WideString::FromLocal(pData);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 return m_pOldDelegate->OnProcessMessage(pMessage); 178 return m_pOldDelegate->OnProcessMessage(pMessage);
179 } 179 }
180 FWL_ERR CXFA_FFImageEdit::OnProcessEvent(CFWL_Event* pEvent) { 180 FWL_ERR CXFA_FFImageEdit::OnProcessEvent(CFWL_Event* pEvent) {
181 CXFA_FFField::OnProcessEvent(pEvent); 181 CXFA_FFField::OnProcessEvent(pEvent);
182 return m_pOldDelegate->OnProcessEvent(pEvent); 182 return m_pOldDelegate->OnProcessEvent(pEvent);
183 } 183 }
184 FWL_ERR CXFA_FFImageEdit::OnDrawWidget(CFX_Graphics* pGraphics, 184 FWL_ERR CXFA_FFImageEdit::OnDrawWidget(CFX_Graphics* pGraphics,
185 const CFX_Matrix* pMatrix) { 185 const CFX_Matrix* pMatrix) {
186 return m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); 186 return m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix);
187 } 187 }
OLDNEW
« no previous file with comments | « xfa/fxfa/app/xfa_ffdocview.cpp ('k') | xfa/fxfa/app/xfa_fftextedit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698