summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorPhilipp Hofer <philipp.hofer@protonmail.com>2020-11-12 12:48:50 +0100
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2020-11-13 14:31:50 +0100
commit16389aae367ebfa8ce19f8ee1c26232fec7ff729 (patch)
tree7aaadc9979fba948691e66ee3ea92cea3b69d0bd /basic
parent0eaf2092940dc604926d31ef11b6ffb07abedc5a (diff)
tdf#123936 Formatting files in module basic with clang-format
Change-Id: I87736d6f1a1d069c990b4e7b9ca291634ab4fb44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105646 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'basic')
-rw-r--r--basic/inc/global.hxx5
-rw-r--r--basic/inc/sb.hxx4
-rw-r--r--basic/inc/sbxbase.hxx10
-rw-r--r--basic/inc/sbxfac.hxx6
-rw-r--r--basic/qa/cppunit/basictest.hxx10
-rw-r--r--basic/qa/cppunit/test_scanner.cxx143
-rw-r--r--basic/source/inc/errobject.hxx11
-rw-r--r--basic/source/inc/sbjsmeth.hxx6
-rw-r--r--basic/source/inc/sbjsmod.hxx10
-rw-r--r--basic/source/inc/stdobj.hxx11
-rw-r--r--basic/source/runtime/comenumwrapper.hxx10
-rw-r--r--basic/source/uno/modsizeexceeded.cxx19
12 files changed, 123 insertions, 122 deletions
diff --git a/basic/inc/global.hxx b/basic/inc/global.hxx
index aa101a562ced..0f380cad3fdd 100644
--- a/basic/inc/global.hxx
+++ b/basic/inc/global.hxx
@@ -9,8 +9,9 @@
#pragma once
-namespace utl {
- class TransliterationWrapper;
+namespace utl
+{
+class TransliterationWrapper;
}
class SbGlobal
diff --git a/basic/inc/sb.hxx b/basic/inc/sb.hxx
index 4f3132fcf569..f94c52a6e045 100644
--- a/basic/inc/sb.hxx
+++ b/basic/inc/sb.hxx
@@ -22,8 +22,8 @@
#include <basic/sbxobj.hxx>
// create object from user-type (+StringID+StringID)
-SbxObject* createUserTypeImpl( const OUString& rClassName );
+SbxObject* createUserTypeImpl(const OUString& rClassName);
-SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj );
+SbxObject* cloneTypeObjectImpl(const SbxObject& rTypeObj);
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basic/inc/sbxbase.hxx b/basic/inc/sbxbase.hxx
index 40255c485a8f..80552c2fbf08 100644
--- a/basic/inc/sbxbase.hxx
+++ b/basic/inc/sbxbase.hxx
@@ -35,15 +35,15 @@ class SbxBasicFormater;
// AppData structure for SBX:
struct SbxAppData
{
- ErrCode eErrCode; // Error code
- SbxVariableRef m_aGlobErr; // Global error object
+ ErrCode eErrCode; // Error code
+ SbxVariableRef m_aGlobErr; // Global error object
std::vector<SbxFactory*> m_Factories; // these are owned by fields in SbiGlobals
- tools::SvRef<SvRefBase> mrImplRepository;
+ tools::SvRef<SvRefBase> mrImplRepository;
// Pointer to Format()-Command helper class
- std::unique_ptr<SbxBasicFormater> pBasicFormater;
+ std::unique_ptr<SbxBasicFormater> pBasicFormater;
- LanguageType eBasicFormaterLangType;
+ LanguageType eBasicFormaterLangType;
// It might be useful to store this class 'global' because some string resources are saved here
SbxAppData();
diff --git a/basic/inc/sbxfac.hxx b/basic/inc/sbxfac.hxx
index 7e92f895adaf..28257b17a6d7 100644
--- a/basic/inc/sbxfac.hxx
+++ b/basic/inc/sbxfac.hxx
@@ -28,9 +28,9 @@ class SbxFactory
{
public:
virtual ~SbxFactory();
- SbxFactory() {}
- virtual SbxBase* Create( sal_uInt16 nSbxId, sal_uInt32 );
- virtual SbxObject* CreateObject( const OUString& );
+ SbxFactory() {}
+ virtual SbxBase* Create(sal_uInt16 nSbxId, sal_uInt32);
+ virtual SbxObject* CreateObject(const OUString&);
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basic/qa/cppunit/basictest.hxx b/basic/qa/cppunit/basictest.hxx
index f5fb79f557ba..c0afeb5bd18c 100644
--- a/basic/qa/cppunit/basictest.hxx
+++ b/basic/qa/cppunit/basictest.hxx
@@ -29,21 +29,21 @@ private:
StarBASICRef mpBasic;
void InitSnippet();
- void MakeModule( const OUString& sSource );
+ void MakeModule(const OUString& sSource);
public:
- explicit MacroSnippet( const OUString& sSource );
+ explicit MacroSnippet(const OUString& sSource);
MacroSnippet();
- void LoadSourceFromFile( const OUString& sMacroFileURL );
+ void LoadSourceFromFile(const OUString& sMacroFileURL);
- SbxVariableRef Run( const css::uno::Sequence< css::uno::Any >& rArgs );
+ SbxVariableRef Run(const css::uno::Sequence<css::uno::Any>& rArgs);
SbxVariableRef Run();
bool Compile();
- DECL_LINK( BasicErrorHdl, StarBASIC *, bool );
+ DECL_LINK(BasicErrorHdl, StarBASIC*, bool);
bool HasError() const;
const ErrCode& getError() const;
diff --git a/basic/qa/cppunit/test_scanner.cxx b/basic/qa/cppunit/test_scanner.cxx
index 7515b0d07862..ed340755deba 100644
--- a/basic/qa/cppunit/test_scanner.cxx
+++ b/basic/qa/cppunit/test_scanner.cxx
@@ -19,22 +19,22 @@
namespace
{
- struct Symbol
- {
+struct Symbol
+{
sal_uInt16 line;
sal_uInt16 col1;
OUString text;
double number;
SbxDataType type;
bool ws;
- };
+};
- /**
+/**
* Perform tests on Scanner.
*/
- class ScannerTest : public CppUnit::TestFixture
- {
- private:
+class ScannerTest : public CppUnit::TestFixture
+{
+private:
void testBlankLines();
void testOperators();
void testAlphanum();
@@ -67,44 +67,44 @@ namespace
// End of test suite definition
CPPUNIT_TEST_SUITE_END();
- };
+};
- const OUString cr = "\n";
- const OUString rem = "REM";
- const OUString asdf = "asdf";
- const OUString dot = ".";
- const OUString goto_ = "goto";
- const OUString excl = "!";
+const OUString cr = "\n";
+const OUString rem = "REM";
+const OUString asdf = "asdf";
+const OUString dot = ".";
+const OUString goto_ = "goto";
+const OUString excl = "!";
- std::vector<Symbol> getSymbols(const OUString& source, sal_Int32& errors, bool bCompatible = false)
- {
+std::vector<Symbol> getSymbols(const OUString& source, sal_Int32& errors, bool bCompatible = false)
+{
std::vector<Symbol> symbols;
SbiScanner scanner(source);
scanner.EnableErrors();
scanner.SetCompatible(bCompatible);
- while(scanner.NextSym())
+ while (scanner.NextSym())
{
- Symbol symbol;
- symbol.line = scanner.GetLine();
- symbol.col1 = scanner.GetCol1();
- symbol.text = scanner.GetSym();
- symbol.number = scanner.GetDbl();
- symbol.type = scanner.GetType();
- symbol.ws = scanner.WhiteSpace();
- symbols.push_back(symbol);
+ Symbol symbol;
+ symbol.line = scanner.GetLine();
+ symbol.col1 = scanner.GetCol1();
+ symbol.text = scanner.GetSym();
+ symbol.number = scanner.GetDbl();
+ symbol.type = scanner.GetType();
+ symbol.ws = scanner.WhiteSpace();
+ symbols.push_back(symbol);
}
errors = scanner.GetErrors();
return symbols;
- }
+}
- std::vector<Symbol> getSymbols(const OUString& source, bool bCompatible = false)
- {
+std::vector<Symbol> getSymbols(const OUString& source, bool bCompatible = false)
+{
sal_Int32 i;
return getSymbols(source, i, bCompatible);
- }
+}
- void ScannerTest::testBlankLines()
- {
+void ScannerTest::testBlankLines()
+{
std::vector<Symbol> symbols;
symbols = getSymbols("");
CPPUNIT_ASSERT(symbols.empty());
@@ -156,10 +156,10 @@ namespace
CPPUNIT_ASSERT_EQUAL(size_t(1), symbols.size());
CPPUNIT_ASSERT_EQUAL(cr, symbols[0].text);
CPPUNIT_ASSERT_EQUAL(SbxVARIANT, symbols[0].type);
- }
+}
- void ScannerTest::testOperators()
- {
+void ScannerTest::testOperators()
+{
const OUString sourceE("=");
const OUString sourceLT("<");
const OUString sourceGT(">");
@@ -235,10 +235,10 @@ namespace
CPPUNIT_ASSERT_EQUAL(SbxVARIANT, symbols[0].type);
CPPUNIT_ASSERT_EQUAL(cr, symbols[1].text);
CPPUNIT_ASSERT_EQUAL(SbxVARIANT, symbols[1].type);
- }
+}
- void ScannerTest::testAlphanum()
- {
+void ScannerTest::testAlphanum()
+{
const OUString source1("asdfghefg");
const OUString source3("AdfsaAUdsl10987");
const OUString source4("asdfa_mnvcnm");
@@ -359,10 +359,10 @@ namespace
CPPUNIT_ASSERT_EQUAL(SbxVARIANT, symbols[1].type);
CPPUNIT_ASSERT_EQUAL(cr, symbols[2].text);
CPPUNIT_ASSERT_EQUAL(SbxVARIANT, symbols[2].type);
- }
+}
- void ScannerTest::testComments()
- {
+void ScannerTest::testComments()
+{
std::vector<Symbol> symbols;
symbols = getSymbols("REM asdf");
@@ -417,10 +417,10 @@ namespace
CPPUNIT_ASSERT_EQUAL(SbxVARIANT, symbols[2].type);
CPPUNIT_ASSERT_EQUAL(rem, symbols[3].text);
CPPUNIT_ASSERT_EQUAL(SbxVARIANT, symbols[3].type);
- }
+}
- void ScannerTest::testGoto()
- {
+void ScannerTest::testGoto()
+{
std::vector<Symbol> symbols;
symbols = getSymbols("goto");
@@ -449,10 +449,10 @@ namespace
CPPUNIT_ASSERT_EQUAL(SbxVARIANT, symbols[2].type);
CPPUNIT_ASSERT_EQUAL(cr, symbols[3].text);
CPPUNIT_ASSERT_EQUAL(SbxVARIANT, symbols[3].type);
- }
+}
- void ScannerTest::testGotoCompatible()
- {
+void ScannerTest::testGotoCompatible()
+{
std::vector<Symbol> symbols;
symbols = getSymbols("goto", true);
@@ -471,10 +471,10 @@ namespace
CPPUNIT_ASSERT_EQUAL(cr, symbols[1].text);
CPPUNIT_ASSERT_EQUAL(OUString("to"), symbols[2].text);
CPPUNIT_ASSERT_EQUAL(cr, symbols[3].text);
- }
+}
- void ScannerTest::testExclamation()
- {
+void ScannerTest::testExclamation()
+{
std::vector<Symbol> symbols;
symbols = getSymbols("asdf!asdf");
@@ -513,10 +513,10 @@ namespace
CPPUNIT_ASSERT_EQUAL(size_t(2), symbols.size());
CPPUNIT_ASSERT_EQUAL(excl, symbols[0].text);
CPPUNIT_ASSERT_EQUAL(cr, symbols[1].text);
- }
+}
- void ScannerTest::testNumbers()
- {
+void ScannerTest::testNumbers()
+{
std::vector<Symbol> symbols;
sal_Int32 errors;
@@ -642,7 +642,10 @@ namespace
CPPUNIT_ASSERT_EQUAL(cr, symbols[5].text);
CPPUNIT_ASSERT_EQUAL(0u, static_cast<unsigned int>(errors));
- symbols = getSymbols("1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", errors);
+ symbols = getSymbols("1."
+ "0000000000000000000000000000000000000000000000000000000000000000000000000"
+ "000000000000000000000000000000000000000000000000000",
+ errors);
CPPUNIT_ASSERT_EQUAL(size_t(2), symbols.size());
CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, symbols[0].number, 1E-12);
CPPUNIT_ASSERT_EQUAL(SbxDOUBLE, symbols[0].type);
@@ -652,13 +655,13 @@ namespace
CPPUNIT_ASSERT_EQUAL(1u, static_cast<unsigned int>(errors)); // HACK
double fInf = 0.0;
- rtl::math::setInf( &fInf, false);
+ rtl::math::setInf(&fInf, false);
symbols = getSymbols("10e308", errors);
CPPUNIT_ASSERT_EQUAL(size_t(2), symbols.size());
CPPUNIT_ASSERT_EQUAL(fInf, symbols[0].number);
CPPUNIT_ASSERT_EQUAL(SbxDOUBLE, symbols[0].type);
CPPUNIT_ASSERT_EQUAL(cr, symbols[1].text);
- CPPUNIT_ASSERT_EQUAL(1u, static_cast<unsigned int>(errors)); // math error, overflow
+ CPPUNIT_ASSERT_EQUAL(1u, static_cast<unsigned int>(errors)); // math error, overflow
// trailing data type character % = SbxINTEGER
symbols = getSymbols("1.23%");
@@ -709,10 +712,10 @@ namespace
CPPUNIT_ASSERT_EQUAL(cr, symbols[1].text);
// ERRCODE_BASIC_SYNTAX
CPPUNIT_ASSERT_EQUAL(1u, static_cast<unsigned int>(errors));
- }
+}
- void ScannerTest::testDataType()
- {
+void ScannerTest::testDataType()
+{
std::vector<Symbol> symbols;
symbols = getSymbols("asdf%");
@@ -749,10 +752,10 @@ namespace
CPPUNIT_ASSERT_EQUAL(size_t(2), symbols.size());
CPPUNIT_ASSERT_EQUAL(SbxVARIANT, symbols[0].type);
CPPUNIT_ASSERT_EQUAL(cr, symbols[1].text);
- }
+}
- void ScannerTest::testHexOctal()
- {
+void ScannerTest::testHexOctal()
+{
sal_Int32 errors;
std::vector<Symbol> symbols;
@@ -1031,10 +1034,10 @@ namespace
CPPUNIT_ASSERT_EQUAL(cr, symbols[1].text);
// ERRCODE_BASIC_MATH_OVERFLOW
CPPUNIT_ASSERT_EQUAL(1u, static_cast<unsigned int>(errors));
- }
+}
- void ScannerTest::testTdf103104()
- {
+void ScannerTest::testTdf103104()
+{
std::vector<Symbol> symbols;
symbols = getSymbols("asdf _\n asdf");
@@ -1061,10 +1064,10 @@ namespace
CPPUNIT_ASSERT_EQUAL(asdf, symbols[2].text);
CPPUNIT_ASSERT(!symbols[2].ws);
CPPUNIT_ASSERT_EQUAL(cr, symbols[3].text);
- }
+}
- void ScannerTest::testTdf136032()
- {
+void ScannerTest::testTdf136032()
+{
std::vector<Symbol> symbols;
sal_Int32 errors;
@@ -1076,10 +1079,10 @@ namespace
symbols = getSymbols("Print #i, \"A#B\"", errors);
CPPUNIT_ASSERT_EQUAL(size_t(5), symbols.size());
CPPUNIT_ASSERT_EQUAL(0u, static_cast<unsigned int>(errors));
- }
+}
- // Put the test suite in the registry
- CPPUNIT_TEST_SUITE_REGISTRATION(ScannerTest);
+// Put the test suite in the registry
+CPPUNIT_TEST_SUITE_REGISTRATION(ScannerTest);
} // namespace
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/basic/source/inc/errobject.hxx b/basic/source/inc/errobject.hxx
index 95900abeb46a..c43e88667f80 100644
--- a/basic/source/inc/errobject.hxx
+++ b/basic/source/inc/errobject.hxx
@@ -21,21 +21,20 @@
#include "sbunoobj.hxx"
#include <ooo/vba/XErrObject.hpp>
-
class SbxErrObject : public SbUnoObject
{
class ErrObject* m_pErrObject;
- css::uno::Reference< ooo::vba::XErrObject > m_xErr;
+ css::uno::Reference<ooo::vba::XErrObject> m_xErr;
- SbxErrObject( const OUString& aName_, const css::uno::Any& aUnoObj_ );
+ SbxErrObject(const OUString& aName_, const css::uno::Any& aUnoObj_);
virtual ~SbxErrObject() override;
public:
- static SbxVariableRef const & getErrObject();
- static css::uno::Reference< ooo::vba::XErrObject > const & getUnoErrObject();
+ static SbxVariableRef const& getErrObject();
+ static css::uno::Reference<ooo::vba::XErrObject> const& getUnoErrObject();
/// @throws css::uno::RuntimeException
- void setNumberAndDescription( ::sal_Int32 _number, const OUString& _description );
+ void setNumberAndDescription(::sal_Int32 _number, const OUString& _description);
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basic/source/inc/sbjsmeth.hxx b/basic/source/inc/sbjsmeth.hxx
index b813eebd9183..6121d4c98f17 100644
--- a/basic/source/inc/sbjsmeth.hxx
+++ b/basic/source/inc/sbjsmeth.hxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
#pragma once
#include <basic/sbmeth.hxx>
@@ -29,11 +28,10 @@
class SbJScriptMethod : public SbMethod
{
public:
- SbJScriptMethod( SbxDataType );
+ SbJScriptMethod(SbxDataType);
virtual ~SbJScriptMethod() override;
- SBX_DECL_PERSIST_NODATA(SBXID_JSCRIPTMETH,2);
+ SBX_DECL_PERSIST_NODATA(SBXID_JSCRIPTMETH, 2);
};
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basic/source/inc/sbjsmod.hxx b/basic/source/inc/sbjsmod.hxx
index 2219c64db004..59be6230bbaf 100644
--- a/basic/source/inc/sbjsmod.hxx
+++ b/basic/source/inc/sbjsmod.hxx
@@ -27,12 +27,12 @@
class SbJScriptModule : public SbModule
{
- virtual bool LoadData( SvStream&, sal_uInt16 ) override;
- virtual bool StoreData( SvStream& ) const override;
+ virtual bool LoadData(SvStream&, sal_uInt16) override;
+ virtual bool StoreData(SvStream&) const override;
+
public:
- SBX_DECL_PERSIST_NODATA(SBXID_JSCRIPTMOD,1);
- SbJScriptModule(); // hand through
+ SBX_DECL_PERSIST_NODATA(SBXID_JSCRIPTMOD, 1);
+ SbJScriptModule(); // hand through
};
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basic/source/inc/stdobj.hxx b/basic/source/inc/stdobj.hxx
index e488648c1128..39b353306203 100644
--- a/basic/source/inc/stdobj.hxx
+++ b/basic/source/inc/stdobj.hxx
@@ -30,12 +30,13 @@ class SbiStdObject : public SbxObject
virtual ~SbiStdObject() override;
using SbxVariable::GetInfo;
- static SbxInfo* GetInfo( short );
- virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
+ static SbxInfo* GetInfo(short);
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
+
public:
- SbiStdObject( const OUString&, StarBASIC* );
- virtual SbxVariable* Find( const OUString&, SbxClassType ) override;
- virtual void SetModified( bool ) override;
+ SbiStdObject(const OUString&, StarBASIC*);
+ virtual SbxVariable* Find(const OUString&, SbxClassType) override;
+ virtual void SetModified(bool) override;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basic/source/runtime/comenumwrapper.hxx b/basic/source/runtime/comenumwrapper.hxx
index 5637a8b7c58b..560829b331bb 100644
--- a/basic/source/runtime/comenumwrapper.hxx
+++ b/basic/source/runtime/comenumwrapper.hxx
@@ -24,15 +24,15 @@
#include <cppuhelper/implbase.hxx>
-class ComEnumerationWrapper : public ::cppu::WeakImplHelper< css::container::XEnumeration >
+class ComEnumerationWrapper : public ::cppu::WeakImplHelper<css::container::XEnumeration>
{
- css::uno::Reference< css::script::XInvocation > m_xInvocation;
+ css::uno::Reference<css::script::XInvocation> m_xInvocation;
sal_Int32 m_nCurInd;
public:
- explicit ComEnumerationWrapper( const css::uno::Reference< css::script::XInvocation >& xInvocation )
- : m_xInvocation( xInvocation )
- , m_nCurInd( 0 )
+ explicit ComEnumerationWrapper(const css::uno::Reference<css::script::XInvocation>& xInvocation)
+ : m_xInvocation(xInvocation)
+ , m_nCurInd(0)
{
}
diff --git a/basic/source/uno/modsizeexceeded.cxx b/basic/source/uno/modsizeexceeded.cxx
index a54b426c719e..897c460f5940 100644
--- a/basic/source/uno/modsizeexceeded.cxx
+++ b/basic/source/uno/modsizeexceeded.cxx
@@ -27,7 +27,7 @@ using namespace com::sun::star;
using namespace cppu;
using namespace osl;
-ModuleSizeExceeded::ModuleSizeExceeded( const std::vector< OUString >& sModules )
+ModuleSizeExceeded::ModuleSizeExceeded(const std::vector<OUString>& sModules)
{
script::ModuleSizeExceededRequest aReq;
aReq.Names = comphelper::containerToSequence(sModules);
@@ -36,24 +36,23 @@ ModuleSizeExceeded::ModuleSizeExceeded( const std::vector< OUString >& sModules
m_xAbort = new comphelper::OInteractionAbort;
m_xApprove = new comphelper::OInteractionApprove;
- m_lContinuations.realloc( 2 );
- m_lContinuations[0] = m_xApprove;
+ m_lContinuations.realloc(2);
+ m_lContinuations[0] = m_xApprove;
m_lContinuations[1] = m_xAbort;
}
-bool
-ModuleSizeExceeded::isAbort() const
+bool ModuleSizeExceeded::isAbort() const
{
- comphelper::OInteractionAbort* pBase = static_cast< comphelper::OInteractionAbort* >( m_xAbort.get() );
+ comphelper::OInteractionAbort* pBase
+ = static_cast<comphelper::OInteractionAbort*>(m_xAbort.get());
return pBase->wasSelected();
}
-bool
-ModuleSizeExceeded::isApprove() const
+bool ModuleSizeExceeded::isApprove() const
{
- comphelper::OInteractionApprove* pBase = static_cast< comphelper::OInteractionApprove* >( m_xApprove.get() );
+ comphelper::OInteractionApprove* pBase
+ = static_cast<comphelper::OInteractionApprove*>(m_xApprove.get());
return pBase->wasSelected();
}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */