vcl/source/fontsubset/cff.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
New commits: commit e0dca3d96cdbbc265f5014b4b9344740c6a72cf3 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Mon Nov 7 14:27:05 2022 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Tue Nov 8 07:14:47 2022 +0100 Fix string comparisons As discussed in the comments at <https://gerrit.libreoffice.org/c/core/+/139908/4#message-cf9911a7e4464d53d8ef852ad0c03e609dd4ac88> "tdf#123234: Fix subsetting CFF deprecated endchar", this probably happened to work most of the time "because pGlyphName presumably /does/ point at elements of the pStringIds array (or the ".notdef" literal near the top of CffSubsetterContext:getGlyphName body), and compilers generally /do/ deduplicate string literals at least per TU." But at least the "sterling" literal in pStandardEncoding does not have a matching literal in pStringIds, so that could never have matched pGlyphName via ==. Change-Id: I7e82cf709f02d426da9c6097e596bbd92b5d4d04 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142405 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx index c398ccb18b98..371c3bbc0682 100644 --- a/vcl/source/fontsubset/cff.cxx +++ b/vcl/source/fontsubset/cff.cxx @@ -1694,12 +1694,12 @@ bool CffSubsetterContext::getBaseAccent(ValType aBase, ValType aAccent, int* nBa for (int i = 0; i < mnCharStrCount; i++) { const char* pGlyphName = getGlyphName(i); - if (pGlyphName == pStandardEncoding[int(aBase)]) + if (std::strcmp(pGlyphName, pStandardEncoding[int(aBase)]) == 0) { *nBase = i; bBase = true; } - if (pGlyphName == pStandardEncoding[int(aAccent)]) + if (std::strcmp(pGlyphName, pStandardEncoding[int(aAccent)]) == 0) { *nAccent = i; bAccent = true;