summaryrefslogtreecommitdiff
path: root/xfa/fwl
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-03-20 15:04:16 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-03-20 20:21:31 +0000
commitcf2d0ca3d5ba890dca4e2735915739430a43cfa0 (patch)
tree3045ca50e2305ea348eb743576e04bdf8ce144f1 /xfa/fwl
parent2a6482c19c5577924f73d100431acceb8c874e04 (diff)
downloadpdfium-cf2d0ca3d5ba890dca4e2735915739430a43cfa0.tar.xz
Simplify date time code
This CL removes the CFX_DateTime class and moves the one used method into the CFX_Unitime class. Change-Id: I89f6d099b2c436d8f12b9dc2c5f10ac236ad56ef Reviewed-on: https://pdfium-review.googlesource.com/3104 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fwl')
-rw-r--r--xfa/fwl/cfwl_monthcalendar.cpp5
-rw-r--r--xfa/fwl/cfwl_monthcalendar.h1
2 files changed, 2 insertions, 4 deletions
diff --git a/xfa/fwl/cfwl_monthcalendar.cpp b/xfa/fwl/cfwl_monthcalendar.cpp
index 6d6066370d..b167141505 100644
--- a/xfa/fwl/cfwl_monthcalendar.cpp
+++ b/xfa/fwl/cfwl_monthcalendar.cpp
@@ -90,7 +90,6 @@ CFWL_MonthCalendar::CFWL_MonthCalendar(
CFWL_Widget* pOuter)
: CFWL_Widget(app, std::move(properties), pOuter),
m_bInitialized(false),
- m_pDateTime(new CFX_DateTime),
m_iCurYear(2011),
m_iCurMonth(1),
m_iYear(2011),
@@ -570,9 +569,9 @@ void CFWL_MonthCalendar::ClearDateItem() {
}
void CFWL_MonthCalendar::ResetDateItem() {
- m_pDateTime->Set(m_iCurYear, m_iCurMonth, 1);
int32_t iDays = FX_DaysInMonth(m_iCurYear, m_iCurMonth);
- int32_t iDayOfWeek = m_pDateTime->GetDayOfWeek();
+ int32_t iDayOfWeek =
+ CFX_Unitime(m_iCurYear, m_iCurMonth, 1, 0, 0, 0, 0).GetDayOfWeek();
for (int32_t i = 0; i < iDays; i++) {
if (iDayOfWeek >= 7)
iDayOfWeek = 0;
diff --git a/xfa/fwl/cfwl_monthcalendar.h b/xfa/fwl/cfwl_monthcalendar.h
index a110ee8297..164e339fa0 100644
--- a/xfa/fwl/cfwl_monthcalendar.h
+++ b/xfa/fwl/cfwl_monthcalendar.h
@@ -165,7 +165,6 @@ class CFWL_MonthCalendar : public CFWL_Widget {
CFX_RectF m_rtWeekNumSep;
CFX_WideString m_wsHead;
CFX_WideString m_wsToday;
- std::unique_ptr<CFX_DateTime> m_pDateTime;
std::vector<std::unique_ptr<DATEINFO>> m_arrDates;
int32_t m_iCurYear;
int32_t m_iCurMonth;