summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdf_editpage.cpp2
-rw-r--r--fpdfsdk/fpdf_ext.cpp5
-rw-r--r--fpdfsdk/fpdf_view_c_api_test.c1
3 files changed, 7 insertions, 1 deletions
diff --git a/fpdfsdk/fpdf_editpage.cpp b/fpdfsdk/fpdf_editpage.cpp
index dcb3d5e1f0..585e7e1740 100644
--- a/fpdfsdk/fpdf_editpage.cpp
+++ b/fpdfsdk/fpdf_editpage.cpp
@@ -164,7 +164,7 @@ FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV FPDF_CreateNewDocument() {
ByteString DateStr;
if (FSDK_IsSandBoxPolicyEnabled(FPDF_POLICY_MACHINETIME_ACCESS)) {
if (FXSYS_time(&currentTime) != -1) {
- tm* pTM = localtime(&currentTime);
+ tm* pTM = FXSYS_localtime(&currentTime);
if (pTM) {
DateStr = ByteString::Format(
"D:%04d%02d%02d%02d%02d%02d", pTM->tm_year + 1900, pTM->tm_mon + 1,
diff --git a/fpdfsdk/fpdf_ext.cpp b/fpdfsdk/fpdf_ext.cpp
index 1ff27cc94d..9f7b24b60f 100644
--- a/fpdfsdk/fpdf_ext.cpp
+++ b/fpdfsdk/fpdf_ext.cpp
@@ -83,6 +83,11 @@ FPDF_EXPORT void FPDF_CALLCONV FSDK_SetTimeFunction(time_t (*func)()) {
FXSYS_SetTimeFunction(func);
}
+FPDF_EXPORT void FPDF_CALLCONV
+FSDK_SetLocaltimeFunction(struct tm* (*func)(const time_t* tp)) {
+ FXSYS_SetLocaltimeFunction(func);
+}
+
FPDF_EXPORT int FPDF_CALLCONV FPDFDoc_GetPageMode(FPDF_DOCUMENT document) {
CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document);
if (!pDoc)
diff --git a/fpdfsdk/fpdf_view_c_api_test.c b/fpdfsdk/fpdf_view_c_api_test.c
index ab184cc519..9cf037685e 100644
--- a/fpdfsdk/fpdf_view_c_api_test.c
+++ b/fpdfsdk/fpdf_view_c_api_test.c
@@ -216,6 +216,7 @@ int CheckPDFiumCApi() {
// fpdf_ext.h
CHK(FPDFDoc_GetPageMode);
+ CHK(FSDK_SetLocaltimeFunction);
CHK(FSDK_SetTimeFunction);
CHK(FSDK_SetUnSpObjProcessHandler);