From ccc19cc539dd836aa3b55ec55f3db2b6f1be1798 Mon Sep 17 00:00:00 2001 From: Sergey Luzyanin Date: Fri, 6 Feb 2026 18:05:56 +0300 Subject: [PATCH] [bug] fix bug 79551 --- .../Paragraph/draw/highlight-draw-state.js | 33 ++++++++++++------- word/Editor/Styles.js | 9 ++++- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/word/Editor/Paragraph/draw/highlight-draw-state.js b/word/Editor/Paragraph/draw/highlight-draw-state.js index 761362b5b1..b92b6ab143 100644 --- a/word/Editor/Paragraph/draw/highlight-draw-state.js +++ b/word/Editor/Paragraph/draw/highlight-draw-state.js @@ -447,21 +447,30 @@ this.run = run; let textPr = run.getCompiledPr(); - let shd = this.DrawShd ? textPr.Shd : null; - - this.shd = shd; - this.shdColor = shd && !shd.IsNil() ? shd.GetSimpleColor(this.drawState.getTheme(), this.drawState.getColorMap()) : null; - this.shdAlpha = shd && !shd.IsNil() ? shd.GetAlpha(this.drawState.getTheme(), this.drawState.getColorMap(), this.Paragraph.GetLogicDocument()) : 255; - if (!this.shdColor || this.shdColor.IsAuto() || (run.IsMathRun() && run.IsPlaceholder())) - this.shdColor = null; - - this.highlight = textPr.HighLight; + let shd = null; + if (this.DrawShd) + { + shd = textPr.Shd; + } if (textPr.HighlightColor) { - textPr.HighlightColor.check(this.drawState.getTheme(), this.drawState.getColorMap()); - let RGBA = textPr.HighlightColor.RGBA; - this.highlight = new CDocumentColor(RGBA.R, RGBA.G, RGBA.B, false); + shd = new CDocumentShd(); + shd.Value = Asc.c_oAscShd.Clear; + shd.ThemeFill = AscFormat.CreateUniFillByUniColor(textPr.HighlightColor); } + this.shd = shd; + this.shdColor = null; + this.shdAlpha = 255; + if (shd && !shd.IsNil()) + { + this.shdColor = shd.GetSimpleColor(this.drawState.getTheme(), this.drawState.getColorMap()); + this.shdAlpha = shd.GetAlpha(this.drawState.getTheme(), this.drawState.getColorMap()); + if (!this.shdColor || this.shdColor.IsAuto() || (run.IsMathRun() && run.IsPlaceholder())) + this.shdColor = null; + } + + + this.highlight = textPr.HighLight; }; /** * diff --git a/word/Editor/Styles.js b/word/Editor/Styles.js index d81d9dbf0e..b911cab80c 100644 --- a/word/Editor/Styles.js +++ b/word/Editor/Styles.js @@ -10089,8 +10089,15 @@ CDocumentShd.prototype.GetSimpleColor = function(oTheme, oColorMap) return oResultColor; }; -CDocumentShd.prototype.GetAlpha = function(theme, colorMap, logicDocument) +CDocumentShd.prototype.GetAlpha = function(theme, colorMap) { + let unifill = this.ThemeFill; + if (unifill) + { + unifill.check(theme, colorMap); + let rgba = unifill.getRGBAColor(); + return (rgba.A !== undefined && rgba.A !== null) ? rgba.A : 255; + } return 255; }; CDocumentShd.prototype.private_GetPctShdColor = function(nPct, strokeColor, fillColor)