Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(583)

Side by Side Diff: xfa/fwl/core/ifwl_monthcalendar.cpp

Issue 2524993002: Remove plumbing for today value (Closed)
Patch Set: Review fixes Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fwl/core/ifwl_monthcalendar.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "xfa/fwl/core/ifwl_monthcalendar.h" 7 #include "xfa/fwl/core/ifwl_monthcalendar.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 m_fMCWid = *static_cast<FX_FLOAT*>( 717 m_fMCWid = *static_cast<FX_FLOAT*>(
718 pTheme->GetCapacity(&part, CFWL_WidgetCapacity::Width)); 718 pTheme->GetCapacity(&part, CFWL_WidgetCapacity::Width));
719 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_MCD_WeekNumbers) 719 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_MCD_WeekNumbers)
720 m_fMCWid += m_fWeekNumWid; 720 m_fMCWid += m_fWeekNumWid;
721 721
722 m_fMCHei = *static_cast<FX_FLOAT*>( 722 m_fMCHei = *static_cast<FX_FLOAT*>(
723 pTheme->GetCapacity(&part, CFWL_WidgetCapacity::Height)); 723 pTheme->GetCapacity(&part, CFWL_WidgetCapacity::Height));
724 } 724 }
725 725
726 void IFWL_MonthCalendar::InitDate() { 726 void IFWL_MonthCalendar::InitDate() {
727 if (m_pProperties->m_pDataProvider) { 727 // TODO(dsinclair): These should pull the real today values instead of
728 IFWL_MonthCalendar::DataProvider* pDateProv = 728 // pretending it's 2011-01-01.
729 static_cast<IFWL_MonthCalendar::DataProvider*>( 729 m_iYear = 2011;
730 m_pProperties->m_pDataProvider); 730 m_iMonth = 1;
731 m_iYear = pDateProv->GetCurYear(this); 731 m_iDay = 1;
732 m_iMonth = pDateProv->GetCurMonth(this); 732 m_iCurYear = m_iYear;
733 m_iDay = pDateProv->GetCurDay(this); 733 m_iCurMonth = m_iMonth;
734 m_iCurYear = m_iYear; 734
735 m_iCurMonth = m_iMonth;
736 } else {
737 m_iDay = 1;
738 m_iMonth = 1;
739 m_iYear = 1;
740 m_iCurYear = m_iYear;
741 m_iCurMonth = m_iMonth;
742 }
743 GetTodayText(m_iYear, m_iMonth, m_iDay, m_wsToday); 735 GetTodayText(m_iYear, m_iMonth, m_iDay, m_wsToday);
744 GetHeadText(m_iCurYear, m_iCurMonth, m_wsHead); 736 GetHeadText(m_iCurYear, m_iCurMonth, m_wsHead);
745 m_dtMin = DATE(1500, 12, 1); 737 m_dtMin = DATE(1500, 12, 1);
746 m_dtMax = DATE(2200, 1, 1); 738 m_dtMax = DATE(2200, 1, 1);
747 } 739 }
748 740
749 void IFWL_MonthCalendar::ClearDateItem() { 741 void IFWL_MonthCalendar::ClearDateItem() {
750 for (int32_t i = 0; i < m_arrDates.GetSize(); i++) 742 for (int32_t i = 0; i < m_arrDates.GetSize(); i++)
751 delete m_arrDates.GetAt(i); 743 delete m_arrDates.GetAt(i);
752 m_arrDates.RemoveAll(); 744 m_arrDates.RemoveAll();
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 uint32_t dwSt, 1102 uint32_t dwSt,
1111 CFX_RectF rc, 1103 CFX_RectF rc,
1112 CFX_WideString& wsday) 1104 CFX_WideString& wsday)
1113 : iDay(day), 1105 : iDay(day),
1114 iDayOfWeek(dayofweek), 1106 iDayOfWeek(dayofweek),
1115 dwStates(dwSt), 1107 dwStates(dwSt),
1116 rect(rc), 1108 rect(rc),
1117 wsDay(wsday) {} 1109 wsDay(wsday) {}
1118 1110
1119 IFWL_MonthCalendar::DATEINFO::~DATEINFO() {} 1111 IFWL_MonthCalendar::DATEINFO::~DATEINFO() {}
OLDNEW
« no previous file with comments | « xfa/fwl/core/ifwl_monthcalendar.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698