summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_ffwidget.cpp
AgeCommit message (Collapse)Author
2018-01-03Fold CXFA_MarginData into CXFA_Marginchromium/3311Dan Sinclair
This CL removes the CXFA_MarginData wrapper and moves the methods directly to CXFA_Margin. Change-Id: I7c9e979fb78d0d356605f1318489daabcb8c32cd Reviewed-on: https://pdfium-review.googlesource.com/22110 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-30Rename XFA_ATTRIBUTEENUM to XFA_AttributeEnum enum classDan Sinclair
This CL changes the enum XFA_ATTRIBUTEENUM to an enum class XFA_AttributeEnum. Methods expecting an int32 have been updated to take or return the XFA_AttrbuteEnum type. Change-Id: I268453949545fe2dd3eae707be4d9cc7edeff763 Reviewed-on: https://pdfium-review.googlesource.com/20070 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-29Remove XFA_Unit::AngleDan Sinclair
We never use the ::Angle unit internally, we just access the value. This CL changes the default value to an Integer and drops the measurement. Change-Id: I85d6d84956595bb0576db42d287f54a5a3db1bed Reviewed-on: https://pdfium-review.googlesource.com/19790 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-27Convert CFX_GifContext::GetFrameNum to size_tDan Sinclair
This CL removes the CollectionSize and updates call locations as needed. Bug: pdfium:774 Change-Id: I813c500b3a17a194407ceb1304252b9b16fe1779 Reviewed-on: https://pdfium-review.googlesource.com/19590 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2017-11-21Cleanup CXFA_StrokeDataDan Sinclair
This CL fixes return types and makes methods consts. Change-Id: I97da09a491d10760d6adf4efcc0557130cf8b405 Reviewed-on: https://pdfium-review.googlesource.com/19110 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-21Cleanup CXFA_ParaDataDan Sinclair
This CL fixes the return types and makes the CXFA_ParaData methods const. Change-Id: Ifb63b46e826d9741682d992d7fc1ee37c772fb41 Reviewed-on: https://pdfium-review.googlesource.com/19070 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-21Cleanup CXFA_ImageDataDan Sinclair
This CL removes the second constructor parameter which is always true and removes all related conditionals. The methods have been changed to const and return instead of using out parameters. Change-Id: Id6d2aa533a212e961e3b8169eef57b7e868d503e Reviewed-on: https://pdfium-review.googlesource.com/19010 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2017-11-21Cleanup CXFA_FillDataDan Sinclair
This CL makes the CXFA_FillData methods const and splits them into retrieving fill information and fill colour methods. Change-Id: Ie407be87c631ea68efa0934d9a98e412ed1eb922 Reviewed-on: https://pdfium-review.googlesource.com/18950 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-21Add CXFA_MarginData::Get*Inset helpersDan Sinclair
This CL adds Get*Inset helpers to CXFA_MarginData which just return a default value of 0 if the Try*Inset method fails. Change-Id: I03b00b7a371c39e521f95952e965b4a3ef71d517 Reviewed-on: https://pdfium-review.googlesource.com/18870 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-20Rename CXFA_MarginData methodschromium/3274Dan Sinclair
This CL renames the CXFA_MarginData::Get*Inset methods to CXFA_MarginData::Try*Inset to match the fact that they may fail. The default value has been removed and all the callers correctly set the default values. Change-Id: Ib0dc8dc35807b60a0ddc0e5724604cb39845fcea Reviewed-on: https://pdfium-review.googlesource.com/18771 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-20Remove CXFA_DataData operator bool overrideDan Sinclair
This CL removes CXFA_DataData::operator bool in favour of an explicit HasValidNode method. This makes the call sites a lot clearer. Change-Id: I6fae14fdeec4674ca7916e21b9e5703070fc3069 Reviewed-on: https://pdfium-review.googlesource.com/18830 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2017-11-20Cleanup return types in CXFA_BoxDataDan Sinclair
This CL cleans up the return types in CXFA_BoxData to use std::tuple and pdfium::Optional where appropriate. Change-Id: I0790fb43769185fa4cbdd7460411a3d1120e9fa1 Reviewed-on: https://pdfium-review.googlesource.com/18812 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2017-11-14Rename the fxgraphics classesDan Sinclair
The build system doesn't like name clashes over directories in XFA. The Pattern and and Shading classes need to be renamed to not clash with future XFA node class names. Change-Id: I978da492d884626c0db2e11ac236a3399e9c7e58 Reviewed-on: https://pdfium-review.googlesource.com/18290 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-14Cleanup const refs and some enumsDan Sinclair
This CL cleans up some const refs and some enum values from the previous rename CLs. Change-Id: Ifaa990c9c45485bb059e0bda0026093d0a2c0944 Reviewed-on: https://pdfium-review.googlesource.com/18230 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-09Remove a couple of unused methods in CXFA_FFWidgetNicolas Pena
This CL removes two unused methods in CXFA_FFWidget and also the code that becomes unused after removing those. Change-Id: Ifa58a7cabc1750bb13942f86385414e8f5e0cce3 Reviewed-on: https://pdfium-review.googlesource.com/18310 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
2017-11-07Rename CXFA_ToolTip to CXFA_ToolTipDataDan Sinclair
This CL renames CXFA_ToolTip to CXFA_ToolTipData to signify it is part of the data hierarchy. Change-Id: I841ce0ee5841b652e03041f21bc220d9edc7564a Reviewed-on: https://pdfium-review.googlesource.com/18016 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-07Rename CXFA_Stroke to CXFA_StrokeDataDan Sinclair
This CL renames CXFA_Stroke to CXFA_StrokeData to show it is part of the data hierarchy. Change-Id: If0041c410630c61129ed1ff0879c68244ad01aa5 Reviewed-on: https://pdfium-review.googlesource.com/18013 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-07Rename CXFA_Margin to CXFA_MarginDataDan Sinclair
This CL renames CXFA_Margin to CXFA_MarginData to reflect the fact this is part of the data hierarchy. Change-Id: I50d82d01fcaf35c621f13b8b68bc04d850ec885a Reviewed-on: https://pdfium-review.googlesource.com/17986 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-07Rename CXFA_Image to CXFA_ImageDataDan Sinclair
This CL renames CXFA_Image to CXFA_ImageData to make it clear it's part of the data hierarchy. Change-Id: Ia593ef3c9deb872db11f8246b13ef3c39a90d4c7 Reviewed-on: https://pdfium-review.googlesource.com/17984 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-07Rename CXFA_Fill to CXFA_FillDataDan Sinclair
This CL renames CXFA_Fill to CXFA_FillData to show it is part of the data hierarchy. Change-Id: I4f1f3e83621dee4f9ccddb3b3d04785d094315b8 Reviewed-on: https://pdfium-review.googlesource.com/17981 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-07Rename CXFA_Edge to CXFA_EdgeDataDan Sinclair
This CL renames CXFA_Edge to CXFA_EdgeData to make it clear it's part of the data hierarchy. Change-Id: Id67526cafe1927803c36159b106656c32e770d6b Reviewed-on: https://pdfium-review.googlesource.com/17979 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-07Rename CXFA_Corner to CXFA_CornerDataDan Sinclair
This CL renames CXFA_Corner to CXFA_CornerData to make it clear it's part of the data hierarchy. Change-Id: I9428c7a09735f11089de344fa148edc86e6e4694 Reviewed-on: https://pdfium-review.googlesource.com/17978 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-07Rename CXFA_Box to CXFA_BoxDataDan Sinclair
This CL renames CXFA_Box to CXFA_BoxData to make it clear it's part of the Data hierarchy. Change-Id: I5971eefb078f73228e2fcfc08d2025d800c319fb Reviewed-on: https://pdfium-review.googlesource.com/17975 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-07Rename CXFA_Border to CXFA_BorderDataDan Sinclair
This CL renames CXFA_Border to CXFA_BorderData to make it clear it's part of the Data hierarchy. Change-Id: Icfe8dc07d527ba54413f073f5a444fb7b2a71271 Reviewed-on: https://pdfium-review.googlesource.com/17974 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-07Rename CXFA_Assist to CXFA_AssistDataDan Sinclair
This CL renames CXFA_Assist to CXFA_AssistData to make it clear it's part of the data hierarchy. Change-Id: I1d320a0f09dd3536251fd308c71b78db5c4ed644 Reviewed-on: https://pdfium-review.googlesource.com/17971 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-02Rename Transparency to iTransparency.Lei Zhang
Fix a mismatched parameter name in cpdf_renderstatus.h too. Change-Id: I9765838e6ab93db37791fc282e553b6cb9c51ec5 Reviewed-on: https://pdfium-review.googlesource.com/17050 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-09-27Remove FXSYS_strlen and FXSYS_wcslenchromium/3226Ryan Harrison
With the conversion of internal string sizes to size_t, these wrappers are no longer needed. Replacing them with strlen and wcslen respectively. BUG=pdfium:828 Change-Id: Ia087ca2ddaf688a57ec9bd9ddfb8533cbe41510d Reviewed-on: https://pdfium-review.googlesource.com/14890 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-09-22Fix crash when rendering invalid GIFRyan Harrison
The core fix in this CL is a change to how LWZ decompression works, so that when the min code table size and the color palette size are different, color codes after the end of the defined color palette are considered errors. This CL also introduces a bunch of tweaks to the call return path, since there were multiple locations where the GIF decode failing status was being dropped on the floor, so the end widget would have a bitmap with the default colour in it, instead of nothing. BUG=chromium:616671 Change-Id: Id6f40d552dc24650c91e9903f710ff2fa63bc774 Reviewed-on: https://pdfium-review.googlesource.com/14630 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-09-21Rename CFX_RetainPtr to RetainPtrDan Sinclair
This CL renames CFX_RetainPtr to RetainPtr and places in the fxcrt namespace. Bug: pdfium:898 Change-Id: I8798a9f79cb0840d3f037e8d04937cedd742914e Reviewed-on: https://pdfium-review.googlesource.com/14616 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-09-21Move CFX_MaybeOwned to fxcrt::MaybeOwnedDan Sinclair
This CL moves CFX_MaybeOwned into the fxcrt namespace and removes the CFX_ prefix. The test names for maybe owned were updated to be in the MaybeOned test suite instead of the fxcrt suite. Bug: pdfium:898 Change-Id: I0c07057d66c8610e7b19133094b4507fff725e76 Reviewed-on: https://pdfium-review.googlesource.com/14470 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-09-18Convert string class namesRyan Harrison
Automated using git grep & sed. Replace StringC classes with StringView classes. Remove the CFX_ prefix and put string classes in fxcrt namespace. Change AsStringC() to AsStringView(). Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*, Foo). Couple of tests needed to have their names regularlized. BUG=pdfium:894 Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d Reviewed-on: https://pdfium-review.googlesource.com/14151 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-08-17Change XFA DrawWidget() code to take its CFX_Matrix by const-ref.chromium/3192chromium/3191chromium/3190chromium/3189Lei Zhang
Change-Id: Idc9dfcafe6727c1689443ce8f9568567e55d51c8 Reviewed-on: https://pdfium-review.googlesource.com/11114 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-17Change CXFA_FFWidget::RenderWidget() to take a const CFX_Matrix&.Lei Zhang
Change some related code to take a const CFX_Matrix* since it is not immediately obvious if the matrix can be made into a const-ref. Change-Id: I15c840222b575cc479b1f6f0b6d3b3c0e50d5515 Reviewed-on: https://pdfium-review.googlesource.com/11113 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-17Remove default parameters from CXFA_FFWidget methods.Lei Zhang
Also remove an unused method and move a bunch of internal methods into an anonymous namespace. Change-Id: Ic7b4a975852cc2a7384bf3f681b953a5bf7e7d29 Reviewed-on: https://pdfium-review.googlesource.com/11112 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-17Remove default argument for CXFA_Graphics::SetLineWidth().Lei Zhang
Change-Id: I6ea062bf5def0bc5fea7c52323198209dcf4c3e9 Reviewed-on: https://pdfium-review.googlesource.com/11110 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-16Tidy CXFA_Color class and argument passing.Tom Sepez
Remove friendship. De-virtualize. Nest enum inside class. Make copy-assignable and pass by const ref. Make pack better on 64-bits. Change-Id: I1ae3b6d03756fa5780e9023795db6648e8b8299a Reviewed-on: https://pdfium-review.googlesource.com/11290 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-07-24Move xfa/fxfa/app to xfa/fxfachromium/3166Dan Sinclair
There currently exists a weird split where some files exist in xfa/fxfa and some files exist in xfa/fxfa/app. This CL removes the app/ folder and moves all files up to the parent directory. Change-Id: I00c87851a1ebc5a7a636eb9a17b58ba3f1708a84 Reviewed-on: https://pdfium-review.googlesource.com/8810 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-07-14Fixup naming of XFA graphics classesDan Sinclair
These files were originally renamed thinking they'd move with the colour class up to core/. It was decided that CPWL_Color was a better core colour class the the xfa colour so these are being renamed back to XFA based names to make it clear where they live. Change-Id: Ie89f2306be0609add29bd445e719567e7b439211 Reviewed-on: https://pdfium-review.googlesource.com/7754 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-07-13Rename cfx_color to cxfa_colorDan Sinclair
This CL renames CFX_Color to CXFA_Color. The class has some XFA specific things like shadings and patterns in it and doesn't make sense as the colour base class. Change-Id: I1d2230b9f03a1017777ce673419926429b769e7c Reviewed-on: https://pdfium-review.googlesource.com/7752 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-06-30Fix nits in a bunch of random XFA files.Lei Zhang
- Simplify if (cond) return true; return false; pattern. - Use size_t in CXFA_FFDocView::RunCalculateRecursive(). Change-Id: I1c426556bc927a118cb062999812ab06bbfcfec7 Reviewed-on: https://pdfium-review.googlesource.com/7130 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-06-29Move Start to constructor in CFX_Image(Renderer|Transformer)chromium/3145Nicolas Pena
The bool returned by Start was not being used and the method was always called right after the constructor, so it should be in the constructor. Change-Id: I98abf9f7c11fbe42b3aa15ec5e46731198aa23d5 Reviewed-on: https://pdfium-review.googlesource.com/7151 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-06-29Change SetReverse to GetInverse in CFX_MatrixNicolas Pena
CFX_Matrix::GetInverse is much clearer. Change-Id: Id10ab1723735332e1a78de853f28415ec3a4d834 Reviewed-on: https://pdfium-review.googlesource.com/7090 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-05-25Mass conversion of all const-lifetime class membersTom Sepez
Sed + minimal conversions to compile, including moving some constructors into the .cpp file. Any that caused ASAN issues during the tests were omitted rather than trying to resolve the underlying issue. Change-Id: I00a421f33b253eb4071ffd9af3f2922c7443b335 Reviewed-on: https://pdfium-review.googlesource.com/5891 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-05-23Cleanup default values and methods in CXFA_WidgetdataDan Sinclair
Change-Id: Ie591de17aba54d6d0f96b1133be7d899bab577cf Reviewed-on: https://pdfium-review.googlesource.com/5660 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-05-19Move CCodec_ModuleMgr ownership to CPDF_ModuleMgr.Lei Zhang
More straight forward than CFX_GEModule owning in and CPDF_ModuleMgr holding a pointer to it. Remove assumptions that the codec modules may return nullptr, and do IWYU. Change-Id: Iba7fc3c7ec223fd6d29a1ab74ed13d35689bc5d5 Reviewed-on: https://pdfium-review.googlesource.com/5654 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-05-16Be skeptical of bare |new|s.Tom Sepez
In particular, prefer an explicit .release() call when handing ownership of an object to a caller across a C-API. Change-Id: Ic3784e9d0b2d378a08d388989eaea7c9166bacd1 Reviewed-on: https://pdfium-review.googlesource.com/5470 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-05-04Cleanup more null IFX_Pause parametersDan Sinclair
This Cl cleans up more IFX_Pause parameters which are always null. Change-Id: Ia48600f06216db64a2db8e6e97222a91bd4ba149 Reviewed-on: https://pdfium-review.googlesource.com/4890 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-04-21Add CFX_RenderDevice::AutoRestorer()chromium/3078Tom Sepez
Avoid cleanup on every return path. Change-Id: I6978adb6f31020d812ac88c5d46c703d1461d373 Reviewed-on: https://pdfium-review.googlesource.com/4435 Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-04-20Let {Argb,Cmyk}Decode return tuplesNicolas Pena
Change-Id: Ic4e766d9417f9a9ece5f9e4269d0f96e1e91639b Reviewed-on: https://pdfium-review.googlesource.com/4392 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-04-20Convert IFX_MemoryStream to CFX_MemoryStreamDan Sinclair
The CFX_MemoryStream is the only implementation of IFX_MemoryStream. This CL removes the interfaces and uses CFX_MemoryStream directly. Change-Id: I2f43fa39e82dafa7673517d214ae15fd2d0df331 Reviewed-on: https://pdfium-review.googlesource.com/4391 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>