editeng/source/editeng/editattr.cxx |    2 +-
 editeng/source/editeng/editdoc.cxx  |    7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit aa8d68f9764eb7714871de7c56b5a0ca7c2ead8b
Author:     Maxim Monastirsky <momonas...@gmail.com>
AuthorDate: Wed May 31 21:59:06 2023 +0300
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Nov 1 21:56:33 2023 +0100

    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 <momonas...@gmail.com>
    (cherry picked from commit 9474ff4cc0abbd16f91ea582050c2332bdad88a3)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158699
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

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 ) )

Reply via email to