diff options
Diffstat (limited to 'fpdfsdk')
35 files changed, 61 insertions, 27 deletions
diff --git a/fpdfsdk/cba_annotiterator.cpp b/fpdfsdk/cba_annotiterator.cpp index a447034cda..cc842babee 100644 --- a/fpdfsdk/cba_annotiterator.cpp +++ b/fpdfsdk/cba_annotiterator.cpp @@ -6,6 +6,8 @@ #include "fpdfsdk/cba_annotiterator.h" +#include <algorithm> + #include "core/fpdfapi/page/cpdf_page.h" #include "fpdfsdk/cpdfsdk_annot.h" #include "fpdfsdk/cpdfsdk_pageview.h" diff --git a/fpdfsdk/cpdfsdk_datetime.h b/fpdfsdk/cpdfsdk_datetime.h index 70c6e0aee3..6b612b27bc 100644 --- a/fpdfsdk/cpdfsdk_datetime.h +++ b/fpdfsdk/cpdfsdk_datetime.h @@ -8,7 +8,7 @@ #define FPDFSDK_CPDFSDK_DATETIME_H_ #if _FX_OS_ == _FX_ANDROID_ -#include "time.h" +#include <time.h> #else #include <ctime> #endif diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.h b/fpdfsdk/cpdfsdk_formfillenvironment.h index b7afbbc489..b4e11ca763 100644 --- a/fpdfsdk/cpdfsdk_formfillenvironment.h +++ b/fpdfsdk/cpdfsdk_formfillenvironment.h @@ -7,7 +7,9 @@ #ifndef FPDFSDK_CPDFSDK_FORMFILLENVIRONMENT_H_ #define FPDFSDK_CPDFSDK_FORMFILLENVIRONMENT_H_ +#include <map> #include <memory> +#include <vector> #include "core/fpdfapi/page/cpdf_page.h" #include "core/fpdfapi/parser/cpdf_document.h" diff --git a/fpdfsdk/cpdfsdk_interform.h b/fpdfsdk/cpdfsdk_interform.h index 4c5d10dccf..9f35d560e6 100644 --- a/fpdfsdk/cpdfsdk_interform.h +++ b/fpdfsdk/cpdfsdk_interform.h @@ -8,6 +8,7 @@ #define FPDFSDK_CPDFSDK_INTERFORM_H_ #include <map> +#include <memory> #include <vector> #include "core/fpdfdoc/cpdf_action.h" diff --git a/fpdfsdk/fpdf_dataavail_embeddertest.cpp b/fpdfsdk/fpdf_dataavail_embeddertest.cpp index cc95c1b177..c226a31b8e 100644 --- a/fpdfsdk/fpdf_dataavail_embeddertest.cpp +++ b/fpdfsdk/fpdf_dataavail_embeddertest.cpp @@ -4,7 +4,9 @@ #include <algorithm> #include <memory> +#include <set> #include <string> +#include <utility> #include <vector> #include "public/fpdfview.h" @@ -16,7 +18,7 @@ namespace { class TestAsyncLoader : public FX_DOWNLOADHINTS, FX_FILEAVAIL { public: - TestAsyncLoader(const std::string& file_name) { + explicit TestAsyncLoader(const std::string& file_name) { std::string file_path; if (!PathService::GetTestFilePath(file_name, &file_path)) return; diff --git a/fpdfsdk/fpdf_sysfontinfo.cpp b/fpdfsdk/fpdf_sysfontinfo.cpp index 6db768a8e2..1b62dc48ac 100644 --- a/fpdfsdk/fpdf_sysfontinfo.cpp +++ b/fpdfsdk/fpdf_sysfontinfo.cpp @@ -6,6 +6,8 @@ #include "public/fpdf_sysfontinfo.h" +#include <memory> + #include "core/fxge/cfx_fontmapper.h" #include "core/fxge/cfx_gemodule.h" #include "core/fxge/fx_font.h" diff --git a/fpdfsdk/fpdfdoc.cpp b/fpdfsdk/fpdfdoc.cpp index 401b3e478b..01d91242f4 100644 --- a/fpdfsdk/fpdfdoc.cpp +++ b/fpdfsdk/fpdfdoc.cpp @@ -6,6 +6,7 @@ #include "public/fpdf_doc.h" +#include <memory> #include <set> #include "core/fpdfapi/page/cpdf_page.h" diff --git a/fpdfsdk/fpdfdoc_embeddertest.cpp b/fpdfsdk/fpdfdoc_embeddertest.cpp index 16160936e6..d7f1f97117 100644 --- a/fpdfsdk/fpdfdoc_embeddertest.cpp +++ b/fpdfsdk/fpdfdoc_embeddertest.cpp @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <memory> #include <string> #include "core/fxcrt/fx_string.h" diff --git a/fpdfsdk/fpdfedit_embeddertest.cpp b/fpdfsdk/fpdfedit_embeddertest.cpp index 34b5993879..1f96b89677 100644 --- a/fpdfsdk/fpdfedit_embeddertest.cpp +++ b/fpdfsdk/fpdfedit_embeddertest.cpp @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <memory> +#include <string> + #include "public/fpdf_edit.h" #include "public/fpdfview.h" #include "testing/embedder_test.h" diff --git a/fpdfsdk/fpdfeditpage.cpp b/fpdfsdk/fpdfeditpage.cpp index c864b82145..18a1d61791 100644 --- a/fpdfsdk/fpdfeditpage.cpp +++ b/fpdfsdk/fpdfeditpage.cpp @@ -34,7 +34,7 @@ #endif // PDF_ENABLE_XFA #if _FX_OS_ == _FX_ANDROID_ -#include "time.h" +#include <time.h> #else #include <ctime> #endif @@ -300,7 +300,7 @@ DLLEXPORT void STDCALL FPDFPage_TransformAnnots(FPDF_PAGE page, pRectArray->SetNewAt<CPDF_Number>(2, rect.right); pRectArray->SetNewAt<CPDF_Number>(3, rect.top); - // TODO: Transform AP's rectangle + // TODO(unknown): Transform AP's rectangle } } diff --git a/fpdfsdk/fpdfsave.cpp b/fpdfsdk/fpdfsave.cpp index c9043249e1..89b8b5839e 100644 --- a/fpdfsdk/fpdfsave.cpp +++ b/fpdfsdk/fpdfsave.cpp @@ -6,6 +6,8 @@ #include "public/fpdf_save.h" +#include <memory> +#include <utility> #include <vector> #include "core/fpdfapi/edit/cpdf_creator.h" @@ -30,7 +32,7 @@ #endif #if _FX_OS_ == _FX_ANDROID_ -#include "time.h" +#include <time.h> #else #include <ctime> #endif diff --git a/fpdfsdk/fpdftext.cpp b/fpdfsdk/fpdftext.cpp index ce195ade26..629e596c8d 100644 --- a/fpdfsdk/fpdftext.cpp +++ b/fpdfsdk/fpdftext.cpp @@ -6,6 +6,9 @@ #include "public/fpdf_text.h" +#include <algorithm> +#include <vector> + #include "core/fpdfapi/page/cpdf_page.h" #include "core/fpdfdoc/cpdf_viewerpreferences.h" #include "core/fpdftext/cpdf_linkextract.h" diff --git a/fpdfsdk/fpdftext_embeddertest.cpp b/fpdfsdk/fpdftext_embeddertest.cpp index 46168c8ac7..198ef8a7f2 100644 --- a/fpdfsdk/fpdftext_embeddertest.cpp +++ b/fpdfsdk/fpdftext_embeddertest.cpp @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <memory> + #include "core/fxcrt/fx_basic.h" #include "public/fpdf_text.h" #include "public/fpdfview.h" diff --git a/fpdfsdk/fpdfview_embeddertest.cpp b/fpdfsdk/fpdfview_embeddertest.cpp index e712edb89a..65e52fec39 100644 --- a/fpdfsdk/fpdfview_embeddertest.cpp +++ b/fpdfsdk/fpdfview_embeddertest.cpp @@ -97,6 +97,7 @@ TEST_F(FPDFViewEmbeddertest, ViewerRef) { EXPECT_EQ(0U, FPDF_VIEWERREF_GetName(document(), "foo", buf, sizeof(buf))); // Make sure |buf| does not get written into when it appears to be too small. + // NOLINTNEXTLINE(runtime/printf) strcpy(buf, "ABCD"); EXPECT_EQ(4U, FPDF_VIEWERREF_GetName(document(), "Foo", buf, 1)); EXPECT_STREQ("ABCD", buf); diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp index b239d70695..7945786070 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp +++ b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp @@ -6,6 +6,8 @@ #include "fpdfsdk/fpdfxfa/cpdfxfa_context.h" +#include <utility> + #include "core/fpdfapi/parser/cpdf_document.h" #include "fpdfsdk/cpdfsdk_formfillenvironment.h" #include "fpdfsdk/cpdfsdk_interform.h" diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_context.h b/fpdfsdk/fpdfxfa/cpdfxfa_context.h index 98161e2b3e..2cd2b439d3 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_context.h +++ b/fpdfsdk/fpdfxfa/cpdfxfa_context.h @@ -29,7 +29,7 @@ enum LoadStatus { class CPDFXFA_Context : public IXFA_AppProvider { public: - CPDFXFA_Context(std::unique_ptr<CPDF_Document> pPDFDoc); + explicit CPDFXFA_Context(std::unique_ptr<CPDF_Document> pPDFDoc); ~CPDFXFA_Context() override; bool LoadXFADoc(); diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h index 8909cf6429..a7d41a88c8 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h +++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h @@ -15,7 +15,7 @@ class IJS_Context; class CPDFXFA_DocEnvironment : public IXFA_DocEnvironment { public: - CPDFXFA_DocEnvironment(CPDFXFA_Context*); + explicit CPDFXFA_DocEnvironment(CPDFXFA_Context*); ~CPDFXFA_DocEnvironment() override; // IXFA_DocEnvironment diff --git a/fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.h b/fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.h index 5b0b414214..9f529fcbc8 100644 --- a/fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.h +++ b/fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.h @@ -17,7 +17,7 @@ struct CFWL_TimerInfo; class CXFA_FWLAdapterTimerMgr : public IFWL_AdapterTimerMgr { public: - CXFA_FWLAdapterTimerMgr(CPDFSDK_FormFillEnvironment* pFormFillEnv) + explicit CXFA_FWLAdapterTimerMgr(CPDFSDK_FormFillEnvironment* pFormFillEnv) : m_pFormFillEnv(pFormFillEnv) {} void Start(IFWL_Timer* pTimer, diff --git a/fpdfsdk/fxedit/fxet_list.h b/fpdfsdk/fxedit/fxet_list.h index f0257056c6..38d1957e00 100644 --- a/fpdfsdk/fxedit/fxet_list.h +++ b/fpdfsdk/fxedit/fxet_list.h @@ -7,6 +7,8 @@ #ifndef FPDFSDK_FXEDIT_FXET_LIST_H_ #define FPDFSDK_FXEDIT_FXET_LIST_H_ +#include <memory> + #include "core/fxcrt/fx_coordinates.h" #include "fpdfsdk/fxedit/fx_edit.h" diff --git a/fpdfsdk/javascript/JS_EventHandler.h b/fpdfsdk/javascript/JS_EventHandler.h index fb0e637f5f..8cfcfa7eb7 100644 --- a/fpdfsdk/javascript/JS_EventHandler.h +++ b/fpdfsdk/javascript/JS_EventHandler.h @@ -60,7 +60,7 @@ enum JS_EVENT_T { class CJS_EventHandler { public: - CJS_EventHandler(CJS_Context* pContext); + explicit CJS_EventHandler(CJS_Context* pContext); virtual ~CJS_EventHandler(); void OnApp_Init(); diff --git a/fpdfsdk/javascript/JS_GlobalData.cpp b/fpdfsdk/javascript/JS_GlobalData.cpp index 580cb466e6..68d929fb3a 100644 --- a/fpdfsdk/javascript/JS_GlobalData.cpp +++ b/fpdfsdk/javascript/JS_GlobalData.cpp @@ -6,6 +6,8 @@ #include "fpdfsdk/javascript/JS_GlobalData.h" +#include <utility> + #include "core/fdrm/crypto/fx_crypt.h" #include "third_party/base/stl_util.h" diff --git a/fpdfsdk/javascript/JS_Runtime_Stub.cpp b/fpdfsdk/javascript/JS_Runtime_Stub.cpp index 1daee4d734..96148d83a0 100644 --- a/fpdfsdk/javascript/JS_Runtime_Stub.cpp +++ b/fpdfsdk/javascript/JS_Runtime_Stub.cpp @@ -120,7 +120,7 @@ class CJS_ContextStub final : public IJS_Context { class CJS_RuntimeStub final : public IJS_Runtime { public: - CJS_RuntimeStub(CPDFSDK_FormFillEnvironment* pFormFillEnv) + explicit CJS_RuntimeStub(CPDFSDK_FormFillEnvironment* pFormFillEnv) : m_pFormFillEnv(pFormFillEnv) {} ~CJS_RuntimeStub() override {} diff --git a/fpdfsdk/javascript/app.cpp b/fpdfsdk/javascript/app.cpp index 2b40de0423..80c952d6ca 100644 --- a/fpdfsdk/javascript/app.cpp +++ b/fpdfsdk/javascript/app.cpp @@ -6,6 +6,7 @@ #include "fpdfsdk/javascript/app.h" +#include <map> #include <memory> #include <vector> diff --git a/fpdfsdk/javascript/app.h b/fpdfsdk/javascript/app.h index 32e2aaf28c..e8c72417bb 100644 --- a/fpdfsdk/javascript/app.h +++ b/fpdfsdk/javascript/app.h @@ -18,7 +18,7 @@ class GlobalTimer; class TimerObj : public CJS_EmbedObj { public: - TimerObj(CJS_Object* pJSObject); + explicit TimerObj(CJS_Object* pJSObject); ~TimerObj() override; void SetTimer(GlobalTimer* pTimer); @@ -30,7 +30,7 @@ class TimerObj : public CJS_EmbedObj { class CJS_TimerObj : public CJS_Object { public: - CJS_TimerObj(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} + explicit CJS_TimerObj(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} ~CJS_TimerObj() override {} DECLARE_JS_CLASS(); @@ -38,7 +38,7 @@ class CJS_TimerObj : public CJS_Object { class app : public CJS_EmbedObj { public: - app(CJS_Object* pJSObject); + explicit app(CJS_Object* pJSObject); ~app() override; bool activeDocs(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); diff --git a/fpdfsdk/javascript/color.h b/fpdfsdk/javascript/color.h index ab56cac0b6..9ea4d63355 100644 --- a/fpdfsdk/javascript/color.h +++ b/fpdfsdk/javascript/color.h @@ -14,7 +14,7 @@ class color : public CJS_EmbedObj { public: - color(CJS_Object* pJSObject); + explicit color(CJS_Object* pJSObject); ~color() override; bool black(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); @@ -63,7 +63,7 @@ class color : public CJS_EmbedObj { class CJS_Color : public CJS_Object { public: - CJS_Color(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} + explicit CJS_Color(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} ~CJS_Color() override {} DECLARE_JS_CLASS(); diff --git a/fpdfsdk/javascript/console.h b/fpdfsdk/javascript/console.h index 4f18980206..069a81d029 100644 --- a/fpdfsdk/javascript/console.h +++ b/fpdfsdk/javascript/console.h @@ -13,7 +13,7 @@ class console : public CJS_EmbedObj { public: - console(CJS_Object* pJSObject); + explicit console(CJS_Object* pJSObject); ~console() override; public: @@ -37,7 +37,7 @@ class console : public CJS_EmbedObj { class CJS_Console : public CJS_Object { public: - CJS_Console(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} + explicit CJS_Console(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} ~CJS_Console() override {} DECLARE_JS_CLASS(); diff --git a/fpdfsdk/javascript/event.h b/fpdfsdk/javascript/event.h index d70b57801e..67194944d0 100644 --- a/fpdfsdk/javascript/event.h +++ b/fpdfsdk/javascript/event.h @@ -11,7 +11,7 @@ class event : public CJS_EmbedObj { public: - event(CJS_Object* pJSObject); + explicit event(CJS_Object* pJSObject); ~event() override; public: @@ -39,7 +39,7 @@ class event : public CJS_EmbedObj { class CJS_Event : public CJS_Object { public: - CJS_Event(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} + explicit CJS_Event(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} ~CJS_Event() override {} DECLARE_JS_CLASS(); diff --git a/fpdfsdk/javascript/global.h b/fpdfsdk/javascript/global.h index c0eb4447f4..9a6568bc27 100644 --- a/fpdfsdk/javascript/global.h +++ b/fpdfsdk/javascript/global.h @@ -32,7 +32,7 @@ struct JSGlobalData { class JSGlobalAlternate : public CJS_EmbedObj { public: - JSGlobalAlternate(CJS_Object* pJSObject); + explicit JSGlobalAlternate(CJS_Object* pJSObject); ~JSGlobalAlternate() override; bool setPersistent(IJS_Context* cc, diff --git a/fpdfsdk/javascript/report.h b/fpdfsdk/javascript/report.h index 0773472a94..fef236943d 100644 --- a/fpdfsdk/javascript/report.h +++ b/fpdfsdk/javascript/report.h @@ -13,7 +13,7 @@ class Report : public CJS_EmbedObj { public: - Report(CJS_Object* pJSObject); + explicit Report(CJS_Object* pJSObject); ~Report() override; public: @@ -29,7 +29,7 @@ class Report : public CJS_EmbedObj { class CJS_Report : public CJS_Object { public: - CJS_Report(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} + explicit CJS_Report(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} ~CJS_Report() override {} DECLARE_JS_CLASS(); diff --git a/fpdfsdk/javascript/util.h b/fpdfsdk/javascript/util.h index efcf0c8f89..80763d1e27 100644 --- a/fpdfsdk/javascript/util.h +++ b/fpdfsdk/javascript/util.h @@ -14,7 +14,7 @@ class util : public CJS_EmbedObj { public: - util(CJS_Object* pJSObject); + explicit util(CJS_Object* pJSObject); ~util() override; bool printd(IJS_Context* cc, @@ -44,7 +44,7 @@ class util : public CJS_EmbedObj { class CJS_Util : public CJS_Object { public: - CJS_Util(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} + explicit CJS_Util(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} ~CJS_Util() override {} DECLARE_JS_CLASS(); diff --git a/fpdfsdk/pdfwindow/PWL_EditCtrl.h b/fpdfsdk/pdfwindow/PWL_EditCtrl.h index 344d25b72b..3ff5cc66c9 100644 --- a/fpdfsdk/pdfwindow/PWL_EditCtrl.h +++ b/fpdfsdk/pdfwindow/PWL_EditCtrl.h @@ -7,6 +7,8 @@ #ifndef FPDFSDK_PDFWINDOW_PWL_EDITCTRL_H_ #define FPDFSDK_PDFWINDOW_PWL_EDITCTRL_H_ +#include <memory> + #include "core/fxcrt/fx_string.h" #include "fpdfsdk/fxedit/fx_edit.h" #include "fpdfsdk/pdfwindow/PWL_Wnd.h" diff --git a/fpdfsdk/pdfwindow/PWL_FontMap.h b/fpdfsdk/pdfwindow/PWL_FontMap.h index fbf5ee0986..47ef193619 100644 --- a/fpdfsdk/pdfwindow/PWL_FontMap.h +++ b/fpdfsdk/pdfwindow/PWL_FontMap.h @@ -30,7 +30,7 @@ struct CPWL_FontMap_Native { class CPWL_FontMap : public IPVT_FontMap { public: - CPWL_FontMap(CFX_SystemHandler* pSystemHandler); + explicit CPWL_FontMap(CFX_SystemHandler* pSystemHandler); ~CPWL_FontMap() override; // IPVT_FontMap diff --git a/fpdfsdk/pdfwindow/PWL_ListBox.h b/fpdfsdk/pdfwindow/PWL_ListBox.h index 290b8762ef..6db4ecb381 100644 --- a/fpdfsdk/pdfwindow/PWL_ListBox.h +++ b/fpdfsdk/pdfwindow/PWL_ListBox.h @@ -7,6 +7,8 @@ #ifndef FPDFSDK_PDFWINDOW_PWL_LISTBOX_H_ #define FPDFSDK_PDFWINDOW_PWL_LISTBOX_H_ +#include <memory> + #include "fpdfsdk/fxedit/fx_edit.h" #include "fpdfsdk/pdfwindow/PWL_Wnd.h" @@ -20,7 +22,7 @@ struct CPVT_WordProps; class CPWL_List_Notify { public: - CPWL_List_Notify(CPWL_ListBox* pList); + explicit CPWL_List_Notify(CPWL_ListBox* pList); ~CPWL_List_Notify(); void IOnSetScrollInfoY(FX_FLOAT fPlateMin, diff --git a/fpdfsdk/pdfwindow/PWL_ScrollBar.h b/fpdfsdk/pdfwindow/PWL_ScrollBar.h index 19e5151c97..bcfb0a6873 100644 --- a/fpdfsdk/pdfwindow/PWL_ScrollBar.h +++ b/fpdfsdk/pdfwindow/PWL_ScrollBar.h @@ -117,7 +117,7 @@ struct PWL_SCROLL_PRIVATEDATA { class CPWL_ScrollBar : public CPWL_Wnd { public: - CPWL_ScrollBar(PWL_SCROLLBAR_TYPE sbType = SBT_HSCROLL); + explicit CPWL_ScrollBar(PWL_SCROLLBAR_TYPE sbType = SBT_HSCROLL); ~CPWL_ScrollBar() override; // CPWL_Wnd diff --git a/fpdfsdk/pdfwindow/PWL_Utils.cpp b/fpdfsdk/pdfwindow/PWL_Utils.cpp index eb6b3cc221..713a193fb3 100644 --- a/fpdfsdk/pdfwindow/PWL_Utils.cpp +++ b/fpdfsdk/pdfwindow/PWL_Utils.cpp @@ -7,6 +7,7 @@ #include "fpdfsdk/pdfwindow/PWL_Utils.h" #include <algorithm> +#include <memory> #include "core/fpdfdoc/cpvt_word.h" #include "core/fxge/cfx_graphstatedata.h" |