summaryrefslogtreecommitdiff
path: root/sd/qa/unit/export-tests-ooxml1.cxx
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2021-05-28 01:23:53 +0300
committerGülşah Köse <gulsah.kose@collabora.com>2021-05-31 11:36:18 +0200
commit936af331ba6f5073aeaa0f10f5f2af1def1d74c6 (patch)
treee145eb9a5f7b9fe05a7f7832cf6eb76388cc4662 /sd/qa/unit/export-tests-ooxml1.cxx
parent7d34a7777cfeec112ab5cdabba059d01d8876be4 (diff)
Clean redundant SvxBackgroundColorItem and use SvxColorItem instead.
SvxBackgroundColorItem is just copied from SvxColorItem. There is nothing special to SvxBackgroundColorItem class. SvxColorItem is a generic item and it's used on many places related with colors. We can use SvxColorItem for background colors too. Change-Id: Iacea31a7557b806e95f5859ff60add9a2626ec05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116282 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sd/qa/unit/export-tests-ooxml1.cxx')
-rw-r--r--sd/qa/unit/export-tests-ooxml1.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx
index 9395e6eabeab..08504c8286a6 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -207,7 +207,7 @@ public:
namespace {
template< typename ItemValue, typename ItemType >
-void checkFontAttributes( const SdrTextObj* pObj, ItemValue nVal)
+void checkFontAttributes( const SdrTextObj* pObj, ItemValue nVal, sal_uInt32 nId)
{
CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr);
const EditTextObject& aEdit = pObj->GetOutlinerParaObject()->GetTextObject();
@@ -216,7 +216,7 @@ void checkFontAttributes( const SdrTextObj* pObj, ItemValue nVal)
for( std::vector<EECharAttrib>::reverse_iterator it = rLst.rbegin(); it!=rLst.rend(); ++it)
{
const ItemType* pAttrib = dynamic_cast<const ItemType *>((*it).pAttr);
- if (pAttrib)
+ if (pAttrib && pAttrib->Which() == nId)
{
CPPUNIT_ASSERT_EQUAL( nVal, static_cast<ItemValue>(pAttrib->GetValue()));
}
@@ -289,7 +289,7 @@ void SdOOXMLExportTest1::testBnc887230()
// Without the fix in place, this test would have failed with
//- Expected: 255
//- Actual : 13421823
- checkFontAttributes<Color, SvxColorItem>( pObj, Color(0x0000ff) );
+ checkFontAttributes<Color, SvxColorItem>( pObj, Color(0x0000ff), EE_CHAR_COLOR );
xDocShRef->DoClose();
}
@@ -306,15 +306,15 @@ void SdOOXMLExportTest1::testBnc870233_1()
// First shape has red, bold font
{
const SdrTextObj *pObj = dynamic_cast<SdrTextObj *>( pPage->GetObj( 0 ) );
- checkFontAttributes<Color, SvxColorItem>( pObj, Color(0xff0000) );
- checkFontAttributes<FontWeight, SvxWeightItem>( pObj, WEIGHT_BOLD );
+ checkFontAttributes<Color, SvxColorItem>( pObj, Color(0xff0000), EE_CHAR_COLOR );
+ checkFontAttributes<FontWeight, SvxWeightItem>( pObj, WEIGHT_BOLD, EE_CHAR_WEIGHT );
}
// Second shape has blue, italic font
{
const SdrTextObj *pObj = dynamic_cast<SdrTextObj *>( pPage->GetObj( 1 ) );
- checkFontAttributes<Color, SvxColorItem>( pObj, Color(0x0000ff) );
- checkFontAttributes<FontItalic, SvxPostureItem>( pObj, ITALIC_NORMAL );
+ checkFontAttributes<Color, SvxColorItem>( pObj, Color(0x0000ff), EE_CHAR_COLOR);
+ checkFontAttributes<FontItalic, SvxPostureItem>( pObj, ITALIC_NORMAL, EE_CHAR_ITALIC);
}
xDocShRef->DoClose();
@@ -334,7 +334,7 @@ void SdOOXMLExportTest1::testBnc870233_2()
const SdrObjGroup *pObjGroup = dynamic_cast<SdrObjGroup *>(pPage->GetObj(0));
CPPUNIT_ASSERT(pObjGroup);
const SdrTextObj *pObj = dynamic_cast<SdrTextObj *>(pObjGroup->GetSubList()->GetObj(0));
- checkFontAttributes<Color, SvxColorItem>(pObj, Color(0x0000ff));
+ checkFontAttributes<Color, SvxColorItem>(pObj, Color(0x0000ff), EE_CHAR_COLOR);
}
// Second smart art has "dk2" font color (style)
@@ -342,7 +342,7 @@ void SdOOXMLExportTest1::testBnc870233_2()
const SdrObjGroup *pObjGroup = dynamic_cast<SdrObjGroup *>(pPage->GetObj(1));
CPPUNIT_ASSERT(pObjGroup);
const SdrTextObj *pObj = dynamic_cast<SdrTextObj *>(pObjGroup->GetSubList()->GetObj(0));
- checkFontAttributes<Color, SvxColorItem>( pObj, Color(0x1F497D) );
+ checkFontAttributes<Color, SvxColorItem>( pObj, Color(0x1F497D), EE_CHAR_COLOR );
}
// Third smart art has white font color (style)
@@ -350,7 +350,7 @@ void SdOOXMLExportTest1::testBnc870233_2()
const SdrObjGroup *pObjGroup = dynamic_cast<SdrObjGroup *>(pPage->GetObj(2));
CPPUNIT_ASSERT(pObjGroup);
const SdrTextObj *pObj = dynamic_cast<SdrTextObj *>(pObjGroup->GetSubList()->GetObj(0));
- checkFontAttributes<Color, SvxColorItem>(pObj, Color(0xffffff));
+ checkFontAttributes<Color, SvxColorItem>(pObj, Color(0xffffff), EE_CHAR_COLOR);
}
xDocShRef->DoClose();