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:
parent
02d65d7a19
commit
7c9a2c4b97
@ -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
|
||||
|
@ -21,7 +21,7 @@
|
||||
#define INCLUDED_SHELL_INC_INTERNAL_GLOBAL_HXX
|
||||
|
||||
#if !defined WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
|
||||
|
@ -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
|
||||
|
@ -35,9 +35,9 @@ class CMetaInfoReader : public CBaseReader
|
||||
public:
|
||||
virtual ~CMetaInfoReader() override;
|
||||
|
||||
CMetaInfoReader( const Filepath_t& DocumentName );
|
||||
CMetaInfoReader(const Filepath_t& DocumentName);
|
||||
|
||||
CMetaInfoReader( StreamInterface* stream );
|
||||
CMetaInfoReader(StreamInterface* stream);
|
||||
|
||||
/** check if the Tag is in the target meta.xml 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
|
||||
@ -61,7 +60,7 @@ public:
|
||||
@param AttributeName
|
||||
the name of the attribute.
|
||||
*/
|
||||
bool hasTagAttribute(const std::wstring& TagName, const std::wstring& AttributeName);
|
||||
bool hasTagAttribute(const std::wstring& TagName, const std::wstring& AttributeName);
|
||||
|
||||
/** Get a specific attribute content.
|
||||
|
||||
@ -70,14 +69,13 @@ public:
|
||||
@param AttributeName
|
||||
the name of the attribute.
|
||||
*/
|
||||
std::wstring getTagAttribute(const std::wstring& TagName, const std::wstring& AttributeName);
|
||||
std::wstring getTagAttribute(const std::wstring& TagName, const std::wstring& AttributeName);
|
||||
|
||||
/** Get the default language of the whole document.
|
||||
*/
|
||||
LocaleSet_t getDefaultLocale( );
|
||||
LocaleSet_t getDefaultLocale();
|
||||
|
||||
protected: // protected because its only an implementation relevant class
|
||||
|
||||
/** start_element occurs when a tag is start.
|
||||
|
||||
@param raw_name
|
||||
@ -87,10 +85,8 @@ 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,
|
||||
const xml_tag_attribute_container_t& attributes) override;
|
||||
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,25 +112,24 @@ 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.
|
||||
|
||||
@param tag_name
|
||||
the name of the tag.
|
||||
*/
|
||||
void saveTagContent( const std::wstring& tag_name );
|
||||
void saveTagContent(const std::wstring& tag_name);
|
||||
|
||||
private:
|
||||
XmlTags_t m_AllMetaInfo;
|
||||
XmlTags_t m_AllMetaInfo;
|
||||
|
||||
private:
|
||||
std::stack<ITag*> m_TagBuilderStack;
|
||||
|
||||
private:
|
||||
CKeywordsTag* m_pKeywords_Builder;
|
||||
CDummyTag* m_pDummy_Builder;
|
||||
CDummyTag* m_pDummy_Builder;
|
||||
CSimpleTag* m_pSimple_Builder;
|
||||
};
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -28,25 +28,27 @@ struct IStream;
|
||||
class BufferStream : public StreamInterface
|
||||
{
|
||||
public:
|
||||
BufferStream(IStream *str);
|
||||
BufferStream(IStream* str);
|
||||
~BufferStream() override;
|
||||
unsigned long sread (unsigned char *vuf, unsigned long size) override;
|
||||
long stell () override;
|
||||
long sseek (long offset, int origin) override;
|
||||
unsigned long sread(unsigned char* vuf, unsigned long size) override;
|
||||
long stell() override;
|
||||
long sseek(long offset, int origin) override;
|
||||
|
||||
private:
|
||||
IStream *stream;
|
||||
IStream* stream;
|
||||
};
|
||||
|
||||
class FileStream : public StreamInterface
|
||||
{
|
||||
public:
|
||||
FileStream(const Filepath_char_t *filename);
|
||||
FileStream(const Filepath_char_t* filename);
|
||||
~FileStream() override;
|
||||
unsigned long sread (unsigned char *buf, unsigned long size) override;
|
||||
long stell () override;
|
||||
long sseek (long offset, int origin) override;
|
||||
unsigned long sread(unsigned char* buf, unsigned long size) override;
|
||||
long stell() override;
|
||||
long sseek(long offset, int origin) override;
|
||||
|
||||
private:
|
||||
FILE *file;
|
||||
FILE* file;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -31,9 +31,9 @@
|
||||
// XmlTags_t, tags defined with tag name and xml tag.
|
||||
// Contents: Definitions of xml tag used in parser.
|
||||
|
||||
typedef std::map<std::wstring, std::wstring> XmlTagAttributes_t;
|
||||
typedef std::pair<std::wstring, XmlTagAttributes_t> XmlTag_t;
|
||||
typedef std::map<std::wstring, XmlTag_t> XmlTags_t;
|
||||
typedef std::map<std::wstring, std::wstring> XmlTagAttributes_t;
|
||||
typedef std::pair<std::wstring, XmlTagAttributes_t> XmlTag_t;
|
||||
typedef std::map<std::wstring, XmlTag_t> XmlTags_t;
|
||||
|
||||
const XmlTag_t EMPTY_XML_TAG = std::make_pair(std::wstring(), XmlTagAttributes_t());
|
||||
|
||||
@ -45,14 +45,14 @@ const XmlTag_t EMPTY_XML_TAG = std::make_pair(std::wstring(), XmlTagAttributes_t
|
||||
|
||||
typedef ::std::wstring Language_t;
|
||||
typedef ::std::wstring Country_t;
|
||||
typedef ::std::pair<Language_t, Country_t > LocaleSet_t;
|
||||
typedef ::std::pair<Language_t, Country_t> LocaleSet_t;
|
||||
|
||||
typedef ::std::wstring Content_t;
|
||||
typedef ::std::pair<LocaleSet_t, Content_t > Chunk_t;
|
||||
typedef ::std::vector< Chunk_t > ChunkBuffer_t;
|
||||
typedef ::std::pair<LocaleSet_t, Content_t> Chunk_t;
|
||||
typedef ::std::vector<Chunk_t> ChunkBuffer_t;
|
||||
|
||||
const LocaleSet_t EMPTY_LOCALE = ::std::make_pair(::std::wstring(), ::std::wstring());
|
||||
const Chunk_t EMPTY_CHUNK = ::std::make_pair( EMPTY_LOCALE, ::std::wstring());
|
||||
const Chunk_t EMPTY_CHUNK = ::std::make_pair(EMPTY_LOCALE, ::std::wstring());
|
||||
|
||||
//+-------------------------------------------------------------------------
|
||||
// Declare: StyleName_t, style name of a style-locale pair.
|
||||
@ -60,18 +60,18 @@ const Chunk_t EMPTY_CHUNK = ::std::make_pair( EMPTY_LOCALE, ::std::wstring());
|
||||
// Contents: Definitions of Style Names.
|
||||
|
||||
typedef ::std::wstring StyleName_t;
|
||||
typedef ::std::pair <StyleName_t, LocaleSet_t> StyleLocalePair_t;
|
||||
typedef ::std::map<StyleName_t, LocaleSet_t> StyleLocaleMap_t;
|
||||
typedef ::std::pair<StyleName_t, LocaleSet_t> StyleLocalePair_t;
|
||||
typedef ::std::map<StyleName_t, LocaleSet_t> StyleLocaleMap_t;
|
||||
|
||||
const StyleLocalePair_t EMPTY_STYLELOCALE_PAIR = ::std::make_pair(::std::wstring(), EMPTY_LOCALE );
|
||||
const StyleLocalePair_t EMPTY_STYLELOCALE_PAIR = ::std::make_pair(::std::wstring(), EMPTY_LOCALE);
|
||||
|
||||
class StreamInterface
|
||||
{
|
||||
public:
|
||||
virtual ~StreamInterface() {}
|
||||
virtual unsigned long sread (unsigned char* vuf, unsigned long size) = 0;
|
||||
virtual long stell () = 0;
|
||||
virtual long sseek (long offset, int origin) = 0;
|
||||
virtual unsigned long sread(unsigned char* vuf, unsigned long size) = 0;
|
||||
virtual long stell() = 0;
|
||||
virtual long sseek(long offset, int origin) = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include <malloc.h>
|
||||
|
||||
#if !defined WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
|
||||
@ -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,33 +68,27 @@ 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 );
|
||||
std::wstring getShortPathName(const std::wstring& aLongName);
|
||||
|
||||
LCID LocaleSetToLCID(const LocaleSet_t& Locale);
|
||||
|
||||
#ifdef DEBUG
|
||||
inline void OutputDebugStringFormatW( LPCWSTR pFormat, ... )
|
||||
inline void OutputDebugStringFormatW(LPCWSTR pFormat, ...)
|
||||
{
|
||||
WCHAR buffer[1024];
|
||||
WCHAR buffer[1024];
|
||||
va_list args;
|
||||
|
||||
va_start( args, pFormat );
|
||||
StringCchVPrintfW( buffer, sizeof(buffer)/sizeof(*buffer), pFormat, args );
|
||||
va_end( args );
|
||||
OutputDebugStringW( buffer );
|
||||
va_start(args, pFormat);
|
||||
StringCchVPrintfW(buffer, sizeof(buffer) / sizeof(*buffer), pFormat, args);
|
||||
va_end(args);
|
||||
OutputDebugStringW(buffer);
|
||||
}
|
||||
#else
|
||||
static inline void OutputDebugStringFormatW( LPCWSTR, ... )
|
||||
{
|
||||
}
|
||||
static inline void OutputDebugStringFormatW(LPCWSTR, ...) {}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
@ -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
|
||||
|
||||
@ -88,9 +85,9 @@ 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:
|
||||
i_xml_parser_event_handler* get_document_handler() const { return document_handler_; }
|
||||
|
||||
private:
|
||||
void init();
|
||||
|
||||
private:
|
||||
|
@ -33,12 +33,11 @@ class StreamInterface;
|
||||
class ZipFile
|
||||
{
|
||||
public:
|
||||
typedef std::vector<std::string> Directory_t;
|
||||
typedef std::vector<std::string> Directory_t;
|
||||
typedef std::unique_ptr<Directory_t> DirectoryPtr_t;
|
||||
typedef std::vector<char> ZipContentBuffer_t;
|
||||
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
|
||||
@ -52,10 +51,9 @@ public:
|
||||
IOException if the specified file doesn't exist
|
||||
AccessViolationException if read access to the file is denied
|
||||
*/
|
||||
static bool IsZipFile(const Filepath_t &FileName);
|
||||
|
||||
static bool IsZipFile(void *stream);
|
||||
static bool IsZipFile(const Filepath_t& FileName);
|
||||
|
||||
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
|
||||
@ -72,12 +70,11 @@ public:
|
||||
IOException if the specified file doesn't exist or is no zip file
|
||||
AccessViolationException if read access to the file is denied
|
||||
*/
|
||||
static bool IsValidZipFileVersionNumber(const Filepath_t &FileName);
|
||||
static bool IsValidZipFileVersionNumber(const Filepath_t& FileName);
|
||||
|
||||
static bool IsValidZipFileVersionNumber(void *stream);
|
||||
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
|
||||
@ -90,10 +87,9 @@ public:
|
||||
WrongZipVersionException if the zip file cannot be uncompressed
|
||||
with the used zlib version
|
||||
*/
|
||||
ZipFile(const Filepath_t &FileName);
|
||||
|
||||
ZipFile(StreamInterface *stream);
|
||||
ZipFile(const Filepath_t& FileName);
|
||||
|
||||
ZipFile(StreamInterface* stream);
|
||||
|
||||
/** Destroys a zip file
|
||||
*/
|
||||
@ -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
|
||||
|
||||
@ -129,10 +126,9 @@ public:
|
||||
iterating over a ZipFileDirectory returned by
|
||||
GetDirectory
|
||||
*/
|
||||
bool HasContent(const std::string &ContentName) const;
|
||||
bool HasContent(const std::string& ContentName) const;
|
||||
|
||||
private:
|
||||
|
||||
/** Returns the length of the longest file name
|
||||
in the current zip file
|
||||
|
||||
@ -141,7 +137,7 @@ private:
|
||||
long GetFileLongestFileNameLength() const;
|
||||
|
||||
private:
|
||||
StreamInterface *m_pStream;
|
||||
StreamInterface* m_pStream;
|
||||
bool m_bShouldFree;
|
||||
};
|
||||
|
||||
|
@ -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,22 +43,17 @@ TestZipImpl::TestZipImpl(StreamInterface *stream) :
|
||||
sort(expectedContents.begin(), expectedContents.end());
|
||||
}
|
||||
|
||||
TestZipImpl::~TestZipImpl()
|
||||
{
|
||||
}
|
||||
TestZipImpl::~TestZipImpl() {}
|
||||
|
||||
bool TestZipImpl::test_directory()
|
||||
{
|
||||
ZipFile::DirectoryPtr_t contents = zipFile.GetDirectory();
|
||||
vector<string> &stringVector = *contents;
|
||||
vector<string>& stringVector = *contents;
|
||||
sort(stringVector.begin(), stringVector.end());
|
||||
return expectedContents == stringVector;
|
||||
}
|
||||
|
||||
bool TestZipImpl::test_hasContentCaseInSensitive()
|
||||
{
|
||||
return zipFile.HasContent("mimetype");
|
||||
}
|
||||
bool TestZipImpl::test_hasContentCaseInSensitive() { return zipFile.HasContent("mimetype"); }
|
||||
|
||||
bool TestZipImpl::test_getContent()
|
||||
{
|
||||
|
@ -30,11 +30,12 @@ using namespace std;
|
||||
|
||||
class TestZipImpl
|
||||
{
|
||||
private:
|
||||
private:
|
||||
ZipFile zipFile;
|
||||
vector<string> expectedContents;
|
||||
public:
|
||||
explicit TestZipImpl(StreamInterface *stream);
|
||||
|
||||
public:
|
||||
explicit TestZipImpl(StreamInterface* stream);
|
||||
~TestZipImpl();
|
||||
bool test_directory();
|
||||
bool test_hasContentCaseInSensitive();
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
#if !defined WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#include <ole2.h>
|
||||
@ -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()
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user