summaryrefslogtreecommitdiff
path: root/core/fpdfdoc
AgeCommit message (Collapse)Author
2017-01-24Fix CPDF_InterForm::CheckRequiredFields and its callers.Nicolas Pena
The method is used twice in fpdfsdk/cpdfsdk_interform.cpp and twice in fpdfsdk/javascript/Document.cpp, but not in a compatible way. Changed the method so that it now returns true when checks pass, which is the more natural thing to do, considering the name of the method. BUG=pdfium:659 Change-Id: Iacf3049f328df1d4db3fbfc995acf184230ebf48 Reviewed-on: https://pdfium-review.googlesource.com/2297 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-01-10Remove some CFX_ArrayTemplate in fpdfapi and fpdfdoctsepez
Also use unique_ptr in one spot while we're at it. Review-Url: https://codereview.chromium.org/2625483002
2016-12-16Return unique_ptr<> from IPDF_StructTreetsepez
Delete some dead code in the process. Review-Url: https://codereview.chromium.org/2585873002
2016-12-14Avoid the ptr.reset(new XXX()) anti-patterntsepez
Be suspicious of |new|. This removes some of the easy cases. Review-Url: https://codereview.chromium.org/2571913002
2016-12-13Use CFX_MaybeOwned<> in CPDF_Annot.tsepez
Avoid another unique_ptr release and a separate flag. Review-Url: https://codereview.chromium.org/2570913002
2016-12-07Fix the way to check terminal field in interactive formchromium/2945weili
Originally the key "T" was checked which was not correct since that key is optional. Now change to check "FT" as well as its parent's key since this key is also inheritable. BUG=chromium:440132 Review-Url: https://codereview.chromium.org/2554223002
2016-11-28Make FDF document creation return unique_ptrstsepez
Review-Url: https://codereview.chromium.org/2538533003
2016-11-23Add FPDF_RenderPageBitmapWithMatrix API.thestig
BUG=pdfium:522 Review-Url: https://codereview.chromium.org/2526473002
2016-11-23Add API for getting page labels.thestig
BUG=pdfium:479 Review-Url: https://codereview.chromium.org/2521843003
2016-11-22Use more unique_ptrs in CPDF_SyntaxParser and CPDF_Annotchromium/2929tsepez
Review-Url: https://codereview.chromium.org/2526543003
2016-11-21Split fwl/core class pt II.dsinclair
Split classes in FWL to be single class per file. In the case of data providers which added no new methods, removed and used the IFWL_Widget::DataProvider directly. Review-Url: https://codereview.chromium.org/2520063002
2016-11-21Fixup lint flags.Dan Sinclair
The -build/include setting was masking out build/include_what_you_use. This CL restores them, fixes any build errors, and adds NOLINT as needed. As well, the runtime/explicit and runtime/printf flags are aslo enabled and NOLINT'd. lint cleanups Change-Id: Ib013b3eb29c8d0e48cad74c5df9028684130719f Reviewed-on: https://pdfium-review.googlesource.com/2030 Reviewed-by: Tom Sepez <tsepez@chromium.org>
2016-11-18Make CPDF_Dictionary use unique pointers.chromium/2926tsepez
Some changes were required to match underlying ctors as invoked by the templated methods. Many release() calls go away, a few WrapUniques() are introduced to avoid going deeper into other code. Review-Url: https://codereview.chromium.org/2510223002
2016-11-16Make CPDF_Object subclass constructors intern stringstsepez
Make CDPF_Arrays intern the object they create. Allow passing nullptr as a CFX_WeakPtr shortcut as well. Review-Url: https://codereview.chromium.org/2509123002
2016-11-16Make CPDF_Array take unique_ptrstsepez
BUG= Review-Url: https://codereview.chromium.org/2498223005
2016-11-15Make AddIndirectObject() take a unique_ptr.tsepez
Add convenience routines to create and add object in one step. Review-Url: https://codereview.chromium.org/2489283003
2016-11-10Use more unique_ptrs for CPDF_Annot and friends.thestig
Review-Url: https://codereview.chromium.org/2494583002
2016-11-10Use more unique_ptrs in CPVT_GenerateAP.thestig
Review-Url: https://codereview.chromium.org/2488103002
2016-11-09Return unique_ptr from CPDF_Object::Clone().tsepez
Because that's what clone does. There are numerous release() calls that will go away as more code is converted. Review-Url: https://codereview.chromium.org/2484033002
2016-11-08Add FPDFDest_GetLocationInPage APIdsinclair
Add an API to get the value of the /XYZ destination parameter. This CL was originally from https://codereview.chromium.org/1960193003/ by halcanary@. Review-Url: https://codereview.chromium.org/2481743004
2016-11-07Force compiler to deduce src type for checked_cast<dst, src>.tsepez
Otherwise, we might be silently doing an unsafe cast before applying the check if the actual argument doesn't match the exact src type. Review-Url: https://codereview.chromium.org/2484953003
2016-11-04Implement FPDF_VIEWERREF_GetName() API.chromium/2910thestig
This is a generic API function to retrieve any viewer preference of type name. BUG=pdfium:414 Review-Url: https://codereview.chromium.org/2475923003
2016-11-04Reland "Remove CPDF_Object::Release() in favor of direct delete"tsepez
This reverts commit f0d5b6c35fa343108a3ab7a25bc2cc2b3cf105b3. Review-Url: https://codereview.chromium.org/2478303002
2016-11-04Revert of Remove CPDF_Object::Release() in favor of direct delete (patchset ↵dsinclair
#11 id:200001 of https://codereview.chromium.org/2384883003/ ) Reason for revert: Looks like it's blocking the roll. https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_compile_dbg_ng/builds/186619 Original issue's description: > Remove CPDF_Object::Release() in favor of direct delete > > Follow-on once we prove Release always deletes in previous CL. > > Committed: https://pdfium.googlesource.com/pdfium/+/4de3d095c9d9e961f93750cf1ebd489fd515be12 TBR=thestig@chromium.org,tsepez@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review-Url: https://codereview.chromium.org/2478253002
2016-11-03Remove CPDF_Object::Release() in favor of direct deletetsepez
Follow-on once we prove Release always deletes in previous CL. Review-Url: https://codereview.chromium.org/2384883003
2016-11-02Remove FX_BOOL from coretsepez
Review-Url: https://codereview.chromium.org/2477443002
2016-10-26Take advantage of implicit std::unique_ptr<>(nulltpr_t) ctor.tsepez
Review-Url: https://codereview.chromium.org/2453163002
2016-10-17Revert "Make CPDF_Object containers hold objects via unique pointers."tsepez
This reverts commit 1d023881cd53485303c0fcc0b5878e700dc470fd. Reason for revert -- fuzzers hit issues. TBR=thestig@chromium.org Review-Url: https://codereview.chromium.org/2425783002
2016-10-15Fix some nits in cpdf_annotlist.cpp.thestig
Review-Url: https://codereview.chromium.org/2395693002
2016-10-14Revert "Update CPDF_IndirectObjectHolder APIs for unique objects."Tom Sepez
This reverts commit 3ba098595ae56b64eacc0c25ab76b89a4d78d920. TBR=thestig@chromium.org,weili@chromium.org Review URL: https://codereview.chromium.org/2424533003 .
2016-10-14Update CPDF_IndirectObjectHolder APIs for unique objects.tsepez
Doing so highlights a few places where ownership is dubious. Add convenience functions to return an unowned reference to a newly-created indirect object. Review-Url: https://codereview.chromium.org/2419173002
2016-10-13Make CPDF_Object containers hold objects via unique pointers.tsepez
This tweaks the implementation while leaving the API the same. The API change is more disruptive, so break this part off first. Review-Url: https://codereview.chromium.org/2385293002
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-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-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-04Move core/fpdfapi/fpdf_render to core/fpdfapi/renderdsinclair
BUG=pdfium:603 Review-Url: https://codereview.chromium.org/2393593002
2016-10-04Move core/fpdfapi/fpdf_parser to core/fpdfapi/parserdsinclair
BUG=pdfium:603 Review-Url: https://codereview.chromium.org/2392603004
2016-10-04Move core/fpdfapi/fpdf_page to core/fpdfapi/pagedsinclair
BUG=pdfium:603 Review-Url: https://codereview.chromium.org/2386423004
2016-10-04Move core/fpdfapi/fpdf_font to core/fpdfapi/fontdsinclair
BUG=pdfium:603 Review-Url: https://codereview.chromium.org/2392773003
2016-10-03Add ptr_util.h from base until std::make_unique<> availabletsepez
Review-Url: https://codereview.chromium.org/2386273004
2016-09-30Fix build of pdf_hint_table_fuzzer.chromium/2877tsepez
Restore CPDF_Dictionary default constructor. Use it in places where reasonable in the code. TBR=dsinclair@chromium.org TBR=thestig@chromium.org Review-Url: https://codereview.chromium.org/2383843002
2016-09-29Move core/fxge/include to core/fxgedsinclair
BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2377393002
2016-09-29Move core/fxcrt/include to core/fxcrtdsinclair
BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2382723003
2016-09-29Move core/fpdfdoc/include to core/fpdfdocdsinclair
BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2374383003
2016-09-29Move core/fpdfapi/fpdf_render/include to core/fpdfapi/fpdf_renderdsinclair
BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2382763002
2016-09-29Move core/fpdfapi/fpdf_parser/include to core/fpdfapi/fpdf_parserdsinclair
BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2383543002
2016-09-29Move core/fpdfapi/fpdf_page/include to core/fpdfapi/fpdf_pagedsinclair
BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2379033002
2016-09-29Move core/fpdfapi/fpdf_font/include to core/fpdfapi/fpdf_fontdsinclair
BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2375283003
2016-09-28Fix leaks in CFieldTree::Node.thestig
Correctly account for non-leaf Nodes that have CPDF_FormField pointers. Review-Url: https://codereview.chromium.org/2376193002
2016-09-28Use string pools in some dictionaries, names, and strings.tsepez
BUG=pdfium:597 Review-Url: https://codereview.chromium.org/2345063002