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>
This commit is contained in:
Philipp Hofer
2020-11-12 13:16:05 +01:00
committed by Christian Lohmaier
parent 02d65d7a19
commit 7c9a2c4b97
18 changed files with 111 additions and 176 deletions

View File

@@ -10,10 +10,8 @@
#ifndef INCLUDED_SHELL_INC_INTERNAL_FILEPATH_HXX
#define INCLUDED_SHELL_INC_INTERNAL_FILEPATH_HXX
// typedefs to allow using Unicode paths on Windows
#include <string>
#if defined _WIN32

View File

@@ -22,7 +22,6 @@
#include <string>
/* Converts ISO 8601 compliant date/time
representation to the representation
conforming to the current locale,
@@ -30,7 +29,6 @@
*/
std::wstring iso8601_date_to_local_date(const std::wstring& iso8601date);
/* Converts ISO 8601 compliant duration
representation to the representation
conforming to the current locale

View File

@@ -46,7 +46,6 @@ public:
*/
bool hasTag(const std::wstring& TagName) const;
/** Get a specific tag content, compound tags will be returned as comma separated list.
@param TagName
@@ -77,7 +76,6 @@ public:
LocaleSet_t getDefaultLocale();
protected: // protected because its only an implementation relevant class
/** start_element occurs when a tag is start.
@param raw_name
@@ -87,9 +85,7 @@ protected: // protected because its only an implementation relevant class
@param attributes
attribute structure.
*/
virtual void start_element(
const string_t& raw_name,
const string_t& local_name,
virtual void start_element(const string_t& raw_name, const string_t& local_name,
const xml_tag_attribute_container_t& attributes) override;
/** end_element occurs when a tag is closed
@@ -99,8 +95,7 @@ protected: // protected because its only an implementation relevant class
@param local_name
local name of the tag.
*/
virtual void end_element(
const string_t& raw_name, const string_t& local_name) override;
virtual void end_element(const string_t& raw_name, const string_t& local_name) override;
/** characters occurs when receiving characters
@@ -117,8 +112,7 @@ protected:
@param XmlAttributes
attribute structure of the tag to save in.
*/
ITag* chooseTagReader(
const std::wstring& tag_name, const XmlTagAttributes_t& XmlAttributes );
ITag* chooseTagReader(const std::wstring& tag_name, const XmlTagAttributes_t& XmlAttributes);
/** save the received content into structure.

View File

@@ -23,20 +23,20 @@
#include <objbase.h>
// {087B3AE3-E237-4467-B8DB-5A38AB959AC9}
const CLSID CLSID_INFOTIP_HANDLER =
{0x87b3ae3, 0xe237, 0x4467, {0xb8, 0xdb, 0x5a, 0x38, 0xab, 0x95, 0x9a, 0xc9}};
const CLSID CLSID_INFOTIP_HANDLER
= { 0x87b3ae3, 0xe237, 0x4467, { 0xb8, 0xdb, 0x5a, 0x38, 0xab, 0x95, 0x9a, 0xc9 } };
// {C52AF81D-F7A0-4aab-8E87-F80A60CCD396}
const CLSID CLSID_COLUMN_HANDLER =
{ 0xc52af81d, 0xf7a0, 0x4aab, { 0x8e, 0x87, 0xf8, 0xa, 0x60, 0xcc, 0xd3, 0x96 } };
const CLSID CLSID_COLUMN_HANDLER
= { 0xc52af81d, 0xf7a0, 0x4aab, { 0x8e, 0x87, 0xf8, 0xa, 0x60, 0xcc, 0xd3, 0x96 } };
// {63542C48-9552-494a-84F7-73AA6A7C99C1}
const CLSID CLSID_PROPERTYSHEET_HANDLER =
{ 0x63542c48, 0x9552, 0x494a, { 0x84, 0xf7, 0x73, 0xaa, 0x6a, 0x7c, 0x99, 0xc1 } };
const CLSID CLSID_PROPERTYSHEET_HANDLER
= { 0x63542c48, 0x9552, 0x494a, { 0x84, 0xf7, 0x73, 0xaa, 0x6a, 0x7c, 0x99, 0xc1 } };
// {3B092F0C-7696-40e3-A80F-68D74DA84210}
const CLSID CLSID_THUMBVIEWER_HANDLER =
{ 0x3b092f0c, 0x7696, 0x40e3, { 0xa8, 0xf, 0x68, 0xd7, 0x4d, 0xa8, 0x42, 0x10 } };
const CLSID CLSID_THUMBVIEWER_HANDLER
= { 0x3b092f0c, 0x7696, 0x40e3, { 0xa8, 0xf, 0x68, 0xd7, 0x4d, 0xa8, 0x42, 0x10 } };
extern HINSTANCE g_hModule;

View File

@@ -33,6 +33,7 @@ public:
unsigned long sread(unsigned char* vuf, unsigned long size) override;
long stell() override;
long sseek(long offset, int origin) override;
private:
IStream* stream;
};
@@ -45,6 +46,7 @@ public:
unsigned long sread(unsigned char* buf, unsigned long size) override;
long stell() override;
long sseek(long offset, int origin) override;
private:
FILE* file;
};

View File

@@ -41,25 +41,21 @@
*/
std::wstring StringToWString(const std::string& String);
/** Convert a wstring to a string
using CP_ACP
*/
std::string WStringToString(const std::wstring& String);
/** Convert a string to a wstring
using CP_UTF8
*/
std::wstring UTF8ToWString(const std::string& String);
/** Retrieve a string from the
resources of this module
*/
std::wstring GetResString(int ResId);
/** helper function to judge if the string is only has spaces.
@returns
<TRUE>if the provided string contains only but at least one space
@@ -72,15 +68,12 @@ bool HasOnlySpaces(const std::wstring& String);
Windows Locale Identifier corresponding to input LocaleSet.
*/
/** Convert a long path name using Windows api call GetShortPathName
*/
std::wstring getShortPathName(const std::wstring& aLongName);
LCID LocaleSetToLCID(const LocaleSet_t& Locale);
#ifdef DEBUG
inline void OutputDebugStringFormatW(LPCWSTR pFormat, ...)
{
@@ -93,12 +86,9 @@ inline void OutputDebugStringFormatW( LPCWSTR pFormat, ... )
OutputDebugStringW(buffer);
}
#else
static inline void OutputDebugStringFormatW( LPCWSTR, ... )
{
}
static inline void OutputDebugStringFormatW(LPCWSTR, ...) {}
#endif
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -26,15 +26,12 @@
class xml_parser_exception final : public std::runtime_error
{
public:
xml_parser_exception(
const std::string& error_msg) :
std::runtime_error(error_msg)
{}
xml_parser_exception(const std::string& error_msg)
: std::runtime_error(error_msg)
{
}
};
// Simple wrapper around expat, the xml parser library
// created by James Clark
@@ -89,8 +86,8 @@ public:
/** Returns the currently used document handler or null if
no document handler was set before. */
i_xml_parser_event_handler* get_document_handler() const { return document_handler_; }
private:
private:
void init();
private:

View File

@@ -38,7 +38,6 @@ public:
typedef std::vector<char> ZipContentBuffer_t;
public:
/** Checks whether a file is a zip file or not
@precond The given parameter must be a string with length > 0
@@ -56,7 +55,6 @@ public:
static bool IsZipFile(void* stream);
/** Returns whether the version of the specified zip file may be uncompressed with the
currently used zlib version or not
@@ -77,7 +75,6 @@ public:
static bool IsValidZipFileVersionNumber(void* stream);
public:
/** Constructs a zip file from a zip file
@precond The given parameter must be a string with length > 0
@@ -94,7 +91,6 @@ public:
ZipFile(StreamInterface* stream);
/** Destroys a zip file
*/
~ZipFile();
@@ -117,7 +113,8 @@ public:
ZipContentMissException if the specified zip content
does not exist in this zip file
*/
void GetUncompressedContent(const std::string &ContentName, /*inout*/ ZipContentBuffer_t &ContentBuffer);
void GetUncompressedContent(const std::string& ContentName,
/*inout*/ ZipContentBuffer_t& ContentBuffer);
/** Returns a list with the content names contained within this file
@@ -132,7 +129,6 @@ public:
bool HasContent(const std::string& ContentName) const;
private:
/** Returns the length of the longest file name
in the current zip file

View File

@@ -19,8 +19,9 @@
#include "testzipimpl.hxx"
TestZipImpl::TestZipImpl(StreamInterface *stream) :
zipFile(ZipFile(stream)), expectedContents()
TestZipImpl::TestZipImpl(StreamInterface* stream)
: zipFile(ZipFile(stream))
, expectedContents()
{
expectedContents.push_back("mimetype");
expectedContents.push_back("Configurations2/statusbar/");
@@ -42,9 +43,7 @@ TestZipImpl::TestZipImpl(StreamInterface *stream) :
sort(expectedContents.begin(), expectedContents.end());
}
TestZipImpl::~TestZipImpl()
{
}
TestZipImpl::~TestZipImpl() {}
bool TestZipImpl::test_directory()
{
@@ -54,10 +53,7 @@ bool TestZipImpl::test_directory()
return expectedContents == stringVector;
}
bool TestZipImpl::test_hasContentCaseInSensitive()
{
return zipFile.HasContent("mimetype");
}
bool TestZipImpl::test_hasContentCaseInSensitive() { return zipFile.HasContent("mimetype"); }
bool TestZipImpl::test_getContent()
{

View File

@@ -33,6 +33,7 @@ class TestZipImpl
private:
ZipFile zipFile;
vector<string> expectedContents;
public:
explicit TestZipImpl(StreamInterface* stream);
~TestZipImpl();

View File

@@ -38,6 +38,7 @@ class Test : public CppUnit::TestFixture
private:
wstring documentName;
LPSTREAM pStream;
public:
Test();
void test_file_directory();
@@ -58,7 +59,9 @@ public:
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
Test::Test() : documentName(), pStream(nullptr)
Test::Test()
: documentName()
, pStream(nullptr)
{
const wchar_t* pSrcRoot = _wgetenv(L"SRC_ROOT");
if (pSrcRoot)
@@ -69,7 +72,8 @@ Test::Test() : documentName(), pStream(nullptr)
documentName.append(L"shell/qa/zip/simpledocument.odt");
// Create an IStream pointer from the file
HANDLE hFile = CreateFileW(documentName.c_str(), GENERIC_READ, 0, nullptr, OPEN_EXISTING, 0, nullptr);
HANDLE hFile
= CreateFileW(documentName.c_str(), GENERIC_READ, 0, nullptr, OPEN_EXISTING, 0, nullptr);
DWORD dwFileSize = GetFileSize(hFile, nullptr);
HGLOBAL hGlobal = GlobalAlloc(GMEM_MOVEABLE, dwFileSize);
@@ -90,7 +94,8 @@ void Test::test_file_directory()
FileStream stream(documentName.c_str());
TestZipImpl testImpl(&stream);
bool isPassed = testImpl.test_directory();
CPPUNIT_ASSERT_MESSAGE("FileStream: Content does not match with expected directory names.", isPassed);
CPPUNIT_ASSERT_MESSAGE("FileStream: Content does not match with expected directory names.",
isPassed);
}
void Test::test_file_hasContentCaseInSensitive()
@@ -114,7 +119,8 @@ void Test::test_stream_directory()
BufferStream stream(pStream);
TestZipImpl testImpl(&stream);
bool isPassed = testImpl.test_directory();
CPPUNIT_ASSERT_MESSAGE("BufferStream: Content does not match with expected directory names.", isPassed);
CPPUNIT_ASSERT_MESSAGE("BufferStream: Content does not match with expected directory names.",
isPassed);
}
void Test::test_stream_hasContentCaseInSensitive()

View File

@@ -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.
@@ -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)

View File

@@ -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,9 +54,7 @@ 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);

View File

@@ -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)
{

View File

@@ -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:

View File

@@ -11483,26 +11483,13 @@ shell/inc/columninfo.hxx
shell/inc/config.hxx
shell/inc/contentreader.hxx
shell/inc/fileextensions.hxx
shell/inc/filepath.hxx
shell/inc/global.hxx
shell/inc/i_xml_parser_event_handler.hxx
shell/inc/infotips.hxx
shell/inc/iso8601_converter.hxx
shell/inc/metainforeader.hxx
shell/inc/propertyhdl.hxx
shell/inc/propsheets.hxx
shell/inc/registry.hxx
shell/inc/resource.h
shell/inc/shlxthdl.hxx
shell/inc/stream_helper.hxx
shell/inc/thumbviewer.hxx
shell/inc/types.hxx
shell/inc/utilities.hxx
shell/inc/xml_parser.hxx
shell/inc/zipfile.hxx
shell/qa/zip/testzipimpl.cxx
shell/qa/zip/testzipimpl.hxx
shell/qa/zip/ziptest.cxx
shell/source/all/xml_parser.cxx
shell/source/backends/desktopbe/desktopbackend.cxx
shell/source/backends/localebe/localebackend.cxx
@@ -11516,8 +11503,6 @@ shell/source/cmdmail/cmdmailsuppl.cxx
shell/source/cmdmail/cmdmailsuppl.hxx
shell/source/sessioninstall/SyncDbusSessionHelper.cxx
shell/source/sessioninstall/SyncDbusSessionHelper.hxx
shell/source/tools/lngconvex/cmdline.cxx
shell/source/tools/lngconvex/cmdline.hxx
shell/source/tools/lngconvex/lngconvex.cxx
shell/source/tools/regsvrex/regsvrex.cxx
shell/source/unix/exec/shellexec.cxx
@@ -11531,7 +11516,6 @@ shell/source/win32/ooofilereader/basereader.cxx
shell/source/win32/ooofilereader/contentreader.cxx
shell/source/win32/ooofilereader/dummytag.hxx
shell/source/win32/ooofilereader/itag.hxx
shell/source/win32/ooofilereader/keywordstag.cxx
shell/source/win32/ooofilereader/keywordstag.hxx
shell/source/win32/ooofilereader/metainforeader.cxx
shell/source/win32/ooofilereader/simpletag.cxx
@@ -11571,7 +11555,6 @@ shell/source/win32/spsupp/spsuppServ.cxx
shell/source/win32/workbench/TestSmplMail.cxx
shell/source/win32/workbench/TestSysShExec.cxx
shell/source/win32/zipfile/zipexcptn.cxx
shell/source/win32/zipfile/zipexcptn.hxx
shell/source/win32/zipfile/zipfile.cxx
slideshow/source/engine/activities/accumulation.hxx
slideshow/source/engine/activities/activitiesfactory.cxx