summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Martens <ama@openoffice.org>2000-11-24 14:56:32 +0000
committerAndreas Martens <ama@openoffice.org>2000-11-24 14:56:32 +0000
commiteab7cbef0ddc235848a64b8e73fd66ab121190cd (patch)
tree84628b32fed8713fd2e35c3c133a3206c4ce481a
parentf625b1d7136219fcf3ed9cc920544847c5a541fd (diff)
#80425#: Different color for the underlining
-rw-r--r--sw/source/core/inc/swfont.hxx7
-rw-r--r--sw/source/core/txtnode/swfont.cxx13
2 files changed, 16 insertions, 4 deletions
diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx
index e83fa7b9a264..f1ca7a571c12 100644
--- a/sw/source/core/inc/swfont.hxx
+++ b/sw/source/core/inc/swfont.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: swfont.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: jp $ $Date: 2000-10-30 12:51:04 $
+ * last change: $Author: ama $ $Date: 2000-11-24 15:55:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -193,6 +193,7 @@ class SwFont
// CTL == Complex text layout ( Hebrew, Arabic )
SwSubFont aSub[SW_SCRIPTS]; // Latin-, CJK- and CTL-font
Color* pBackColor; // background color (i.e. at character styles)
+ Color aUnderColor; // color of the underlining
BYTE nToxCnt; // Zaehlt die Schachtelungstiefe der Tox
BYTE nRefCnt; // Zaehlt die Schachtelungstiefe der Refs
BYTE nActual; // actual font (Latin, CJK or CTL)
@@ -259,6 +260,7 @@ public:
inline void SetFillColor( const Color& rColor );
inline void SetAlign( const FontAlign eAlign );
inline void SetUnderline( const FontUnderline eUnderline );
+ inline void SetUnderColor( const Color &rColor ) { aUnderColor = rColor; }
inline void SetStrikeout( const FontStrikeout eStrikeout );
inline void SetOutline( const BOOL bOutline );
inline void SetShadow( const BOOL bShadow );
@@ -323,6 +325,7 @@ public:
BOOL IsSymbol( ViewShell *pSh )
{ return aSub[nActual].IsSymbol( pSh ); }
FontUnderline GetUnderline() const { return aSub[nActual].GetUnderline(); }
+ const Color& GetUnderColor() const { return aUnderColor; }
short GetFixKerning() const { return aSub[nActual].GetFixKerning(); }
FontStrikeout GetStrikeout() const { return aSub[nActual].GetStrikeout(); }
const Color& GetColor() const { return aSub[nActual].GetColor(); }
diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx
index c535ac7dd98e..504f6bf090c8 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: swfont.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: jp $ $Date: 2000-11-20 09:14:07 $
+ * last change: $Author: ama $ $Date: 2000-11-24 15:56:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -313,6 +313,7 @@ void SwFont::SetFnt( const SwAttrSet *pAttrSet )
aSub[SW_CTL].SetLanguage( pAttrSet->GetCTLLanguage().GetLanguage() );
}
SetUnderline( pAttrSet->GetUnderline().GetUnderline() );
+ SetUnderColor( pAttrSet->GetUnderline().GetColor() );
SetEmphasisMark( pAttrSet->GetEmphasisMark().GetEmphasisMark() );
SetStrikeout( pAttrSet->GetCrossedOut().GetStrikeout() );
SetColor( pAttrSet->GetColor().GetValue() );
@@ -449,7 +450,10 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet )
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_UNDERLINE,
TRUE, &pItem ))
+ {
SetUnderline( ((SvxUnderlineItem*)pItem)->GetUnderline() );
+ SetUnderColor( ((SvxUnderlineItem*)pItem)->GetColor() );
+ }
if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CROSSEDOUT,
TRUE, &pItem ))
SetStrikeout( ((SvxCrossedOutItem*)pItem)->GetStrikeout() );
@@ -518,6 +522,7 @@ SwFont::SwFont( const SwFont &rFont )
aSub[SW_CTL] = rFont.aSub[SW_CTL];
nActual = rFont.nActual;
pBackColor = rFont.pBackColor ? new Color( *rFont.pBackColor ) : NULL;
+ aUnderColor = rFont.GetUnderColor();
nToxCnt = nRefCnt = 0;
bFntChg = rFont.bFntChg;
bOrgChg = rFont.bOrgChg;
@@ -590,6 +595,7 @@ SwFont::SwFont( const SwAttrSet* pAttrSet )
}
SetUnderline( pAttrSet->GetUnderline().GetUnderline() );
+ SetUnderColor( pAttrSet->GetUnderline().GetColor() );
SetEmphasisMark( pAttrSet->GetEmphasisMark().GetEmphasisMark() );
SetStrikeout( pAttrSet->GetCrossedOut().GetStrikeout() );
SetColor( pAttrSet->GetColor().GetValue() );
@@ -632,6 +638,7 @@ SwFont& SwFont::operator=( const SwFont &rFont )
nActual = rFont.nActual;
delete pBackColor;
pBackColor = rFont.pBackColor ? new Color( *rFont.pBackColor ) : NULL;
+ aUnderColor = rFont.GetUnderColor();
nToxCnt = nRefCnt = 0;
bFntChg = rFont.bFntChg;
bOrgChg = rFont.bOrgChg;
@@ -726,6 +733,8 @@ void SwFont::ChgPhysFnt( ViewShell *pSh, OutputDevice *pOut )
ChgFnt( pSh, pOut );
bFntChg = bOrgChg;
}
+ if( pOut->GetTextLineColor() != aUnderColor )
+ pOut->SetTextLineColor( aUnderColor );
}
/*************************************************************************