summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fsdk_mgr.cpp
AgeCommit message (Collapse)Author
2015-10-30Clean up CPDF_AnnotList.Lei Zhang
- Remove dead code - Stop using CFX_PtrArray - Mark more things const - Fix style nits R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1425093003 .
2015-10-30Move a unique_ptr initialisation out of the initialisation list in fsdk_mgr.cppOliver Chang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1407103006 .
2015-10-30Convert a bunch of raw pointers in fsdk_mgr to unique_ptrs.Oliver Chang
R=tsepez@chromium.org, thestig@chromium.org Review URL: https://codereview.chromium.org/1425233002 .
2015-10-30CPDFDoc_Environment::GetAnnotHandlerMgr() never returns nullptr.Lei Zhang
Remove checks for its return value. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1424233003 .
2015-10-30Rip out the KillFocusAnnot call from CPDFSDK_PageView's destructorOliver Chang
Previously, blur event actions could potentially touch deleted PageViews as CPDFSDK_Document deletes the PageViews one by one. This also fixes a related issue: CPDFSDK_Document::SetFocusAnnot no longer does anything if the document is being destroyed. Otherwise, it eventually tries to use m_pEnv->GetSDKDocument() at which point has already been set to NULL by FPDFDOC_ExitFormFillEnvironment. R=tsepez@chromium.org, thestig@chromium.org BUG=512445 Review URL: https://codereview.chromium.org/1414353007 .
2015-10-30Fix incorrect CPDFSDK_PageView::CountAnnots(). (try 2)Lei Zhang
The original XFA version was correct, and the master version here is wrong. The two versions are now in sync, but incorrect. So we need to fix this here and then merge to XFA again. Also fix what are now incorrect uses of CountAnnots() and do some cleanups. BUG=543049 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1413973011 .
2015-10-30Revert "Fix incorrect CPDFSDK_PageView::CountAnnots()."Lei Zhang
This reverts commit 9dd9439d23d44d105db0950e33af0cc913a6cece. BUG=536967 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1421583005 .
2015-10-30Fix incorrect CPDFSDK_PageView::CountAnnots().Lei Zhang
The original XFA version was correct, and the master version here is wrong. The two versions are now in sync, but incorrect. So we need to fix this here and then merge to XFA again. BUG=536967 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1406183007 .
2015-10-23Cleanup parts of CPDFSDK_AnnotIterator and CPDFSDK_PageView.chromium/2547chromium/2546Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1411203007 .
2015-10-22Add type cast definitions for CPDF_Array.Dan Sinclair
This Cl adds ToArray, CPDF_Object::AsArray and CPDF_Object::IsArray and updates the src to use them as needed. BUG=pdfium:201 R=thestig@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1417893003 .
2015-10-20Make CFX_FontMgr member variables private. (try 2)Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1412733011 .
2015-10-20Revert "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 .
2015-10-20Revert "Make CFX_FontMgr member variables private."Lei Zhang
This reverts commit c29bee029cd5fe3f8a4ceb580235ac2d0e5ce8fd. because it broke corpus tests. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1410733005 .
2015-10-20Revert "Add type cast definitions for CPDF_Dictionary."Dan Sinclair
This reverts commit 4816432671eef6467354aa252f22bb80acc315b7. Reason, broke the javascript_test Rendering PDF file /mnt/data/b/build/slave/linux/build/pdfium/out/Debug/gen/pdfium/testing/javascript/document_methods.pdf. Non-linearized path... FAILURE: document_methods.in; Command '['/mnt/data/b/build/slave/linux/build/pdfium/out/Debug/pdfium_test', '/mnt/data/b/build/slave/linux/build/pdfium/out/Debug/gen/pdfium/testing/javascript/document_methods.pdf']' returned non-zero exit status -11 BUG=pdfium:201 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1412413002 .
2015-10-20Make CFX_FontMgr member variables private.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1405213003 .
2015-10-20Add type cast definitions for CPDF_Dictionary.Dan Sinclair
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/1399233003 .
2015-10-14Next round of master changes to match XFATom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1401423004 .
2015-10-13Changes to master to more closely match XFA.Tom Sepez
These files should change in master in order to reduce the number of "noise diffs" between master and XFA as seen in https://codereview.chromium.org/1399273003/ This includes: whitespace, matching header ordering, and implementing a GetPageFromFPDFPage() from XFA. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1407583004 .
2015-10-07Rename IFXJS_Runtime and IFXJS_Context to IJS_.Tom Sepez
Nothing but sed. FXJS is a layer that makes it easier to define objects in V8, but has no knowledge of PDF-specific native objects. It could in theory be used to implement other sets of native objects. JS is the layer that implements PDF-specific native objects on top of FXJS. Therefore, the classes used to interface to JS should be named using IJS_. IFXJS_ is reserved for someday adding better API for FXJS iteslf. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1386173002 .
2015-10-06Make the vast majority of JS headers private to src/javascript.Tom Sepez
The fpdfsdk/include/javascript/IJavascript.h is the sole API. This required moving a creaton method to it from JS_Runtime. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1389783002 .
2015-09-21Remove CJS_RuntimeFactorychromium/2519chromium/2518chromium/2517Tom Sepez
The Factory Design Pattern isn't buying us anything here over just new'ing the object we want. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1360523004 .
2015-09-09Fix heap use after free in CPDFSDK_Annot::GetPDFAnnot.Tom Sepez
Use two seperate loops to kill current focus annot and to release annots in current page. Loop to kill current focus annot is run first, so it will not access deleted annots. BUG=507316 R=tsepez@chromium.org TEST=Reproduction steps mentioned in issue 507316 should not crash chrome. Unit test added to pdfium. Run pdfium_embeddertests.exe. Review URL: https://codereview.chromium.org/1312313006 .
2015-09-01CPDFSDK_MediaActionHandler is unused.Tom Sepez
It's never instantiated, and any pointers to it are always NULL. Also kill an unused arg to CPDFSDK_ActionHandler ctor along the way. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1329583004 .
2015-08-19Extern in .cpp files is a code smell.Tom Sepez
Part 1. Move to headers so compiler can type check against the definitions. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1299963002 .
2015-08-14Use override in more classes in fpdfsdk/Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1287193005 .
2015-08-04clang-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' | \ xargs ../../buildtools/mac/clang-format -i See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion. BUG=none R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1265503005 .
2015-07-27Revert "FX Bool considered harmful, part 3"Tom Sepez
This reverts commit ff46aaf499edcf153ee2f57c7016587aa96dcfa0. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1255293002 .
2015-07-27FX Bool considered harmful, part 3Tom Sepez
Try to reland this patch after fixing underlying issues that caused it to be reverted. fx_system.h is the only manual edit. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1258093002 .
2015-07-23Revert "FX_BOOL considered harmful, part 2."Tom Sepez
This reverts commit 320b2313d19869333ed453af546e61a9fc2b81c9. Reason for revert: build failure. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1255693002 .
2015-07-23FX_BOOL considered harmful, part 2.Tom Sepez
Fully automatic change, execpt for cleanup in fx_system.h R=thestig@chromium.org Review URL: https://codereview.chromium.org/1254703002 .
2015-07-22Re-land else-after-returnsTom Sepez
Revert "Revert "Fix else-after-returns throughout pdfium."" This reverts commit 4eb4d7f6c707cc2c23c806aa540d055c8832b55d. Fix one naming conflict. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1243953004 .
2015-07-22Revert "Fix else-after-returns throughout pdfium."Tom Sepez
This reverts commit 7cc97521db1e52d5927f5605de5f9a7102f8af40.
2015-07-22Fix else-after-returns throughout pdfium.Tom Sepez
Driven by CS search for pcre:yes file:third_party/pdfium/ -file:pdfium/third_party/ \breturn\b[^;]*;\s*\n*\s*\}*\s*\n*\r*else Note: Care is required to ensure the preceding block is not an else-if. As usual, removed any tabs I saw. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1243883003 .
2015-07-16Tidy up CPDFDOC_Environment.Tom Sepez
- untabify as encountered. - Only put single-statement method in .h file, move more complex methods to .cpp (counting an if without braces as a single statement, killing braces as needed). - Move invariant arguments to constructor and make corresponding members const. - Make all members private and add accessor methods. - Make existing accessor methods const where possible. - Kill meaningless asserts. - Add helper functions in place of duplicate code. - Rename GetCurrentDoc() to GetSDKDocument(), since the class has two document members, one of CPDF_Document and one of CPDFSDK_Document, making it clear which one you get. - Simplify some logic with early returns. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1235393002 .
2015-06-22Cleanup: Remove more checks for new returning NULL.Lei Zhang
R=jam@chromium.org Review URL: https://codereview.chromium.org/1198903002.
2015-06-22Delete dead code for deleting pages and icons.Lei Zhang
1) Document::deletePages() 2) CPDFSDK_Document::DeletePages() 3) Document::removeIcon() 4) IconTree::DeleteIconElement() Originally (1) called (2), but only when FOXIT_CHROME_BUILD was not defined. Since it was always defined for PDFium, this was effectively dead code the whole time. Ditto for (3) and (4). The functions were deemed unsafe in https://crbug.com/67100 R=jam@chromium.org Review URL: https://codereview.chromium.org/1193323002.
2015-06-19Replace CFX_MapPtrTemplate with std::map.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1181593003.
2015-06-19Cleanup: Do not check pointers before deleting them.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1192743004.
2015-06-17Replace some Release() calls with virtual destructors.Tom Sepez
A virtual method that does |delete this| is an anti-pattern. Some classes can be de-virtualized instead. Throw in some unique_ptrs and delete dead code for good measure. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1192013002.
2015-06-11Cleanup: Get this rid of "this->" in fpdfsdk/Lei Zhang
Also remove commented out code and trailing whitespaces. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1179653005.
2015-06-10Remove typdefs for pointer types in fx_system.h.Tom Sepez
This involves fixing some multiple variable per line declarations, as the textually-substituted "*" applies only to the first one. This involves moving some consts around following the substitution. This involves replacing some typedefs used as constructors with better code. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1171733003
2015-06-09Use stdint.h types throughout PDFium.Tom Sepez
It's redundant nowadays to provide our own equivalents, now that this is done for us by the system header. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1177483002
2015-06-05Cleanup: Make CPDF_Annot::m_pAnnotDict private.Lei Zhang
Remove dead code in CPDF_Annot as well. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1157773012
2015-05-11Create top-level public/ header directory.Tom Sepez
These are the only files that embedders of PDFium should be including. They are entirely self-contained, and compile cleanly against -Wall so as to not offend the code that may include them. Having done this, we can see that chromium is pulling in two additional files from the fpdfsdk/include/pdfwindow directory, which is not guaranteed to work. A few files are renamed, adding an "_" to make the names consistent. The exception is fpdfview, which is doc'd as such in the doc. Naturally, paths will need updating in a handful of files in chrome when this rolls in. BUG=pdfium:154 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1135913002
2015-03-05Make conversion between CPDF_Action and its dictionary explicit.Tom Sepez
Precursor to taking a second shot at cleaning up the FPDF_* APIs. A FPDF_Action is a CPDF_Dictionary, and a CPDF_Action is a structure holding a FPDF_Action. This goes against the convention that FPDF_ types get cast to CPDF_* types, so we want to make it clear where objects are getting constructed, etc. Also tidy fpdf_actionhandler.cpp because it bugs me. R=thestig@chromium.org Review URL: https://codereview.chromium.org/984773002
2014-09-24Lock page in LoadFXAnnot to prevent unintended page closingBo Xu
BUG=410326 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/594403003
2014-07-31Fix a few more -Wreorder warnings.Nico Weber
No intended behavior change. BUG=pdfium:29 R=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/436483002
2014-05-23Convert all line endings to LF.John Abd-El-Malek
2014-05-17Initial commit.John Abd-El-Malek