From 109aa6d0f673aee11a398aae478fb758fc73a33f Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 20 Sep 2018 01:21:05 +0000 Subject: Remove more unneeded STL #includes from headers. Remove some variables named "string" to avoid false positives from the linter. Change-Id: I00a53e6970451fd0cea8ab2f8178183650ca00d2 Reviewed-on: https://pdfium-review.googlesource.com/42810 Reviewed-by: Tom Sepez Commit-Queue: Lei Zhang --- core/fpdfapi/font/cpdf_fontglobals.h | 1 - core/fpdfapi/parser/cpdf_simple_parser.h | 2 -- core/fpdfapi/parser/cpdf_syntax_parser.cpp | 4 ++++ core/fpdfapi/parser/cpdf_syntax_parser.h | 3 +-- core/fxcrt/cfx_seekablestreamproxy.h | 2 -- core/fxcrt/css/cfx_cssdeclaration.h | 1 - core/fxcrt/fileaccess_iface.h | 1 - core/fxcrt/maybe_owned.h | 1 - core/fxcrt/string_view_template.h | 1 - core/fxcrt/xml/cfx_xmlparser.cpp | 1 + core/fxcrt/xml/cfx_xmlparser.h | 1 - fpdfsdk/cpdfsdk_widget.h | 2 -- fxjs/cjs_delaydata.h | 3 +-- fxjs/cjs_field.cpp | 6 +++--- fxjs/cjs_field.h | 2 +- fxjs/cjs_publicmethods.h | 5 ++--- fxjs/js_define.h | 1 - xfa/fxfa/parser/cxfa_itemlayoutprocessor.h | 1 - 18 files changed, 13 insertions(+), 25 deletions(-) diff --git a/core/fpdfapi/font/cpdf_fontglobals.h b/core/fpdfapi/font/cpdf_fontglobals.h index d5156aae65..0e2985f312 100644 --- a/core/fpdfapi/font/cpdf_fontglobals.h +++ b/core/fpdfapi/font/cpdf_fontglobals.h @@ -9,7 +9,6 @@ #include #include -#include #include "core/fpdfapi/cmaps/cmap_int.h" #include "core/fpdfapi/font/cfx_stockfontarray.h" diff --git a/core/fpdfapi/parser/cpdf_simple_parser.h b/core/fpdfapi/parser/cpdf_simple_parser.h index c8dae23ba6..f9461b644c 100644 --- a/core/fpdfapi/parser/cpdf_simple_parser.h +++ b/core/fpdfapi/parser/cpdf_simple_parser.h @@ -7,8 +7,6 @@ #ifndef CORE_FPDFAPI_PARSER_CPDF_SIMPLE_PARSER_H_ #define CORE_FPDFAPI_PARSER_CPDF_SIMPLE_PARSER_H_ -#include - #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" #include "third_party/base/span.h" diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.cpp b/core/fpdfapi/parser/cpdf_syntax_parser.cpp index cc83fa091a..45e0f1730b 100644 --- a/core/fpdfapi/parser/cpdf_syntax_parser.cpp +++ b/core/fpdfapi/parser/cpdf_syntax_parser.cpp @@ -403,6 +403,10 @@ ByteString CPDF_SyntaxParser::GetKeyword() { return GetNextWord(nullptr); } +void CPDF_SyntaxParser::SetPos(FX_FILESIZE pos) { + m_Pos = std::min(pos, m_FileLen); +} + std::unique_ptr CPDF_SyntaxParser::GetObjectBody( CPDF_IndirectObjectHolder* pObjList) { const CPDF_ReadValidator::Session read_session(GetValidator().Get()); diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.h b/core/fpdfapi/parser/cpdf_syntax_parser.h index 92f28d9874..6e6b98c068 100644 --- a/core/fpdfapi/parser/cpdf_syntax_parser.h +++ b/core/fpdfapi/parser/cpdf_syntax_parser.h @@ -7,7 +7,6 @@ #ifndef CORE_FPDFAPI_PARSER_CPDF_SYNTAX_PARSER_H_ #define CORE_FPDFAPI_PARSER_CPDF_SYNTAX_PARSER_H_ -#include #include #include @@ -42,7 +41,7 @@ class CPDF_SyntaxParser { } FX_FILESIZE GetPos() const { return m_Pos; } - void SetPos(FX_FILESIZE pos) { m_Pos = std::min(pos, m_FileLen); } + void SetPos(FX_FILESIZE pos); std::unique_ptr GetObjectBody( CPDF_IndirectObjectHolder* pObjList); diff --git a/core/fxcrt/cfx_seekablestreamproxy.h b/core/fxcrt/cfx_seekablestreamproxy.h index b193b1801a..42123fd88c 100644 --- a/core/fxcrt/cfx_seekablestreamproxy.h +++ b/core/fxcrt/cfx_seekablestreamproxy.h @@ -7,8 +7,6 @@ #ifndef CORE_FXCRT_CFX_SEEKABLESTREAMPROXY_H_ #define CORE_FXCRT_CFX_SEEKABLESTREAMPROXY_H_ -#include - #include "core/fxcrt/fx_stream.h" #include "core/fxcrt/fx_system.h" #include "core/fxcrt/retain_ptr.h" diff --git a/core/fxcrt/css/cfx_cssdeclaration.h b/core/fxcrt/css/cfx_cssdeclaration.h index 8d67bb7944..5092da438a 100644 --- a/core/fxcrt/css/cfx_cssdeclaration.h +++ b/core/fxcrt/css/cfx_cssdeclaration.h @@ -8,7 +8,6 @@ #define CORE_FXCRT_CSS_CFX_CSSDECLARATION_H_ #include -#include #include #include "core/fxcrt/css/cfx_cssdata.h" diff --git a/core/fxcrt/fileaccess_iface.h b/core/fxcrt/fileaccess_iface.h index c438f9ec47..210080e438 100644 --- a/core/fxcrt/fileaccess_iface.h +++ b/core/fxcrt/fileaccess_iface.h @@ -7,7 +7,6 @@ #ifndef CORE_FXCRT_FILEACCESS_IFACE_H_ #define CORE_FXCRT_FILEACCESS_IFACE_H_ -#include #include #include "core/fxcrt/fx_safe_types.h" diff --git a/core/fxcrt/maybe_owned.h b/core/fxcrt/maybe_owned.h index ac3a81d47e..511e63223b 100644 --- a/core/fxcrt/maybe_owned.h +++ b/core/fxcrt/maybe_owned.h @@ -5,7 +5,6 @@ #ifndef CORE_FXCRT_MAYBE_OWNED_H_ #define CORE_FXCRT_MAYBE_OWNED_H_ -#include #include #include diff --git a/core/fxcrt/string_view_template.h b/core/fxcrt/string_view_template.h index d774e3f4bd..e459f2d275 100644 --- a/core/fxcrt/string_view_template.h +++ b/core/fxcrt/string_view_template.h @@ -10,7 +10,6 @@ #include #include #include -#include #include #include "core/fxcrt/fx_system.h" diff --git a/core/fxcrt/xml/cfx_xmlparser.cpp b/core/fxcrt/xml/cfx_xmlparser.cpp index d66d980f38..97ba90d0fe 100644 --- a/core/fxcrt/xml/cfx_xmlparser.cpp +++ b/core/fxcrt/xml/cfx_xmlparser.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include "core/fxcrt/cfx_seekablestreamproxy.h" diff --git a/core/fxcrt/xml/cfx_xmlparser.h b/core/fxcrt/xml/cfx_xmlparser.h index 4d9184de3e..466968054b 100644 --- a/core/fxcrt/xml/cfx_xmlparser.h +++ b/core/fxcrt/xml/cfx_xmlparser.h @@ -8,7 +8,6 @@ #define CORE_FXCRT_XML_CFX_XMLPARSER_H_ #include -#include #include #include "core/fxcrt/fx_string.h" diff --git a/fpdfsdk/cpdfsdk_widget.h b/fpdfsdk/cpdfsdk_widget.h index a1ff9238d8..e7d5f6d3cd 100644 --- a/fpdfsdk/cpdfsdk_widget.h +++ b/fpdfsdk/cpdfsdk_widget.h @@ -7,8 +7,6 @@ #ifndef FPDFSDK_CPDFSDK_WIDGET_H_ #define FPDFSDK_CPDFSDK_WIDGET_H_ -#include - #include "core/fpdfdoc/cpdf_aaction.h" #include "core/fpdfdoc/cpdf_action.h" #include "core/fpdfdoc/cpdf_annot.h" diff --git a/fxjs/cjs_delaydata.h b/fxjs/cjs_delaydata.h index deeb65d56f..f4c7820143 100644 --- a/fxjs/cjs_delaydata.h +++ b/fxjs/cjs_delaydata.h @@ -7,7 +7,6 @@ #ifndef FXJS_CJS_DELAYDATA_H_ #define FXJS_CJS_DELAYDATA_H_ -#include #include #include "core/fxcrt/fx_coordinates.h" @@ -24,7 +23,7 @@ struct CJS_DelayData { WideString sFieldName; int32_t num; bool b; - ByteString string; + ByteString bytestring; WideString widestring; CFX_FloatRect rect; CFX_Color color; diff --git a/fxjs/cjs_field.cpp b/fxjs/cjs_field.cpp index 1f390519fd..45baf613b0 100644 --- a/fxjs/cjs_field.cpp +++ b/fxjs/cjs_field.cpp @@ -2608,10 +2608,10 @@ void CJS_Field::AddDelay_Bool(FIELD_PROP prop, bool b) { m_pJSDoc->AddDelayData(std::move(pNewData)); } -void CJS_Field::AddDelay_String(FIELD_PROP prop, const ByteString& string) { +void CJS_Field::AddDelay_String(FIELD_PROP prop, const ByteString& str) { auto pNewData = pdfium::MakeUnique(prop, m_nFormControlIndex, m_FieldName); - pNewData->string = string; + pNewData->bytestring = str; m_pJSDoc->AddDelayData(std::move(pNewData)); } @@ -2644,7 +2644,7 @@ void CJS_Field::DoDelay(CPDFSDK_FormFillEnvironment* pFormFillEnv, switch (pData->eProp) { case FP_BORDERSTYLE: SetBorderStyle(pFormFillEnv, pData->sFieldName, pData->nControlIndex, - pData->string); + pData->bytestring); break; case FP_CURRENTVALUEINDICES: SetCurrentValueIndices(pFormFillEnv, pData->sFieldName, diff --git a/fxjs/cjs_field.h b/fxjs/cjs_field.h index 4f2171017d..d4abb693bf 100644 --- a/fxjs/cjs_field.h +++ b/fxjs/cjs_field.h @@ -360,7 +360,7 @@ class CJS_Field final : public CJS_Object { void AddDelay_Int(FIELD_PROP prop, int32_t n); void AddDelay_Bool(FIELD_PROP prop, bool b); - void AddDelay_String(FIELD_PROP prop, const ByteString& string); + void AddDelay_String(FIELD_PROP prop, const ByteString& str); void AddDelay_Rect(FIELD_PROP prop, const CFX_FloatRect& rect); void AddDelay_WordArray(FIELD_PROP prop, const std::vector& array); void AddDelay_WideStringArray(FIELD_PROP prop, diff --git a/fxjs/cjs_publicmethods.h b/fxjs/cjs_publicmethods.h index f83375ca54..049fa681aa 100644 --- a/fxjs/cjs_publicmethods.h +++ b/fxjs/cjs_publicmethods.h @@ -7,7 +7,6 @@ #ifndef FXJS_CJS_PUBLICMETHODS_H_ #define FXJS_CJS_PUBLICMETHODS_H_ -#include #include #include "fxjs/js_define.h" @@ -137,11 +136,11 @@ class CJS_PublicMethods final : public CJS_Object { const v8::FunctionCallbackInfo& info); static const JSMethodSpec GlobalFunctionSpecs[]; - static int ParseStringInteger(const WideString& string, + static int ParseStringInteger(const WideString& str, size_t nStart, size_t* pSkip, size_t nMaxStep); - static WideString ParseStringString(const WideString& string, + static WideString ParseStringString(const WideString& str, size_t nStart, size_t* pSkip); static double ParseNormalDate(const WideString& value, bool* bWrongFormat); diff --git a/fxjs/js_define.h b/fxjs/js_define.h index 0d8c43f86e..9187e60e3f 100644 --- a/fxjs/js_define.h +++ b/fxjs/js_define.h @@ -7,7 +7,6 @@ #ifndef FXJS_JS_DEFINE_H_ #define FXJS_JS_DEFINE_H_ -#include #include #include "core/fxcrt/unowned_ptr.h" diff --git a/xfa/fxfa/parser/cxfa_itemlayoutprocessor.h b/xfa/fxfa/parser/cxfa_itemlayoutprocessor.h index 9c25fa88c7..d021ca38b6 100644 --- a/xfa/fxfa/parser/cxfa_itemlayoutprocessor.h +++ b/xfa/fxfa/parser/cxfa_itemlayoutprocessor.h @@ -11,7 +11,6 @@ #include #include -#include #include #include "core/fxcrt/fx_coordinates.h" -- cgit v1.2.3