Age | Commit message (Collapse) | Author |
|
Fix some nits too.
Change-Id: I7d088f28b3b6898fcfbafb9c0e6eac6442ff1515
Reviewed-on: https://pdfium-review.googlesource.com/42910
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
They do not have to be part of the class. Fix nits and lint errors too.
Change-Id: Ie8f745f378beeebf05841ff17a98141924999613
Reviewed-on: https://pdfium-review.googlesource.com/42890
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Proves we own the memory that the class will eventually free.
Change-Id: Ie9523da8db738e7478a1c73e3e1a6b24aed38442
Reviewed-on: https://pdfium-review.googlesource.com/41290
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
It is always true now.
BUG=pdfium:263
Change-Id: I74fd0091f5815701718e8cd5acc6e7a0de772a85
Reviewed-on: https://pdfium-review.googlesource.com/40031
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Turns out that "FromUnicode" is misleading in that, on linux, it simply
removes any characters beyond 0xFF and passes the rest unchanged, so
no unicode decoding actually takes place. On Windows, it passes it into
the system function specifying FX_CODEPAGE_DefANSI, converting it into
the so-called "default ANSI code plane", passing some characters,
converting others to '?' and still others to 'A'. Either way, nothing
resembling UTF8 comes out of this, so pick a better name.
These now immediately look suspicious, so a follow-up CL will see
which ones should really be WideString::UTF8Encode() instead.
Making this a normal method on a widestring rather than a static
method on a bytestring feels more natural; this is parallel to
the UTF8Encode and UTF16LE_Encode functions.
Add a test that shows these conversions.
Change-Id: Ia7551b47199eba61b5c328a97bfe9176ac8e583c
Reviewed-on: https://pdfium-review.googlesource.com/39690
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I5dfadcb68e640235be6e3eb7c8d57ae3b8013d26
Reviewed-on: https://pdfium-review.googlesource.com/35691
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Many of these are converting ByteString => c_str => ByteStringView, since
the ByteStringView ctor is implicit. This is unfortunate, since that
involves a strlen() which the ByteString already knows if we use
AsStringView() instead.
This changed one test result where we can now return the string
"\0" instead of "" -- since strlen no longer eats the NUL. This
seems consistent, say, with String.fromCharCode().
Change-Id: I17f68d1a1f4b352960208f9148e68ab4c4d78bd2
Reviewed-on: https://pdfium-review.googlesource.com/35590
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
When generating PDFs using the fixup script and a .in, specify them to
to use Ahem.ttf as the text font. Ahem is a font designed to reduce
flakiness in pixel tests due to font rendering differences between
platforms. Specifically the glyphs in the font are standard size black
boxes, so though the specific text content cannot be easily compared,
things like layout and high level changes to the content can still
be tested. Testing things like specific text changes should be done
via an embedder test, where the strings in the elements can be
extracted and inspected.
The font itself is is CID type 2 font, which is relatively complex to
correctly embed in a PDF due to subsetting and other features. Instead
of embedding it in the generated PDFs, which was originally attempted,
it is being supplied to pdfium_test via the --font-dir flag. This flag
overrides where the binary looks for system fonts. This works
correctly on Mac and Linux, but not on Windows, which is why that
platform remains suppressed.
BUG=pdfium:1008,pdfium:1020
Change-Id: I00811536de98f736fc599d96b397194ccf8db0cd
Reviewed-on: https://pdfium-review.googlesource.com/27790
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: I71417cc5b1bd00f77d42740198cc17487ebd686e
Reviewed-on: https://pdfium-review.googlesource.com/33330
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
Fix an use-after-free issue which was introduced by
commit 53279b1dcabae4913f7f0a58e741942e82ab7d59.
Bug: chromium:832589
Change-Id: Id7da791c3aa2d71d0a9e56d062069f41b7eb48d1
Reviewed-on: https://pdfium-review.googlesource.com/30570
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
This CL renames IFX classes in core/fxge to Iface.
Change-Id: I137167ddd4ff1563d8002d9501222c27183408cc
Reviewed-on: https://pdfium-review.googlesource.com/27990
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: Ibaf53ee27eefc692ac4f002c3ab28b7738676b31
Reviewed-on: https://pdfium-review.googlesource.com/26991
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: Ic1d63e8ef54a820b01d67dbf1dd6f6f72a06b77c
Reviewed-on: https://pdfium-review.googlesource.com/26990
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
The existing code has a couple of issues that need to be
addressed. First it assumes that for a hash, there will be an entry in
the map and blindly calls the [] operator and takes the address of the
result. If there isn't an entry for the hash then this will cause a
crash. This has been converted to a call to find and returning
nullptr, which is the fail result, if it cannot find an entry for the
hash.
The other issue is that it assumed that the first entry in the vector
would be a valid pointer. When removing fonts from the vector,
RemoveFont, first nulls out entries. Once all of the entries have been
removed from a vector on subsequent calls to RemoveFont, then the
vector is removed from the map. Thus the first entry in the vector
might not be the correct value to return. This has been changed to a
linear scan of the vector for a valid pointer.
BUG=chromium:648177
Change-Id: Ife758636545f0d10fb726c243e3e0a5b7c1d1138
Reviewed-on: https://pdfium-review.googlesource.com/25930
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
BUG=pdfium:798
Change-Id: If89c162f8a6c15a8a0f4313fbf4713ee2fde5357
Reviewed-on: https://pdfium-review.googlesource.com/24719
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I0caba99cb8e99ea5af49d906b576f580275620bb
Reviewed-on: https://pdfium-review.googlesource.com/20570
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Also fix other occurrences that were missed.
Bug:pdfium:947
Change-Id: Ic7e909ff9ce3abdf91e8e9ba108c84ad28b2fd65
Reviewed-on: https://pdfium-review.googlesource.com/20472
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
This CL unifies a bit the public methods of CFGAS_FontMgr. It does so by
replacing the multiple maps on the Windows implementation to a single
map from hash to font. Also, cloning CFX_Fonts is avoided with the use
of SetLogicalFontStyle. These Windows changes are just mimicking other
OS's. As a side-effect, some members of CFX_Fonts are now owned so the
raw pointers are replaced with unique_ptrs.
Change-Id: I576d438572ccbe6c48f8f5cc434d66fc6adba372
Reviewed-on: https://pdfium-review.googlesource.com/18131
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
This CL removes the single use case from |m_bFlagExact|. This flag
allows the PDF viewer to treat a substitute font with a matching name as
if it was actually an embedded font, which is wrong. For all substitute
fonts, it is important to follow the longer process of first obtaining
the unicode from the charcode to then obtain the glyph in the substitute
font that corresponds to that unicode.
Bug: chromium:781785
Change-Id: Ie5958b43914e0e46334b89b7c2c55c02d0da0c11
Reviewed-on: https://pdfium-review.googlesource.com/17859
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
The CFX_CRTFileAccess class was only used in one place and only provided
one method. That method was folded back into the caller and the class
removed.
Change-Id: I5e670474244a9ec037b6d099d67bd5091cac7ff4
Reviewed-on: https://pdfium-review.googlesource.com/15410
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Use methods to match font information; cleanup some font code.
Change-Id: Ib99c1e466e56723cb5d264d49e1caf9bbbc0daed
Reviewed-on: https://pdfium-review.googlesource.com/15072
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes duplicate defines between XFA and core. Several OR'd
values have been coverted into individual booleans to make the code
clearer.
Change-Id: Ic32a71c711cffd9a0cf1136e5a22f0502e085c39
Reviewed-on: https://pdfium-review.googlesource.com/15071
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL moves the CFX_Font definition out of fx_font.h and into
cfx_font.h to match the cfx_font.cpp implementation.
Change-Id: Icc2fc7463fa4b9d0bec925e80b60a638136a83a1
Reviewed-on: https://pdfium-review.googlesource.com/14951
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
This CL moves the static CFGAS_FontMgr methods to the anonymous
namespace.
Change-Id: I2835099ed9e503ee04daca3012a4ddd278255fdc
Reviewed-on: https://pdfium-review.googlesource.com/14830
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
This CL renames the FX_OS defines to have _OS_ in their names and drops
the _DESKTOP suffix. The FXM defines have been changed to just FX.
Change-Id: Iab172fba541713b5f6d14fb8098baf68e3364c74
Reviewed-on: https://pdfium-review.googlesource.com/14833
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL moves FX_HandleParentPath to be a private inner class of
CFX_FontSourceEnum_File.
Change-Id: I5e2d16c4d78457a28e1833d0b937547019cdece6
Reviewed-on: https://pdfium-review.googlesource.com/14818
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL moves the public part of the CFGAS_FontMgr declaration to be
shared across all platforms.
Change-Id: I92e587fe06611c92f72746477775802c2f3b8b57
Reviewed-on: https://pdfium-review.googlesource.com/14817
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL moves the font source into the font manager so it doesn't need
to be stored by each caller (and removes the platform dependant code).
The |EnumFonts| method is exposed on the CFGAS_FontMgr so the caller can
clear the manager if the enumeration fails.
Change-Id: Iecce3d2e09ff01152b7bb79a34fe2b728320da9c
Reviewed-on: https://pdfium-review.googlesource.com/14816
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes some default parameters from the font code.
Change-Id: If6f6e09c93474e1e8b7ffaae53eb37dd40c32fab
Reviewed-on: https://pdfium-review.googlesource.com/14815
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL renames CFX_RetainPtr to RetainPtr and places in the fxcrt
namespace.
Bug: pdfium:898
Change-Id: I8798a9f79cb0840d3f037e8d04937cedd742914e
Reviewed-on: https://pdfium-review.googlesource.com/14616
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Automated using git grep & sed.
Replace StringC classes with StringView classes.
Remove the CFX_ prefix and put string classes in fxcrt namespace.
Change AsStringC() to AsStringView().
Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*,
Foo).
Couple of tests needed to have their names regularlized.
BUG=pdfium:894
Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d
Reviewed-on: https://pdfium-review.googlesource.com/14151
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Change-Id: I87b5e6cefe973b82b4868e56fc5285c95c53a12b
Reviewed-on: https://pdfium-review.googlesource.com/12550
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
Remove dead code, move code to namespaces where possible, cleanup some
single use items.
Change-Id: Ia734477ceb2105a1ed272463bd8220f1205a7ce9
Reviewed-on: https://pdfium-review.googlesource.com/12732
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
The Find and ReverseFind methods for WideString, WideStringC,
ByteString, and ByteStringC have been converted from returning a raw
FX_STRSIZE, to returning Optional<FX_STRSIZE>, so that success/failure
can be indicated without using FX_STRNPOS.
This allows for removing FX_STRNPOS and by association makes the
conversion of FX_STRSIZE to size_t easier, since it forces checking
the return value of Find to be explictly done as well as taking the
error value out of the range of FX_STRSIZE.
New Contains methods have been added for cases where the success or
failure is all the call site to Find cared about, and the actual
position was ignored.
BUG=pdfium:828
Change-Id: Id827e508c8660affa68cc08a13d96121369364b7
Reviewed-on: https://pdfium-review.googlesource.com/11350
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Currently Find() and other methods that return a FX_STRSIZE return -1
to indicate error/failure. This means that there is a lot of magic
numbers and magic checks floating around. The standard library for
similar operations uses a npos constant. This CL implements
FX_STRNPOS, and replaces usages of magic number checking. It also does
some type cleanup along the way where it was obvious that FX_STRSIZE
should be being used.
Removing the magic numbers should make eventually changing FX_STRSIZE
to be unsigned easier in the future.
BUG=pdfium:828
Change-Id: I67e481e44cf2f75a1698afa8fbee4f375a74c490
Reviewed-on: https://pdfium-review.googlesource.com/9651
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
BUG=pdfium:690
Change-Id: I922279e4bdc8b411f47f49798155e8f9118c1396
Reviewed-on: https://pdfium-review.googlesource.com/6552
Commit-Queue: Chris Palmer <palmer@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
The CFX_MemoryStream is the only implementation of IFX_MemoryStream.
This CL removes the interfaces and uses CFX_MemoryStream directly.
Change-Id: I2f43fa39e82dafa7673517d214ae15fd2d0df331
Reviewed-on: https://pdfium-review.googlesource.com/4391
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL cleans up the fx_extension file. The stream code was moved to
fx_stream. IFX_FileAccess was removed and CFX_CRTFileAccess split to its
own file. Code shuffled from header to cpp file.
Change-Id: I700fdfcc9797cf4e8050cd9ba010ad8854feefbf
Reviewed-on: https://pdfium-review.googlesource.com/4371
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This Cl cleans up the unused defines in fx_codepage.h. The
FXFONT_CHARSET_ defines are replaced with fx_codepage defines, this
moves fx_codepage into core instead of xfa only. Static asserts are
added to verify the public/ charsets match the fx_codepage charsets.
Change-Id: Ie2f749e093de60a9a6743128a1fb087912e4cc96
Reviewed-on: https://pdfium-review.googlesource.com/4316
Commit-Queue: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
This CL moves the FGAS stream code into core/fxcrt and renames to
CFX_SeekableStreamProxy.
Change-Id: I6641fe0cca45a128ef3ec281b0b40f8d60296387
Reviewed-on: https://pdfium-review.googlesource.com/4311
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
This CL moves the FX_GetCodePageFromCharset method into cfgas_fontmgr
anonymouse namespace.
Change-Id: I1232341b8639328035f12aebfb7a65a4fc0ba08f
Reviewed-on: https://pdfium-review.googlesource.com/4291
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This Cl drops the FXSYS_ from mem methods which are the same on all
platforms.
Bug: pdfium:694
Change-Id: I9d5ae905997dbaaec5aa0b2ae4c07358ed9c6236
Reviewed-on: https://pdfium-review.googlesource.com/3613
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
The methods are not called, so the data is not used. Removed.
Change-Id: I29e904da2a000fd5173d2f5240ad377613db200a
Reviewed-on: https://pdfium-review.googlesource.com/3050
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: Iddd99312aee6447c05be5633eead023a004e65e1
Reviewed-on: https://pdfium-review.googlesource.com/3034
Reviewed-by: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I96e0a20d66b9184d22f64d8e4ce0dadd5a78c1e8
Reviewed-on: https://pdfium-review.googlesource.com/2967
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: Ic6edc7740513075c2a738cc8897460af17bb0103
Reviewed-on: https://pdfium-review.googlesource.com/2895
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
In https://codereview.chromium.org/2559903002 we refactored the font manager
in XFA but got part of the negation wrong. Fixup logic.
Change-Id: Idd51ff846fe64a56908ec26bf2798c1df8433611
Reviewed-on: https://pdfium-review.googlesource.com/2891
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Doing so reveals places where there are needless copies
and conversions.
Change-Id: I24a868d40aa63836f4167eaf4541964049df7916
Reviewed-on: https://pdfium-review.googlesource.com/2555
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Code is much clearer when we use the actual types
rather than this convention.
Review-Url: https://codereview.chromium.org/2618993002
|
|
Review-Url: https://codereview.chromium.org/2610813010
|