diff options
author | Philipp Hofer <philipp.hofer@protonmail.com> | 2020-11-12 13:16:05 +0100 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2020-11-19 10:44:14 +0100 |
commit | 7c9a2c4b97c145a358084bed4b875396d3dc3e5c (patch) | |
tree | 28875b0ca8e1137ac1efae3851d299ddf5a68e08 /shell/source | |
parent | 02d65d7a19981d342d9ef3996b296b4efda905a4 (diff) |
tdf#123936 Formatting files in module shell with clang-format
Change-Id: Iba0c34cff0e04b18a3b4c5b7bb2aa42e14aedb81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105707
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'shell/source')
-rw-r--r-- | shell/source/tools/lngconvex/cmdline.cxx | 19 | ||||
-rw-r--r-- | shell/source/tools/lngconvex/cmdline.hxx | 13 | ||||
-rw-r--r-- | shell/source/win32/ooofilereader/keywordstag.cxx | 20 | ||||
-rw-r--r-- | shell/source/win32/zipfile/zipexcptn.hxx | 6 |
4 files changed, 16 insertions, 42 deletions
diff --git a/shell/source/tools/lngconvex/cmdline.cxx b/shell/source/tools/lngconvex/cmdline.cxx index ffbd228e582a..e3f24e1d8b5c 100644 --- a/shell/source/tools/lngconvex/cmdline.cxx +++ b/shell/source/tools/lngconvex/cmdline.cxx @@ -17,27 +17,22 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - #include <stdexcept> #include "cmdline.hxx" - /** Simple command line abstraction */ // Creation - -CommandLine::CommandLine(size_t argc, char* argv[]) : - m_argc(argc), - m_argv(argv) +CommandLine::CommandLine(size_t argc, char* argv[]) + : m_argc(argc) + , m_argv(argv) { } - // Query - /** Returns an argument by name. If there are duplicate argument names in the command line, the first one wins. @@ -58,13 +53,13 @@ std::string CommandLine::get_arg(const std::string& ArgumentName) const { std::string arg_value; size_t i; - for ( i = 0; i < m_argc; i++) + for (i = 0; i < m_argc; i++) { std::string arg = m_argv[i]; - if (ArgumentName == arg && ((i+1) < m_argc) && !is_arg_name(m_argv[i+1])) + if (ArgumentName == arg && ((i + 1) < m_argc) && !is_arg_name(m_argv[i + 1])) { - arg_value = m_argv[i+1]; + arg_value = m_argv[i + 1]; break; } } @@ -75,10 +70,8 @@ std::string CommandLine::get_arg(const std::string& ArgumentName) const return arg_value; } - // Command - /** Returns whether a given argument is an argument name */ bool CommandLine::is_arg_name(const std::string& Argument) diff --git a/shell/source/tools/lngconvex/cmdline.hxx b/shell/source/tools/lngconvex/cmdline.hxx index bbf5afa5b0e5..507ace6174de 100644 --- a/shell/source/tools/lngconvex/cmdline.hxx +++ b/shell/source/tools/lngconvex/cmdline.hxx @@ -24,23 +24,18 @@ #include <sal/config.h> - /** Simple command line abstraction */ class CommandLine { public: - // Creation - CommandLine(size_t argc, char* argv[]); - // Query - /** Returns an argument by name. If there are duplicate argument names in the command line, the first one wins. @@ -59,18 +54,16 @@ public: */ std::string get_arg(const std::string& ArgumentName) const; - private: - /** Returns whether a given argument is an argument name */ static bool is_arg_name(const std::string& Argument); private: - size_t m_argc; - char** m_argv; + size_t m_argc; + char** m_argv; -// prevent copy and assignment + // prevent copy and assignment private: CommandLine(const CommandLine&) = delete; CommandLine& operator=(const CommandLine&) = delete; diff --git a/shell/source/win32/ooofilereader/keywordstag.cxx b/shell/source/win32/ooofilereader/keywordstag.cxx index 8a8600e2823f..4bc63e0423b0 100644 --- a/shell/source/win32/ooofilereader/keywordstag.cxx +++ b/shell/source/win32/ooofilereader/keywordstag.cxx @@ -21,15 +21,9 @@ /*********************** CKeywordsTag ***********************/ -void CKeywordsTag::startTag() -{ - m_sCurrentKeyword.clear(); -} +void CKeywordsTag::startTag() { m_sCurrentKeyword.clear(); } -void CKeywordsTag::endTag() -{ - m_slKeywords.push_back(m_sCurrentKeyword); -} +void CKeywordsTag::endTag() { m_slKeywords.push_back(m_sCurrentKeyword); } void CKeywordsTag::addCharacters(const std::wstring& characters) { @@ -41,13 +35,13 @@ void CKeywordsTag::addAttributes(const XmlTagAttributes_t& /*attributes*/) // there are no attributes for keywords } -std::wstring CKeywordsTag::getTagContent( ) +std::wstring CKeywordsTag::getTagContent() { - auto keywords_Iter= m_slKeywords.cbegin( ); - auto keywords_Iter_end = m_slKeywords.cend( ); + auto keywords_Iter = m_slKeywords.cbegin(); + auto keywords_Iter_end = m_slKeywords.cend(); - std::wstring ret_KeyWord_String = ( keywords_Iter != keywords_Iter_end) ? *keywords_Iter++ : L""; - for ( ; keywords_Iter != keywords_Iter_end; ++keywords_Iter) + std::wstring ret_KeyWord_String = (keywords_Iter != keywords_Iter_end) ? *keywords_Iter++ : L""; + for (; keywords_Iter != keywords_Iter_end; ++keywords_Iter) ret_KeyWord_String += L"," + *keywords_Iter; return ret_KeyWord_String; } diff --git a/shell/source/win32/zipfile/zipexcptn.hxx b/shell/source/win32/zipfile/zipexcptn.hxx index 6fb7c0d971b7..f6c6205058da 100644 --- a/shell/source/win32/zipfile/zipexcptn.hxx +++ b/shell/source/win32/zipfile/zipexcptn.hxx @@ -24,7 +24,6 @@ #include <stdexcept> - class RuntimeException : public std::exception { public: @@ -37,7 +36,6 @@ private: int m_Error; }; - class ZipException : public RuntimeException { public: @@ -46,7 +44,6 @@ public: virtual const char* what() const throw() override; }; - class Win32Exception : public RuntimeException { public: @@ -59,21 +56,18 @@ private: mutable char* m_MsgBuff; }; - class ZipContentMissException : public ZipException { public: explicit ZipContentMissException(int Error); }; - class AccessViolationException : public Win32Exception { public: explicit AccessViolationException(int Error); }; - class IOException : public Win32Exception { public: |