summaryrefslogtreecommitdiff
path: root/xfa/fgas/layout
AgeCommit message (Collapse)Author
2018-10-26Forward declare a bunch of classes.Lei Zhang
Then do IWYU to fix up build errors. Move some implementations out of headers to allow more forward declarations. Change-Id: Idbeb978705a21cd6fb710ca9f5e99b4ea7d93ec5 Reviewed-on: https://pdfium-review.googlesource.com/c/44632 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-12Remove more unnecessary includes and do IWYU as needed.Lei Zhang
Also move some implementations out of headers. Change-Id: I321fc26970c440d874b135bd28e8bc8156b9afee Reviewed-on: https://pdfium-review.googlesource.com/c/43890 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-09Do IWYU for ptr_util.h.Lei Zhang
Change-Id: Ib96a66eb47bea791f061e1d6da8aadad8037a99d Reviewed-on: https://pdfium-review.googlesource.com/c/43609 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-09-20Fix misc lint errors and other cleanups.Lei Zhang
Change-Id: I00ce0109251d1231858e87ffc3889abe6937fa26 Reviewed-on: https://pdfium-review.googlesource.com/42811 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-09-20Remove many unneeded STL #includes from headers.Lei Zhang
Change-Id: I7010cedee8d17d05b2c37a94d767e6f3a9c48f7d Reviewed-on: https://pdfium-review.googlesource.com/42790 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-08-27The final game: mark everything final.Tom Sepez
Then revert the ones that break compilation. Fix one IWYU noticed during presubmit. Change-Id: I881a8a72818e55dbc4816247e35ff5e3015194e7 Reviewed-on: https://pdfium-review.googlesource.com/41470 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-08-20Use more consts in CFX_Break.Lei Zhang
Change-Id: I57cd74581849a8f434f64c4ec3c4ad3ce1f92546 Reviewed-on: https://pdfium-review.googlesource.com/40630 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-07-03Use more UnowendPtr<> in cfgas_formatstring.h and cfx_break.hTom Sepez
Move initializers to .h file (proves none missing). Change-Id: Iff8fe76e46634aa32a32ecd592476594a9d1bafa Reviewed-on: https://pdfium-review.googlesource.com/36950 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-06-26Assert that tab width assumption holds in CFX_RTFBreak.Henrique Nakashima
Bug: chromium:844367 Change-Id: I3cbe5d97a913c734c3d54657a2fb47b30cc362fe Reviewed-on: https://pdfium-review.googlesource.com/36191 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-06-26Fix Integer-overflow in CFX_RTFBreak::AppendChar_TabHenrique Nakashima
Bug: chromium:844367 Change-Id: Id8185ea0219c03b4f8683362a3c2a45d481a5cfb Reviewed-on: https://pdfium-review.googlesource.com/36170 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-06-05Clean up CFX_TxtBreakRyan Harrison
Removed some unused assignments and now unused variables. Also rewrote a for loop so that its secondary condition is now in the control block. The static analyzer was claiming it was possible for a division by 0, though following the control path it was claiming, I am pretty sure it should have exited early. This reorganizing of the code makes it a bit more readable and eliminates the div by 0 warning from the static analyzer. Issues found with Clang Static Analyzer. Change-Id: I91f1b42374734665b06724e9fafa6490e06bd3da Reviewed-on: https://pdfium-review.googlesource.com/33910 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-06-04Remove unused assignment from CFX_RTFBreakRyan Harrison
This assignment is never used, so removing it. Issue found with Clang Static Analyzer. Change-Id: I5cf4bd9626f0a0391681c3923ae1bee70ffb99c7 Reviewed-on: https://pdfium-review.googlesource.com/33791 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-05-17More overflow checks in bidi codeDan Sinclair
There are several more places where the width is added to a characters valid width in the bidi code. This CL changes all occurances to used a check numeric. Bug: chromium:844046 Change-Id: Idd8be3a4a576af626b5afa6f7cd04cc160b929d5 Reviewed-on: https://pdfium-review.googlesource.com/32714 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-05-16Move FX_LBUN shorthand codes from .h to .cpp fileTom Sepez
They are not used outside of it. Change-Id: I0baa84c5a015621bc0ba211c2ddb01608997dc7d Reviewed-on: https://pdfium-review.googlesource.com/32633 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-05-16Use CheckedNumeric in CFX_RTFBreak::AppendChar_OthersDan Sinclair
This CL adds verification to the m_iWidth value when adding the characters width. Bug: chromium:843096 Change-Id: I7b2e7b1e786a9cba77f5aceafbb5d2bf13dc8eb9 Reviewed-on: https://pdfium-review.googlesource.com/32610 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-05-15Remove unused methods from CFX_BreakLineDan Sinclair
Remove the unused GetChar method and GetPiece method from CFX_BreakLine. Change-Id: Ieee8e7b20513b37537d304e2bff46f0d1629576c Reviewed-on: https://pdfium-review.googlesource.com/32592 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-05-15Remove CFX_BreakLine::CountPiecesDan Sinclair
This CL inlines the call to pdfium::CollectionSize for the one usage of CFX_BreakLine::CountPieces. Change-Id: I7eb64486c0a84c329d773f6d55ae277604098baf Reviewed-on: https://pdfium-review.googlesource.com/32591 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-05-15Remove CFX_BreakLine::CountCharsDan Sinclair
The CFX_BreakLine::CountChars is a thin wrapper around getting the size of the m_LineChars vector. This CL removes CountChars and uses the vectory directly. Change-Id: I6b172c090aa7acf3282df517a8ae2bbdd55ff15b Reviewed-on: https://pdfium-review.googlesource.com/32590 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-05-10Fixup ASSERT in Bidi handling; Add bidi fuzzer.Dan Sinclair
This CL converts several asserts in the FX_Bidi code to continue instead of asserting in the face of unexpected input. A BIDI fuzzer has been added as well. Bug: chromium:839695 Change-Id: If61f822bde7442c008d50be58f7cecffb6e5d658 Reviewed-on: https://pdfium-review.googlesource.com/32191 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-05-02Transform in/out params from ref to pointer in CFX_(Txt|RTF)Break.Henrique Nakashima
Remove some default parameters while we're at it. Change-Id: Ifa51f580d9773ca9cf8d08016361a0283b2d4794 Reviewed-on: https://pdfium-review.googlesource.com/31953 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-05-01Fix possible integer overflows in CFX_RTFBreak.Henrique Nakashima
Bug: chromium:838095 Change-Id: I21de7cf88c995446049faa3d688a286faa117868 Reviewed-on: https://pdfium-review.googlesource.com/31754 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-04-30Change out parameter of CFGAS_GEFont::GetCharWidth to pointer.chromium/3416Henrique Nakashima
Change-Id: I1e04c7645b2238d292a6a8eb5fb5fa365fa958f5 Reviewed-on: https://pdfium-review.googlesource.com/31752 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-04-30Fix more possible integer overflows in CFX_TxtBreak.Henrique Nakashima
Bug: chromium:838095 Change-Id: I9b5edefbff9f84b9b913ab4387a7df2588e203fb Reviewed-on: https://pdfium-review.googlesource.com/31751 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-04-30Fix Integer-overflow in CFX_TxtBreak::AppendChar_OthersHenrique Nakashima
Bug: chromium:838095 Change-Id: I6fbb67ad763800eb45fb3c84f909f74e238748e0 Reviewed-on: https://pdfium-review.googlesource.com/31750 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-04-26Enter key inserts a line break correctly in XFA edits.Henrique Nakashima
Bug: chromium:836361 Change-Id: I6d86ccec813f934ed2d0ab124501527d39ce535f Reviewed-on: https://pdfium-review.googlesource.com/31390 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-19Fix duplicated text in each line in XFA widgets.Henrique Nakashima
When calculating the characters to display, the run offset was not added to the offset inside the run, so characters from the first run were always used instead of from the run that the line should display. Bug: chromium:832909 Change-Id: I4d1d284894ce6ac9c7a49976aa6a6d0cf21f1382 Reviewed-on: https://pdfium-review.googlesource.com/30993 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-04-10Remove CFX_Rect.Lei Zhang
It is rarely used and FX_RECT is the more common integer rect type. Change-Id: I7c5b875321c2d587becedcd058bb3a57fd1f0b61 Reviewed-on: https://pdfium-review.googlesource.com/30053 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-04-03Re-arrange so inline vectors come last in structs.Tom Sepez
This might make the memory tools more effective in finding OOBs. Change-Id: Id093bb0a88c37954c80d612ac00b5a168e75bdbf Reviewed-on: https://pdfium-review.googlesource.com/29550 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-03-27Remove unused FX_TXTRUN::pIdentityDan Sinclair
Unused, removed. Change-Id: I0c7e65224777932e38ca93d81709c8321aecb1c5 Reviewed-on: https://pdfium-review.googlesource.com/29290 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-30Use unsigned for char widthchromium/3335Nicolas Pena
Bug: 806612 Change-Id: I22bd9046dd37a1b596762c46a6b29a323d6e9fa1 Reviewed-on: https://pdfium-review.googlesource.com/24410 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
2018-01-18Remove more unneeded includes and code from headers.Lei Zhang
Change-Id: I0a07dbc9850bef2184ed35ff04b08385fc1bdd17 Reviewed-on: https://pdfium-review.googlesource.com/22891 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-01-05Remove unused code from CFX_BreakLineRyan Harrison
Change-Id: I5b1cdeb53fa791f557cde93074f75e8d18c49f17 Reviewed-on: https://pdfium-review.googlesource.com/22330 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-11-29Remove CollectionSize from fx_bidiDan Sinclair
Bug: pdfium:774 Change-Id: I2056583c270f1bb0046250ce2ec53a2cbe46b893 Reviewed-on: https://pdfium-review.googlesource.com/19672 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-09-28Cleanup CFGAS_GEFont methodsDan Sinclair
Remove unused params, cleanup return values. Change-Id: I9a1bc400e24cdcac982a578242ff0f9de8055775 Reviewed-on: https://pdfium-review.googlesource.com/15070 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2017-09-27Cleanup FX macrosDan Sinclair
This CL renames the FX_OS defines to have _OS_ in their names and drops the _DESKTOP suffix. The FXM defines have been changed to just FX. Change-Id: Iab172fba541713b5f6d14fb8098baf68e3364c74 Reviewed-on: https://pdfium-review.googlesource.com/14833 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-09-21Move CFX_UnownedPtr to UnownedPtrDan Sinclair
This CL moves CFX_UnownedPtr to UnownedPtr and places in the fxcrt namespace. Bug: pdfium:898 Change-Id: I6d1fa463f365e5cb3aafa8c8a7a5f7eff62ed8e0 Reviewed-on: https://pdfium-review.googlesource.com/14620 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: 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-18Remove some unused variables.Lei Zhang
BUG=chromium:760070 Change-Id: Icb2e46da86b6b7e71dae309a015ae1c5301fc931 Reviewed-on: https://pdfium-review.googlesource.com/14230 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@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-09-05Split fx_ucd.h into fx_unicode.h and fx_ucddata.h.Tom Sepez
File naming now matches. Fix one usage not going through the accessor function. Change-Id: I5cc4986238764964f2a71807a94bd2facf517263 Reviewed-on: https://pdfium-review.googlesource.com/12930 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-31More BIDI code shufflingchromium/3206chromium/3205Dan Sinclair
Change-Id: I6df7e7d1283541ea2e6b9bcf3de172f6a886054a Reviewed-on: https://pdfium-review.googlesource.com/12731 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-31Move bidi code to fx_bidiDan Sinclair
This CL moves the BIDI code from fx_arabic to fx_bidi and conditionally compiles based on XFA. Change-Id: Iaba60486f03e48f0816d60e365a58a8622bc8254 Reviewed-on: https://pdfium-review.googlesource.com/12713 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-08-31Remove fx_basic.hDan Sinclair
This CL removes the fx_basic.h header and fixes up includes as needed. Change-Id: I49af32a8327bdbcda40c50a61ffbd75d06609040 Reviewed-on: https://pdfium-review.googlesource.com/12670 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-08-30Rebuild CFDE_TextEditEngine.Dan Sinclair
This CL rebuilds the text edit engine in a simpler fashion. Instead of depending on multiple pages, paragraphs and buffer fields there is a single text edit engine which contains a gap buffer. This makes the code easier to understand and follow. Change-Id: I10fe85603fa9ed15a647eaac2d931f113cd0c7b0 Reviewed-on: https://pdfium-review.googlesource.com/11990 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2017-08-28Add a global font loader in XFA testsDan Sinclair
This CL creates a global font loader for use in XFA tests. This is needed because the CFGAS_FontMangaer takes a linearly increasing amount of time to load fonts each time it's loaded. This can get excessively slow for test suites which run a lot of tests. Change-Id: Ie389844b56598ce414f4f761654fa4ed465955fd Reviewed-on: https://pdfium-review.googlesource.com/12090 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-28Remove code which does nothingDan Sinclair
This code will just add 0 to x and subtract 0 from y. Doing nothing. Remove. Change-Id: I6e0aa91d088acd49cb83d4bded29908b544b692b Reviewed-on: https://pdfium-review.googlesource.com/12110 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2017-08-17Remove redundant members in CFDE_TxtEdtEngineDan Sinclair
This CL removes a bunch of redundant members from the text edit engine. The change information tracking was removed as most of it was unused or was used inconsistently. Change-Id: I92460594e46accff0b78e1183c8574fc83ce728a Reviewed-on: https://pdfium-review.googlesource.com/11275 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-15Remove default params from xfa/fde code.Dan Sinclair
This CL removes the default params from methods in xfa/fde. Change-Id: Ide93a51430c62753656b9e9c0bcd842d8179aa3c Reviewed-on: https://pdfium-review.googlesource.com/10952 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-01Encapsulate some CFX_Char members.Lei Zhang
Change-Id: Iab34de5858ae06582023be220ef7dd0d1d0a91c9 Reviewed-on: https://pdfium-review.googlesource.com/9530 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-07-28Use FX_GetUnicodeProperties() in more places.chromium/3173chromium/3172chromium/3171Lei Zhang
Instead of accessing the raw kTextLayoutCodeProperties data. Change-Id: Ie39cf5c098e1564ae2f18d76b234af42f24db4ca Reviewed-on: https://pdfium-review.googlesource.com/9451 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>