diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-11-23 11:25:49 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-11-23 15:03:25 +0100 |
commit | 94d76cef1f71056fab106caf4cc8e65504475615 (patch) | |
tree | bb31a42873eae96bd402a152211dafe1d232bb65 /sc/qa | |
parent | e0846b7abe78e55bc1e959143d980208077b13ca (diff) |
TypedWhichId create custom get methods in ScPatternAttr
Change-Id: Iaa326332f5806477dd81463e6b6004a962bac934
Reviewed-on: https://gerrit.libreoffice.org/45128
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/helper/qahelper.cxx | 10 | ||||
-rw-r--r-- | sc/qa/unit/subsequent_filters-test.cxx | 9 |
2 files changed, 9 insertions, 10 deletions
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx index 66d2da055013..b53c8377e1a0 100644 --- a/sc/qa/unit/helper/qahelper.cxx +++ b/sc/qa/unit/helper/qahelper.cxx @@ -226,17 +226,17 @@ void testFormats(ScBootstrapFixture* pTest, ScDocument* pDoc, sal_Int32 nFormat) CPPUNIT_ASSERT_EQUAL( aKnownGoodStr, aTestStr ); } pPattern = pDoc->GetPattern(1,4,1); - Color aColor = static_cast<const SvxBrushItem&>(pPattern->GetItem(ATTR_BACKGROUND)).GetColor(); + Color aColor = pPattern->GetItem(ATTR_BACKGROUND).GetColor(); CPPUNIT_ASSERT_EQUAL_MESSAGE("background color should be green", Color(COL_LIGHTGREEN), aColor); pPattern = pDoc->GetPattern(2,0,1); - SvxCellHorJustify eHorJustify = static_cast<const SvxHorJustifyItem&>(pPattern->GetItem(ATTR_HOR_JUSTIFY)).GetValue(); + SvxCellHorJustify eHorJustify = pPattern->GetItem(ATTR_HOR_JUSTIFY).GetValue(); CPPUNIT_ASSERT_EQUAL_MESSAGE("cell content should be aligned centre horizontally", SvxCellHorJustify::Center, eHorJustify); //test alignment pPattern = pDoc->GetPattern(2,1,1); - eHorJustify = static_cast<const SvxHorJustifyItem&>(pPattern->GetItem(ATTR_HOR_JUSTIFY)).GetValue(); + eHorJustify = pPattern->GetItem(ATTR_HOR_JUSTIFY).GetValue(); CPPUNIT_ASSERT_EQUAL_MESSAGE("cell content should be aligned right horizontally", SvxCellHorJustify::Right, eHorJustify); pPattern = pDoc->GetPattern(2,2,1); - eHorJustify = static_cast<const SvxHorJustifyItem&>(pPattern->GetItem(ATTR_HOR_JUSTIFY)).GetValue(); + eHorJustify = pPattern->GetItem(ATTR_HOR_JUSTIFY).GetValue(); CPPUNIT_ASSERT_EQUAL_MESSAGE("cell content should be aligned block horizontally", SvxCellHorJustify::Block, eHorJustify); //test Sheet3 only for ods and xlsx @@ -264,7 +264,7 @@ void testFormats(ScBootstrapFixture* pTest, ScDocument* pDoc, sal_Int32 nFormat) // check actual align applied to cell, should be the same as // the style - eHorJustify = static_cast< const SvxHorJustifyItem& >(pPattern->GetItem( ATTR_HOR_JUSTIFY ) ).GetValue(); + eHorJustify = pPattern->GetItem( ATTR_HOR_JUSTIFY ).GetValue(); CPPUNIT_ASSERT_EQUAL_MESSAGE("cell with 'Excel Built-in Date' style should be aligned centre horizontally", SvxCellHorJustify::Center, eHorJustify); } } diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 6843f9f37fba..9f3bc88ba9f3 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -1836,8 +1836,7 @@ void ScFiltersTest::testRichTextContentODS() CPPUNIT_ASSERT_EQUAL(OUString("All bold"), rDoc.GetString(aPos.Col(), aPos.Row(), aPos.Tab())); const ScPatternAttr* pAttr = rDoc.GetPattern(aPos.Col(), aPos.Row(), aPos.Tab()); CPPUNIT_ASSERT_MESSAGE("Failed to get cell attribute.", pAttr); - const SvxWeightItem& rWeightItem = - static_cast<const SvxWeightItem&>(pAttr->GetItem(ATTR_FONT_WEIGHT)); + const SvxWeightItem& rWeightItem = pAttr->GetItem(ATTR_FONT_WEIGHT); CPPUNIT_ASSERT_EQUAL(WEIGHT_BOLD, rWeightItem.GetWeight()); } @@ -2802,13 +2801,13 @@ void ScFiltersTest::testColumnStyleXLSX() const ScPatternAttr* pPattern = rDoc.GetPattern(0,0,0); CPPUNIT_ASSERT(pPattern); - const ScProtectionAttr& rAttr = static_cast<const ScProtectionAttr&>(pPattern->GetItem(ATTR_PROTECTION)); + const ScProtectionAttr& rAttr = pPattern->GetItem(ATTR_PROTECTION); CPPUNIT_ASSERT(rAttr.GetProtection()); pPattern = rDoc.GetPattern(0,1,0); CPPUNIT_ASSERT(pPattern); - const ScProtectionAttr& rAttrNew = static_cast<const ScProtectionAttr&>(pPattern->GetItem(ATTR_PROTECTION)); + const ScProtectionAttr& rAttrNew = pPattern->GetItem(ATTR_PROTECTION); CPPUNIT_ASSERT(!rAttrNew.GetProtection()); xDocSh->DoClose(); @@ -2823,7 +2822,7 @@ void ScFiltersTest::testColumnStyleAutoFilterXLSX() const ScPatternAttr* pPattern = rDoc.GetPattern(0, 10, 18); CPPUNIT_ASSERT(pPattern); - const ScMergeFlagAttr& rAttr = static_cast<const ScMergeFlagAttr&>(pPattern->GetItem(ATTR_MERGE_FLAG)); + const ScMergeFlagAttr& rAttr = pPattern->GetItem(ATTR_MERGE_FLAG); CPPUNIT_ASSERT(!rAttr.HasAutoFilter()); xDocSh->DoClose(); |