Kaydet (Commit) ad6a2607 authored tarafından matteocam's avatar matteocam

Added class SvxBackgroundColorItem

Change-Id: If10795bbbd9fc911896b57bbab5410bc1e62f71f
üst 7fb0e8c9
......@@ -136,7 +136,6 @@ void EditCharAttribUnderline::SetFont( SvxFont& rFont, OutputDevice* pOutDev )
//pOutDev->SetTextLineColor( ((const SvxUnderlineItem*)GetItem())->GetColor() );
// FIXME(matteocam)
if ( pOutDev )
pOutDev->SetTextFillColor(aColor);
}
......@@ -230,6 +229,28 @@ void EditCharAttribColor::SetFont( SvxFont& rFont, OutputDevice* )
//fprintf(stderr, "Called SetFont with Color %d\n", aColor.GetColor());
}
// class EditCharAttribBackgroundColor
EditCharAttribBackgroundColor::EditCharAttribBackgroundColor(
const SvxBackgroundColorItem& rAttr,
sal_uInt16 _nStart,
sal_uInt16 _nEnd )
: EditCharAttrib( rAttr, _nStart, _nEnd )
{
// FIXME(matteocam)
//DBG_ASSERT( rAttr.Which() == EE_CHAR_BKG_COLOR, "Not a BackgroundColor attribute!" );
}
void EditCharAttribBackgroundColor::SetFont( SvxFont& rFont, OutputDevice* )
{
/* FIXME(matteocam)
*
Color aColor = ((const SvxBackgroundColorItem*)GetItem())->GetValue();
rFont.SetFillColor( aColor); // XXX: Is it SetFillColor we want?
*/
}
// class EditCharAttribLanguage
......
......@@ -38,6 +38,7 @@ class SvxOverlineItem;
class SvxFontHeightItem;
class SvxCharScaleWidthItem;
class SvxColorItem;
class SvxBackgroundColorItem;
class SvxAutoKernItem;
class SvxKerningItem;
class SvxWordLineModeItem;
......@@ -308,6 +309,18 @@ public:
virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ) SAL_OVERRIDE;
};
// class EditCharAttribBackgroundColor
class EditCharAttribBackgroundColor : public EditCharAttrib
{
public:
EditCharAttribBackgroundColor(const SvxBackgroundColorItem& rAttr,
sal_uInt16 nStart,
sal_uInt16 nEnd );
virtual void SetFont(SvxFont& rFont, OutputDevice* pOutDev) SAL_OVERRIDE;
};
// class EditCharAttribLanguage
......
......@@ -122,6 +122,8 @@ TYPEINIT1_FACTORY(SvxWordLineModeItem, SfxBoolItem, new SvxWordLineModeItem(fals
TYPEINIT1_FACTORY(SvxContourItem, SfxBoolItem, new SvxContourItem(false, 0));
TYPEINIT1_FACTORY(SvxPropSizeItem, SfxUInt16Item, new SvxPropSizeItem(100, 0));
TYPEINIT1_FACTORY(SvxColorItem, SfxPoolItem, new SvxColorItem(0));
// FIXME(matteocam): Should 2nd argoment of next line SfxColorItem or SfxPoolItem?
TYPEINIT1_FACTORY(SvxBackgroundColorItem, SvxColorItem, new SvxBackgroundColorItem(0));
TYPEINIT1_FACTORY(SvxCharSetColorItem, SvxColorItem, new SvxCharSetColorItem(0));
TYPEINIT1_FACTORY(SvxKerningItem, SfxInt16Item, new SvxKerningItem(0, 0));
TYPEINIT1_FACTORY(SvxCaseMapItem, SfxEnumItem, new SvxCaseMapItem(SVX_CASEMAP_NOT_MAPPED, 0));
......@@ -1908,6 +1910,43 @@ SfxItemPresentation SvxPropSizeItem::GetPresentation
return SFX_ITEM_PRESENTATION_NONE;
}
// class SvxBackgroundColorItem -----------------------------------------
SvxBackgroundColorItem::SvxBackgroundColorItem( const sal_uInt16 nId ) :
SvxColorItem( nId )
{
}
SvxBackgroundColorItem::SvxBackgroundColorItem( const Color& rCol,
const sal_uInt16 nId ) :
SvxColorItem( rCol, nId )
{
}
SvxBackgroundColorItem:: SvxBackgroundColorItem( SvStream& rStrm, const sal_uInt16 Id ) :
SvxColorItem( rStrm, Id )
{
}
SvxBackgroundColorItem::SvxBackgroundColorItem( const SvxBackgroundColorItem& rCopy ) :
SvxColorItem( rCopy )
{
}
SfxPoolItem* SvxBackgroundColorItem::Clone( SfxItemPool * ) const
{
return new SvxBackgroundColorItem( *this );
}
SfxPoolItem* SvxBackgroundColorItem::Create(SvStream& rStrm, sal_uInt16 ) const
{
return new SvxBackgroundColorItem( rStrm, Which() );
}
// class SvxColorItem ----------------------------------------------------
SvxColorItem::SvxColorItem( const sal_uInt16 nId ) :
......
......@@ -77,6 +77,31 @@ public:
};
/*
* FIXME(matteocam):
* both classes Svx{Background,}Color should be derived from a
* common ancestor or be totally separate (not recommended probably).
*/
// class SvxBackgroundColorItem
// XXX: to be moved in a separate header.
class EDITENG_DLLPUBLIC SvxBackgroundColorItem : public SvxColorItem
{
public:
TYPEINFO_OVERRIDE();
SvxBackgroundColorItem( const sal_uInt16 nId );
SvxBackgroundColorItem( const Color& rCol,
const sal_uInt16 nId );
SvxBackgroundColorItem( SvStream& rStrm, const sal_uInt16 nId );
SvxBackgroundColorItem( const SvxBackgroundColorItem& rCopy );
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const SAL_OVERRIDE;
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment