[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-text-background-color' - drawinglayer/source include/drawinglayer svx/source
matteocam
matteo.campanelli at gmail.com
Mon Jun 16 06:26:53 PDT 2014
drawinglayer/source/primitive2d/textprimitive2d.cxx | 6 ++++--
drawinglayer/source/processor2d/vclprocessor2d.cxx | 10 ++++------
include/drawinglayer/primitive2d/textprimitive2d.hxx | 8 +++++++-
svx/source/svdraw/svdotextdecomposition.cxx | 3 +++
4 files changed, 18 insertions(+), 9 deletions(-)
New commits:
commit 4177d9b34551f7cf2a7ea8d2dfdff37b89400db4
Author: matteocam <matteo.campanelli at gmail.com>
Date: Mon Jun 16 15:07:58 2014 +0200
Added Text Fill Color in TextSimplePortionPrimitive2D
Change-Id: I40309c17d6e3d0547c4724a01b464e94a3c8a61c
diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx
index f35015a..4aba22d 100644
--- a/drawinglayer/source/primitive2d/textprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx
@@ -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());
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 213b514..54aef74 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -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() )
diff --git a/include/drawinglayer/primitive2d/textprimitive2d.hxx b/include/drawinglayer/primitive2d/textprimitive2d.hxx
index da5b665..0e93391 100644
--- a/include/drawinglayer/primitive2d/textprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/textprimitive2d.hxx
@@ -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; }
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index 8767e5d..9547cfa 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -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
More information about the Libreoffice-commits
mailing list