Kaydet (Commit) 6c1fc9e9 authored tarafından matteocam's avatar matteocam Kaydeden (comit) Fridrich Štrba

Added Text Fill Color in TextSimplePortionPrimitive2D

Change-Id: I40309c17d6e3d0547c4724a01b464e94a3c8a61c
(cherry picked from commit 4177d9b3)
üst 7bb6020e
......@@ -228,7 +228,8 @@ namespace drawinglayer
const ::com::sun::star::lang::Locale& rLocale,
const basegfx::BColor& rFontColor,
bool bFilled,
long nWidthToFill)
long nWidthToFill,
const basegfx::BColor& rFillColor)
: BufferedDecompositionPrimitive2D(),
maTextTransform(rNewTransform),
maText(rText),
......@@ -240,7 +241,8 @@ namespace drawinglayer
maFontColor(rFontColor),
maB2DRange(),
mbFilled(bFilled),
mnWidthToFill(nWidthToFill)
mnWidthToFill(nWidthToFill),
maTextFillColor(rFillColor)
{
#if OSL_DEBUG_LEVEL > 0
const sal_Int32 aStringLength(getText().getLength());
......
......@@ -189,18 +189,16 @@ namespace drawinglayer
// set FillColor Attribute
// FIXME(matteocam)
// XXX: is "Color" the right type
//const Color aFillColor(pTCPP->getFontFillColor() );
//if( aFillColor != COL_TRANSPARENT )
// set fill Color if underlined
if ( eFontUnderline != UNDERLINE_NONE )
// XXX: is "Color" the right type? i.e. can we use class Color in TextSimplePortionPrimitive2D
const Color aFillColor(pTCPP->getTextFillColor() );
if( aFillColor != COL_TRANSPARENT )
{
Color aFillColor = RGB_COLORDATA(0x66, 0x66, 0xff);
aFont.SetFillColor(aFillColor);
aFont.SetTransparent(false);
}
// set EmphasisMark attribute
FontEmphasisMark eFontEmphasisMark = EMPHASISMARK_NONE;
switch( pTCPP->getTextEmphasisMark() )
......
......@@ -117,11 +117,15 @@ namespace drawinglayer
/// font color
basegfx::BColor maFontColor;
/// #i96669# internal: add simple range buffering for this primitive
basegfx::B2DRange maB2DRange;
bool mbFilled; // Whether to fill a given width with the text
long mnWidthToFill; // the width to fill
/// The fill color of the text
basegfx::BColor maTextFillColor;
protected:
/// local decomposition.
virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const SAL_OVERRIDE;
......@@ -138,7 +142,8 @@ namespace drawinglayer
const ::com::sun::star::lang::Locale& rLocale,
const basegfx::BColor& rFontColor,
bool bFilled = false,
long nWidthToFill = 0);
long nWidthToFill = 0,
const basegfx::BColor& rFillColor = Color(COL_TRANSPARENT).getBColor());
/// helpers
/** get text outlines as polygons and their according ObjectTransformation. Handles all
......@@ -155,6 +160,7 @@ namespace drawinglayer
const attribute::FontAttribute& getFontAttribute() const { return maFontAttribute; }
const ::com::sun::star::lang::Locale& getLocale() const { return maLocale; }
const basegfx::BColor& getFontColor() const { return maFontColor; }
const basegfx::BColor& getTextFillColor() const { return maTextFillColor; }
bool isFilled() const { return mbFilled; }
long getWidthToFill() const { return mnWidthToFill; }
......
......@@ -259,6 +259,9 @@ namespace
const Color aFontColor(rInfo.mrFont.GetColor());
const basegfx::BColor aBFontColor(aFontColor.getBColor());
const Color aTextFillColor(rInfo.mrFont.GetFillColor());
const basegfx::BColor aBTextFill(aTextFillColor.getBColor());
// prepare wordLineMode (for underline and strikeout)
// NOT for bullet texts. It is set (this may be an error by itself), but needs to be suppressed to hinder e.g. '1)'
// to be split which would not look like the original
......
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