summaryrefslogtreecommitdiff
path: root/fpdfsdk/pwl/cpwl_edit.cpp
AgeCommit message (Collapse)Author
2018-08-16Remove arguments from CPWL_Edit::SetAlignFormatV().chromium/3525Tom Sepez
There's only one caller. Rename to match its new behaviour. Change-Id: I2d5ac2017316fdf6e9533fe506f2dab14205043a Reviewed-on: https://pdfium-review.googlesource.com/40410 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-08-07Make CPDF_Font::GetFontBBox() return the bounding box.Lei Zhang
Instead of using an out parameter. Fix nits in the only caller as well. Change-Id: I04eb92705b2fbda001191c36da972eee499acbc7 Reviewed-on: https://pdfium-review.googlesource.com/39490 Reviewed-by: Nicolás Peña Moreno <npm@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-04-16Remove CPWL_Edit rich text supportdan sinclair
This CL removes the code which attempts to provide rich text support for CPWL_Edit. The code, as written, doesn't actually work well. If you have tags under the <p> tag we will just lose the content (so <p><b>foo</b></p> would end up being a blank string). Multiple <p> tags get concatenated together with a \n, but we subsequently lose the \n later when we store the content into the VariableText object (so <p>foo</p><p>bar</p> becomes foobar instead of foo\nbar). We never read the "RV" field from the dictionary. The RV field is what actually stores the rich text value. So, we never set a rich text value into the text edit. Change-Id: Idc1d65e1b5d75380dd28c45bcbf9137a2a4cea9a Reviewed-on: https://pdfium-review.googlesource.com/30690 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-12-19Remove some dead code.Lei Zhang
Change-Id: I8edb14c024860c66b5e6c014136393e71e38387d Reviewed-on: https://pdfium-review.googlesource.com/21570 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-12-13Use size_t in CXML_Element and callers.Lei Zhang
Change-Id: I9ebacd18252a837f1f5f13ccaec19b196bacc3ae Reviewed-on: https://pdfium-review.googlesource.com/21072 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-10-04Fix UAF in SetVisible().Henrique Nakashima
SetVisible() may be called during Destroy() which may be called during SetVisible(). This fixes the latest in a family of bugs that happen after an instance is freed by code triggered by JS code while it's executing a method. The CL has a lot of protection for many of these points where JS may be executed and potentially destroy objects. The return types of many methods that may execute JS have been changed to bool, indicating whether the instance is still alive after the call. Bug: chromium:770148 Change-Id: If5a9db4d8d6aac10f4dd6b645922bb96c116684d Reviewed-on: https://pdfium-review.googlesource.com/15190 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2017-09-22Fix UAF after destroying a widget during OnBeforeKeyStroke().chromium/3223Henrique Nakashima
Bug: chromium:766957 Change-Id: I61b282059fb4fc2c8ba6dafc502f030f31dd324d Reviewed-on: https://pdfium-review.googlesource.com/14710 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-09-19Setting focus on a widget may destroy the widgetDan Sinclair
When a widget has focus set, this can trigger an Invalidation call which can trigger a page and annotation reload. This reload can destroy the current widget we're handling. This CL adds ObservedPtrs as needed so we can make sure the widgets are still alive after we've done the Invalidation. Bug: chromium:765921 Change-Id: I51cd24aa1ebd96abe9478efef5130a4e568dac1a Reviewed-on: https://pdfium-review.googlesource.com/14290 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-09-15Introduce CPWL_Wnd::PrivateData class.Tom Sepez
First step in passing ownership of this memory to the CPWL_Wnd. In turn, nest two other classes that also require PrivateData to satisfy nesting rules. Move one stray #define to the appropriate file while at it. Change-Id: I565934565421f5843a3b792b3bdc21b5e8839eb8 Reviewed-on: https://pdfium-review.googlesource.com/14170 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-09-15Add ObservedPtrs to KillFocus pathRyan Harrison
This is to prevent use after free issues due to these calls causing reloads of content that have the side of effect of destroying windows. BUG=chromium:760455 Change-Id: I3f3947be8b32964783abf5577a24ba6a713b3476 Reviewed-on: https://pdfium-review.googlesource.com/14150 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-08-15Change a bunch of methods to take a const CFX_Matrix& param.chromium/3187Lei Zhang
Simplify some code along the way. Change-Id: I0022c8a82188192c63b9ac0bc87e9b9dbf983040 Reviewed-on: https://pdfium-review.googlesource.com/10852 Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-08-15Remove default argument from CPWL_Wnd::InvalidateRect().Lei Zhang
Change-Id: I529925b10fa43d4c9c6c9d398265d2ae7eccf93d Reviewed-on: https://pdfium-review.googlesource.com/10853 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-15Do some cleanup in CPWL_Edit.Lei Zhang
- Return early in some methods. - Make IsProceedtoOnChar() a static method. Change-Id: I56b92d920b2c0bbdff84cb3024d80e379f1c6a2a Reviewed-on: https://pdfium-review.googlesource.com/10857 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-08-15Remove CPWL_EditImpl::EnableOprNotify().Lei Zhang
It's redundant with SetOprNotify(). Change-Id: Iee2741744017ea6bd1b9839fc6395197c560f1e7 Reviewed-on: https://pdfium-review.googlesource.com/10850 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-07-25Move fpdfsdk/pdfwindow to fpdfsdk/pwlDan Sinclair
This makes it clearer what the directory contains. Change-Id: I34fc38dd30b8e0f6e057052ea33c8b5a10f1b9c3 Reviewed-on: https://pdfium-review.googlesource.com/8791 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>