summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
AgeCommit message (Collapse)Author
2017-05-23Use NOTREACHED() in more places.Lei Zhang
Change-Id: I88466943171f19259f84add69679741d44c8e123 Reviewed-on: https://pdfium-review.googlesource.com/5551 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-04-28Remove some more |new|s, part 4.Tom Sepez
FindMatchingDataNode(): The callers that passed null iterators, triggering the new, are perfectly capable of making their own iterators. Change-Id: I712fa36667d6070b43f237916e448d518e8855c2 Reviewed-on: https://pdfium-review.googlesource.com/4616 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-04-20Cleanup the fx_extension code.Dan Sinclair
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>
2017-04-19Move fde XML parser to coreDan Sinclair
This CL moves the XML parser from FDE into FXCRT and renames to CFX_ from CFDE_. Change-Id: I21a9590bf74daf5517df630d7e7a5de89da99ea4 Reviewed-on: https://pdfium-review.googlesource.com/4312 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-04-05Move XML attribute handling to a base class.Dan Sinclair
This CL moves the attribute handling out of CFDE_XMLElement and CFDE_XMLInstruction into a common CFDE_XMLAttributeNode. The handling is also converted to a std::map from either a) a vector storing name,value,name,value or b) two vectors one for names and the other for values. The unused Get/Set methods for interger and float are removed and the iteration is converted to use iterators. Change-Id: Icda00ae898a595d58b06af0ced337f55f47c317c Reviewed-on: https://pdfium-review.googlesource.com/3753 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-03Split the FDE XML file into indiviual class files.Dan Sinclair
This Cl splits the fde_xml_int file apart into individual class files. Includes are fixed as needed. fde_xml.h is also removed and the needed defines moved to more appropiate places. Change-Id: I29774dabc4d0fb2d5092fcbbe7853f03401b6ec7 Reviewed-on: https://pdfium-review.googlesource.com/3616 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-03-29Split xfa_object.h apart.Dan Sinclair
This Cl splits the xfa_object.h into individual class header files and fixes the needed includes. Change-Id: Ia011ee9bc5deee5e44b8a956fa54bc2c3849cff0 Reviewed-on: https://pdfium-review.googlesource.com/3254 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-28Renaming and splitting in xfa/fxfa/parser.Dan Sinclair
This Cl renames several of the files in xfa/fxfa/parser to match the name of the contained classes. Files with multiple clasess are split apart when renamed. Change-Id: Ice8a1279072ee13c2f62a81946be7f42f9ba6007 Reviewed-on: https://pdfium-review.googlesource.com/3250 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-03-28Remove CFX_ArrayTemplate from xfa_document_datamerger_imp.cppTom Sepez
Change-Id: Ie59ed4172c2da7afe0b60d1d0e94d204ec4b9004 Reviewed-on: https://pdfium-review.googlesource.com/3238 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-27Return arrays where appropriate in fxfa.Tom Sepez
Also, remove some default method arguments along the way. Change-Id: Ifbd157499881ed6a3777f3903dd7f0193753cf59 Reviewed-on: https://pdfium-review.googlesource.com/3219 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-03-14Replace CXFA_{Object,Node}Array with std::vectorTom Sepez
These two ought to happen at the same time as they are intertwined in spots. Remove blatant casts between the two along the way. Change-Id: I9ce5d2faadf1e38aba7cade316560d24a66d8669 Reviewed-on: https://pdfium-review.googlesource.com/2933 Commit-Queue: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-02-02Remove FX_WSTRC usagechromium/3003chromium/3002dan sinclair
Not needed with modern compilers, removed. Change-Id: Ia8977262b5791bd4445f02be8456641d1a7e18f3 Reviewed-on: https://pdfium-review.googlesource.com/2431 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-01-05Remove CFX_MapPtrToPtr from xfa/fxfa.tsepez
Review-Url: https://codereview.chromium.org/2612923002
2016-12-08Replace CFX_WideStringArray with std::vectortsepez
Minimalist changes with the tidying of the code to use better loop iterators as a follow-up. Review-Url: https://codereview.chromium.org/2556963004
2016-11-02Remove FX_BOOL from xfa.tsepez
Review-Url: https://codereview.chromium.org/2467203003
2016-10-25Fix some return FALSE in functions that return pointerschromium/2901tsepez
This previously compiled because FALSE is #defined to 0, and 0 is a perfectly fine value for a pointer. Review-Url: https://codereview.chromium.org/2448943003
2016-09-29Move core/fxcrt/include to core/fxcrtdsinclair
BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2382723003
2016-09-07Fix spelling of "Formated" in several variableschromium/2854tsepez
Review-Url: https://codereview.chromium.org/2318423002
2016-07-21Move xfa_document to cxfa_documentdsinclair
This moves the code to match the actual class name. Review-Url: https://codereview.chromium.org/2163133004
2016-07-21Rename xfa_doclayout and xfa_document_layout_imp files.dsinclair
This Cl moves the xfa_doclayout and xfa_document_layout_imp files to have names based off of their classes. Review-Url: https://codereview.chromium.org/2170473002
2016-07-21Move xfa_basic_imp to cxfa_widetextread.dsinclair
This Cl splits out the CXFA_WideTextRead class into it's own file. The helper methods have been moved into xfa_utils.cpp and their pre-declarations into xfa_utils.h. Review-Url: https://codereview.chromium.org/2165993002
2016-07-20Rename remaining xfa_script_* files.dsinclair
This Cl renames the remaining xfa_script_* files to match the class names contained within the files. Review-Url: https://codereview.chromium.org/2160343002
2016-07-19Cleanup CXFA_Documentchromium/2803chromium/2802dsinclair
Removing unused XFA_LAYOUTRESULT, cleanup unused parameters, convert XFA_DocFlag to an enum from defines and make the constructor explicit. Review-Url: https://codereview.chromium.org/2166433002
2016-07-11Break xfa_parser_imp apartdsinclair
This CL splits the three parsers into individual files to make working with the code easier. Review-Url: https://codereview.chromium.org/2129963002
2016-07-11Remove IXFA_Parser, cleanup XFA parser code.dsinclair
The IXFA_Parser only created a CXFA_SimpleParser, the CXFA_DocumentParser is only created in one spot and doesn't need all the IXFA_Parser methods. This CL removes IXFA_Parser, instantiates the CXFA_SimpleParser where needed and cleans up surrounding code. Review-Url: https://codereview.chromium.org/2123133004
2016-07-07Cleanup xfa_document_datamerge filesdsinclair
This CL moves the static methods into an anonymous namespace, removes default parameters and moves some other methods only used by this file into the anonymous namespace. Review-Url: https://codereview.chromium.org/2122373003
2016-06-23Remove NULL in xfa/dsinclair
This CL converts all NULL's to nullptr. All instances of comparison to nullptr have been removed. Review-Url: https://codereview.chromium.org/2095653002
2016-06-23Cleanup some variable namings.chromium/2778dsinclair
This CL cleans up some variable namings from the XFA_Element enum change. Review-Url: https://codereview.chromium.org/2093663002
2016-06-22Update GetClassID to GetElementTypedsinclair
The GetClassID method actually returns the XFA_Element, change the name of the method to be more suggestive of the return value. The GetClassID was sort-of polymorphich and would call down to subclasses. This CL changes the data to be stored on the CXFA_Object class and just returns what is set. The values are set in the constructor as needed. Review-Url: https://codereview.chromium.org/2082573007
2016-06-21Convert XFA_ELEMENT to an enum classdsinclair
This CL changes XFA_ELEMENT From an enum to an enum class. The type name was updated to XFA_Element. Review-Url: https://codereview.chromium.org/2089443002
2016-06-20Split the XFA_OBJECTTYPE enum into two parts.dsinclair
Currently the object type and the node flags are both mixed into the single XFA_OBJECTTYPE_* enum. These two things are un-related and should not share a single type. This Cl creates an XFA_ObjectType enum class and a XFA_NodeFlag enum to hold the two types. Accessors are added to determine if the flags are set (or called where they already existed. Review-Url: https://codereview.chromium.org/2083453003
2016-06-02Fix all the code which has duplicate variable declarationsweili
When there are duplicate variable declarations, the inner names shadow the outter ones. This is error prone and harder to read. Remove all the instances found by /analyze. BUG=chromium:613623, chromium:427616 Review-Url: https://codereview.chromium.org/2027273002
2016-06-01Remove XFA_HFM2JSCONTEXT.dsinclair
This CL removes XFA_HFM2JSCONTEXT and the supporting code. XFA_HFM2JSCONTEXT was replaced by CXFA_FM2JSContext. The translate method was moved to CXFA_FM2JSContext. Review-Url: https://codereview.chromium.org/2024833003
2016-05-26Fix MSVC C4800 build warnings.thestig
TBR=weili@chromium.org Review-Url: https://codereview.chromium.org/2017863002
2016-05-20Clean up XFA code which causes warningsweili
This is part of efforts to bring XFA to chromium_code standard. The warnings are from unreachable code, or using potentially uninitialized variables, or using assignment within a condition. This change list only contains easy to fix cases. More cleanups will follow. BUG=pdfium:29 Review-Url: https://codereview.chromium.org/1998873002
2016-05-13Make CFX_WideString(const CFX_WideString&) explicit.tsepez
BUG= Review-Url: https://codereview.chromium.org/1979723003
2016-04-27Standardize on ASSERT.dsinclair
There are currently three ways to assert in the code (ASSERT, FXSYS_assert and assert). This CL standardizes on ASSERT. The benefit of ASSERT is that it can be overridden if the platform requies and we can pickup the Chromium version if it has already been defined in the build. This does change behaviour. Currently FXSYS_assert is always defined but ASSERT is only defined in debug builds. So, the FXSYS_assert's would fire in Release builds. That will no longer happen. BUG=pdfium:219 Review-Url: https://codereview.chromium.org/1914303003
2016-04-25Pass CFX_*StringCs to FX_HashCode_GETA and _GETW hash functions.tsepez
Too many calls were of the form fn(x.c_str(), x.GetLength()) which is an anti-pattern given the StringC classes which tie these together. There are a few places where explicit CFX_*StringCs are constructed, but this can be avoided by changing the args to these functions in the same manner. Removed String_ from name of functions since it added little value. Also removed default argument. Review URL: https://codereview.chromium.org/1919563002
2016-04-19XFA unused function cleanupdsinclair
This CL removes a series of unused XFA methods. Review URL: https://codereview.chromium.org/1899103002
2016-04-14Simplify XFA event handling.thestig
- Avoid casting to void* - Don't bother firing events that no one listens for Review URL: https://codereview.chromium.org/1890563003
2016-04-14Change string argument type to GetFormatDataValue.tsepez
Avoid string duplication, since the first thing these routines do is allocate a new string from the static string argument. Review URL: https://codereview.chromium.org/1889983002
2016-04-14Replace calls to deprecated CFX_{Wide,Byte}String::Empty()tsepez
Use the more standard name "clear()" instead. Review URL: https://codereview.chromium.org/1888103002
2016-04-13Remove implicit cast from CFX_WideString to (const wchar_t*)tsepez
BUG= Review URL: https://codereview.chromium.org/1882043004
2016-04-08Rename both As{Byte,Wide}StringC() helpers to AsStringC().tsepez
The naming is redundant given the base type, and will stand in the way of consolidating Byte and Wide code. BUG= Review URL: https://codereview.chromium.org/1862123003
2016-04-06Split fxfa_objectacc.h into pieces.dsinclair
This Cl splits apart the fxfa_objectacc.h file and moves the individual classes into the xfa/fxfa/parser directory. Review URL: https://codereview.chromium.org/1861353002
2016-04-06Rename CFX_WideStringC::raw_str() to c_str()tsepez
No functional change intended. This difference in naming is standing in the way of consolidating some of the string code between Wide and Byte strings. The Wide code wants to call raw_str() in exactly the same spots that the Byte code calls c_str(). This makes sense, because in both places we get a character type back, and not a uint*_t type. If WideStringC had a raw_str() method, it would have to return uint32_t or similar. R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1863593004
2016-04-05Make down-conversion explicit from CFX_Widetring to CFX_WideStringC.tsepez
Companion to https://codereview.chromium.org/1853233002 BUG= Review URL: https://codereview.chromium.org/1857073002
2016-04-05Rename GetCStr and GetPtr to match CFX_ByteString.dsinclair
This CL updates CFX_ByteStringC to use the more common c_str and raw_str instead of GetCStr and GetPtr. Review URL: https://codereview.chromium.org/1857713003
2016-04-01Remove CFX_{Byte,Wide}String::Equal in favor of "==".tsepez
Makes the code slightly cleaner. Review URL: https://codereview.chromium.org/1846083002
2016-03-31Remove IXFA_* interfaces.dsinclair
This CL removes the IXFA_* interfaces which are: - Implemented once. - Not implemented by an fpdfsdk class. This requires making a few classes visible to fpdfsdk so we can have the correct instances available instead of the IXFA types. Review URL: https://codereview.chromium.org/1846993002