summaryrefslogtreecommitdiff
path: root/xfa/fgas
AgeCommit message (Collapse)Author
2017-03-14Replace FX_CHAR and FX_WCHAR with underlying types.Dan Sinclair
Change-Id: I96e0a20d66b9184d22f64d8e4ce0dadd5a78c1e8 Reviewed-on: https://pdfium-review.googlesource.com/2967 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-03-14Merge text breaking helper classes.Dan Sinclair
This Cl merges the CFX_TxtPiece and CFX_RTFPiece classes into CFX_BreakPiece. CFX_TxtLine and CFX_RTFLine into CFX_BreakLine and CFX_TxtChar and CFX_RTFChar into CFX_Char. Change-Id: I95421bdf4cafd5e394db9238dea3603ccb8349c3 Reviewed-on: https://pdfium-review.googlesource.com/2966 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-13Replace discrete array with a map.dan sinclair
There is one use of the discrete array, GFGAS_GEFont. This CL replaces that usage with a std::map and removes the fgas_util classes. Change-Id: Ic45812168e9487ebac08abaa131c58080a949d69 Reviewed-on: https://pdfium-review.googlesource.com/2953 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-03-13Convert TxtBreak line pieces to a vector.dan sinclair
This Cl converts the m_LinePieces array to a vector. This is the last usage of the CFX_BaseArrayTemplate so remove it and supporting code. Change-Id: I3f81e4fd1210f8d0347364a2e4e5bb42cd83cb30 Reviewed-on: https://pdfium-review.googlesource.com/2952 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-03-13Simplify TxtBreak line handling.dan sinclair
This Cl moves the two lines into an array and uses m_iReady to index the array. Change-Id: Ibecfb35fb72603433a6ed1efa6ec8ae609caebf7 Reviewed-on: https://pdfium-review.googlesource.com/2951 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-03-13Simplify the CFX_TxtPiece classdan sinclair
This Cl removes unused methods and makes GetString return a CFX_WideString instead of taking an out parameter. Change-Id: I3d2fcbdf51e7619f4fa42e46a0c83fbfa1132a84 Reviewed-on: https://pdfium-review.googlesource.com/2950 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-03-13Remove some single use interfacesDan Sinclair
Remove interfaces which are only implemented once. Change-Id: I73ceaa7bfd7ef2a630479c7eebed5e32ecb99940 Reviewed-on: https://pdfium-review.googlesource.com/2944 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-03-13Remove TextBreak rotation codeDan Sinclair
The rotation value is always 0 so we end up doing nothing for the rotation. Change-Id: Ib12a269d4f3c16961b1b934bf9dfc04d1c368e51 Reviewed-on: https://pdfium-review.googlesource.com/2943 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-03-13Remove unused defines from TextBreak.Dan Sinclair
This Cl removes the unused TXTLAYOUTSTYLE and TXTCHARTYLE defines from fgas_textbreak. This also ripples and removes some of the defined styles from fde_textout as well. Change-Id: Ic647e97694366685bbad367e0a7ba61a00416598 Reviewed-on: https://pdfium-review.googlesource.com/2942 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-03-13Cleanup TXTLINEALIGNMENT definesDan Sinclair
This Cl replaces the FX_TXTLINEALIGNMENT_ defines with an enum and cleans up various usages. Change-Id: I5ff20f046322e5cd39a7d2abbd8735eac81e8c69 Reviewed-on: https://pdfium-review.googlesource.com/2941 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-03-13Remove unused TextBreak methodsDan Sinclair
This Cl removes some CFX_TxtBreak methods which aren't called. Change-Id: Ic66a89fa9c99aefb78d8314e1a3ebee089ef83cf Reviewed-on: https://pdfium-review.googlesource.com/2940 Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-13Cleanup FX_TXTBREAKDan Sinclair
This Cl removes the FX_TXTBREAK defines and unifies the type with the CFX_RTFBreakType which is renamed to CFX_BreakType. Change-Id: I890ae5e08a65f922d714aaaa9ab0f9f8a882cb3c Reviewed-on: https://pdfium-review.googlesource.com/2939 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-09Remove unused Txt break policies.chromium/3037Dan Sinclair
These are unset in the code, remove support. Change-Id: I76ef73929a1f74f59ccdd7bbd054d04dc9c5c6e7 Reviewed-on: https://pdfium-review.googlesource.com/2938 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-03-08Remove CFX_RTFPieceArray and use std::vectorDan Sinclair
This CL removes the CFX_RTFPieceArray typedef and updates the code to use a std::vector. Change-Id: I885038d432e700830958e37b8c03c5beceff012f Reviewed-on: https://pdfium-review.googlesource.com/2936 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-07Cleanup m_RTFLine code in RTFBreak.chromium/3034Dan Sinclair
This CL cleans up the m_RTFLine and m_iReady to be easier to work with. Change-Id: Ic8a2938d01672a4bc3f587fd144a5b63a0cee300 Reviewed-on: https://pdfium-review.googlesource.com/2935 Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-07Cleanup text codeDan Sinclair
This Cl removes unused defines and methods. It also merges fx_arb into fx_arabic as the arb methods are only used in the arabic file and they are always included together. Change-Id: I1e6f75d5cb5f5bcc8db3b54cb2a14d284da5b7b1 Reviewed-on: https://pdfium-review.googlesource.com/2899 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-03-07Remove CFX_StackTemplate now that all usage removed.Tom Sepez
Change-Id: I5682af84f29bcd123e294e57998f50abcdadc894 Reviewed-on: https://pdfium-review.googlesource.com/2932 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-06Simplify RTFBreak AppendChar.Dan Sinclair
This Cl simplifies the AppendChar code by removing the array of callback methods and using a switch instead. Change-Id: I07475d3950395dea2189569d95bfba1be1f9ceb5 Reviewed-on: https://pdfium-review.googlesource.com/2918 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-06Adding tests for CFX_RTFBreakDan Sinclair
This CL starts adding tests to the CFX_RTFBreak class. In doing so, the code to append char has been simplified to make it clearer. Change-Id: I5a2c8c114b52e1efa0c41a18670c6542b733baae Reviewed-on: https://pdfium-review.googlesource.com/2900 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-02Remove unused CFX_ObjectStackTemplateTom Sepez
Change-Id: I9341f38cbea8c325e0d50f26987bc9e55e295630 Reviewed-on: https://pdfium-review.googlesource.com/2904 Commit-Queue: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-02Remove CFX_MassArrayTemplateTom Sepez
CFX_BaseMassArrayImp is still used under the covers; leave it for now. Change-Id: Iad8bec13243b92c36e9d13130b89fd61a7e63436 Reviewed-on: https://pdfium-review.googlesource.com/2902 Commit-Queue: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-02Use std::deque for CFX_MassArrayTemplate<FDE_TEXTEDITPIECE>Tom Sepez
Change-Id: I1080eefb4e47d7bc86fb3384fd7479a1fd49b203 Reviewed-on: https://pdfium-review.googlesource.com/2898 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-02Use std::deque for CFX_FontDescriptorsTom Sepez
Change-Id: Ic6edc7740513075c2a738cc8897460af17bb0103 Reviewed-on: https://pdfium-review.googlesource.com/2895 Commit-Queue: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-02Remove CFX_MassArrayTemplate<CFX_Rect> backing array.Tom Sepez
The map is one-to-one, so no need for a pointer to an externally stored rect. Change-Id: I4cd6f728cdadeb4c7b25b6f34f5d50bb5db89623 Reviewed-on: https://pdfium-review.googlesource.com/2896 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-02Use std::deque for CFX_TPOArrayTom Sepez
They both encompass the same concept: a segmented array that can grow without copying. Change-Id: Ifc02207385b1bc106df41932c7b78ec2e9cc2146 Reviewed-on: https://pdfium-review.googlesource.com/2894 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-01Convert positioned tabs to std::vectorchromium/3028Dan Sinclair
This Cl changes from an CFX_ArrayTemplate to a std::vector and cleans up the supporting code. Change-Id: If07cb4fbd5fb9bcb078b5792a74ea62527cdd9a4 Reviewed-on: https://pdfium-review.googlesource.com/2884 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-03-01Remove unused FX_AdjustCharDisplayPos type, always nullptr argsTom Sepez
Found while looking for c-style callbacks. Change-Id: If21ad273e23eb83c25297e9fc123c3a2228fed70 Reviewed-on: https://pdfium-review.googlesource.com/2893 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-03-01Return values instead of out paramsDan Sinclair
This Cl converts CFX_RTFPiece::GetString and CFX_RTFPiece::GetWidths to return CFX_WideString and std::vector<int32_t> respectively instead of taking pointers out parameters. Change-Id: Ie153caa0336861b3efa9b8ce26f75f0e019526e9 Reviewed-on: https://pdfium-review.googlesource.com/2882 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-01Fix font manager negation issueDan Sinclair
In https://codereview.chromium.org/2559903002 we refactored the font manager in XFA but got part of the negation wrong. Fixup logic. Change-Id: Idd51ff846fe64a56908ec26bf2798c1df8433611 Reviewed-on: https://pdfium-review.googlesource.com/2891 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-01More RTFBreak unused code and default paramsDan Sinclair
This Cl removes more unused methods from the RTFBreak code along with removing all default params. Change-Id: I31d2880acde590ca9239440239ac56f5bb370f56 Reviewed-on: https://pdfium-review.googlesource.com/2881 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-03-01Fixup RTFBreak and TextBreak nitsDan Sinclair
Change-Id: Ied5d23e18e9194e66d8be8d1057f55d83faada88 Reviewed-on: https://pdfium-review.googlesource.com/2880 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-02-28Remove always true method paramschromium/3027Dan Sinclair
Cleanup a couple methods in RTFBreak and TextBreak which always recieve true as their parameter. Change-Id: I4704cdb6200b85e0a1a2990d16158ea58699a110 Reviewed-on: https://pdfium-review.googlesource.com/2879 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-02-28Remove unused methods from RTFBreak and TextBreakDan Sinclair
This Cl removes unused methods from the RTFBreak and TextBreak classes. Change-Id: If1e7e041cfd32b3be1240ae759f73c503b9c4cad Reviewed-on: https://pdfium-review.googlesource.com/2878 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-02-28Convert the FX_RTFBREAK defines to an enum classDan Sinclair
This Cl converts the type and updates the usage as required. Change-Id: I7c0f13aeabee1117086728333618504d3b65bb06 Reviewed-on: https://pdfium-review.googlesource.com/2876 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-02-28Convert FX_RTFLINEALIGNMENT to an enum classDan Sinclair
This Cl removes unused items and converts the remaining members to an enum class. Change-Id: I86e95231275ab20f274a5913715c1579a6fbc5dc Reviewed-on: https://pdfium-review.googlesource.com/2875 Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-02-28Remove unused layout stylesDan Sinclair
This Cl removes the unused layout styles from RTF Break and the supporting code. Change-Id: I5f4ef593250be1c9b3ae32f1ae3d9ce6913abdcc Reviewed-on: https://pdfium-review.googlesource.com/2874 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-02-28Remove unused RTF Break PoliciesDan Sinclair
The break policy was always set to 0 so it would never match any of the polices. Removed and simplified the code. Change-Id: I260631a2210037ae75ca1a3a282a1fe4e7f8ef6f Reviewed-on: https://pdfium-review.googlesource.com/2873 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-02-16Change FXTEXT_CHARPOS to use CFX_PointFDan Sinclair
This CL updates the Origin x,y coordinates in FXTEXT_CHARPOS to be an CFX_PointF. Change-Id: I67281db2cb82687e12490145f7c99aee908e5fa8 Reviewed-on: https://pdfium-review.googlesource.com/2718 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-02-14Revert "Convert Origins to points"Dan Sinclair
This reverts commit da83d3a5cc09c4056310b3cf299dbbccd5c70d11. Reason for revert: Reverting chain to see if fixes Chrome roll. Original change's description: > Convert Origins to points > > This CL converts various OriginX, OriginY pairs into CFX_PointF objects. > > Change-Id: I9141f7fc713c710b2014d4fdcdec7dc93501f844 > Reviewed-on: https://pdfium-review.googlesource.com/2575 > Commit-Queue: dsinclair <dsinclair@chromium.org> > Reviewed-by: Nicolás Peña <npm@chromium.org> > TBR=tsepez@chromium.org,dsinclair@chromium.org,npm@chromium.org,pdfium-reviews@googlegroups.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG= Change-Id: I949fb4ec712e2587e7d0ef0191c34db198b61dcc Reviewed-on: https://pdfium-review.googlesource.com/2696 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-02-13Convert Origins to pointsDan Sinclair
This CL converts various OriginX, OriginY pairs into CFX_PointF objects. Change-Id: I9141f7fc713c710b2014d4fdcdec7dc93501f844 Reviewed-on: https://pdfium-review.googlesource.com/2575 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-02-13Simplify FX_UTF8Encode variants.chromium/3012Tom Sepez
Doing so reveals places where there are needless copies and conversions. Change-Id: I24a868d40aa63836f4167eaf4541964049df7916 Reviewed-on: https://pdfium-review.googlesource.com/2555 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-02-08Update to use CFX_Rect{F} and CFX_Matrix constructors.Dan Sinclair
This Cl updates the code to use the constructors instead of creating an empty object and calling Set(). It also removes the various memsets of the CFX_Rect{F} classes. Change-Id: I6e20cec00866a38372858dcba5a30d31103172e4 Reviewed-on: https://pdfium-review.googlesource.com/2550 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@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-25Remove last usage of IFX_Retainable.chromium/2993Tom Sepez
Change-Id: Id2ece818c80e8cce4748b9a237871131a7acd6d1 Reviewed-on: https://pdfium-review.googlesource.com/2354 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-01-24Use std::vector for fx_ucd.h arrays.chromium/2992tsepez
Review-Url: https://codereview.chromium.org/2650773003
2017-01-24Use std::vector for CFX_RectF arraystsepez
Review-Url: https://codereview.chromium.org/2653743002
2017-01-20Replace CFX_ByteArray with CFX_ArrayTemplate<uint8_t>chromium/2990chromium/2989chromium/2988tsepez
Also replace CFX_Int32Array typedef with CFX_ArrayTemplate<int32_t>. Removing the typedefs makes subsequent conversion to std::vector<> easier on a case-by-case basis. Review-Url: https://codereview.chromium.org/2649563003
2017-01-17Avoid endless loop deleting CFGAS_GEFont.tsepez
It's a ref-counted class, so if we're in the destructor, the ref count has hit zero. We can't make a new ref pointer to itself here, as it will re-invoke the destructor when it goes out of scope. This should have been an obvious anti-pattern in hindsight. The object in question can't be in the m_pFontManager, since the font manager retains a reference, and we wouldn't get to this destructor while that is present. So the cleanup isn't required. Fixing this revealed a free-delete mismatch in cxfa_textlayout.cpp. I also converted to use unique_ptrs in a few places near this issue. Fixing this revealed a UAF in CFGAS_GEFont, memcpy'ing a RetainPtr is not a good idea as it doesn't bump the ref count. Also protect and friend the CFGAS_GEFont destructor, to make sure random deletes don't happen. Also kill off a const cast, and remove unnecessary conversion to retain_ptr when we already have one. TEST=look for absence of -11 in XFA corpus test logs, bots not currently noticing the segv. Argh. Review-Url: https://codereview.chromium.org/2631703003
2017-01-10Strip out custom allocator codeDan Sinclair
This Cl replaces the custom IFX_MemoryAllocator code with new/delete as needed. Change-Id: Ie786f607c9e0b3035ffd87733bc3e29a4b6426d9 Reviewed-on: https://pdfium-review.googlesource.com/2164 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-01-10Remove more _LP* typedefs.tsepez
Code is much clearer when we use the actual types rather than this convention. Review-Url: https://codereview.chromium.org/2618993002