From 35aaf79b14bf8252e3dbded4d35894aac303408d Mon Sep 17 00:00:00 2001 From: David Date: Thu, 10 Jun 2021 09:56:24 -0400 Subject: [PATCH] fix(calendar): Fix few C++ translation issues --- .../Controls/CalendarView/CalendarLayoutStrategy_Partial.cs | 2 +- .../Xaml/Controls/CalendarView/CalendarViewGeneratorHost.cs | 2 +- .../CalendarView/CalendarViewGeneratorMonthViewHost.cs | 2 +- .../CalendarView/CalendarViewGeneratorYearViewHost.cs | 2 +- .../UI/Xaml/Controls/CalendarView/CalendarView_Partial.cs | 6 +++--- .../Controls/CalendarView/CalendarView_Partial_Selection.cs | 2 +- .../Xaml/Controls/DatePicker/DateTimePickerFlyoutHelper.cs | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarLayoutStrategy_Partial.cs b/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarLayoutStrategy_Partial.cs index 4956c4110c7a..413a90ff359b 100644 --- a/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarLayoutStrategy_Partial.cs +++ b/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarLayoutStrategy_Partial.cs @@ -239,7 +239,7 @@ private void HasIrregularSnapPointsImpl( out bool returnValue) /*override*/ { returnValue = false; - returnValue = !!_layoutStrategyImpl.HasIrregularSnapPoints(elementType); + returnValue = _layoutStrategyImpl.HasIrregularSnapPoints(elementType); } private void HasSnapPointOnElementImpl( diff --git a/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewGeneratorHost.cs b/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewGeneratorHost.cs index 4847dcbfc568..88ce73465ac9 100644 --- a/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewGeneratorHost.cs +++ b/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewGeneratorHost.cs @@ -151,7 +151,7 @@ internal virtual void PrepareItemContainer( isTodayHighlighted = Owner.IsTodayHighlighted; - isToday = !!isTodayHighlighted; + isToday = isTodayHighlighted; } spContainer.SetIsToday(isToday); diff --git a/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewGeneratorMonthViewHost.cs b/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewGeneratorMonthViewHost.cs index 6a66574146d5..d794cf09618b 100644 --- a/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewGeneratorMonthViewHost.cs +++ b/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewGeneratorMonthViewHost.cs @@ -68,7 +68,7 @@ internal override void PrepareItemContainer( isLabelVisible = Owner.IsGroupLabelVisible; - UpdateLabel(spContainer, !isLabelVisible); + UpdateLabel(spContainer, isLabelVisible); } // today state will be updated in CalendarViewGeneratorHost.PrepareItemContainer diff --git a/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewGeneratorYearViewHost.cs b/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewGeneratorYearViewHost.cs index 155faa4e3d60..fba073abb39b 100644 --- a/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewGeneratorYearViewHost.cs +++ b/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewGeneratorYearViewHost.cs @@ -58,7 +58,7 @@ internal override void PrepareItemContainer( isLabelVisible = Owner.IsGroupLabelVisible; - UpdateLabel(spContainer, !isLabelVisible); + UpdateLabel(spContainer, isLabelVisible); } // today state will be updated in CalendarViewGeneratorHost.PrepareItemContainer diff --git a/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarView_Partial.cs b/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarView_Partial.cs index d52fe15c97ef..dcddac66d060 100644 --- a/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarView_Partial.cs +++ b/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarView_Partial.cs @@ -2004,7 +2004,7 @@ private void OnIsTodayHighlightedPropertyChanged() bool isTodayHighlighted = false; isTodayHighlighted = IsTodayHighlighted; - ((CalendarViewBaseItem)spChildAsI).SetIsToday(!isTodayHighlighted); + ((CalendarViewBaseItem)spChildAsI).SetIsToday(isTodayHighlighted); } } } @@ -2021,7 +2021,7 @@ private void OnIsOutOfScopePropertyChanged() // when IsOutOfScopeEnabled property is false, we don't care about scope state (all are inScope), // so we don't need to hook to ScrollViewer's state change handler. // when IsOutOfScopeEnabled property is true, we need to do so. - if (m_areDirectManipulationStateChangeHandlersHooked != !isOutOfScopeEnabled) + if (m_areDirectManipulationStateChangeHandlersHooked != isOutOfScopeEnabled) { m_areDirectManipulationStateChangeHandlersHooked = !m_areDirectManipulationStateChangeHandlersHooked; @@ -2252,7 +2252,7 @@ private void OnIsLabelVisibleChanged() ForeachChildInPanel(pPanel, (CalendarViewBaseItem pItem) => { - pHost.UpdateLabel(pItem, !isLabelVisible); + pHost.UpdateLabel(pItem, isLabelVisible); }); } } diff --git a/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarView_Partial_Selection.cs b/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarView_Partial_Selection.cs index 3c99b63b3084..f6ab638ea189 100644 --- a/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarView_Partial_Selection.cs +++ b/src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarView_Partial_Selection.cs @@ -388,7 +388,7 @@ internal void IsSelected(DateTime date, out bool pIsSelected) found = m_tpSelectedDates.IndexOf(date, out index); - pIsSelected = !!found; + pIsSelected = found; } diff --git a/src/Uno.UI/UI/Xaml/Controls/DatePicker/DateTimePickerFlyoutHelper.cs b/src/Uno.UI/UI/Xaml/Controls/DatePicker/DateTimePickerFlyoutHelper.cs index 1a0a2c6d623b..b8b7faec2ba4 100644 --- a/src/Uno.UI/UI/Xaml/Controls/DatePicker/DateTimePickerFlyoutHelper.cs +++ b/src/Uno.UI/UI/Xaml/Controls/DatePicker/DateTimePickerFlyoutHelper.cs @@ -193,7 +193,7 @@ internal static void OnKeyDownImpl( } } - pEventArgs.Handled = !!focusChanged; + pEventArgs.Handled = focusChanged; } return;