diff options
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/export-tests-ooxml1.cxx | 20 | ||||
-rw-r--r-- | sd/qa/unit/export-tests.cxx | 9 | ||||
-rw-r--r-- | sd/source/core/stlpool.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/func/fuchar.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/futempl.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/drtxtob1.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/drviews2.cxx | 2 |
7 files changed, 24 insertions, 23 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(); diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index 24797c0bb674..0e6d89297f03 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -18,6 +18,7 @@ #include <editeng/editobj.hxx> #include <editeng/outlobj.hxx> #include <editeng/colritem.hxx> +#include <editeng/eeitem.hxx> #include <svx/svdotext.hxx> #include <svx/svdograf.hxx> @@ -272,7 +273,7 @@ void SdExportTest::testBackgroundImage() 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(); @@ -281,7 +282,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())); } @@ -298,10 +299,10 @@ void SdExportTest::testTransparentBackground() const SdrPage *pPage = GetPage( 1, xDocShRef ); const SdrTextObj *pObj1 = dynamic_cast<SdrTextObj *>( pPage->GetObj( 0 ) ); - checkFontAttributes<Color, SvxBackgroundColorItem>( pObj1, COL_TRANSPARENT ); + checkFontAttributes<Color, SvxColorItem>( pObj1, COL_TRANSPARENT, EE_CHAR_BKGCOLOR); const SdrTextObj *pObj2 = dynamic_cast<SdrTextObj *>( pPage->GetObj( 1 ) ); - checkFontAttributes<Color, SvxBackgroundColorItem>( pObj2, COL_YELLOW); + checkFontAttributes<Color, SvxColorItem>( pObj2, COL_YELLOW, EE_CHAR_BKGCOLOR); xDocShRef->DoClose(); } diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx index e03b4ca17399..f7744e353b40 100644 --- a/sd/source/core/stlpool.cxx +++ b/sd/source/core/stlpool.cxx @@ -239,7 +239,7 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(std::u16string_view rLayoutName, rSet.Put( SvxEmphasisMarkItem(FontEmphasisMark::NONE, EE_CHAR_EMPHASISMARK ) ); rSet.Put( SvxCharReliefItem(FontRelief::NONE, EE_CHAR_RELIEF) ); rSet.Put( SvxColorItem( COL_AUTO, EE_CHAR_COLOR) ); - rSet.Put( SvxBackgroundColorItem( COL_AUTO, EE_CHAR_BKGCOLOR ) ); + rSet.Put( SvxColorItem( COL_AUTO, EE_CHAR_BKGCOLOR ) ); rSet.Put( XLineStyleItem(css::drawing::LineStyle_NONE) ); rSet.Put( XFillStyleItem(drawing::FillStyle_NONE) ); rSet.Put( SdrTextFitToSizeTypeItem(drawing::TextFitToSizeType_AUTOFIT) ); @@ -354,7 +354,7 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(std::u16string_view rLayoutName, rTitleSet.Put( SvxEmphasisMarkItem(FontEmphasisMark::NONE, EE_CHAR_EMPHASISMARK ) ); rTitleSet.Put( SvxCharReliefItem(FontRelief::NONE, EE_CHAR_RELIEF ) ); rTitleSet.Put(SvxColorItem( COL_AUTO, EE_CHAR_COLOR )); - rTitleSet.Put(SvxBackgroundColorItem( COL_AUTO, EE_CHAR_BKGCOLOR )); + rTitleSet.Put(SvxColorItem( COL_AUTO, EE_CHAR_BKGCOLOR )); rTitleSet.Put(SvxAdjustItem(SvxAdjust::Center, EE_PARA_JUST )); rTitleSet.Put( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_CENTER ) ); // #i16874# enable kerning by default but only for new documents @@ -400,7 +400,7 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(std::u16string_view rLayoutName, rSubtitleSet.Put( SvxEmphasisMarkItem(FontEmphasisMark::NONE, EE_CHAR_EMPHASISMARK ) ); rSubtitleSet.Put( SvxCharReliefItem(FontRelief::NONE, EE_CHAR_RELIEF ) ); rSubtitleSet.Put(SvxColorItem( COL_AUTO, EE_CHAR_COLOR )); - rSubtitleSet.Put(SvxBackgroundColorItem( COL_AUTO, EE_CHAR_BKGCOLOR )); + rSubtitleSet.Put(SvxColorItem( COL_AUTO, EE_CHAR_BKGCOLOR )); rSubtitleSet.Put(SvxAdjustItem(SvxAdjust::Center, EE_PARA_JUST )); rSubtitleSet.Put( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_CENTER ) ); // #i16874# enable kerning by default but only for new documents @@ -449,7 +449,7 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(std::u16string_view rLayoutName, rNotesSet.Put( SvxEmphasisMarkItem(FontEmphasisMark::NONE, EE_CHAR_EMPHASISMARK ) ); rNotesSet.Put( SvxCharReliefItem(FontRelief::NONE, EE_CHAR_RELIEF) ); rNotesSet.Put( SvxColorItem( COL_AUTO, EE_CHAR_COLOR ) ); - rNotesSet.Put( SvxBackgroundColorItem( COL_AUTO, EE_CHAR_BKGCOLOR ) ); + rNotesSet.Put( SvxColorItem( COL_AUTO, EE_CHAR_BKGCOLOR ) ); rNotesSet.Put( SvxLRSpaceItem( 0, 0, 600, -600, EE_PARA_LRSPACE ) ); // #i16874# enable kerning by default but only for new documents rNotesSet.Put( SvxAutoKernItem( true, EE_CHAR_PAIRKERNING ) ); diff --git a/sd/source/ui/func/fuchar.cxx b/sd/source/ui/func/fuchar.cxx index 6b5cad68a973..a1c69e25b041 100644 --- a/sd/source/ui/func/fuchar.cxx +++ b/sd/source/ui/func/fuchar.cxx @@ -85,7 +85,7 @@ void FuChar::DoExecute( SfxRequest& rReq ) if ( pBrushItem ) { - SvxBackgroundColorItem aBackColorItem( pBrushItem->GetColor(), EE_CHAR_BKGCOLOR ); + SvxColorItem aBackColorItem( pBrushItem->GetColor(), EE_CHAR_BKGCOLOR ); aOtherSet.ClearItem( SID_ATTR_BRUSH_CHAR ); aOtherSet.Put( aBackColorItem ); } diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx index aeb9251e3002..e75a18b74782 100644 --- a/sd/source/ui/func/futempl.cxx +++ b/sd/source/ui/func/futempl.cxx @@ -385,12 +385,12 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) if (eFamily == SfxStyleFamily::Pseudo) { SfxItemSet aTempSet(*pOutSet); - /* Extract SvxBrushItem out of set and insert SvxBackgroundColorItem */ + /* Extract SvxBrushItem out of set and insert SvxColorItem */ const SvxBrushItem* pBrushItem = aTempSet.GetItem<SvxBrushItem>( SID_ATTR_BRUSH_CHAR ); if ( pBrushItem ) { - SvxBackgroundColorItem aBackColorItem(pBrushItem->GetColor(), EE_CHAR_BKGCOLOR); + SvxColorItem aBackColorItem(pBrushItem->GetColor(), EE_CHAR_BKGCOLOR); aTempSet.ClearItem( EE_CHAR_BKGCOLOR ); aTempSet.Put( aBackColorItem ); } diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index 2c92f0b66d06..4292978d85cf 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -95,7 +95,7 @@ namespace case SID_ATTR_CHAR_BACK_COLOR: { - SvxBackgroundColorItem pBackgroundItem(aColor, EE_CHAR_BKGCOLOR); + SvxColorItem pBackgroundItem(aColor, EE_CHAR_BKGCOLOR); pArgs->Put(pBackgroundItem); break; } diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 01120a842903..094cbb806d2b 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -3781,7 +3781,7 @@ void DrawViewShell::ExecChar( SfxRequest &rReq ) case SID_ATTR_CHAR_BACK_COLOR: if( rReq.GetArgs() ) { - const SvxBackgroundColorItem* pItem = rReq.GetArg<SvxBackgroundColorItem>(SID_ATTR_CHAR_BACK_COLOR); + const SvxColorItem* pItem = rReq.GetArg<SvxColorItem>(SID_ATTR_CHAR_BACK_COLOR); if (pItem) { aNewAttr.Put(*pItem); |