summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_fwltheme.cpp
AgeCommit message (Collapse)Author
2018-07-30Don't static_cast<>(this) to subclass in CXFA_LayoutItem methods.chromium/3508Tom Sepez
Instead, move the methods to the subclass where they belong. Fix IWYU in CJX_Object.h to fix compilation. Change-Id: I4c71f28235b9cf5000e9ddaf33d6602baf22205f Reviewed-on: https://pdfium-review.googlesource.com/39170 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-05-18Fix issues with XFA font loadingRyan Harrison
This fixes two partially interrelated bugs with font loading in XFA documents. First, it adds falling back to the builtin fonts if there are no viable embedded or installed font for the top-level XFA font manager. Additionally it changes the load font code path in CXFA_FWLTheme to use the top level XFA font manager, instead of the one that just handles the system installed fonts. The main visible issue that this patch fixes is that currently using --font-dir with pdfium_test on a XFA PDF can cause text to not be displayed in widgets and/or NOTREACHED asserts. This occurs if there isn't a needed fonts embedded in the document or in the font directory, since currently PDFium will not correctly fall back to the builtins. BUG=pdfium:1008,pdfium:1020 Change-Id: I451a8aede63d639e401c0cc076443e61d8b7a2f8 Reviewed-on: https://pdfium-review.googlesource.com/32730 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-05-01Transform rect out param from reference to pointer in XFA code.Henrique Nakashima
Change-Id: Ib5f8b8754bca8198d9122700d7d876b45d1428da Reviewed-on: https://pdfium-review.googlesource.com/31852 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-05-01Fix last character missing from strings in XFA Month Calendar.Henrique Nakashima
This was a bug introduced in a refactor a long, long time ago. A line was removed (probably unintentionally). https://chromiumcodereview.appspot.com/2435603003/diff/40001/xfa/fxfa/app/xfa_fwltheme.cpp Bug: pdfium:751 Change-Id: I0e3d094a543bd0e31010a8093387906d62c0a5dc Reviewed-on: https://pdfium-review.googlesource.com/31830 Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-04-27Fix focused day disappears in XFA MonthCalendar.Henrique Nakashima
Bug: pdfium:751 Change-Id: I27c4cf96c1b0d314ace8461ca6020c1034eff646 Reviewed-on: https://pdfium-review.googlesource.com/31650 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-04-25Allow failing to build CFXA_FWLTheme if unable to load fontsRyan Harrison
The current implementation of this class potentially does a lot of work in the constructor. Specifically when getting a calendar font it might cause the whole font loading pipeline to run. This can fail if it is unable to load fonts. Breaking out the font loading part, so that the factory method can return nullptr if it fails. Additionally adding a guard for the case the font manager fails to load, which is the root cause of the crash in the bug. BUG=chromium:835608 Change-Id: I05b987aaad6f0814907066904331610a7fbb7f70 Reviewed-on: https://pdfium-review.googlesource.com/31330 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-01-23Remove GetWidgetAcc callsDan Sinclair
This CL removes the calls to CXFA_Node::GetWidgetAcc() as they redundantly return the node they were called upon. Change-Id: I46e66cf98137a1dee7cd3fa8bc7d379eb97fded5 Reviewed-on: https://pdfium-review.googlesource.com/23630 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-23Merge CXFA_WidgetAcc into CXFA_Nodechromium/3330Dan Sinclair
This CL merges CXFA_WidgetAcc into CXFA_Node. Change-Id: Iab52ca7f98c9dcd4ab089c61b8f1324a565bf647 Reviewed-on: https://pdfium-review.googlesource.com/23610 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-22Remove unused WidgetPreRemove and WidgetPostAdd paramsDan Sinclair
This CL removes the unused WidgetAcc param from both methods and updates callsites as needed. The include for cxfa_widgetacc.h was removed from fxfa.h and had to be inserted in locations where needed. Change-Id: I55ae9e935a948dff3b6d906b4567665e60530eba Reviewed-on: https://pdfium-review.googlesource.com/23391 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-22Move the UI elements from CXFA_WidgetAcc to CXFA_NodeDan Sinclair
This CL moves the methods and members related to the UI nodes from the CXFA_WidgetAcc class to the CXFA_Node class. Change-Id: I1fdc5173787141065f1e607bbfefa3b22af738b4 Reviewed-on: https://pdfium-review.googlesource.com/23290 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-10Rename GetPara to GetParaIfExistschromium/3318Dan Sinclair
This CL renames GetPara to make it explicit it can return nullptr. Change-Id: I7c6529c15646b9947964e25a8d28938b38f091d6 Reviewed-on: https://pdfium-review.googlesource.com/22680 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-08Change the FFWidgets to store the nodeDan Sinclair
This CL changes the various CXFA_FF* widgets to hold a CXFA_Node instead of a CXFA_WidgetAcc wrapper. Change-Id: I7e31633d5ffd3b61abcdcdfeee7822514c5b28da Reviewed-on: https://pdfium-review.googlesource.com/22410 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-08Move proxy methods from CXFA_WidgetAcc to CXFA_NodeDan Sinclair
This CL moves methods from WidgetAcc which just proxy to CXFA_Node. Change-Id: Icf1006b4be3f91077de411ed1a571b1507117602 Reviewed-on: https://pdfium-review.googlesource.com/22391 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-04Remove CXFA_FFDocView from CXFA_WidgetAcc.Dan Sinclair
This CL removes the CXFA_FFDocView parameter from CXFA_WidgetAcc and passes in the document to the methods which require a document. Change-Id: I7b264caf0ed89d0453ae0b74c27f2ee0f31f61af Reviewed-on: https://pdfium-review.googlesource.com/22260 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-12-14Fold CXFA_ParaData into CXFA_ParaDan Sinclair
This CL removes the CXFA_ParaData wrapper and folds the code into CXFA_Para. Change-Id: I86d139f1df48dcc80d28c7516b1bda95a59e94bd Reviewed-on: https://pdfium-review.googlesource.com/21270 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-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-07Rename CXFA_Para to CXFA_ParaDataDan Sinclair
This CL renames CXFA_Para to CXFA_ParaData to show it is part of the data hierarchy. Change-Id: I71f58c87416b17d1e59252ca374aad13935fc430 Reviewed-on: https://pdfium-review.googlesource.com/17989 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@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-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-21Cleanup CFDE_TextOutDan Sinclair
This CL cleans up formatting and simplifies logic in CFDE_TextOut. Change-Id: Ib675a35da79df77854f51e86bf24e5dc90b33b06 Reviewed-on: https://pdfium-review.googlesource.com/11334 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-17Remove default parameters in CXFA_Graphics methods.Lei Zhang
Constify parameters as well. Change-Id: I7e87b11cc73b133b04d49ceed1c46f5afcb89d1a Reviewed-on: https://pdfium-review.googlesource.com/11111 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-15Remove CFDE_RenderDeviceDan Sinclair
This CL removes CFDE_RenderDevice. For most of the proxy'd calls we call the CFX_RenderDevice directly now. To set the clip rect an overload was added to accept a CFX_RectF and handle the casting to FX_RECT. The one needed method, DrawString, is move to a static on CFDE_TextOut. Change-Id: I95ea7e1fa1fd4702074b797c06423c9c9cb51db9 Reviewed-on: https://pdfium-review.googlesource.com/10951 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@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>