Updating comments per the C++ core guidelines and removing trailing whitespace (#194)

Fixed comments that were inconsistent with the style guidelines described in C++ core guidelines and the modern C++/WinRT language projections and removed trailing whitespace.

Inserted a space after the beginning of the comment so the text wasn't touching the // on all occurrences.

Removed all occurrences of trailing whitespace
This commit is contained in:
Will
2019-03-15 02:30:07 -04:00
committed by Howard Wolosky
parent 62317fd63b
commit 1113ff4b86
82 changed files with 509 additions and 510 deletions

View File

@@ -76,7 +76,7 @@ void CalculationResult::OnApplyTemplate()
if (m_textContainer)
{
m_textContainer->SizeChanged += ref new SizeChangedEventHandler(this, &CalculationResult::TextContainerSizeChanged);
// We want to know when the size of the container changes so
// We want to know when the size of the container changes so
// we can rescale the textbox
m_textContainerLayoutChangedToken = m_textContainer->LayoutUpdated += ref new EventHandler<Object^>(this, &CalculationResult::OnTextContainerLayoutUpdated);
@@ -154,15 +154,15 @@ void CalculationResult::OnIsInErrorPropertyChanged(bool /*oldValue*/, bool newVa
if (newValue)
{
// If there's an error message we need to override the normal display font
// with the font appropriate for this language. This is because the error
// with the font appropriate for this language. This is because the error
// message is localized and therefore can contain characters that are not
// available in the normal font.
// available in the normal font.
// We use UIText as the font type because this is the most common font type to use
m_textBlock->FontFamily = LocalizationService::GetInstance()->GetLanguageFontFamilyForType(LanguageFontType::UIText);
}
else
{
// The error result is no longer an error so we will restore the
// The error result is no longer an error so we will restore the
// value to FontFamily property to the value provided in the style
// for the TextBlock in the template.
m_textBlock->ClearValue(TextBlock::FontFamilyProperty);
@@ -175,7 +175,7 @@ void CalculationResult::UpdateVisualState()
{
VisualStateManager::GoToState(this, "Active", true);
}
else
else
{
VisualStateManager::GoToState(this, "Normal", true);
}
@@ -192,8 +192,8 @@ void CalculationResult::UpdateTextState()
String^ oldText = m_textBlock->Text;
String^ newText = Utils::LRO + DisplayValue + Utils::PDF;
//Initiate the scaling operation
//UpdateLayout will keep calling us until we make it through the below 2 if-statements
// Initiate the scaling operation
// UpdateLayout will keep calling us until we make it through the below 2 if-statements
if (!m_isScalingText || oldText != newText)
{
m_textBlock->Text = newText;
@@ -329,17 +329,17 @@ void CalculationResult::ShowHideScrollButtons(::Visibility vLeft, ::Visibility v
void CalculationResult::UpdateScrollButtons()
{
// When the width is smaller than the container, don't show any
if (m_textBlock->ActualWidth < m_textContainer->ActualWidth)
if (m_textBlock->ActualWidth < m_textContainer->ActualWidth)
{
ShowHideScrollButtons(::Visibility::Collapsed, ::Visibility::Collapsed);
}
// We have more number on both side. Show both arrows
else if (m_textContainer->HorizontalOffset > 0 && m_textContainer->HorizontalOffset < (m_textContainer->ExtentWidth - m_textContainer->ViewportWidth))
else if (m_textContainer->HorizontalOffset > 0 && m_textContainer->HorizontalOffset < (m_textContainer->ExtentWidth - m_textContainer->ViewportWidth))
{
ShowHideScrollButtons(::Visibility::Visible, ::Visibility::Visible);
}
// Width is larger than the container and left most part of the number is shown. Should be able to scroll left.
else if (m_textContainer->HorizontalOffset == 0)
else if (m_textContainer->HorizontalOffset == 0)
{
ShowHideScrollButtons(::Visibility::Collapsed, ::Visibility::Visible);
}

View File

@@ -54,7 +54,7 @@ void CalculatorButton::OnKeyUp(KeyRoutedEventArgs^ e)
}
void CalculatorButton::OnButtonIdPropertyChanged(
NumbersAndOperatorsEnum /*oldValue*/,
NumbersAndOperatorsEnum /*oldValue*/,
NumbersAndOperatorsEnum newValue)
{
this->CommandParameter = ref new CalculatorButtonPressedEventArgs(AuditoryFeedback, newValue);

View File

@@ -13,7 +13,7 @@ namespace CalculatorApp
public ref class CalculatorButton sealed: Windows::UI::Xaml::Controls::Button
{
public:
CalculatorButton();
DEPENDENCY_PROPERTY_OWNER(CalculatorButton);

View File

@@ -43,7 +43,7 @@ void FlipButtons::OnKeyUp(KeyRoutedEventArgs^ e)
}
void FlipButtons::OnButtonIdPropertyChanged(
NumbersAndOperatorsEnum /*oldValue*/,
NumbersAndOperatorsEnum /*oldValue*/,
NumbersAndOperatorsEnum newValue)
{
this->CommandParameter = newValue;

View File

@@ -29,7 +29,7 @@ namespace CalculatorApp
private:
void OnButtonIdPropertyChanged(
NumbersAndOperatorsEnum oldValue,
NumbersAndOperatorsEnum oldValue,
NumbersAndOperatorsEnum newValue);
};
}

View File

@@ -23,7 +23,7 @@ using namespace Windows::UI::Xaml::Media;
using namespace Windows::UI::Xaml::Navigation;
void OperandTextBox::OnApplyTemplate()
{
{
this->IsEnabled = false;
this->IsHitTestVisible = false;
this->IsTapEnabled = false;

View File

@@ -34,22 +34,22 @@ void OverflowTextBlock::OnApplyTemplate()
m_expressionContainer = safe_cast<ScrollViewer^>(GetTemplateChild("expressionContainer"));
m_expressionContainer->ChangeView(m_expressionContainer->ExtentWidth - m_expressionContainer->ViewportWidth, nullptr, nullptr);
m_scrollLeft = safe_cast<Button^>(GetTemplateChild("scrollLeft"));
m_scrollRight = safe_cast<Button^>(GetTemplateChild("scrollRight"));
m_scrollLeftClickEventToken = m_scrollLeft->Click += ref new RoutedEventHandler(this, &OverflowTextBlock::OnScrollClick);
m_scrollRightClickEventToken = m_scrollRight->Click += ref new RoutedEventHandler(this, &OverflowTextBlock::OnScrollClick);
m_scrollingLeft = false;
m_scrollingRight = false;
auto borderContainer = safe_cast<Border^>(GetTemplateChild("expressionborder"));
m_pointerEnteredEventToken = borderContainer->PointerEntered += ref new PointerEventHandler(this, &OverflowTextBlock::OnPointerEntered);
m_pointerExitedEventToken = borderContainer->PointerExited += ref new PointerEventHandler(this, &OverflowTextBlock::OnPointerExited);
m_listView = safe_cast<ListView^>(GetTemplateChild("TokenList"));
UpdateAllState();
}

View File

@@ -12,7 +12,7 @@ namespace CalculatorApp
public ref class OverflowTextBlock sealed : public Windows::UI::Xaml::Controls::Control
{
public:
OverflowTextBlock()
OverflowTextBlock()
{
}