diff options
author | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2013-08-17 18:32:23 +0200 |
---|---|---|
committer | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2013-08-18 09:49:52 +0200 |
commit | d22964a936919faea3ae9734d253ddfd05c01bc8 (patch) | |
tree | be75da7165026cb618b41e134c66d23535c1a846 /sw | |
parent | cc7a94cfa8ec901627e8f9abf28c724923deb520 (diff) |
Paint drop cap background only once
Painting default background is unecessary when
there is a user defined background.
Change-Id: I6564f403f0f7769b5460b07d5f3947be08c0dbf6
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/text/txtdrop.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx index 500b5e094430..db5e3ca4088c 100644 --- a/sw/source/core/text/txtdrop.cxx +++ b/sw/source/core/text/txtdrop.cxx @@ -273,10 +273,6 @@ bool SwTxtNode::GetDropSize(int& rFontHeight, int& rDropHeight, int& rDropDescen void SwDropPortion::PaintTxt( const SwTxtPaintInfo &rInf ) const { - if ( rInf.OnWin() && - !rInf.GetOpt().IsPagePreview() && !rInf.GetOpt().IsReadonly() && SwViewOption::IsFieldShadings() ) - rInf.DrawBackground( *this ); - OSL_ENSURE( nDropHeight && pPart && nLines != 1, "Drop Portion painted twice" ); const SwDropPortionPart* pCurrPart = GetPart(); @@ -299,6 +295,13 @@ void SwDropPortion::PaintTxt( const SwTxtPaintInfo &rInf ) const ((SwTxtPaintInfo&)rInf).SetLen( pCurrPart->GetLen() ); SwFontSave aFontSave( rInf, &pCurrPart->GetFont() ); + if ( rInf.OnWin() && + !rInf.GetOpt().IsPagePreview() && !rInf.GetOpt().IsReadonly() && SwViewOption::IsFieldShadings() && + (!pCurrPart->GetFont().GetBackColor() || *pCurrPart->GetFont().GetBackColor() == Color(COL_TRANSPARENT)) ) + { + rInf.DrawBackground( *this ); + } + SwTxtPortion::Paint( rInf ); ((SwTxtPaintInfo&)rInf).SetIdx( rInf.GetIdx() + pCurrPart->GetLen() ); |