diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-11-07 14:27:05 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-11-08 07:14:47 +0100 |
commit | e0dca3d96cdbbc265f5014b4b9344740c6a72cf3 (patch) | |
tree | 3bc6b0fd05b79819d4858a78434b1c259652baa1 /vcl/source | |
parent | 2469c623d7985e9e5db54ed8f96df02219def74d (diff) |
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 <sbergman@redhat.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/fontsubset/cff.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
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; |