summaryrefslogtreecommitdiff
path: root/xfa/fwl
AgeCommit message (Collapse)Author
2016-06-15Make code compile with clang_use_chrome_plugin (part IV)weili
This change mainly contains files in fpdfsdk/ directory. This is part of the efforts to make PDFium code compilable by Clang chromium style plugins. The changes are mainly the following: -- move inline constructor/destructor of complex class/struct out-of-line; -- add constructor/destructor of complex class/struct if not explicitly defined; -- add explicit out-of-line copy constructor when needed; -- move inline virtual functions out-of-line; -- Properly mark virtual functions with 'override'; -- some minor cleanups plus removing an unused file and splitting cxfa_eventparam out from fxfa.h BUG=pdfium:469 Review-Url: https://codereview.chromium.org/2062313002
2016-06-09Avoid casts via correct types in fgas_textbreaktsepez
FLW_DATEINFO cast not required. Review-Url: https://codereview.chromium.org/2053963002
2016-06-07Replace IFGAS_Font with underlying concrete typethestig
Review-Url: https://codereview.chromium.org/2037563002
2016-06-07Fix more code which has shadow variablesweili
The code has local variables that shadow struct or class member variables. Also, when this happens, different variable names should be used instead of namespaces. These were discovered by /Wshadow warning flag in Clang. Review-Url: https://codereview.chromium.org/2034253003
2016-06-07Get rid of NULLs in core/thestig
Review-Url: https://codereview.chromium.org/2032613003
2016-06-06Remove FWL_HTIMER in favor of IWFL_TimerInfotsepez
Review-Url: https://codereview.chromium.org/2037573003
2016-06-06Make GetDevFont() return a CFX_Font* instead of void*tsepez
Then we can remove a bunch of casts. Review-Url: https://codereview.chromium.org/2033243004
2016-06-03Rename IFX_FontMgr to IFGAS_FontMgrtsepez
Avoid confusion with CFX_FontMgr, which does not inherit from IFX_FontMgr, and lives in a different layer of code. Do the same CFX_ -> CFGAS_ transformation for the concrete classes that implement IFGAS_FontMgr. Review-Url: https://codereview.chromium.org/2039463003
2016-06-03Fix more bugs found by /analyze toolweili
Three more bugs are discovered: -- potientially used freed pointer; -- potientially used uninitialized variable; -- Used '&&' instead of bitwise operator '&' BUG=chromium:613623, chromium:427616 Review-Url: https://codereview.chromium.org/2040503002
2016-06-03Rename IFX_Font to IFGAS_Fonttsepez
Avoid confusion with CFX_Font, which is defined in fxcrt, and does not inherit from nor bear any resemblence to IFX_Font. Review-Url: https://codereview.chromium.org/2036173003
2016-06-03Remove two unused opaque handle typestsepez
Review-Url: https://codereview.chromium.org/2038913002
2016-06-02Fix all the code which has duplicate variable declarationsweili
When there are duplicate variable declarations, the inner names shadow the outter ones. This is error prone and harder to read. Remove all the instances found by /analyze. BUG=chromium:613623, chromium:427616 Review-Url: https://codereview.chromium.org/2027273002
2016-06-02Replace FWL_HLISTITEM with class IFWL_ListItem {}tsepez
Make CFWL_ classes inherit from IFWL_ListItem. Replace reinterpret_casts with static_casts. Review-Url: https://codereview.chromium.org/2029923002
2016-05-27Fix two bugs found by /analyze toolweili
The first one is about bitwise AND on zero, the result would always be zero. The second one is about using wrong bitmasks, the result would cause branches never get executed. BUG=chromium:613623, chromium:427616 Review-Url: https://codereview.chromium.org/2016243003
2016-05-27Add back-pointer to "Associated widget" to CFWL_WidgetImp.tsepez
This is the last use of CFX_PrivateData, which is now removed. Review-Url: https://codereview.chromium.org/2016743002
2016-05-26Fix MSVC C4800 build warnings.thestig
TBR=weili@chromium.org Review-Url: https://codereview.chromium.org/2017863002
2016-05-26Remove default arguments from CFX_FxgeDevice.thestig
Remove unused dithering code. Review-Url: https://codereview.chromium.org/2010813003
2016-05-26Add opaque "layout item" to widgets for caller's use.tsepez
This avoids another use of CFX_PrivateData. Note that in the old code, we'd be calling through a m_pImpl onto the same underlying object as we passed as the "key" argument when setting the value, which explains why the get calls, happening one object lower, pass the same argument as which they are being inovked against. Review-Url: https://codereview.chromium.org/2010923002
2016-05-26Enable chromium_code standard for XFA codeweili
Clean up the left code which causes warnings. Enable using chromium_code for XFA compilation, also re-enable all the msvs warning flags except 4267 (same as the main pdfium code). BUG=pdfium:29,pdfium:475 Review-Url: https://codereview.chromium.org/2009813004
2016-05-26Remove unused FWL_Error::OutOfMemorytsepez
Interestingly, callers don't take different action based on the specific code, but that's a matter for another day. Review-Url: https://codereview.chromium.org/2010973003
2016-05-26Remove one (of several) usages of SetPrivateData from IFWL_Widgettsepez
Allow an upper layer to store an "event key" directly in the widget. Also fix some dubious logic in key allocation. Review-Url: https://codereview.chromium.org/2012143003
2016-05-25Rename fwl_widgetmgrimp.{cpp,h} to cfwl_widgetmgr.{cpp,h}tsepez
Review-Url: https://codereview.chromium.org/2004293004
2016-05-24Correctly implement GetPartState() functionweili
The original function doesn't seem right. Re-implement it. Review-Url: https://codereview.chromium.org/2001203002
2016-05-24Remove IWFL_WidgetMgr in favor of CFWL_WidgetMgr.tsepez
The pure virtual class isn't buying us anything, and is costing us an otherwise unneeded vtable. Fix pre-existing presubmit warning in fwl_noteimp.cpp:88: If statement had no body and no else clause ... Remove switch on enum() and make separate GetWidget() methods. Review-Url: https://codereview.chromium.org/2004213002
2016-05-20Return no style in GetItemStyles() for item of null pointerweili
The error handling in GetItemStyles() of list box is wrong. -1 is 0xFFFFFFFF in uint32_t, which suggests all the style bits on. This was discovered by a signed/unsigned mismatch warning. BUG=pdfium:29 Review-Url: https://codereview.chromium.org/2005583002
2016-05-20Remove Release() from CFX_Barcodetsepez
Review-Url: https://codereview.chromium.org/2000883002
2016-05-20Clean up XFA code which causes warningsweili
This is part of efforts to bring XFA to chromium_code standard. The warnings are from unreachable code, or using potentially uninitialized variables, or using assignment within a condition. This change list only contains easy to fix cases. More cleanups will follow. BUG=pdfium:29 Review-Url: https://codereview.chromium.org/1998873002
2016-05-20Fix a bug on scrollbar's checking theme statesweili
The current switch statement will never execute any branch other than falling to default. The intention should be checking on the specific state bits. BUG=613623, 427616 Review-Url: https://codereview.chromium.org/2002643003
2016-05-20Fix unreachable code in fwl_comboboximp.cpptsepez
Althought this may change behaviour, I'm going to make the assumption that the intent expressed by the current code is what is desired, and that this is simply a case of not being able to count bits properly. BUG=613620,427616 Review-Url: https://codereview.chromium.org/1996303003
2016-05-20Use std::map, std::unique_ptr in fwl_widgetmgrimp.htsepez
Review-Url: https://codereview.chromium.org/1998303002
2016-05-19Work around sign compare error from commit be9b894.thestig
Review-Url: https://codereview.chromium.org/1989203007
2016-05-18Remove Release() from CFDE_TxtEdit* classestsepez
Review-Url: https://codereview.chromium.org/1987223003
2016-05-18Remove Release() from CXFA_FWLThemetsepez
Cleanup virtual overrides along the way. Add final to other class deriving from pure virtual interface. Review-Url: https://codereview.chromium.org/1988373002
2016-05-18Split xfa/fee files into individual class files.dsinclair
This CL splits the xfa/fee files into individual class files and moves them into the xfa/fde directory where they belong. Review-Url: https://codereview.chromium.org/1994693002
2016-05-18Pass objects instead of strings for undo/redo records.dsinclair
Currently the Undo/Redo records are serialized as byte strings and stored into a CFX_ByteStringArray. They are deserialized when used. This CL removes the serialization and stores the objects in a deque of unique pointers. Review-Url: https://codereview.chromium.org/1980293004
2016-05-16Convert border style defines to an enum class.dsinclair
There were two defines, BBS_ and PBS_ for the various border styles in the system. They were the same, except PBS_ had an extra SHADOW define which was never used. This CL combines both of those into a single BorderStyle enum class and updates the code as needed. Also, removes ADDBIT, GETBIT unused defines. Updates barcode code to use the util.h defines instead of redefinition. fsdk_baseannot names starting with _ were cleaned up and some #defines moved to constants. Review-Url: https://codereview.chromium.org/1980973002
2016-05-13Make CFX_ByteString(const CFX_ByteStringC&) explicit.tsepez
Add missing helper function to CFX_ByteTextBuf to avoid the anti-pattern CFX_ByteString(sBuf.AsStringC()), using the name "Make" to indicate there's an allocation going on in this case. Change some method arguments to take pre-existing ByteStrings where possible. Review-Url: https://codereview.chromium.org/1977093002
2016-05-13Make CFX_WideString(const CFX_WideString&) explicit.tsepez
BUG= Review-Url: https://codereview.chromium.org/1979723003
2016-05-13ReplaceSelections() methods never called.tsepez
Review-Url: https://codereview.chromium.org/1973883005
2016-05-11Use STL map for m_eventTargets.tsepez
Remove unused member and return value along the way. Review-Url: https://codereview.chromium.org/1940033002
2016-05-11Replace some calls to Release() with direct delete, part 1.tsepez
Searching for the anti-pattern: void Release() { delete this; } We must be explicit on the ownership model. Add unique_ptrs as a result. Review-Url: https://codereview.chromium.org/1960673003
2016-05-05Remove CLASSHASH defines in favour of an enum class.dsinclair
This Cl updates all the CLASSHASH defines to use an enum class. A few defines where unabled and were either updated or removed if the number no longer exists in the code base. Review-Url: https://codereview.chromium.org/1946213003
2016-05-04Convert FWL_ERR into an enum class.dsinclair
This Cl updates FWL_ERR to be an FWL_Error enum class. It removes FX_ERR and replaces it with FWL_Error as well as the values were the same. There were many places where we either returned other values for FWL_ERR results. This Cl is the same as: https://codereview.chromium.org/1943413002/ but I seem to have messed up the base URL in that one. TBR=tsepez@chromium.org Review-Url: https://codereview.chromium.org/1952693003
2016-05-04Cleanup IFWL_Adapter interfaces.dsinclair
This CL removes: * IFWL_AdapterNative * IFWL_Adapter{Widget|Thread}Mgr * IFWL_WidgetMgrDelegate * CFWL_SDAdapter{Widget|Thread}Mgr Methods which just returned have also been removed. Review-Url: https://codereview.chromium.org/1928963004
2016-05-04Cleanup CFWL_ThemePart data.dsinclair
The m_dwData pointer was being used as a generic way to pass around data. There were only two places we were reading that data. This Cl changes to have two specific flags and removes the generic pointer. Review-Url: https://codereview.chromium.org/1950973003
2016-05-04Convert some theme defines to values.dsinclair
This Cl updates several of the theme defines to be constant values instead of defines. Some of the items were re-ordered so the calculations would work correctly. Review-Url: https://codereview.chromium.org/1945183004
2016-05-04More define cleanup.dsinclair
This CL converts defines into constants, enums, enum classes or removes them as needed. Review-Url: https://codereview.chromium.org/1938163002
2016-05-04Return bool rather than bitwise-and for FX_BOOLtsepez
Investigate results of: git grep -ni 'return [(]*[a-z0-9_]* &[^&]' git grep -ni 'BOOL.*= [(]*[a-z0-9_]* &[^&]' Review-Url: https://codereview.chromium.org/1951653002
2016-05-03Remove FWL_WGTHITTEST_* defines in favour of enum class.dsinclair
This Cl updates the FWL_WGTHITTEST_ defines to an enum class and fixes up any code issues. Review-Url: https://codereview.chromium.org/1948583002
2016-05-02Fix lint bugs.thestig
Also fix typos and overrides. Review-Url: https://codereview.chromium.org/1935793002