summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-10-12Cleanup nits from merge CLchromium/2889dsinclair
This CL cleans up the nits from https://codereview.chromium.org/2410893002/. Review-Url: https://codereview.chromium.org/2417633002
2016-10-12added SkSL to Skia buildethannicholas
This fixes a pfdium build error when using the Skia backend, due to new Skia files which are not being properly included in the pdfium build. Review-Url: https://codereview.chromium.org/2403863002
2016-10-12Convert from int to float values.dsinclair
The CPDF_Page::GetDisplayMatrix expects to set float values into the |display_matrix| but all of the input values are currently int. It is possible to overflow the int values, so this CL changes the variables to be int which closer reflects what they're being used for. BUG=chromium:652038 Review-Url: https://codereview.chromium.org/2412983002
2016-10-12Cleanup env variable namesdsinclair
This CL cleans up any old m_pEnv variables to be correctly named m_pFormFillEnv. Review-Url: https://codereview.chromium.org/2412523002
2016-10-12Merge CPDFSDK_Document into CPDFSDK_FormFillEnvironmentdsinclair
This CL merges the CPDFSDK_Document and CPDFSDK_FormFillEnvironment classes as they always existed and always pointed at each other. Review-Url: https://codereview.chromium.org/2410893002
2016-10-12Reduce code duplication in CPDF_Type1Font::LoadGlyphMapnpm
Added methods SetExtGID and CalcExtGID for this purpose. Changed protected to private: no one inherits CPDF_Type1Font. Review-Url: https://codereview.chromium.org/2412483006
2016-10-12Check for more undefined behavior in CPDF_PSEngine.thestig
BUG=chromium:639792 Review-Url: https://codereview.chromium.org/2415483002
2016-10-12Get rid of CFX_ArrayTemplate<CPDF_Object*>tsepez
They won't work with std::unique_ptr down the road, so replace with std::vector. Review-Url: https://codereview.chromium.org/2411703003
2016-10-12Optimize roll operator in CPDF_PSEngine.thestig
Rolling 0 times is a no-op. Rolling 0 items is a no-op. Rolling N items J times is the same as rolling N items J % N times. This also avoids an integer overflow corner case. BUG=chromium:648077 Review-Url: https://codereview.chromium.org/2412833002
2016-10-12Remove unused widget handler overridesdsinclair
This CL removes override points from the widget hander classes. Review-Url: https://codereview.chromium.org/2410193005
2016-10-12Fix else-line corrupted by non-ascii character when importkcwu
BUG=pdfium:619 Review-Url: https://codereview.chromium.org/2411123003
2016-10-11Delete unused flags from CFX_SubstFontchromium/2888npm
Review-Url: https://codereview.chromium.org/2409173003
2016-10-11Fixup formfiller cleanupdsinclair
The CFFL_InteractiveFormFiller must be cleaned up before the environment because the destruction of the formfiller will trigger the destruction of the formfiller widgets. Some of those widgets may require stopping timers, which requires accessing the environment. BUG=chromium:654272, chromium:653459 Review-Url: https://codereview.chromium.org/2408163003
2016-10-11Remove remaining CPDFSDK_Document referencesdsinclair
Review-Url: https://codereview.chromium.org/2399213002
2016-10-11Convert CPDFXFA_Document to use CPDFSDK_FormFillEnvironmentdsinclair
This CL removes the use of CPDFSDK_Document from CPDFXFA_Document. Review-Url: https://codereview.chromium.org/2396213002
2016-10-11Add CPDF_Object::IsInline()tsepez
Prevent having to remember what an object number of 0 implies. Review-Url: https://codereview.chromium.org/2412673002
2016-10-11Deleted unused members in CTTFontDescnpm
Review-Url: https://codereview.chromium.org/2408213002
2016-10-11Convert fpdfformfill to use CPDFSDK_FormFillEnvironmentdsinclair
This CL converts to using CPDFSDK_FormFillEnvironment instead of CPDFSDK_Document internally. Review-Url: https://codereview.chromium.org/2398253002
2016-10-11Convert CPDFSDK_ActionHandler to CPDFSDK_FormFillEnvironmentdsinclair
This CL replaces CPDFSDK_Document with CPDFSDK_FormFillEnvironment in CPDFSDK_ActionHandler. Review-Url: https://codereview.chromium.org/2397933003
2016-10-11Convert IJS_Runtime to CPDFSDK_FormFillEnvironmentdsinclair
This CL changes the use of CPDFSDK_Document to CPDFSDK_FormFillEnvironment. Review-Url: https://codereview.chromium.org/2394313002
2016-10-11Rename fpdf_page_doc.cpp -> cpdf_docpagedata.htsepez
Review-Url: https://codereview.chromium.org/2409283002
2016-10-11Fix negative font rendering on Mac by reversing matrix c component.npm
Notice that this is just making it analoguous to how it works when the font is positive: the b and d components are reversed. Currently, when the font is negative, only the a component is reversed. The c one needs to be reversed as well. BUG=chromium:653941 Review-Url: https://codereview.chromium.org/2411833002
2016-10-11Remove CPDFSDK_Document from IJS_Contextdsinclair
This CL converts the IJS_Context and implementations over to use CPDFSDK_FormFillEnvironment instead of CPDFSDK_Document. Review-Url: https://codereview.chromium.org/2399943002
2016-10-11Convert Field to use CPDFSDK_FormFillEnvironmentdsinclair
This CL changes Field from using a CPDFSDK_Document to using a CPDFSDK_FormFillEnvironment. Review-Url: https://codereview.chromium.org/2400443005
2016-10-11Convert CPDFSDK_PageView to have a CPDFSDK_FormFillEnvironmentdsinclair
This CL changes CPDFSDK_PageView to have a CPDFSDK_FormFillEnvironment instead of a CPDFSDK_Document. Review-Url: https://codereview.chromium.org/2400673002
2016-10-11Convert CPDFSDK_InterForm to take a CPDFSDK_FormFillEnvironmentdsinclair
This CL removes CPDFSDK_Document from CPDFSDK_InterForm and has it work with a CPDFSDK_FormFillEnvironment. Review-Url: https://codereview.chromium.org/2397723005
2016-10-11Slightly simplify CFX_FontMapper::FindSubstFontnpm
- Deleted useless flag FXFONT_SUBST_STANDARD - Change kExternalFontIndex to something more meaningful - Fetch symbolic fonts using UseInternalSubst too Review-Url: https://codereview.chromium.org/2400773002
2016-10-11Fix cmdStageAllocMatrix parameter swap againkcwu
This is fixup of 958e57cb. BUG=chromium:651849,chromium:654198 Review-Url: https://codereview.chromium.org/2407113002
2016-10-10Move ToString() and friends from CPDF_Object.h to CPDF_String.htsepez
Ditto with the other ToXXX functions to CPDF_xxx.h. Shortly, we will want to introduce another variant: inline std::unique_ptr<CPDF_String> ToString( std::unique_ptr<CPDF_Object>); This will require that CPDF_String be complete which is not the case in the CPDF_Object.h header. Rather than dragging all the other .h's into it, move these to the subclass headers. That way, these will be together when the new form is added. Review-Url: https://codereview.chromium.org/2406033002
2016-10-10Land all the fixes from 5609f39c but don't enable assertchromium/2887tsepez
Split this off so that we don't keep losing this when the assert is reverted again. Review-Url: https://codereview.chromium.org/2401423005
2016-10-10Add method to convert to an indirect object in a dictionary.tsepez
Avoid an assert which previously could only be overcome by removing/re-inserting. Back-fill a unit test for the equivalent Array method. BUG=654387 Review-Url: https://codereview.chromium.org/2403143002
2016-10-10Revert "Re-land "Assert that only 0-numbered objects are Released()""tsepez
This reverts commit b69a98cf50537130f88ce3a799117f2ca8353ac5. Reason for revert: crashes on mac. BUG=654387 TBR=thestig@chromium.org Review-Url: https://codereview.chromium.org/2410483002
2016-10-10libtiff: Prevent a buffer overflow in function ChopUpSingleUncompressedStrip.stackexploit
The patch (https://codereview.chromium.org/2284063002) for Issue 618267 was insufficient. The integer overflow still could be triggered and could lead to heap buffer overflow. This CL strengthens integer overflow check in function _TIFFCheckRealloc. BUG=chromium:654169 R=ochang@chromium.org, tsepez@chromium.org, dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2405693002
2016-10-06Fix assertion failure when decoding malform G4 fax imagechromium/2886chromium/2885chromium/2884kcwu
The position indexes of color elements must be monotonic increasing. Bail out if the decoded index is less or equal to the previous index. BUG=pdfium:615 Review-Url: https://codereview.chromium.org/2398033002
2016-10-06Reject JBig2 Huffman table with too large shift valuekcwu
BUG=chromium:653044 Review-Url: https://codereview.chromium.org/2397783002
2016-10-06Split m_InstalledTTFonts into two vectors to avoid sketchy logic.npm
Instead of relying on ' ' to determine whether the CFX_Bytestring is added on one place or another, use another vector. When trying to match fonts from the fontmapper, compare with both vectors. BUG=pdfium:510 Review-Url: https://codereview.chromium.org/2395883002
2016-10-06switch to new skia blend mode enum classcaryclark
Skia's interface to transfer modes is not described by an enum instead of a class. R=reed@google.com, dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2394683004
2016-10-06Fixup MSan embeddertestsDan Sinclair
The embeddertests were closing the document before the formfill environment. This caused a use-after-free as we try to use the document during formfill destruction. This Cl fixes the destruction order in the embedder tests. As well, a few guards are put in place to keep the system from crashing if the wrong destruction order is called. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/2398063002 .
2016-10-05Remove m_pOccontent from CPDFSDK_Documentchromium/2882dsinclair
Unused, remove. Review-Url: https://codereview.chromium.org/2397513003
2016-10-05Rename CPDFSDK_Environment to CPDFSDK_FormfillEnvironmentdsinclair
Rename CPDFSDK_Environment to make it explicit that this is part of the formfill system. Review-Url: https://codereview.chromium.org/2391313002
2016-10-05Remove ownership of CPDFSDK_Document from CPDFXFA_Documentdsinclair
This CL updates CPDFXFA_Document so it never owns the CPDFSDK_Document. The CPDFSDK_Document is now always owned by the CPDFXFA_Environment. This also cleans up the strange need to reverse the order of document and form destruction when using XFA. Review-Url: https://codereview.chromium.org/2397473006
2016-10-05Removed unused stuff, some FX_BOOL, and cleanup pageint.h a bitnpm
- Remove some unused stuff from pageint.h. - Replace some FX_BOOL with bool in pageint.h, and related. - Replace some "protected" with "private" in pageint.h. - Move 2 methods into namespace in fpdf_page_parser_old.cpp. Review-Url: https://codereview.chromium.org/2399573002
2016-10-05Re-land "Assert that only 0-numbered objects are Released()"tsepez
This reverts commit b73c99335bfbd158ad16dd59c9c52396ffd2b54b. TBR=thestig@chromium.org Review-Url: https://codereview.chromium.org/2393783004
2016-10-05Rework a redundant check when calling ConvertToIndirectObjectAt()tsepez
This avoids a re-assignment that can otherwise cause a later fault. BUG=pdfium:607 Review-Url: https://codereview.chromium.org/2393953002
2016-10-05Cleanup some CPDFSDK_PageView annotation code.dsinclair
This Cl cleans up the code regarding CPDFSDK_Annots in CPDFSDK_PageView. This includes: * Makes DeleteAnnot XFA only and wraps at the call site. * Removes unused methods * Replaces use of CountAnnots and GetAnnot with vector iteration * Removes {Set|Kill}FocusAnnot from CPDFSDK_PageView * Renames m_fxAnnotArray to m_SDKAnnotArray Review-Url: https://codereview.chromium.org/2384323005
2016-10-05Remove FX_BOOL from core/fpdfapi/fontnpm
FX_BOOL can be replaced by bool. Also replaced in a couple other places so that Winbots pass. Review-Url: https://codereview.chromium.org/2395803002
2016-10-04Fix cmdStageAllocMatrix parameter swapkcwu
For cmdStageAllocMatrix, InputChans is length of Matrix, OutputChans is length of Offsets. The original code will allocate NewElem->Offset with length Cols=InputChans (cmslut.c:417). This results in heap buffer overflow later. BUG=chromium:651849 Review-Url: https://codereview.chromium.org/2384063006
2016-10-04Fix ownership when making a private annot dictionary into a shared one.tsepez
There's no way to take ownership back from the CPDF_Array without deleting the object, so add a new primitive to make elements become indirect rather than manipulating them outside the class. This should solve the ASSERT(objnum == 0) issue that blocked the previous roll. Review-Url: https://codereview.chromium.org/2391883003
2016-10-04Rename fpdfsdk/fpdfxfa files to match contentschromium/2881dsinclair
Each of these files contains a single class, rename the file to match the internal class name. Review-Url: https://codereview.chromium.org/2385423004
2016-10-04Cleanup DEPS filesdsinclair
Remove redundant DEPS files and DEPS file entries. Review-Url: https://codereview.chromium.org/2390833003