diff options
author | Kitware Robot <kwrobot@kitware.com> | 2016-05-16 14:34:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-05-16 20:05:19 (GMT) |
commit | d9fd2f5402eeaa345691313658e02b51038f570b (patch) | |
tree | dca71b9a7e267f4c6300da3eb770415381726785 /Source/CursesDialog/cmCursesBoolWidget.cxx | |
parent | 82df6deaafb36cbbfd450202bb20b320f637751a (diff) | |
download | CMake-d9fd2f5402eeaa345691313658e02b51038f570b.zip CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.gz CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.bz2 |
Revise C++ coding style using clang-format
Run the `Utilities/Scripts/clang-format.bash` script to update
all our C++ code to a new style defined by `.clang-format`.
Use `clang-format` version 3.8.
* If you reached this commit for a line in `git blame`, re-run the blame
operation starting at the parent of this commit to see older history
for the content.
* See the parent commit for instructions to rebase a change across this
style transition commit.
Diffstat (limited to 'Source/CursesDialog/cmCursesBoolWidget.cxx')
-rw-r--r-- | Source/CursesDialog/cmCursesBoolWidget.cxx | 49 |
1 files changed, 18 insertions, 31 deletions
diff --git a/Source/CursesDialog/cmCursesBoolWidget.cxx b/Source/CursesDialog/cmCursesBoolWidget.cxx index 0529b78..0055e88 100644 --- a/Source/CursesDialog/cmCursesBoolWidget.cxx +++ b/Source/CursesDialog/cmCursesBoolWidget.cxx @@ -13,14 +13,14 @@ #include "cmCursesMainForm.h" -cmCursesBoolWidget::cmCursesBoolWidget(int width, int height, - int left, int top) : - cmCursesWidget(width, height, left, top) +cmCursesBoolWidget::cmCursesBoolWidget(int width, int height, int left, + int top) + : cmCursesWidget(width, height, left, top) { this->Type = cmState::BOOL; - set_field_fore(this->Field, A_NORMAL); - set_field_back(this->Field, A_STANDOUT); - field_opts_off(this->Field, O_STATIC); + set_field_fore(this->Field, A_NORMAL); + set_field_back(this->Field, A_STANDOUT); + field_opts_off(this->Field, O_STATIC); this->SetValueAsBool(false); } @@ -28,48 +28,35 @@ bool cmCursesBoolWidget::HandleInput(int& key, cmCursesMainForm*, WINDOW* w) { // 10 == enter - if (key == 10 || key == KEY_ENTER) - { - if (this->GetValueAsBool()) - { + if (key == 10 || key == KEY_ENTER) { + if (this->GetValueAsBool()) { this->SetValueAsBool(false); - } - else - { + } else { this->SetValueAsBool(true); - } + } touchwin(w); wrefresh(w); return true; - } - else - { + } else { return false; - } - + } } void cmCursesBoolWidget::SetValueAsBool(bool value) { - if (value) - { + if (value) { this->SetValue("ON"); - } - else - { + } else { this->SetValue("OFF"); - } + } } bool cmCursesBoolWidget::GetValueAsBool() { - if (this->Value == "ON") - { + if (this->Value == "ON") { return true; - } - else - { + } else { return false; - } + } } |