tdf#123936 Formatting files in module comphelper with clang-format

Change-Id: I01cf258f8fedb4d98f64d2a18735764463f1b2af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105653
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
This commit is contained in:
Philipp Hofer
2020-11-12 12:51:27 +01:00
committed by Christian Lohmaier
parent 79368f8102
commit d66683f86a
7 changed files with 52 additions and 74 deletions

View File

@@ -30,12 +30,11 @@
using namespace css;
namespace {
namespace
{
class Base64Test : public CppUnit::TestFixture
{
public:
void testBase64Encode();
void testBase64Decode();
void testBase64EncodeForOStringBuffer();
@@ -73,15 +72,18 @@ void Base64Test::testBase64Decode()
uno::Sequence<sal_Int8> expectedSequence = { 0, 0, 0, 0, 0, 1, 2, 3 };
comphelper::Base64::decode(decodedSequence, "AAAAAAABAgM=");
CPPUNIT_ASSERT(std::equal(expectedSequence.begin(), expectedSequence.end(), decodedSequence.begin()));
CPPUNIT_ASSERT(
std::equal(expectedSequence.begin(), expectedSequence.end(), decodedSequence.begin()));
expectedSequence = { 5, 2, 3, 0, 0, 1, 2, 3 };
comphelper::Base64::decode(decodedSequence, "BQIDAAABAgM=");
CPPUNIT_ASSERT(std::equal(expectedSequence.begin(), expectedSequence.end(), decodedSequence.begin()));
CPPUNIT_ASSERT(
std::equal(expectedSequence.begin(), expectedSequence.end(), decodedSequence.begin()));
expectedSequence = { sal_Int8(sal_uInt8(200)), 31, 77, 111, 0, 1, 2, 3 };
comphelper::Base64::decode(decodedSequence, "yB9NbwABAgM=");
CPPUNIT_ASSERT(std::equal(expectedSequence.begin(), expectedSequence.end(), decodedSequence.begin()));
CPPUNIT_ASSERT(
std::equal(expectedSequence.begin(), expectedSequence.end(), decodedSequence.begin()));
}
void Base64Test::testBase64EncodeForOStringBuffer()
@@ -105,7 +107,6 @@ void Base64Test::testBase64EncodeForOStringBuffer()
}
CPPUNIT_TEST_SUITE_REGISTRATION(Base64Test);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -26,11 +26,13 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/plugin/TestPlugIn.h>
namespace {
class Test: public CppUnit::TestFixture {
namespace
{
class Test : public CppUnit::TestFixture
{
public:
void test() {
void test()
{
css::uno::Reference<css::uno::XInterface> ref1(new cppu::OWeakObject);
css::uno::Reference<css::uno::XInterface> ref2(new cppu::OWeakObject);
css::uno::Reference<css::uno::XInterface> ref3(new cppu::OWeakObject);
@@ -54,7 +56,6 @@ public:
};
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -22,8 +22,6 @@
#include <comphelper/fileurl.hxx>
#include <rtl/ustring.hxx>
bool comphelper::isFileUrl(OUString const & url) {
return url.startsWithIgnoreAsciiCase("file:");
}
bool comphelper::isFileUrl(OUString const& url) { return url.startsWithIgnoreAsciiCase("file:"); }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -27,7 +27,6 @@
namespace comphelper::rng
{
// underlying random number generator
// std::mt19937 implements the Mersenne twister algorithm which
// is fast and has good statistical properties, it produces integers
@@ -36,8 +35,8 @@ namespace comphelper::rng
// http://en.wikipedia.org/wiki/Mersenne_twister
#define STD_RNG_ALGO std::mt19937
namespace {
namespace
{
struct RandomNumberGenerator
{
std::mutex mutex;
@@ -75,8 +74,9 @@ struct RandomNumberGenerator
}
};
class theRandomNumberGenerator : public rtl::Static<RandomNumberGenerator, theRandomNumberGenerator> {};
class theRandomNumberGenerator : public rtl::Static<RandomNumberGenerator, theRandomNumberGenerator>
{
};
}
// uniform ints [a,b] distribution

View File

@@ -16,8 +16,8 @@
#include <com/sun/star/ucb/InteractiveNetworkException.hpp>
#include <com/sun/star/ucb/UnsupportedDataSinkException.hpp>
namespace comphelper {
namespace comphelper
{
/// Will handle com::sun::star::ucb::InteractiveIOException and derived classes
const sal_Int32 HANDLE_INTERACTIVEIOEXCEPTION = 0;
/// Will handle com::sun::star::ucb::UnsupportedDataSinkException
@@ -69,9 +69,7 @@ SimpleFileAccessInteraction::SimpleFileAccessInteraction(
setInterceptions(lInterceptions);
}
SimpleFileAccessInteraction::~SimpleFileAccessInteraction()
{
}
SimpleFileAccessInteraction::~SimpleFileAccessInteraction() {}
ucbhelper::InterceptedInteraction::EInterceptionState SimpleFileAccessInteraction::intercepted(
const ::ucbhelper::InterceptedInteraction::InterceptedRequest& aRequest,
@@ -119,10 +117,9 @@ ucbhelper::InterceptedInteraction::EInterceptionState SimpleFileAccessInteractio
// any selection...
if (bAbort)
{
css::uno::Reference< css::task::XInteractionContinuation > xAbort =
::ucbhelper::InterceptedInteraction::extractContinuation(
xRequest->getContinuations(),
cppu::UnoType<css::task::XInteractionAbort>::get() );
css::uno::Reference<css::task::XInteractionContinuation> xAbort
= ::ucbhelper::InterceptedInteraction::extractContinuation(
xRequest->getContinuations(), cppu::UnoType<css::task::XInteractionAbort>::get());
if (!xAbort.is())
return ::ucbhelper::InterceptedInteraction::E_NO_CONTINUATION_FOUND;
return ::ucbhelper::InterceptedInteraction::E_INTERCEPTED;

View File

@@ -27,11 +27,8 @@
#include <typelib/typedescription.hxx>
#include <sal/log.hxx>
namespace comphelper
{
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::awt;
using namespace ::com::sun::star::lang;
@@ -44,7 +41,6 @@ sal_Int64 getINT64(const Any& _rAny)
return nReturn;
}
sal_Int32 getINT32(const Any& _rAny)
{
sal_Int32 nReturn = 0;
@@ -53,7 +49,6 @@ sal_Int32 getINT32(const Any& _rAny)
return nReturn;
}
sal_Int16 getINT16(const Any& _rAny)
{
sal_Int16 nReturn = 0;
@@ -62,7 +57,6 @@ sal_Int16 getINT16(const Any& _rAny)
return nReturn;
}
double getDouble(const Any& _rAny)
{
double nReturn = 0.0;
@@ -71,7 +65,6 @@ double getDouble(const Any& _rAny)
return nReturn;
}
float getFloat(const Any& _rAny)
{
float nReturn = 0.0;
@@ -80,7 +73,6 @@ float getFloat(const Any& _rAny)
return nReturn;
}
OUString getString(const Any& _rAny)
{
OUString nReturn;
@@ -89,7 +81,6 @@ OUString getString(const Any& _rAny)
return nReturn;
}
bool getBOOL(const Any& _rAny)
{
bool bReturn = false;
@@ -100,7 +91,6 @@ bool getBOOL(const Any& _rAny)
return bReturn;
}
sal_Int32 getEnumAsINT32(const Any& _rAny)
{
sal_Int32 nReturn = 0;
@@ -109,7 +99,6 @@ sal_Int32 getEnumAsINT32(const Any& _rAny)
return nReturn;
}
FontDescriptor getDefaultFont()
{
FontDescriptor aReturn;
@@ -119,7 +108,6 @@ FontDescriptor getDefaultFont()
return aReturn;
}
bool isAssignableFrom(const Type& _rAssignable, const Type& _rFrom)
{
// get the type lib descriptions
@@ -142,8 +130,8 @@ Type getSequenceElementType(const Type& _rSequenceType)
return Type();
TypeDescription aTD(_rSequenceType);
typelib_IndirectTypeDescription* pSequenceTD =
reinterpret_cast< typelib_IndirectTypeDescription* >(aTD.get());
typelib_IndirectTypeDescription* pSequenceTD
= reinterpret_cast<typelib_IndirectTypeDescription*>(aTD.get());
OSL_ASSERT(pSequenceTD && pSequenceTD->pType);
if (pSequenceTD && pSequenceTD->pType)
@@ -154,5 +142,4 @@ Type getSequenceElementType(const Type& _rSequenceType)
} // namespace comphelper
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -1460,11 +1460,9 @@ codemaker/source/javamaker/javatype.hxx
comphelper/qa/container/comphelper_ifcontainer.cxx
comphelper/qa/container/testifcontainer.cxx
comphelper/qa/string/test_string.cxx
comphelper/qa/unit/base64_test.cxx
comphelper/qa/unit/syntaxhighlighttest.cxx
comphelper/qa/unit/test_hash.cxx
comphelper/qa/unit/variadictemplates.cxx
comphelper/qa/weakbag/test_weakbag.cxx
comphelper/source/compare/AnyCompareFactory.cxx
comphelper/source/container/IndexedPropertyValuesContainer.cxx
comphelper/source/container/NamedPropertyValuesContainer.cxx
@@ -1499,7 +1497,6 @@ comphelper/source/misc/docpasswordrequest.cxx
comphelper/source/misc/documentinfo.cxx
comphelper/source/misc/evtlistenerhlp.cxx
comphelper/source/misc/evtmethodhelper.cxx
comphelper/source/misc/fileurl.cxx
comphelper/source/misc/getexpandeduri.cxx
comphelper/source/misc/hash.cxx
comphelper/source/misc/instancelocker.cxx
@@ -1516,11 +1513,9 @@ comphelper/source/misc/officerestartmanager.cxx
comphelper/source/misc/officerestartmanager.hxx
comphelper/source/misc/profilezone.cxx
comphelper/source/misc/proxyaggregation.cxx
comphelper/source/misc/random.cxx
comphelper/source/misc/sequenceashashmap.cxx
comphelper/source/misc/servicedecl.cxx
comphelper/source/misc/sharedmutex.cxx
comphelper/source/misc/simplefileaccessinteraction.cxx
comphelper/source/misc/solarmutex.cxx
comphelper/source/misc/stillreadwriteinteraction.cxx
comphelper/source/misc/storagehelper.cxx
@@ -1528,7 +1523,6 @@ comphelper/source/misc/string.cxx
comphelper/source/misc/synchronousdispatch.cxx
comphelper/source/misc/syntaxhighlight.cxx
comphelper/source/misc/threadpool.cxx
comphelper/source/misc/types.cxx
comphelper/source/misc/weak.cxx
comphelper/source/misc/weakeventlistener.cxx
comphelper/source/misc/xmlsechelper.cxx