summaryrefslogtreecommitdiff
path: root/xfa/fxfa
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa')
-rw-r--r--xfa/fxfa/app/xfa_ffnotify.cpp2
-rw-r--r--xfa/fxfa/app/xfa_fftextedit.cpp6
-rw-r--r--xfa/fxfa/fm2js/xfa_fm2jscontext.cpp8
-rw-r--r--xfa/fxfa/parser/cxfa_localemgr.h2
-rw-r--r--xfa/fxfa/parser/cxfa_localevalue.cpp42
-rw-r--r--xfa/fxfa/parser/cxfa_localevalue.h17
-rw-r--r--xfa/fxfa/parser/cxfa_timezoneprovider.h2
7 files changed, 40 insertions, 39 deletions
diff --git a/xfa/fxfa/app/xfa_ffnotify.cpp b/xfa/fxfa/app/xfa_ffnotify.cpp
index 56562c9403..d9ec99aba9 100644
--- a/xfa/fxfa/app/xfa_ffnotify.cpp
+++ b/xfa/fxfa/app/xfa_ffnotify.cpp
@@ -263,7 +263,7 @@ void CXFA_FFNotify::OpenDropDownList(CXFA_FFWidget* hWidget) {
pDocView->UpdateDocView();
}
CFX_WideString CXFA_FFNotify::GetCurrentDateTime() {
- CFX_Unitime dataTime;
+ CFX_DateTime dataTime;
dataTime.Now();
CFX_WideString wsDateTime;
diff --git a/xfa/fxfa/app/xfa_fftextedit.cpp b/xfa/fxfa/app/xfa_fftextedit.cpp
index e99fefbd73..2658758718 100644
--- a/xfa/fxfa/app/xfa_fftextedit.cpp
+++ b/xfa/fxfa/app/xfa_fftextedit.cpp
@@ -522,7 +522,7 @@ bool CXFA_FFDateTimeEdit::LoadWidget() {
case XFA_Element::Date: {
if (!wsText.IsEmpty()) {
CXFA_LocaleValue lcValue = XFA_GetLocaleValue(m_pDataAcc);
- CFX_Unitime date = lcValue.GetDate();
+ CFX_DateTime date = lcValue.GetDate();
if (date.IsSet())
pWidget->SetCurSel(date.GetYear(), date.GetMonth(), date.GetDay());
}
@@ -618,7 +618,7 @@ bool CXFA_FFDateTimeEdit::UpdateFWLData() {
((CFWL_DateTimePicker*)m_pNormalWidget)->SetEditText(wsText);
if (IsFocused() && !wsText.IsEmpty()) {
CXFA_LocaleValue lcValue = XFA_GetLocaleValue(m_pDataAcc);
- CFX_Unitime date = lcValue.GetDate();
+ CFX_DateTime date = lcValue.GetDate();
if (lcValue.IsValid()) {
if (date.IsSet()) {
static_cast<CFWL_DateTimePicker*>(m_pNormalWidget)
@@ -647,7 +647,7 @@ void CXFA_FFDateTimeEdit::OnSelectChanged(CFWL_Widget* pWidget,
CFX_WideString wsPicture;
m_pDataAcc->GetPictureContent(wsPicture, XFA_VALUEPICTURE_Edit);
CXFA_LocaleValue date(XFA_VT_DATE, GetDoc()->GetXFADoc()->GetLocalMgr());
- date.SetDate(CFX_Unitime(iYear, iMonth, iDay, 0, 0, 0, 0));
+ date.SetDate(CFX_DateTime(iYear, iMonth, iDay, 0, 0, 0, 0));
CFX_WideString wsDate;
date.FormatPatterns(wsDate, wsPicture, m_pDataAcc->GetLocal(),
diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
index 5ec6215336..8879f2bfa7 100644
--- a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
+++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
@@ -1164,7 +1164,7 @@ void CXFA_FM2JSContext::IsoTime2Num(CFXJSE_Value* pThis,
return;
}
- CFX_Unitime uniTime = timeValue.GetTime();
+ CFX_DateTime uniTime = timeValue.GetTime();
int32_t hour = uniTime.GetHour();
int32_t min = uniTime.GetMinute();
int32_t second = uniTime.GetSecond();
@@ -1580,7 +1580,7 @@ void CXFA_FM2JSContext::Time2Num(CFXJSE_Value* pThis,
return;
}
- CFX_Unitime uniTime = localeValue.GetTime();
+ CFX_DateTime uniTime = localeValue.GetTime();
int32_t hour = uniTime.GetHour();
int32_t min = uniTime.GetMinute();
int32_t second = uniTime.GetSecond();
@@ -1944,7 +1944,7 @@ bool CXFA_FM2JSContext::Local2IsoDate(CFXJSE_Value* pThis,
CXFA_LocaleValue widgetValue(XFA_VT_DATE, CFX_WideString::FromUTF8(szDate),
wsFormat, pLocale, pMgr);
- CFX_Unitime dt = widgetValue.GetDate();
+ CFX_DateTime dt = widgetValue.GetDate();
strIsoDate.Format("%4d-%02d-%02d", dt.GetYear(), dt.GetMonth(), dt.GetDay());
return true;
}
@@ -1982,7 +1982,7 @@ bool CXFA_FM2JSContext::Local2IsoTime(CFXJSE_Value* pThis,
wsFormat = L"time{" + wsFormat + L"}";
CXFA_LocaleValue widgetValue(XFA_VT_TIME, CFX_WideString::FromUTF8(szTime),
wsFormat, pLocale, pMgr);
- CFX_Unitime utime = widgetValue.GetTime();
+ CFX_DateTime utime = widgetValue.GetTime();
strIsoTime.Format("%02d:%02d:%02d.%03d", utime.GetHour(), utime.GetMinute(),
utime.GetSecond(), utime.GetMillisecond());
return true;
diff --git a/xfa/fxfa/parser/cxfa_localemgr.h b/xfa/fxfa/parser/cxfa_localemgr.h
index b3b9635765..6d360112f0 100644
--- a/xfa/fxfa/parser/cxfa_localemgr.h
+++ b/xfa/fxfa/parser/cxfa_localemgr.h
@@ -10,7 +10,7 @@
#include <memory>
#include <vector>
-#include "xfa/fgas/localization/fgas_datetime.h"
+#include "xfa/fgas/localization/cfx_datetime.h"
#include "xfa/fgas/localization/fgas_locale.h"
#include "xfa/fxfa/parser/cxfa_localemgr.h"
diff --git a/xfa/fxfa/parser/cxfa_localevalue.cpp b/xfa/fxfa/parser/cxfa_localevalue.cpp
index 1fd7ac197c..e66e55330f 100644
--- a/xfa/fxfa/parser/cxfa_localevalue.cpp
+++ b/xfa/fxfa/parser/cxfa_localevalue.cpp
@@ -130,7 +130,7 @@ bool CXFA_LocaleValue::ValidateValue(const CFX_WideString& wsValue,
}
break;
case FX_LOCALECATEGORY_Date: {
- CFX_Unitime dt;
+ CFX_DateTime dt;
bRet = ValidateCanonicalDate(wsValue, &dt);
if (!bRet) {
bRet = pFormat->ParseDateTime(wsValue, wsFormat, FX_DATETIMETYPE_Date,
@@ -143,7 +143,7 @@ bool CXFA_LocaleValue::ValidateValue(const CFX_WideString& wsValue,
break;
}
case FX_LOCALECATEGORY_Time: {
- CFX_Unitime dt;
+ CFX_DateTime dt;
bRet = pFormat->ParseDateTime(wsValue, wsFormat, FX_DATETIMETYPE_Time,
&dt);
if (!bRet) {
@@ -153,7 +153,7 @@ bool CXFA_LocaleValue::ValidateValue(const CFX_WideString& wsValue,
break;
}
case FX_LOCALECATEGORY_DateTime: {
- CFX_Unitime dt;
+ CFX_DateTime dt;
bRet = pFormat->ParseDateTime(wsValue, wsFormat,
FX_DATETIMETYPE_DateTime, &dt);
if (!bRet) {
@@ -347,31 +347,31 @@ double CXFA_LocaleValue::GetDoubleNum() const {
return 0;
}
-CFX_Unitime CXFA_LocaleValue::GetDate() const {
+CFX_DateTime CXFA_LocaleValue::GetDate() const {
if (m_bValid && m_dwType == XFA_VT_DATE) {
- CFX_Unitime dt;
+ CFX_DateTime dt;
FX_DateFromCanonical(m_wsValue, &dt);
return dt;
}
- return CFX_Unitime();
+ return CFX_DateTime();
}
-CFX_Unitime CXFA_LocaleValue::GetTime() const {
+CFX_DateTime CXFA_LocaleValue::GetTime() const {
if (m_bValid && m_dwType == XFA_VT_TIME) {
ASSERT(m_pLocaleMgr);
- CFX_Unitime dt;
+ CFX_DateTime dt;
FX_TimeFromCanonical(m_wsValue.AsStringC(), &dt,
m_pLocaleMgr->GetDefLocale());
return dt;
}
- return CFX_Unitime();
+ return CFX_DateTime();
}
-CFX_Unitime CXFA_LocaleValue::GetDateTime() const {
+CFX_DateTime CXFA_LocaleValue::GetDateTime() const {
if (m_bValid && m_dwType == XFA_VT_DATETIME) {
int32_t index = m_wsValue.Find('T');
- CFX_Unitime dt;
+ CFX_DateTime dt;
FX_DateFromCanonical(m_wsValue.Left(index), &dt);
ASSERT(m_pLocaleMgr);
FX_TimeFromCanonical(
@@ -379,7 +379,7 @@ CFX_Unitime CXFA_LocaleValue::GetDateTime() const {
m_pLocaleMgr->GetDefLocale());
return dt;
}
- return CFX_Unitime();
+ return CFX_DateTime();
}
bool CXFA_LocaleValue::SetText(const CFX_WideString& wsText) {
@@ -408,7 +408,7 @@ bool CXFA_LocaleValue::SetNum(const CFX_WideString& wsNum,
return m_bValid = ParsePatternValue(wsNum, wsFormat, pLocale);
}
-bool CXFA_LocaleValue::SetDate(const CFX_Unitime& d) {
+bool CXFA_LocaleValue::SetDate(const CFX_DateTime& d) {
m_dwType = XFA_VT_DATE;
m_wsValue.Format(L"%04d-%02d-%02d", d.GetYear(), d.GetMonth(), d.GetDay());
return true;
@@ -421,7 +421,7 @@ bool CXFA_LocaleValue::SetDate(const CFX_WideString& wsDate,
return m_bValid = ParsePatternValue(wsDate, wsFormat, pLocale);
}
-bool CXFA_LocaleValue::SetTime(const CFX_Unitime& t) {
+bool CXFA_LocaleValue::SetTime(const CFX_DateTime& t) {
m_dwType = XFA_VT_TIME;
m_wsValue.Format(L"%02d:%02d:%02d", t.GetHour(), t.GetMinute(),
t.GetSecond());
@@ -440,7 +440,7 @@ bool CXFA_LocaleValue::SetTime(const CFX_WideString& wsTime,
return m_bValid = ParsePatternValue(wsTime, wsFormat, pLocale);
}
-bool CXFA_LocaleValue::SetDateTime(const CFX_Unitime& dt) {
+bool CXFA_LocaleValue::SetDateTime(const CFX_DateTime& dt) {
m_dwType = XFA_VT_DATETIME;
m_wsValue.Format(L"%04d-%02d-%02dT%02d:%02d:%02d", dt.GetYear(),
dt.GetMonth(), dt.GetDay(), dt.GetHour(), dt.GetMinute(),
@@ -557,7 +557,7 @@ bool CXFA_LocaleValue::ValidateCanonicalValue(const CFX_WideString& wsValue,
if (wsValue.IsEmpty()) {
return true;
}
- CFX_Unitime dt;
+ CFX_DateTime dt;
switch (dwVType) {
case XFA_VT_DATE: {
if (ValidateCanonicalDate(wsValue, &dt))
@@ -592,7 +592,7 @@ bool CXFA_LocaleValue::ValidateCanonicalValue(const CFX_WideString& wsValue,
return true;
}
bool CXFA_LocaleValue::ValidateCanonicalDate(const CFX_WideString& wsDate,
- CFX_Unitime* unDate) {
+ CFX_DateTime* unDate) {
const uint16_t LastDay[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const uint16_t wCountY = 4, wCountM = 2, wCountD = 2;
int nLen = wsDate.GetLength();
@@ -784,7 +784,7 @@ bool CXFA_LocaleValue::ValidateCanonicalDateTime(
wsDate = wsDateTime.Left(nSplitIndex);
wsTime = wsDateTime.Right(wsDateTime.GetLength() - nSplitIndex - 1);
- CFX_Unitime dt;
+ CFX_DateTime dt;
return ValidateCanonicalDate(wsDate, &dt) && ValidateCanonicalTime(wsTime);
}
@@ -828,7 +828,7 @@ bool CXFA_LocaleValue::ParsePatternValue(const CFX_WideString& wsValue,
bRet = pFormat->ParseText(wsValue, wsFormat, m_wsValue);
break;
case FX_LOCALECATEGORY_Date: {
- CFX_Unitime dt;
+ CFX_DateTime dt;
bRet = ValidateCanonicalDate(wsValue, &dt);
if (!bRet) {
bRet = pFormat->ParseDateTime(wsValue, wsFormat, FX_DATETIMETYPE_Date,
@@ -839,7 +839,7 @@ bool CXFA_LocaleValue::ParsePatternValue(const CFX_WideString& wsValue,
break;
}
case FX_LOCALECATEGORY_Time: {
- CFX_Unitime dt;
+ CFX_DateTime dt;
bRet = pFormat->ParseDateTime(wsValue, wsFormat, FX_DATETIMETYPE_Time,
&dt);
if (bRet)
@@ -847,7 +847,7 @@ bool CXFA_LocaleValue::ParsePatternValue(const CFX_WideString& wsValue,
break;
}
case FX_LOCALECATEGORY_DateTime: {
- CFX_Unitime dt;
+ CFX_DateTime dt;
bRet = pFormat->ParseDateTime(wsValue, wsFormat,
FX_DATETIMETYPE_DateTime, &dt);
if (bRet)
diff --git a/xfa/fxfa/parser/cxfa_localevalue.h b/xfa/fxfa/parser/cxfa_localevalue.h
index 75687b4281..cb30d37792 100644
--- a/xfa/fxfa/parser/cxfa_localevalue.h
+++ b/xfa/fxfa/parser/cxfa_localevalue.h
@@ -12,7 +12,7 @@
#include "xfa/fxfa/parser/cxfa_widgetdata.h"
class IFX_Locale;
-class CFX_Unitime;
+class CFX_DateTime;
class CXFA_LocaleMgr;
#define XFA_VT_NULL 0
@@ -54,7 +54,8 @@ class CXFA_LocaleValue {
IFX_Locale* pLocale,
XFA_VALUEPICTURE eValueType) const;
bool ValidateCanonicalValue(const CFX_WideString& wsValue, uint32_t dwVType);
- bool ValidateCanonicalDate(const CFX_WideString& wsDate, CFX_Unitime* unDate);
+ bool ValidateCanonicalDate(const CFX_WideString& wsDate,
+ CFX_DateTime* unDate);
bool ValidateCanonicalTime(const CFX_WideString& wsTime);
bool ValidateCanonicalDateTime(const CFX_WideString& wsDateTime);
void GetNumbericFormat(CFX_WideString& wsFormat,
@@ -72,9 +73,9 @@ class CXFA_LocaleValue {
CFX_WideString GetText() const;
float GetNum() const;
double GetDoubleNum() const;
- CFX_Unitime GetDate() const;
- CFX_Unitime GetTime() const;
- CFX_Unitime GetDateTime() const;
+ CFX_DateTime GetDate() const;
+ CFX_DateTime GetTime() const;
+ CFX_DateTime GetDateTime() const;
bool SetText(const CFX_WideString& wsText);
bool SetText(const CFX_WideString& wsText,
const CFX_WideString& wsFormat,
@@ -83,15 +84,15 @@ class CXFA_LocaleValue {
bool SetNum(const CFX_WideString& wsNum,
const CFX_WideString& wsFormat,
IFX_Locale* pLocale);
- bool SetDate(const CFX_Unitime& d);
+ bool SetDate(const CFX_DateTime& d);
bool SetDate(const CFX_WideString& wsDate,
const CFX_WideString& wsFormat,
IFX_Locale* pLocale);
- bool SetTime(const CFX_Unitime& t);
+ bool SetTime(const CFX_DateTime& t);
bool SetTime(const CFX_WideString& wsTime,
const CFX_WideString& wsFormat,
IFX_Locale* pLocale);
- bool SetDateTime(const CFX_Unitime& dt);
+ bool SetDateTime(const CFX_DateTime& dt);
bool SetDateTime(const CFX_WideString& wsDateTime,
const CFX_WideString& wsFormat,
IFX_Locale* pLocale);
diff --git a/xfa/fxfa/parser/cxfa_timezoneprovider.h b/xfa/fxfa/parser/cxfa_timezoneprovider.h
index 493da32288..eace151987 100644
--- a/xfa/fxfa/parser/cxfa_timezoneprovider.h
+++ b/xfa/fxfa/parser/cxfa_timezoneprovider.h
@@ -7,7 +7,7 @@
#ifndef XFA_FXFA_PARSER_CXFA_TIMEZONEPROVIDER_H_
#define XFA_FXFA_PARSER_CXFA_TIMEZONEPROVIDER_H_
-#include "xfa/fgas/localization/fgas_datetime.h"
+#include "xfa/fgas/localization/cfx_datetime.h"
class CXFA_TimeZoneProvider {
public: