diff --git a/dev/Repeater/FlowLayoutAlgorithm.cpp b/dev/Repeater/FlowLayoutAlgorithm.cpp index 75cbecd898..d684412de4 100644 --- a/dev/Repeater/FlowLayoutAlgorithm.cpp +++ b/dev/Repeater/FlowLayoutAlgorithm.cpp @@ -135,7 +135,7 @@ winrt::Size FlowLayoutAlgorithm::MeasureElement( { const auto measureSize = m_algorithmCallbacks->Algorithm_GetMeasureSize(index, availableSize, context); element.Measure(measureSize); - auto provisionalArrangeSize = m_algorithmCallbacks->Algorithm_GetProvisionalArrangeSize(index, measureSize, element.DesiredSize(), context); + const auto provisionalArrangeSize = m_algorithmCallbacks->Algorithm_GetProvisionalArrangeSize(index, measureSize, element.DesiredSize(), context); m_algorithmCallbacks->Algorithm_OnElementMeasured(element, index, availableSize, measureSize, element.DesiredSize(), provisionalArrangeSize, context); return provisionalArrangeSize; @@ -503,7 +503,7 @@ winrt::Rect FlowLayoutAlgorithm::EstimateExtent(const winrt::Size& availableSize lastBounds = m_elementManager.GetLayoutBoundsForRealizedIndex(last); } - winrt::Rect extent = m_algorithmCallbacks->Algorithm_GetExtent( + const winrt::Rect extent = m_algorithmCallbacks->Algorithm_GetExtent( availableSize, m_context.get(), firstRealizedElement, diff --git a/dev/Repeater/ItemsRepeaterScrollHost.cpp b/dev/Repeater/ItemsRepeaterScrollHost.cpp index ebd6928a5d..f430e993a5 100644 --- a/dev/Repeater/ItemsRepeaterScrollHost.cpp +++ b/dev/Repeater/ItemsRepeaterScrollHost.cpp @@ -67,7 +67,7 @@ winrt::Size ItemsRepeaterScrollHost::MeasureOverride(winrt::Size const& availabl winrt::Size ItemsRepeaterScrollHost::ArrangeOverride(winrt::Size const& finalSize) { - winrt::Size result = finalSize; + const winrt::Size result = finalSize; if (auto scrollViewer = ScrollViewer()) { if (SharedHelpers::IsRS5OrHigher()) diff --git a/dev/Repeater/UniformGridLayout.cpp b/dev/Repeater/UniformGridLayout.cpp index a8345cfabf..a293d791ff 100644 --- a/dev/Repeater/UniformGridLayout.cpp +++ b/dev/Repeater/UniformGridLayout.cpp @@ -324,7 +324,7 @@ winrt::Rect UniformGridLayout::GetLayoutRectForDataIndex( const int indexInRow = index - (rowIndex * itemsPerLine); auto gridState = GetAsGridState(context.LayoutState()); - winrt::Rect bounds = MinorMajorRect( + const winrt::Rect bounds = MinorMajorRect( indexInRow * GetMinorSizeWithSpacing(context) + MinorStart(lastExtent), rowIndex * GetMajorSizeWithSpacing(context) + MajorStart(lastExtent), GetScrollOrientation() == ScrollOrientation::Vertical ? static_cast(gridState->EffectiveItemWidth()) : static_cast(gridState->EffectiveItemHeight()), diff --git a/dev/ScrollPresenter/ScrollPresenter.cpp b/dev/ScrollPresenter/ScrollPresenter.cpp index e62818e341..1fe73b50d2 100644 --- a/dev/ScrollPresenter/ScrollPresenter.cpp +++ b/dev/ScrollPresenter/ScrollPresenter.cpp @@ -675,7 +675,7 @@ winrt::Size ScrollPresenter::ArrangeOverride(winrt::Size const& finalSize) // No matter the ScrollPresenter's alignment, it does not grow larger than finalSize. viewport is finalSize again. // 3. m_availableSize <= finalSize, the ScrollPresenter is constrained and its Content is larger than or equal to // the available size. viewport is the smaller & constrained m_availableSize. - winrt::Size viewport = + const winrt::Size viewport = { std::min(finalSize.Width, m_availableSize.Width), std::min(finalSize.Height, m_availableSize.Height) diff --git a/dev/ScrollPresenter/ScrollPresenterAnchoring.cpp b/dev/ScrollPresenter/ScrollPresenterAnchoring.cpp index 7e40d281a8..22c385e7f9 100644 --- a/dev/ScrollPresenter/ScrollPresenterAnchoring.cpp +++ b/dev/ScrollPresenter/ScrollPresenterAnchoring.cpp @@ -262,7 +262,7 @@ winrt::Size ScrollPresenter::ComputeViewportToElementAnchorPointsDistance( MUX_ASSERT(isnan(viewportAnchorPointVerticalOffset) == isnan(elementAnchorPointVerticalOffset)); // Rounding the distance to 6 precision digits to avoid layout cycles due to float/double conversions. - winrt::Size viewportToElementAnchorPointsDistance = winrt::Size{ + const winrt::Size viewportToElementAnchorPointsDistance = winrt::Size{ isnan(viewportAnchorPointHorizontalOffset) ? FloatUtil::NaN : static_cast(round((elementAnchorPointHorizontalOffset - viewportAnchorPointHorizontalOffset) * 1000000) / 1000000), isnan(viewportAnchorPointVerticalOffset) ? diff --git a/dev/ScrollPresenter/ScrollPresenterPrivate.cpp b/dev/ScrollPresenter/ScrollPresenterPrivate.cpp index 16894b4d85..9fb330498c 100644 --- a/dev/ScrollPresenter/ScrollPresenterPrivate.cpp +++ b/dev/ScrollPresenter/ScrollPresenterPrivate.cpp @@ -69,7 +69,7 @@ winrt::Rect ScrollPresenter::GetRelativeViewport( ComputeMinMaxPositions(m_zoomFactor, &minPosition, nullptr); - winrt::Rect result = { (minPosition.x - m_contentLayoutOffsetX + static_cast(m_zoomedHorizontalOffset) - elementOffset.X) / m_zoomFactor, + const winrt::Rect result = { (minPosition.x - m_contentLayoutOffsetX + static_cast(m_zoomedHorizontalOffset) - elementOffset.X) / m_zoomFactor, (minPosition.y - m_contentLayoutOffsetY + static_cast(m_zoomedVerticalOffset) - elementOffset.Y) / m_zoomFactor, viewportWidth, viewportHeight }; diff --git a/dev/TwoPaneView/DisplayRegionHelper.cpp b/dev/TwoPaneView/DisplayRegionHelper.cpp index 4229c36c5d..b824c7e506 100644 --- a/dev/TwoPaneView/DisplayRegionHelper.cpp +++ b/dev/TwoPaneView/DisplayRegionHelper.cpp @@ -110,7 +110,7 @@ winrt::Rect DisplayRegionHelper::WindowRect() { // Return the bounds of the simulated window winrt::FrameworkElement window = DisplayRegionHelper::WindowElement().as(); - winrt::Rect rc = { + const winrt::Rect rc = { 0, 0, (float)window.ActualWidth(), (float)window.ActualHeight() };