no need to do repeated lookups here

Change-Id: Iec30aa6bbd1bcb8bb22cfb002f81ea04458755b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178116
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
This commit is contained in:
Noel Grandin 2024-12-08 19:43:46 +02:00
parent 0892ff2de0
commit ba16fd8e74

View file

@ -1357,12 +1357,14 @@ void SwTextPaintInfo::DrawCSDFHighlighting(const SwLinePortion &rPor) const
OUString sCharStyleDisplayName; OUString sCharStyleDisplayName;
sCharStyleDisplayName = SwStyleNameMapper::GetUIName(sCurrentCharStyle, sCharStyleDisplayName = SwStyleNameMapper::GetUIName(sCurrentCharStyle,
SwGetPoolIdFromName::ChrFmt); SwGetPoolIdFromName::ChrFmt);
if (!sCharStyleDisplayName.isEmpty() if (!sCharStyleDisplayName.isEmpty())
&& rCharStylesColorMap.find(sCharStyleDisplayName)
!= rCharStylesColorMap.end())
{ {
aFillColor = rCharStylesColorMap[sCharStyleDisplayName].first; auto it = rCharStylesColorMap.find(sCharStyleDisplayName);
sCSNumberOrDF = OUString::number(rCharStylesColorMap[sCharStyleDisplayName].second); if (it != rCharStylesColorMap.end())
{
aFillColor = it->second.first;
sCSNumberOrDF = OUString::number(it->second.second);
}
} }
} }
} }