diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-12-13 16:27:32 +0000 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-12-14 20:12:33 +0100 |
commit | ad65448f3a3c1186c2c86970cbb7df1c48f81ba7 (patch) | |
tree | 039a998cbdfb144f3421f238e4f6dae7622c2583 /sw | |
parent | 4544d10c3833b05a5cdb653e8ba59749f09430f1 (diff) |
Get the style color and number just once
Change-Id: I4dfa6feb1f41f9c62bd025ff521adc011c655926
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178453
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 68486df83780..a24963e7afca 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -4576,15 +4576,18 @@ void SwTextFrame::PaintParagraphStylesHighlighting() const pRenderContext->Push(vcl::PushFlags::ALL); - pRenderContext->SetFillColor(rParaStylesColorMap[sStyleName].first); - pRenderContext->SetLineColor(rParaStylesColorMap[sStyleName].first); + Color nStyleColor = rParaStylesColorMap[sStyleName].first; + int nStyleNumber = rParaStylesColorMap[sStyleName].second; + + pRenderContext->SetFillColor(nStyleColor); + pRenderContext->SetLineColor(nStyleColor); pRenderContext->DrawRect(aRect); // draw hatch pattern if paragraph has direct formatting if (SwDoc::HasParagraphDirectFormatting(SwPosition(*GetTextNodeForParaProps()))) { - Color aHatchColor(rParaStylesColorMap[sStyleName].first); + Color aHatchColor(nStyleColor); // make hatch line color 41% darker than the fill color aHatchColor.ApplyTintOrShade(-4100); Hatch aHatch(HatchStyle::Single, aHatchColor, 50, 450_deg10); @@ -4593,8 +4596,8 @@ void SwTextFrame::PaintParagraphStylesHighlighting() const pRenderContext->SetFont(aFont); pRenderContext->SetLayoutMode(vcl::text::ComplexTextLayoutFlags::Default); - pRenderContext->SetTextFillColor(rParaStylesColorMap[sStyleName].first); - pRenderContext->DrawText(aRect, OUString::number(rParaStylesColorMap[sStyleName].second), + pRenderContext->SetTextFillColor(nStyleColor); + pRenderContext->DrawText(aRect, OUString::number(nStyleNumber), DrawTextFlags::Center | DrawTextFlags::VCenter); pRenderContext->Pop(); |