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

Cleaned up code from operations in vcl

Change-Id: Ica5194f0cf6e30ec099974ae8b794fb2bc5e654a
(cherry picked from commit 4445f361)
üst fcbfcc75
......@@ -2556,6 +2556,9 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo
rFont = pNode->GetCharAttribs().GetDefFont();
/*
* Set attributes for script types Asian and Complex
*/
short nScriptType = GetI18NScriptType( EditPaM( pNode, nPos ) );
if ( ( nScriptType == i18n::ScriptType::ASIAN ) || ( nScriptType == i18n::ScriptType::COMPLEX ) )
{
......@@ -2574,6 +2577,9 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo
sal_uInt16 nRelWidth = ((const SvxCharScaleWidthItem&)pNode->GetContentAttribs().GetItem( EE_CHAR_FONTWIDTH)).GetValue();
/*
* Set output device's line and overline colors
*/
if ( pOut )
{
const SvxUnderlineItem& rTextLineColor = (const SvxUnderlineItem&)pNode->GetContentAttribs().GetItem( EE_CHAR_UNDERLINE );
......@@ -2594,6 +2600,9 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo
const SvxLanguageItem* pCJKLanguageItem = NULL;
/*
* Scan through char attributes of pNode
*/
if ( aStatus.UseCharAttribs() )
{
CharAttribList::AttribsType& rAttribs = pNode->GetCharAttribs().GetAttribs();
......@@ -3412,6 +3421,12 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt
' ' == aText[nTextStart + nTextLen - 1] )
--nTextLen;
// FIXME(matteocam)
if (aTmpFont.GetItalic() != ITALIC_NONE) {
Color aColor = COL_BROWN;
aTmpFont.SetFillColor(aColor);
}
// output directly
aTmpFont.QuickDrawText( pOutDev, aRealOutPos, aText, nTextStart, nTextLen, pDXArray );
......@@ -3684,6 +3699,8 @@ void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRect, OutputDev
SvxFont aTmpFont;
ContentNode* pNode = GetEditDoc().GetObject( 0 );
SeekCursor( pNode, 1, aTmpFont );
Color aFontColor( aTmpFont.GetColor() );
if( (aFontColor == COL_AUTO) || IsForceAutoColor() )
aFontColor = GetAutoColor();
......
......@@ -80,18 +80,18 @@
#define EE_CHAR_OVERLINE (EE_ITEMS_START+47)
#define EE_CHAR_CASEMAP (EE_ITEMS_START+48)
#define EE_CHAR_GRABBAG (EE_ITEMS_START+49)
#define EE_CHAR_BKGCOLOR (EE_ITEMS_START+50)
//#define EE_CHAR_BKGCOLOR (EE_ITEMS_START+50)
#define EE_CHAR_END (EE_ITEMS_START+50)
#define EE_CHAR_END (EE_ITEMS_START+49)
#define EE_FEATURE_START (EE_ITEMS_START+51)
#define EE_FEATURE_TAB (EE_ITEMS_START+51)
#define EE_FEATURE_LINEBR (EE_ITEMS_START+52)
#define EE_FEATURE_NOTCONV (EE_ITEMS_START+53)
#define EE_FEATURE_FIELD (EE_ITEMS_START+54)
#define EE_FEATURE_END (EE_ITEMS_START+54)
#define EE_FEATURE_START (EE_ITEMS_START+50)
#define EE_FEATURE_TAB (EE_ITEMS_START+50)
#define EE_FEATURE_LINEBR (EE_ITEMS_START+51)
#define EE_FEATURE_NOTCONV (EE_ITEMS_START+52)
#define EE_FEATURE_FIELD (EE_ITEMS_START+53)
#define EE_FEATURE_END (EE_ITEMS_START+53)
#define EE_ITEMS_END (EE_ITEMS_START+54)
#define EE_ITEMS_END (EE_ITEMS_START+53)
#define EDITITEMCOUNT ( EE_ITEMS_END - EE_ITEMS_START + 1 )
......
......@@ -60,12 +60,10 @@ public:
void SetAlign( FontAlign );
FontAlign GetAlign() const;
// XXX: now font has background iff it is (single-y) underlined
// also forces non transparency
bool HasBackgroundColor() const {
// FIXME(matteocam) // XXX: is this the right spot for changes?
void SetBackgroundColor(const Color &);
const Color& GetBackgroundColor() const;
return GetUnderline() == UNDERLINE_SINGLE;
}
void SetName( const OUString& rFamilyName );
const OUString& GetName() const;
......
......@@ -301,6 +301,15 @@ void Font::SetFillColor( const Color& rColor )
mpImplFont->mbTransparent = true;
}
void Font::SetBackgroundColor(const Color& rColor)
{
// FIXME
//MakeUnique();
/*mpImplFont->maBkgColor = rColor;
if () */
}
void Font::SetTransparent( bool bTransparent )
{
......@@ -957,6 +966,8 @@ const Color& Font::GetColor() const { return mpImplFont->maColor; }
const Color& Font::GetFillColor() const { return mpImplFont->maFillColor; }
const Color& Font::GetBackgroundColor() const { /*return mpImplFont->maBkgColor;*/ }
bool Font::IsTransparent() const { return mpImplFont->mbTransparent; }
FontAlign Font::GetAlign() const { return mpImplFont->meAlign; }
......
......@@ -520,8 +520,6 @@ void OutputDevice::SetFont( const Font& rNewFont )
aFont.SetColor( aTextColor );
mbTextBackground = aFont.HasBackgroundColor();
bool bTransFill = aFont.IsTransparent();
if ( !bTransFill )
{
......
......@@ -481,18 +481,6 @@ void OutputDevice::ImplDrawText( SalLayout& rSalLayout )
rSalLayout.DrawBase() += Point( mnTextOffX, mnTextOffY );
/*
if the text has some background get it
and the set it as the new filling color
*/
if (mbTextBackground) {
// FIXME(matteocam)
// set right background // (XXX: now getting fixed color)
Color aColor = RGB_COLORDATA(0x66,0x66, 0xFF); // blue-ish
// SetBackground does not work
SetTextFillColor(aColor);
}
if( IsTextFillColor() )
ImplDrawTextBackground( rSalLayout );
......
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