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/CPack/WiX/cmWIXShortcut.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/CPack/WiX/cmWIXShortcut.cxx')
-rw-r--r-- | Source/CPack/WiX/cmWIXShortcut.cxx | 78 |
1 files changed, 34 insertions, 44 deletions
diff --git a/Source/CPack/WiX/cmWIXShortcut.cxx b/Source/CPack/WiX/cmWIXShortcut.cxx index d721872..2685a23 100644 --- a/Source/CPack/WiX/cmWIXShortcut.cxx +++ b/Source/CPack/WiX/cmWIXShortcut.cxx @@ -14,8 +14,8 @@ #include "cmWIXFilesSourceWriter.h" -void cmWIXShortcuts::insert( - Type type, std::string const& id, cmWIXShortcut const& shortcut) +void cmWIXShortcuts::insert(Type type, std::string const& id, + cmWIXShortcut const& shortcut) { this->Shortcuts[type][id].push_back(shortcut); } @@ -26,25 +26,22 @@ bool cmWIXShortcuts::empty(Type type) const } bool cmWIXShortcuts::EmitShortcuts( - Type type, - std::string const& registryKey, + Type type, std::string const& registryKey, std::string const& cpackComponentName, cmWIXFilesSourceWriter& fileDefinitions) const { shortcut_type_map_t::const_iterator i = this->Shortcuts.find(type); - if(i == this->Shortcuts.end()) - { + if (i == this->Shortcuts.end()) { return false; - } + } shortcut_id_map_t const& id_map = i->second; std::string shortcutPrefix; std::string registrySuffix; - switch(type) - { + switch (type) { case START_MENU: shortcutPrefix = "CM_S"; break; @@ -58,68 +55,61 @@ bool cmWIXShortcuts::EmitShortcuts( break; default: return false; - } + } - for(shortcut_id_map_t::const_iterator j = id_map.begin(); - j != id_map.end(); ++j) - { + for (shortcut_id_map_t::const_iterator j = id_map.begin(); j != id_map.end(); + ++j) { std::string const& id = j->first; shortcut_list_t const& shortcutList = j->second; - for(size_t shortcutListIndex = 0; - shortcutListIndex < shortcutList.size(); ++shortcutListIndex) - { + for (size_t shortcutListIndex = 0; shortcutListIndex < shortcutList.size(); + ++shortcutListIndex) { cmWIXShortcut const& shortcut = shortcutList[shortcutListIndex]; - fileDefinitions.EmitShortcut(id, shortcut, - shortcutPrefix, shortcutListIndex); - } + fileDefinitions.EmitShortcut(id, shortcut, shortcutPrefix, + shortcutListIndex); } + } - fileDefinitions.EmitInstallRegistryValue( - registryKey, cpackComponentName, registrySuffix); + fileDefinitions.EmitInstallRegistryValue(registryKey, cpackComponentName, + registrySuffix); return true; } void cmWIXShortcuts::AddShortcutTypes(std::set<Type>& types) { - for(shortcut_type_map_t::const_iterator i = this->Shortcuts.begin(); - i != this->Shortcuts.end(); ++i) - { + for (shortcut_type_map_t::const_iterator i = this->Shortcuts.begin(); + i != this->Shortcuts.end(); ++i) { types.insert(i->first); - } + } } -void cmWIXShortcuts::CreateFromProperties( - std::string const& id, - std::string const& directoryId, - cmInstalledFile const& installedFile) +void cmWIXShortcuts::CreateFromProperties(std::string const& id, + std::string const& directoryId, + cmInstalledFile const& installedFile) { - CreateFromProperty("CPACK_START_MENU_SHORTCUTS", - START_MENU, id, directoryId, installedFile); + CreateFromProperty("CPACK_START_MENU_SHORTCUTS", START_MENU, id, directoryId, + installedFile); - CreateFromProperty("CPACK_DESKTOP_SHORTCUTS", - DESKTOP, id, directoryId, installedFile); + CreateFromProperty("CPACK_DESKTOP_SHORTCUTS", DESKTOP, id, directoryId, + installedFile); - CreateFromProperty("CPACK_STARTUP_SHORTCUTS", - STARTUP, id, directoryId, installedFile); + CreateFromProperty("CPACK_STARTUP_SHORTCUTS", STARTUP, id, directoryId, + installedFile); } -void cmWIXShortcuts::CreateFromProperty( - std::string const& propertyName, - Type type, - std::string const& id, - std::string const& directoryId, - cmInstalledFile const& installedFile) +void cmWIXShortcuts::CreateFromProperty(std::string const& propertyName, + Type type, std::string const& id, + std::string const& directoryId, + cmInstalledFile const& installedFile) { std::vector<std::string> list; installedFile.GetPropertyAsList(propertyName, list); - for(size_t i = 0; i < list.size(); ++i) - { + for (size_t i = 0; i < list.size(); ++i) { cmWIXShortcut shortcut; shortcut.label = list[i]; shortcut.workingDirectoryId = directoryId; insert(type, id, shortcut); - } + } } |