summaryrefslogtreecommitdiff
path: root/xfa/fde
AgeCommit message (Collapse)Author
2016-07-18Cleanup fgas/crt.dsinclair
This CL removes unused methods and default parameters from the fgas/crt code. Review-Url: https://codereview.chromium.org/2162503003
2016-07-11Cleanup ownership of parser membersdsinclair
Change m_pXMLDoc and m_pStream in CXFA_SimpleParser to be a unique_ptr. This allows removing the CloseParser() call from CXFA_DocumentParser as the items will get cleaned up automatically. Review-Url: https://codereview.chromium.org/2131653002
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-21Use FXFONT defines in place of integers.thestig
Fix nits along the way. Review-Url: https://codereview.chromium.org/2083943003
2016-06-20Another round of fx_ge cleanup.thestig
- Clean up CFX_GEModule. - Remove duplicate #defines in fx_ge.h - Remove IsFontStyleFromCharCode() that always returns true. - Mark a FXTEXT_CHARPOS field as Mac only. Review-Url: https://codereview.chromium.org/2075333002
2016-06-18Make code compile with clang_use_chrome_plugin (final)weili
This change mainly contains files in xfa/ and fxjse/ directories which were not covered by previous changes. This is part of the efforts to make PDFium code compilable by Clang chromium style plugins. After this change, PDFium can be compiled with "clang_use_chrome_plugin=true" for GN build. Since clang_use_chrome_plugin is true by default, we no longer need to set this parameter explicitly. The changes are mainly the following: -- move inline constructor/destructor of complex class/struct out-of-line; -- add constructor/destructor of complex class/struct if not explicitly defined; -- add explicit out-of-line copy constructor when needed; -- move inline virtual functions out-of-line; -- Properly mark virtual functions with 'override'; -- some minor cleanups; BUG=pdfium:469 Review-Url: https://codereview.chromium.org/2072803002
2016-06-16Cleanup XML parser code.dsinclair
This Cl removes the CFDE_XMLSAXParser and CFDE_XMLDOMParser along with the ::LoadXML() method which would create them, it was never called. It also cleans up the use of virtual in the various XML classes. Review-Url: https://codereview.chromium.org/2067253002
2016-06-10Remove redundant casts, part 9.tsepez
Make CFDE_TxtEdtParag::m_lpData a int32_t*, not void*, since it is cast to int32_t everywhere it is used. Many fxbarcode casts are redundant, likely the result of previous generic PtrArray replacement with templated type. Review-Url: https://codereview.chromium.org/2059953002
2016-06-10Get rid of NULLs in xfa/fde/thestig
Review-Url: https://codereview.chromium.org/2039923004
2016-06-09Remove more casts, part 7.tsepez
Replacing a void* member in CFX_SAXItem saves lots of casts. Review-Url: https://codereview.chromium.org/2051233002
2016-06-09Remove C-style casts in xfa/fde.tsepez
Review-Url: https://codereview.chromium.org/2040323004
2016-06-07Replace IFGAS_Font with underlying concrete typethestig
Review-Url: https://codereview.chromium.org/2037563002
2016-06-07Get rid of NULLs in core/thestig
Review-Url: https://codereview.chromium.org/2032613003
2016-06-07Remove FDE_HVISUALOBJ.dsinclair
This CL removes the FDE_HVISUALOBJ in favour of the concrete FDE_TEXTEDITPIECE class. The parameter was removed from any method which didn't use it and the non-implemented methods were removed. Review-Url: https://codereview.chromium.org/2047693002
2016-06-06Remove unused CFDE_TxtEdtEngine::SetBufChunkSize().tsepez
In turn, CFDE_TxtEdtBuf::SetChunkSize becomes unused. Review-Url: https://codereview.chromium.org/2042743003
2016-06-06Remove FDE_HDEVICESTATE.dsinclair
The value returned is always NULL and when passed as a param is never used. Review-Url: https://codereview.chromium.org/2044623002
2016-06-06Make GetDevFont() return a CFX_Font* instead of void*tsepez
Then we can remove a bunch of casts. Review-Url: https://codereview.chromium.org/2033243004
2016-06-03Rename IFX_FontMgr to IFGAS_FontMgrtsepez
Avoid confusion with CFX_FontMgr, which does not inherit from IFX_FontMgr, and lives in a different layer of code. Do the same CFX_ -> CFGAS_ transformation for the concrete classes that implement IFGAS_FontMgr. Review-Url: https://codereview.chromium.org/2039463003
2016-06-03Rename IFX_Font to IFGAS_Fonttsepez
Avoid confusion with CFX_Font, which is defined in fxcrt, and does not inherit from nor bear any resemblence to IFX_Font. Review-Url: https://codereview.chromium.org/2036173003
2016-06-03Remove two unused opaque handle typestsepez
Review-Url: https://codereview.chromium.org/2038913002
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-05-27Avoid two C-style FX_WCHAR* casts in pdfiumbrucedawson
FX_WCHAR* casts were hiding a number of misuses of narrow strings in pdfium, which /analyze identified. Now that those are fixed I did a search for other instances of (FX_WCHAR*) to see if any other bugs were lurking. No bugs were found but one unnecessary cast and one that should be a const_cast were identified. This change fixes those. No behavioral change. Review-Url: https://codereview.chromium.org/2024463002
2016-05-27Make sure CFDE_XMLSyntaxParser's buffer is null terminated.ochang
BUG=chromium:614962 Review-Url: https://codereview.chromium.org/2017803002
2016-05-26Remove default arguments from CFX_FxgeDevice.thestig
Remove unused dithering code. Review-Url: https://codereview.chromium.org/2010813003
2016-05-26Remove default argument from RestoreState() methods.thestig
Review-Url: https://codereview.chromium.org/2009803003
2016-05-25Clean up fx_ge.h and IWYU.thestig
Review-Url: https://codereview.chromium.org/2009253003
2016-05-24Replace CFX_DSPATemplate with std::binary_search.dsinclair
This CL replaces the last instance of CFX_DSPATemplate with std::binary_search. Review-Url: https://codereview.chromium.org/2007443003
2016-05-23Rename IFX_Unknown to IFX_Retainable.tsepez
Rename addRef() method to Retain() to match Release(). This CL does not convert to CFX_RetainPtrs, which will happen in a follow-on. Review-Url: https://codereview.chromium.org/2005933002
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-19Use std::unordered_map for CFDE_CSSStyleSheet::m_StringCachetsepez
Get rid of some LPC typedefs while we're at it. Review-Url: https://codereview.chromium.org/1990363003
2016-05-19Move fgas_sax into individual files in fde.dsinclair
This CL moves the fgas Sax parser into the fde/xml directory. This places the parse with the other XML parser in the system. Review-Url: https://codereview.chromium.org/1990003002
2016-05-19fgas/ code cleanup.dsinclair
This CL shuffles code around in the fgas/ headers, removes unused functions and adds anonymous namepaces for static methods and data. Review-Url: https://codereview.chromium.org/1992033002
2016-05-19Expand some typedefs to the original typesdsinclair
Sevearal typedefs are only used once or twice. Expand and remove the typedef. Review-Url: https://codereview.chromium.org/1995033002
2016-05-18Remove Release() from CFX_TxtBreaktsepez
Review-Url: https://codereview.chromium.org/1988393002
2016-05-18Remove Release() from CFDE_TxtEdit* classestsepez
Review-Url: https://codereview.chromium.org/1987223003
2016-05-18Split xfa/fee files into individual class files.dsinclair
This CL splits the xfa/fee files into individual class files and moves them into the xfa/fde directory where they belong. Review-Url: https://codereview.chromium.org/1994693002
2016-05-16Revert "Replace Release() { delete this; } in fde_xml_imp.h"Tom Sepez
This reverts commit fa34e805fd03ba81bcfe1148cf96b24fe63b39a0. Reason for revert: broke asan tests. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1982843002 .
2016-05-16Replace Release() { delete this; } in fde_xml_imp.htsepez
Review-Url: https://codereview.chromium.org/1981003002
2016-05-11Replace some calls to Release() with direct delete, part 1.tsepez
Searching for the anti-pattern: void Release() { delete this; } We must be explicit on the ownership model. Add unique_ptrs as a result. Review-Url: https://codereview.chromium.org/1960673003
2016-05-04Replace IFX_MemoryAllocator::Release() with delete.tsepez
All Release() did was invoke delete. Add some "overrides" while we're at it. Review-Url: https://codereview.chromium.org/1951573002
2016-05-03Cleanup XFA-Specific memory allocators.tsepez
Remove unused "dynamic" allocator (the scary one). Use malloc/free wrapper allocator under #ifdef for CF/asan testing. Rename IFX_MEMAllocator to IFX_MemoryAllocator (MEM in all caps would imply that MEM was an acroynm, not an abbreviation). Review-Url: https://codereview.chromium.org/1944093002
2016-04-28Do not check pointers before deleting them.thestig
XFA edition. Review-Url: https://codereview.chromium.org/1925363002
2016-04-28Cleanup IFDE_CSS interfaces.dsinclair
This CL removes the follwing in favour of their concrete class. * IFDE_CSSDeclaration * IFDE_CSSSelector * IFDE_CSSSyntaxParser * IFDE_CSSStyleSelector Review-Url: https://codereview.chromium.org/1928763002
2016-04-27Replace CFX_PtrArray with type-safe CFX_ArrayTemplate<>, Part 1.tsepez
Ideally, these will become std::vector<>, but in the mean time this is quicker and allow us to remove casts. Doing so has already turned up one place where the wrong type of object was being used. Review-Url: https://codereview.chromium.org/1924073002
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-21Remove IFDE_CSSTagProvider.dsinclair
There is only one subsclass, use that instead. Remove the use of WideStringC in the API. BUG=pdfium:468 Review URL: https://codereview.chromium.org/1911843002
2016-04-21Cleanup FDE interfaces.dsinclair
This CL removes IFDE_TextOut, IFDE_Path, IFDE_RenderContext, IFDE_RenderDevice, and IFDE_VisualSetIterator in favour of the concrete classes. BUG=pdfium:468 Review URL: https://codereview.chromium.org/1896893003
2016-04-19Store WideString, not raw pointer, in FX_TXTRUNtsepez
Storing raw pointers in structs is a questionable idea, given that we've got string classes to auto-manage lifetimes of the underlying storage. Also, return FX_TXTRUN while we're at it, since we count on RVO removing copies nowadays. BUG=pdfium:480 Review URL: https://codereview.chromium.org/1900743004
2016-04-15Remove unused IFDE_CSSStyleSheetCache/CFDE_CSSStyleSheetCache.tsepez
Review URL: https://codereview.chromium.org/1896553004