diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2023-05-31 21:59:06 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2023-06-15 22:37:16 +0200 |
commit | 9474ff4cc0abbd16f91ea582050c2332bdad88a3 (patch) | |
tree | 046da2b8dd9fcef1eac27f179fd6e3fb1e0595cf /editeng | |
parent | 12f256cd1ae3e625c7b7f48987b7e843046924fa (diff) |
tdf#103064 editeng: fix handling of char highlighting
Transparency should be set to false if a color is present, but not
with COL_TRANSPARENT. Compare with what is done for shape text in
VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D.
Change-Id: I5e4c8e53b53a363813ced50358c5ee795cdb61dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153107
Tested-by: Jenkins
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editattr.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/editdoc.cxx | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/editeng/source/editeng/editattr.cxx b/editeng/source/editeng/editattr.cxx index 3277ed0916ba..42e5f20206ba 100644 --- a/editeng/source/editeng/editattr.cxx +++ b/editeng/source/editeng/editattr.cxx @@ -230,7 +230,7 @@ EditCharAttribBackgroundColor::EditCharAttribBackgroundColor( void EditCharAttribBackgroundColor::SetFont( SvxFont& rFont, OutputDevice* ) { Color aColor = static_cast<const SvxColorItem*>(GetItem())->GetValue(); - rFont.SetTransparent(false); + rFont.SetTransparent(aColor == COL_TRANSPARENT); rFont.SetFillColor(aColor); } diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index 9fff222d9368..08750a94fcd2 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -1976,7 +1976,6 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent, S { vcl::Font aPrevFont( rFont ); rFont.SetAlignment( ALIGN_BASELINE ); - rFont.SetTransparent( true ); sal_uInt16 nWhich_FontInfo = GetScriptItemId( EE_CHAR_FONTINFO, nScriptType ); sal_uInt16 nWhich_Language = GetScriptItemId( EE_CHAR_LANGUAGE, nScriptType ); @@ -1997,7 +1996,11 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent, S if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_COLOR ) == SfxItemState::SET ) ) rFont.SetColor( rSet.Get( EE_CHAR_COLOR ).GetValue() ); if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_BKGCOLOR ) == SfxItemState::SET ) ) - rFont.SetFillColor( rSet.Get( EE_CHAR_BKGCOLOR ).GetValue() ); + { + auto& aColor = rSet.Get( EE_CHAR_BKGCOLOR ).GetValue(); + rFont.SetTransparent(aColor == COL_TRANSPARENT); + rFont.SetFillColor(aColor); + } if ( bSearchInParent || ( rSet.GetItemState( nWhich_FontHeight ) == SfxItemState::SET ) ) rFont.SetFontSize( Size( rFont.GetFontSize().Width(), static_cast<const SvxFontHeightItem&>(rSet.Get( nWhich_FontHeight ) ).GetHeight() ) ); if ( bSearchInParent || ( rSet.GetItemState( nWhich_Weight ) == SfxItemState::SET ) ) |