tdf#109214 - Highlight the favorites in the grid of special characters

Change-Id: Ie1bb019495d2db4acd92da4bccf44ece2bd1d976
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131446
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index bda30b7..0e991d6 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -421,6 +421,8 @@ void SvxCharacterMap::updateFavCharControl()
    }
    m_xShowSet->getFavCharacterList();
    m_xSearchSet->getFavCharacterList();
    // tdf#109214 - redraw highlight of the favorite characters
    m_xShowSet->Invalidate();
}

void SvxCharacterMap::deleteFavCharacterFromList(std::u16string_view sTitle, std::u16string_view rFont)
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index 23b6cda..6b618d5 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -567,6 +567,19 @@ void SvxShowCharSet::DrawChars_Impl(vcl::RenderContext& rRenderContext, int n1, 
                aPointTxTy.AdjustX(nXHDelta - 1 );
        }

        // tdf#109214 - highlight the favorite characters
        if (isFavChar(aCharStr, mxVirDev->GetFont().GetFamilyName()))
        {
            const Color aLineCol = rRenderContext.GetLineColor();
            rRenderContext.SetLineColor(aHighlightColor);
            rRenderContext.SetFillColor(COL_TRANSPARENT);
            // Outer border
            rRenderContext.DrawRect(tools::Rectangle(Point(x - 1, y - 1), Size(nX + 3, nY + 3)));
            // Inner border
            rRenderContext.DrawRect(tools::Rectangle(Point(x, y), Size(nX + 1, nY + 1)));
            rRenderContext.SetLineColor(aLineCol);
        }

        Color aTextCol = rRenderContext.GetTextColor();
        if (i != nSelectedIndex)
        {