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

Side by Side Diff: xfa/fgas/font/fgas_stdfontmgr.cpp

Issue 2430743003: in the attempt to fix 627393, changed IFX_FileRead's readBlock to return the length it reads
Patch Set: remove .tmp files Created 4 years, 2 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
OLDNEW
1 // Copyright 2015 PDFium Authors. All rights reserved. 1 // Copyright 2015 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/fgas/font/fgas_stdfontmgr.h" 7 #include "xfa/fgas/font/fgas_stdfontmgr.h"
8 8
9 #include "core/fxcrt/include/fx_stream.h" 9 #include "core/fxcrt/include/fx_stream.h"
10 #include "core/fxge/include/cfx_fontmapper.h" 10 #include "core/fxge/include/cfx_fontmapper.h"
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 extern "C" { 869 extern "C" {
870 870
871 unsigned long _ftStreamRead(FXFT_Stream stream, 871 unsigned long _ftStreamRead(FXFT_Stream stream,
872 unsigned long offset, 872 unsigned long offset,
873 unsigned char* buffer, 873 unsigned char* buffer,
874 unsigned long count) { 874 unsigned long count) {
875 if (count == 0) 875 if (count == 0)
876 return 0; 876 return 0;
877 877
878 IFX_FileRead* pFile = (IFX_FileRead*)stream->descriptor.pointer; 878 IFX_FileRead* pFile = (IFX_FileRead*)stream->descriptor.pointer;
879 int res = pFile->ReadBlock(buffer, offset, count); 879 if (pFile->ReadBlock(buffer, offset, count) == count || pFile->IsEOF())
880 if (res)
881 return count; 880 return count;
882 return 0; 881 return 0;
883 } 882 }
884 883
885 void _ftStreamClose(FXFT_Stream stream) {} 884 void _ftStreamClose(FXFT_Stream stream) {}
886 885
887 }; // extern "C" 886 }; // extern "C"
888 887
889 FXFT_Face CFGAS_FontMgrImp::LoadFace(IFX_FileRead* pFontStream, 888 FXFT_Face CFGAS_FontMgrImp::LoadFace(IFX_FileRead* pFontStream,
890 int32_t iFaceIndex) { 889 int32_t iFaceIndex) {
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1382 1381
1383 int32_t CFGAS_FontMgrImp::IsPartName(const CFX_WideString& Name1, 1382 int32_t CFGAS_FontMgrImp::IsPartName(const CFX_WideString& Name1,
1384 const CFX_WideString& Name2) { 1383 const CFX_WideString& Name2) {
1385 if (Name1.Find(Name2.c_str()) != -1) { 1384 if (Name1.Find(Name2.c_str()) != -1) {
1386 return 1; 1385 return 1;
1387 } 1386 }
1388 return 0; 1387 return 0;
1389 } 1388 }
1390 1389
1391 #endif 1390 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698