Tiny fix to two attributes of PDF tags

I used the wrong data type for encoding the alt text and language of
a node in the PDF structure tree. "Alt" and "Lang" should both be
strings (arbitrary text), not names (which are supposed to be used for
keywords that are defined as part of the text).

Bug: chromium:607777
Change-Id: I1000c177d66a1e4f68afc713fc950369ecf3b408
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275010
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
This commit is contained in:
Dominic Mazzoni 2020-03-04 09:45:18 -08:00 committed by Skia Commit-Bot
parent 345af2527d
commit 4db2af43d0

View File

@ -277,10 +277,10 @@ SkPDFIndirectReference prepare_tag_tree_to_emit(SkPDFIndirectReference parent,
dict.insertName("S", tag_name_from_type(node->fType));
}
if (!node->fAlt.isEmpty()) {
dict.insertName("Alt", node->fAlt);
dict.insertString("Alt", node->fAlt);
}
if (!node->fLang.isEmpty()) {
dict.insertName("Lang", node->fLang);
dict.insertString("Lang", node->fLang);
}
dict.insertRef("P", parent);
dict.insertObject("K", std::move(kids));