summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
AgeCommit message (Collapse)Author
2016-01-07Merge to XFA: Make m_pStockMap a real map.Tom Sepez
Original Review URL: https://codereview.chromium.org/1564783003 . (cherry picked from commit a462162a76b3f487e76d8cc1b1f917f0937ea040) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1566233002 .
2015-12-24Merge to XFA: Switch from nonstd::unique_ptr to std::unique_ptr.Lei Zhang
TBR=thakis@chromium.org Review URL: https://codereview.chromium.org/1547833002 . (cherry picked from commit d20dfba2ae10e8aeb328328f09da79ff904110a8) Review URL: https://codereview.chromium.org/1545183002 .
2015-12-22Merge to XFA: Add ContainsKey() and ContainsValue() and use them where ↵Lei Zhang
appropriate. TBR=ochang@chromium.org Review URL: https://codereview.chromium.org/1540263003 . (cherry picked from commit 1fc92867ca53f0fba4272fbee3814d844f487495) Review URL: https://codereview.chromium.org/1542193002 .
2015-12-18Merge to XFA: Get rid of a few CPDF_Object Create() methods and just use new ↵Lei Zhang
instead. R=ochang@chromium.org Review URL: https://codereview.chromium.org/1540693002 . (cherry picked from commit d866ab0b44a571c884fdd8ba5a5319adaf607559) Review URL: https://codereview.chromium.org/1541563002 .
2015-12-14Merge to XFA: Get rid of most instance of 'foo == NULL'Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1520063002 . (cherry picked from commit e385244f8cd6ae376f6b3cf1265a0795d5d30eff) Review URL: https://codereview.chromium.org/1528763003 .
2015-12-14Merge to XFA: Get rid of most instance of 'foo != NULL'Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1512763013 . (cherry picked from commit e3c7c2b54348da4a6939f6672f6c6bff126815a7) Review URL: https://codereview.chromium.org/1529553003 .
2015-12-14Merge to XFA: Remove FX_BSTRC.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1521563002 . (cherry picked from commit 1956a174020686f91cd3b34294e91f4560fe45aa) Review URL: https://codereview.chromium.org/1526823002 .
2015-11-16Merge to XFA: Reland "Cleanup some numeric code.""Dan Sinclair
This reverts commit 0569ab0b11b723d9bca4ddd642b0cf8828c4bdd1. This changes the various comparisons of char >= '0' && char <= '9' and char < '0' || char > '9' to use std::isdigit checks. It also cleans up a handful of hex to digit conversions to call one common method. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1449873003 . (cherry picked from commit 3f148915d12f54a946a0c0bf526162b79c39d650) Review URL: https://codereview.chromium.org/1452673002 .
2015-11-12Merge to XFA: Remove relative includes.Lei Zhang
That refer to parent directories. TBR=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1434223002 . (cherry picked from commit 22bc4227fbbda5a5e9abad2a2c0a98c04fe7f228) Review URL: https://codereview.chromium.org/1439223003 .
2015-11-10Merge to XFA: Fix relative includes within core/Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1427633010 . (cherry picked from commit 9fb27cb9797937499c9678bc74cf7846cbf5d2b8) Review URL: https://codereview.chromium.org/1438573002 .
2015-11-09Merge to XFA: Fix a leak in CPDF_Type3Font::LoadChar().Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1408063016 . (cherry picked from commit 6d9979dc685e3b67b0a6d9946376e026d75d3e47) Review URL: https://codereview.chromium.org/1418503020 .
2015-11-02Merge to XFA: Add test for StringToCode and StringToWideStringDan Sinclair
This CL adds a test case for the StringToCode and StringToWideString methods in fpdf_font.cpp. In order to do so, it moves the methods to be private methods of CPDF_ToUnicodeMap and make the tests friends of the class. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1428593005 . (cherry picked from commit 52b0b525dca3d982a04b77fa6d0913aff1e5fd9c) Review URL: https://codereview.chromium.org/1425233004 .
2015-10-23XFA: Manually apply changes to fpdf_text.h and fx_font.h from masterTom Sepez
Driven off of https://codereview.chromium.org/1398383002/ Then make the other files as similar as possible. Note that this required changes to xfa/ code, and required adding some Set() methods. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1411833003 .
2015-10-22Merge to XFA: Add type cast definitions for CPDF_Stream.Dan Sinclair
This Cl adds ToStream, CPDF_Object::AsStream and CPDF_Object::IsStream and updates the src to use them as needed. BUG=pdfium:201 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1402413004 . (cherry picked from commit 338805f1366dcdf9a5b48cf591541cf98d7490f1) Review URL: https://codereview.chromium.org/1422513004 .
2015-10-21Merge to XFA: Add type cast definitions for CPDF_Name.Dan Sinclair
This Cl adds ToName, CPDF_Object::AsName and CPDF_Object::IsName and updates the src to use them as needed. BUG=pdfium:201 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1417823005 . (cherry picked from commit 1c77edb7b34e03787605b7965784cea38ef9f1d7) Review URL: https://codereview.chromium.org/1417033004 .
2015-10-20[Merge to XFA] Revert "Revert "Add type cast definitions for CPDF_Dictionary.""Dan Sinclair
This reverts commit 937840e1722d1f2b77d80575d6e710d760662c9c. Add type cast definitions for CPDF_Dictionary. This CL adds ToCPDFDictionary type definitions and updates one file to use instead of straight casts. I had to fix two places where we'd casted off the constness of the original pointer. BUG=pdfium:201 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1420583003 . (cherry picked from commit 39869b641511c882d78e17548293cdb458c36f38) Review URL: https://codereview.chromium.org/1410343003 .
2015-10-16Merge to XFA: Fix a bunch of sign mismatch warnings.Lei Zhang
Also remove some gotos and move code into an anonymous namespace. And then do the partial revert to avoid size_t going negative. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1356373003 . Review URL: https://codereview.chromium.org/1400723002 . (cherry picked from commit d03ba8d1a5928e8f3f6bd7da063b53b0bc40abfd) (cherry picked from commit a398ca611d1925182ff6a4e8b2b43c277c364dc0) Review URL: https://codereview.chromium.org/1406373002 .
2015-10-16Merge to XFA: Declare PDF_GetStandardFontName() in the header.Lei Zhang
R=tsepez@chromium.org TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1410043003 . (cherry picked from commit 3d7d1d2f29e5fb099367a40822684d31f684fd62) Review URL: https://codereview.chromium.org/1415453002 .
2015-08-19Merge to XFA: Extern in .cpp file is a code smell, part 2.Tom Sepez
(cherry picked from commit c3f4894a6862c74b9ab32b4ec38c531de6ecd83c) Original Review URL: https://codereview.chromium.org/1298393003 . Fixed IWYU in core/src/fpdftext/text_int.h exposed by new inclusion. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1294933008 .
2015-08-19Merge to XFA: FX_CMapDwordToDword considered harmful.Tom Sepez
(cherry picked from commit 85d5c4af4a9546970b34dd413c473d10fef8534b) Original Review URL: https://codereview.chromium.org/1289703003 . TBR=thestig@chromium.org Conflicts: core/include/fxcrt/fx_basic.h BUG= Review URL: https://codereview.chromium.org/1302783003 .
2015-08-14Merge to XFA: Don't bother checking pointers before delete[] and FX_Free().Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1297713003 . (cherry picked from commit cb62e7657b3a9a04142028a4e6614029a08e894b) Review URL: https://codereview.chromium.org/1287053005 .
2015-08-04XFA: clang-format all pdfium code.Nico Weber
No behavior change. Generated by: find . -name '*.cpp' -o -name '*.h' | \ grep -E -v 'third_party|thirdparties|lpng_v163|tiff_v403' | \ xargs ../../buildtools/mac/clang-format -i Then manually merged https://codereview.chromium.org/1269223002/ See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion. BUG=none
2015-07-23Merge to XFA - else after returns.Tom Sepez
(cherry picked from commit 3c012fef2bb72c8ec1faa73e11ee35539b2559d6) Original Review URL: https://codereview.chromium.org/1243953004 . R=thestig@chromium.org Review URL: https://codereview.chromium.org/1239313005 .
2015-07-21Merge to XFA: Move extern fpdf_font_charset.cpp function prototypes.Tom Sepez
(cherry picked from commit c5fa7f2a36ebd4c92c935e1332a2f7db4f3594d9) Orignal Review URL: https://codereview.chromium.org/1241173004 . TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1243243003 .
2015-06-19Merge to XFA: Cleanup: Do not check pointers before deleting them.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1192743004. (cherry picked from commit cfac954abcab7caf47d3fa3d641c553cba998271) Review URL: https://codereview.chromium.org/1196783003.
2015-06-13Remove trailing whitespaces in core, XFA edition.Lei Zhang
Review URL: https://codereview.chromium.org/1180333002.
2015-06-11Merge to XFA: Kill FXSYS_mem{cpy,cmp,set.move}{32,8}.Tom Sepez
Only manual merge was core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp follwed by scripts. Original Review URL: https://codereview.chromium.org/1179693003. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1179953002.
2015-06-10Merge to XFA: Remove FX_BSTR and FX_WSTR typedefs.Tom Sepez
Nearly automatic merge + re-run script on new files. Original Review URL: https://codereview.chromium.org/1180593004. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1174303002.
2015-06-10Merge to XFA: Remove typdefs for pointer types in fx_system.h.Tom Sepez
Original Review URL: https://codereview.chromium.org/1171733003 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1178613002.
2015-06-09Merge to XFA: Use stdint.h types throughout PDFium.Tom Sepez
Near-automatic merge, plus re-running scripts to update additional usage. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1172793002
2015-05-15Merge to XFA: Remove FX_NEW_VECTOR() macros.Tom Sepez
Original Review URL: https://codereview.chromium.org/1135273004 R=thestig@chromium.org TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1134003007
2015-05-07Merge to XFA: Make CFX_StockFontArray more robust.Lei Zhang
- Check bounds when accessing array. - Remove potential memory leak. - Merge duplicate code. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1094763002 (cherry picked from commit ee2fe42f9bf3ac6afc4f05f79629a3e34179a2b9) Review URL: https://codereview.chromium.org/1128803003
2015-05-06Merge to XFA: Replace FX_NEW with new, remove tests from fpdfapiLei Zhang
Very few places where a change is required, but remove FX_NEW to show they've been audited. Review URL: https://codereview.chromium.org/1075953004 (cherry picked from commit 5c357a5d3d873be6b0ab01d7bec82f79d0a09f0e) R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1125183006
2015-04-17Merge to XFA: Set m_FontType in CPDF_Font() constructor.Tom Sepez
Original Review URL: https://codereview.chromium.org/1060813003 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1060843005
2015-04-14Fix two new / free mismatchesTom Sepez
R=brucedawson@chromium.org Review URL: https://codereview.chromium.org/1085963002
2015-04-14Merge to XFA: Kill CFX_Object.Tom Sepez
Not just a simple merge, but changes to remove CFX_Object from XFA. Original Review URL: https://codereview.chromium.org/1088733002 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1087053002
2015-04-11Merge to XFA: Fix a heap buffer overflow issue in CPDF_CMap::GetNextCharJUN FANG
Add a check to make sure offset is less than the size of string in the function of GetNextChar(). BUG=471651 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1067073003
2014-12-23XFA: merge patch from CL 733693003, getting rid of more castsBruce Dawson
Getting rid of more (FX_LPCWSTR) casts and fixing two bugs revealed by this. Since casts to FX_LPCWSTR have been shown to hide bugs I tried removing more of them, targeting those places where a cast was used to force a conversion from CFX_WideString to FX_LPCWSTR, replacing these casts with calls to the newly added .c_str() function. This revealed two places where the cast was hiding a bug -- where ->c_str() was required instead! This removes ~33 FX_LPCWSTR casts and there are ~31 left, many of which will go away in some future change. Also includes this change: Removing unnecessary casts from wchar_t* to wchar_t*, by various names. Original patch from Bruce Dawson(brucedawson@chromium.org) TBR=bo_xu@foxitsoftware.com, tsepez@chromium.org Review URL: https://codereview.chromium.org/811593007
2014-07-29Fix a few more warnings in chromium_code mode.Nico Weber
No intended behavior change. - Remove more unused variables, functions, member variables. - Put a few constructor initializers in the order they execute in. - Add braces for subobject initializers. - Fix a handful of signed / unsigned comparisons. BUG=pdfium:29 R=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/429593005
2014-06-30Remove "this==NULL" and adjust corresponding callersBo Xu
BUG= R=thakis@chromium.org Review URL: https://codereview.chromium.org/361553002
2014-06-20BUG=382241foxit
R=palmer@chromium.org Review URL: https://codereview.chromium.org/331123002
2014-05-23Convert all line endings to LF.John Abd-El-Malek
2014-05-17Initial commit.John Abd-El-Malek