From c635c93c974db1c55032c36e81e98f3d214a249f Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 3 Jan 2017 15:46:55 -0500 Subject: Remove the ::GetCapacity methods. The GetCapacity methods return a void* because they return different types of internal class memory based on what the calling parameter was. This is confusing and makes it difficult to tell when then enum values can be removed. This CL removes GetCapacity and adds methods as needed to get the real values. Change-Id: I64c2edc858220624880e27f4ed49c2dae080f462 Reviewed-on: https://pdfium-review.googlesource.com/2137 Commit-Queue: dsinclair Reviewed-by: Tom Sepez --- xfa/fwl/theme/cfwl_monthcalendartp.cpp | 164 --------------------------------- 1 file changed, 164 deletions(-) (limited to 'xfa/fwl/theme/cfwl_monthcalendartp.cpp') diff --git a/xfa/fwl/theme/cfwl_monthcalendartp.cpp b/xfa/fwl/theme/cfwl_monthcalendartp.cpp index a76d959cca..7e9ea0a72f 100644 --- a/xfa/fwl/theme/cfwl_monthcalendartp.cpp +++ b/xfa/fwl/theme/cfwl_monthcalendartp.cpp @@ -15,40 +15,6 @@ #include "xfa/fxgraphics/cfx_color.h" #include "xfa/fxgraphics/cfx_path.h" -namespace { - -const int kWidth = 200; -const int kHeight = 160; - -const int kHeaderWidth = 200; -const int kHeaderHeight = 30; - -const int kButtonWidth = 18; -const int kButtonHeight = 16; -const int kButtonHorizontalMargin = 5; -const int kButtonVerticalMargin = (kHeaderHeight - kButtonHeight) / 2; - -const int kHeaderTextWidth = 100; -const int kHeaderTextHeight = 20; -const int kHeaderTextHorizontalMargin = (kHeaderWidth - kHeaderTextWidth) / 2; -const int kHeaderTextVerticalMargin = (kHeaderHeight - kHeaderTextHeight) / 2; - -const int kDatesCellWidth = (kHeaderWidth / 7); -const int kDatesCellHeight = 16; -const int kWeekWidth = kDatesCellWidth * 7; -const int kWeekNumWidth = 26; -const int kWeekNumHeight = (6 * kDatesCellHeight); - -const int kHorizontalSeparatorWidth = kWeekWidth - 10; -const int kHorizontalSeparatorHeight = 1; -const int kVerticalSeparatorWidth = 1; -const int kVerticalSeparatorHeight = kWeekNumHeight; -const int kSeparatorDOffset = -4; -const int kSeparatorX = 3; -const int kSeparatorY = kHeaderHeight + kDatesCellHeight + kSeparatorDOffset; - -} // namespace - CFWL_MonthCalendarTP::CFWL_MonthCalendarTP() : m_pThemeData(new MCThemeData) { SetThemeData(); } @@ -130,136 +96,6 @@ void CFWL_MonthCalendarTP::DrawText(CFWL_ThemeText* pParams) { CFWL_WidgetTP::DrawText(pParams); } -void* CFWL_MonthCalendarTP::GetCapacity(CFWL_ThemePart* pThemePart, - CFWL_WidgetCapacity dwCapacity) { - bool bDefPro = false; - bool bDwordVal = false; - switch (dwCapacity) { - case CFWL_WidgetCapacity::HeaderWidth: { - m_fValue = kHeaderWidth; - break; - } - case CFWL_WidgetCapacity::HeaderHeight: { - m_fValue = kHeaderHeight; - break; - } - case CFWL_WidgetCapacity::HeaderBtnWidth: { - m_fValue = kButtonWidth; - break; - } - case CFWL_WidgetCapacity::HeaderBtnHeight: { - m_fValue = kButtonHeight; - break; - } - case CFWL_WidgetCapacity::HeaderBtnHMargin: { - bDwordVal = true; - m_dwValue = kButtonHorizontalMargin; - break; - } - case CFWL_WidgetCapacity::HeaderBtnVMargin: { - m_fValue = kButtonVerticalMargin; - break; - } - case CFWL_WidgetCapacity::HeaderTextWidth: { - m_fValue = kHeaderTextWidth; - break; - } - case CFWL_WidgetCapacity::HeaderTextHeight: { - m_fValue = kHeaderTextHeight; - break; - } - case CFWL_WidgetCapacity::HeaderTextHMargin: { - m_fValue = kHeaderTextHorizontalMargin; - break; - } - case CFWL_WidgetCapacity::HeaderTextVMargin: { - m_fValue = kHeaderTextVerticalMargin; - break; - } - case CFWL_WidgetCapacity::HSepWidth: { - m_fValue = kHorizontalSeparatorWidth; - break; - } - case CFWL_WidgetCapacity::HSepHeight: { - m_fValue = kHorizontalSeparatorHeight; - break; - } - case CFWL_WidgetCapacity::VSepWidth: { - m_fValue = kVerticalSeparatorWidth; - break; - } - case CFWL_WidgetCapacity::VSepHeight: { - m_fValue = kVerticalSeparatorHeight; - break; - } - case CFWL_WidgetCapacity::WeekNumWidth: { - m_fValue = kWeekNumWidth; - break; - } - case CFWL_WidgetCapacity::WeekNumHeight: { - m_fValue = kWeekNumHeight; - break; - } - case CFWL_WidgetCapacity::WeekWidth: { - m_fValue = kWeekWidth; - break; - } - case CFWL_WidgetCapacity::WeekHeight: { - m_fValue = kDatesCellHeight; - break; - } - case CFWL_WidgetCapacity::SepDOffset: { - m_fValue = kSeparatorDOffset; - break; - } - case CFWL_WidgetCapacity::SepX: { - m_fValue = kSeparatorX; - break; - } - case CFWL_WidgetCapacity::SepY: { - m_fValue = kSeparatorY; - break; - } - case CFWL_WidgetCapacity::DatesCellWidth: { - m_fValue = kDatesCellWidth; - break; - } - case CFWL_WidgetCapacity::DatesCellHeight: { - m_fValue = kDatesCellHeight; - break; - } - case CFWL_WidgetCapacity::TodayWidth: { - m_fValue = kHeaderWidth; - break; - } - case CFWL_WidgetCapacity::TodayHeight: { - m_fValue = kDatesCellHeight; - break; - } - case CFWL_WidgetCapacity::TodayFlagWidth: { - m_fValue = kDatesCellWidth; - break; - } - case CFWL_WidgetCapacity::Width: { - m_fValue = kWidth; - break; - } - case CFWL_WidgetCapacity::Height: { - m_fValue = kHeight; - break; - } - default: - bDefPro = true; - break; - } - if (!bDefPro) { - if (bDwordVal) - return &m_dwValue; - return &m_fValue; - } - return CFWL_WidgetTP::GetCapacity(pThemePart, dwCapacity); -} - void CFWL_MonthCalendarTP::Initialize() { InitTTO(); CFWL_WidgetTP::Initialize(); -- cgit v1.2.3