diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-10 20:47:32 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-11 11:20:43 +0200 |
commit | 2d582244680e7f6dec6e4a466e276f93ccb01dc9 (patch) | |
tree | b0e880ddfb3ce1ea2f47151b648e7fbb55132f08 /test | |
parent | 74012c48d99634a7556a86f77e9522024f2afdb2 (diff) |
loplugin:flatten
Change-Id: I6560756eb63856a22b43e3e65a7b7843cd2d5376
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100447
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'test')
-rw-r--r-- | test/source/screenshot_test.cxx | 42 | ||||
-rw-r--r-- | test/source/sheet/xnamedranges.cxx | 26 |
2 files changed, 33 insertions, 35 deletions
diff --git a/test/source/screenshot_test.cxx b/test/source/screenshot_test.cxx index ea26f80c47a6..9d02a67b896b 100644 --- a/test/source/screenshot_test.cxx +++ b/test/source/screenshot_test.cxx @@ -197,27 +197,27 @@ void ScreenshotTest::dumpDialogToPath(weld::Builder& rBuilder) void ScreenshotTest::dumpDialogToPath(const OString& rUIXMLDescription) { - if (!rUIXMLDescription.isEmpty()) - { - bool bNonConforming = rUIXMLDescription == "modules/swriter/ui/sidebarstylepresets.ui" || - rUIXMLDescription == "modules/swriter/ui/sidebartheme.ui" || - rUIXMLDescription == "modules/swriter/ui/notebookbar.ui" || - rUIXMLDescription == "modules/scalc/ui/sidebaralignment.ui" || - rUIXMLDescription == "modules/scalc/ui/sidebarcellappearance.ui" || - rUIXMLDescription == "modules/scalc/ui/sidebarnumberformat.ui" || - rUIXMLDescription == "sfx/ui/helpbookmarkpage.ui" || - rUIXMLDescription == "sfx/ui/helpcontentpage.ui" || - rUIXMLDescription == "sfx/ui/helpindexpage.ui" || - rUIXMLDescription == "sfx/ui/helpsearchpage.ui" || - rUIXMLDescription == "sfx/ui/startcenter.ui" || - rUIXMLDescription == "svx/ui/datanavigator.ui" || - rUIXMLDescription == "svx/ui/xformspage.ui" || - rUIXMLDescription == "modules/dbreport/ui/conditionwin.ui"; - if (bNonConforming) // skip these broken ones - return; - std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(mxParentWidget.get(), OStringToOUString(rUIXMLDescription, RTL_TEXTENCODING_UTF8))); - dumpDialogToPath(*xBuilder); - } + if (rUIXMLDescription.isEmpty()) + return; + + bool bNonConforming = rUIXMLDescription == "modules/swriter/ui/sidebarstylepresets.ui" || + rUIXMLDescription == "modules/swriter/ui/sidebartheme.ui" || + rUIXMLDescription == "modules/swriter/ui/notebookbar.ui" || + rUIXMLDescription == "modules/scalc/ui/sidebaralignment.ui" || + rUIXMLDescription == "modules/scalc/ui/sidebarcellappearance.ui" || + rUIXMLDescription == "modules/scalc/ui/sidebarnumberformat.ui" || + rUIXMLDescription == "sfx/ui/helpbookmarkpage.ui" || + rUIXMLDescription == "sfx/ui/helpcontentpage.ui" || + rUIXMLDescription == "sfx/ui/helpindexpage.ui" || + rUIXMLDescription == "sfx/ui/helpsearchpage.ui" || + rUIXMLDescription == "sfx/ui/startcenter.ui" || + rUIXMLDescription == "svx/ui/datanavigator.ui" || + rUIXMLDescription == "svx/ui/xformspage.ui" || + rUIXMLDescription == "modules/dbreport/ui/conditionwin.ui"; + if (bNonConforming) // skip these broken ones + return; + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(mxParentWidget.get(), OStringToOUString(rUIXMLDescription, RTL_TEXTENCODING_UTF8))); + dumpDialogToPath(*xBuilder); } void ScreenshotTest::processAllKnownDialogs() diff --git a/test/source/sheet/xnamedranges.cxx b/test/source/sheet/xnamedranges.cxx index c4d272cdcc39..25726ca9e739 100644 --- a/test/source/sheet/xnamedranges.cxx +++ b/test/source/sheet/xnamedranges.cxx @@ -146,20 +146,18 @@ void XNamedRanges::testRemoveByName() bool bHasIt = xNamedRanges->hasByName(maNameToRemove); CPPUNIT_ASSERT_MESSAGE("NamedRange initial1 does not exist, can't remove it", bHasIt); - if (bHasIt) - { - // remove existing - sal_Int32 nInitialCount = xIndex->getCount(); - xNamedRanges->removeByName(maNameToRemove); - sal_Int32 nNewCount = xIndex->getCount(); - CPPUNIT_ASSERT_EQUAL_MESSAGE("NamedRange initial1 not removed", nNewCount, - nInitialCount - 1); - CPPUNIT_ASSERT_MESSAGE("Wrong NamedRange removed, initial1 still present", - !xNamedRanges->hasByName(maNameToRemove)); - // try to remove non existing - xNamedRanges->removeByName( - "dummyNonExistingNamedRange"); // an exception should be raised here - } + if (!bHasIt) + return; + + // remove existing + sal_Int32 nInitialCount = xIndex->getCount(); + xNamedRanges->removeByName(maNameToRemove); + sal_Int32 nNewCount = xIndex->getCount(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("NamedRange initial1 not removed", nNewCount, nInitialCount - 1); + CPPUNIT_ASSERT_MESSAGE("Wrong NamedRange removed, initial1 still present", + !xNamedRanges->hasByName(maNameToRemove)); + // try to remove non existing + xNamedRanges->removeByName("dummyNonExistingNamedRange"); // an exception should be raised here } void XNamedRanges::testOutputList() |