From b536e10390c171e96b6477c04d66023a1da543c4 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 8 Nov 2017 11:28:04 +0100 Subject: Retrofit "KeepEmptyLinesAtTheStartOfBlocks: false" into .clang-format ...even if that can cause reformatting of already formatted code. The problem I came across is that without this something like > namespace { > > void f1(); > > void f2(); > > } (which is quite a common style in the current code base) would be changed to > namespace > { > > void f1(); > > void f2(); > } instead of > namespace > { > void f1(); > > void f2(); > } and I found no other clang-format style option that would result in the presence or absence of an empty line be identical at the start and end of the namespace block. vmiklos asked to reformat the existing new (i.e., non-blacklisted) files at the same time, so this commit includes that. Some of those new files had not been formatted at all, so this commit includes their full reformatting changes. Change-Id: I54daf0c11098d07d02c802104cf7f56372e61f7c Reviewed-on: https://gerrit.libreoffice.org/44450 Reviewed-by: Thorsten Behrens Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- sc/qa/extras/sctableconditionalentryobj.cxx | 31 +++++++++++++++-------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'sc/qa/extras/sctableconditionalentryobj.cxx') diff --git a/sc/qa/extras/sctableconditionalentryobj.cxx b/sc/qa/extras/sctableconditionalentryobj.cxx index 4895d03dc9e1..ad39a74ef20e 100644 --- a/sc/qa/extras/sctableconditionalentryobj.cxx +++ b/sc/qa/extras/sctableconditionalentryobj.cxx @@ -33,8 +33,8 @@ using namespace css; using namespace css::uno; using namespace com::sun::star; -namespace sc_apitest { - +namespace sc_apitest +{ #define NUMBER_OF_TESTS 5 class ScTableConditionalEntryObj : public CalcUnoApiTest, @@ -44,7 +44,7 @@ class ScTableConditionalEntryObj : public CalcUnoApiTest, public: ScTableConditionalEntryObj(); - virtual uno::Reference< uno::XInterface > init() override; + virtual uno::Reference init() override; virtual void setUp() override; virtual void tearDown() override; @@ -63,39 +63,39 @@ public: private: static sal_Int32 nTest; - static uno::Reference< lang::XComponent > mxComponent; - + static uno::Reference mxComponent; }; sal_Int32 ScTableConditionalEntryObj::nTest = 0; -uno::Reference< lang::XComponent > ScTableConditionalEntryObj::mxComponent; +uno::Reference ScTableConditionalEntryObj::mxComponent; ScTableConditionalEntryObj::ScTableConditionalEntryObj() : CalcUnoApiTest("/sc/qa/extras/testdocuments") { } -uno::Reference< uno::XInterface > ScTableConditionalEntryObj::init() +uno::Reference ScTableConditionalEntryObj::init() { // create a calc document if (!mxComponent.is()) mxComponent = loadFromDesktop("private:factory/scalc"); - uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, uno::UNO_QUERY_THROW); + uno::Reference xDoc(mxComponent, uno::UNO_QUERY_THROW); CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); - uno::Reference< container::XIndexAccess > xIndex(xDoc->getSheets(), uno::UNO_QUERY_THROW); - uno::Reference< sheet::XSpreadsheet > xSheet(xIndex->getByIndex(0), uno::UNO_QUERY_THROW); + uno::Reference xIndex(xDoc->getSheets(), uno::UNO_QUERY_THROW); + uno::Reference xSheet(xIndex->getByIndex(0), uno::UNO_QUERY_THROW); xSheet->getCellByPosition(5, 5)->setValue(15); xSheet->getCellByPosition(1, 4)->setValue(10); xSheet->getCellByPosition(2, 0)->setValue(-5.15); - uno::Reference< beans::XPropertySet > xPropSet(xSheet, uno::UNO_QUERY_THROW); - uno::Reference< sheet::XSheetConditionalEntries > xSheetConditionalEntries; - xSheetConditionalEntries.set(xPropSet->getPropertyValue(SC_UNONAME_CONDFMT), uno::UNO_QUERY_THROW); + uno::Reference xPropSet(xSheet, uno::UNO_QUERY_THROW); + uno::Reference xSheetConditionalEntries; + xSheetConditionalEntries.set(xPropSet->getPropertyValue(SC_UNONAME_CONDFMT), + uno::UNO_QUERY_THROW); - uno::Sequence< beans::PropertyValue > aPropValue(5); + uno::Sequence aPropValue(5); aPropValue[0].Name = SC_UNONAME_STYLENAME; aPropValue[0].Value <<= OUString("Result2"); aPropValue[1].Name = SC_UNONAME_FORMULA1; @@ -108,7 +108,8 @@ uno::Reference< uno::XInterface > ScTableConditionalEntryObj::init() aPropValue[4].Value <<= table::CellAddress(0, 1, 5); xSheetConditionalEntries->addNew(aPropValue); - uno::Reference< sheet::XSheetConditionalEntry > xSheetConditionalEntry(xSheetConditionalEntries->getByIndex(0), uno::UNO_QUERY_THROW); + uno::Reference xSheetConditionalEntry( + xSheetConditionalEntries->getByIndex(0), uno::UNO_QUERY_THROW); return xSheetConditionalEntry; } -- cgit