Index: src/pdf/SkPDFMetadata.cpp |
diff --git a/src/pdf/SkPDFMetadata.cpp b/src/pdf/SkPDFMetadata.cpp |
index 5a1d7aa406e6747aaebe903044f07791a8238e07..4ca1903d21b2a23fce8268b994b513044a30c7ec 100644 |
--- a/src/pdf/SkPDFMetadata.cpp |
+++ b/src/pdf/SkPDFMetadata.cpp |
@@ -263,7 +263,7 @@ const SkString escape_xml(const SkString& input, |
// Validate that we haven't written outside of our string. |
SkASSERT(out == &output.writable_str()[output.size()]); |
*out = '\0'; |
- return std::move(output); |
+ return output; |
} |
SkPDFObject* SkPDFMetadata::createXMPObject(const UUID& doc, |
@@ -285,7 +285,6 @@ SkPDFObject* SkPDFMetadata::createXMPObject(const UUID& doc, |
"<pdfaid:conformance>B</pdfaid:conformance>\n" |
"%s" // ModifyDate |
"%s" // CreateDate |
- "%s" // MetadataDate |
"%s" // xmp:CreatorTool |
"<dc:format>application/pdf</dc:format>\n" |
"%s" // dc:title |
@@ -303,7 +302,6 @@ SkPDFObject* SkPDFMetadata::createXMPObject(const UUID& doc, |
SkString creationDate; |
SkString modificationDate; |
- SkString metadataDate; |
if (fCreation) { |
SkString tmp; |
fCreation->toISO8601(&tmp); |
@@ -318,25 +316,25 @@ SkPDFObject* SkPDFMetadata::createXMPObject(const UUID& doc, |
SkASSERT(0 == count_xml_escape_size(tmp)); |
modificationDate = sk_string_printf( |
"<xmp:ModifyDate>%s</xmp:ModifyDate>\n", tmp.c_str()); |
- metadataDate = sk_string_printf( |
- "<xmp:MetadataDate>%s</xmp:MetadataDate>\n", tmp.c_str()); |
} |
- |
- SkString title = |
- escape_xml(get(fInfo, "Title"), "<dc:title><rdf:Alt><rdf:li>", |
- "</rdf:li></rdf:Alt></dc:title>\n"); |
- SkString author = |
- escape_xml(get(fInfo, "Author"), "<dc:creator><rdf:Bag><rdf:li>", |
- "</rdf:li></rdf:Bag></dc:creator>\n"); |
+ SkString title = escape_xml( |
+ get(fInfo, "Title"), |
+ "<dc:title><rdf:Alt><rdf:li xml:lang=\"x-default\">", |
+ "</rdf:li></rdf:Alt></dc:title>\n"); |
+ SkString author = escape_xml( |
+ get(fInfo, "Author"), "<dc:creator><rdf:Bag><rdf:li>", |
+ "</rdf:li></rdf:Bag></dc:creator>\n"); |
// TODO: in theory, XMP can support multiple authors. Split on a delimiter? |
- SkString subject = escape_xml(get(fInfo, "Subject"), |
- "<dc:description><rdf:Alt><rdf:li>", |
- "</rdf:li></rdf:Alt></dc:description>\n"); |
- SkString keywords1 = |
- escape_xml(get(fInfo, "Keywords"), "<dc:subject><rdf:Bag><rdf:li>", |
- "</rdf:li></rdf:Bag></dc:subject>\n"); |
- SkString keywords2 = escape_xml(get(fInfo, "Keywords"), "<pdf:Keywords>", |
- "</pdf:Keywords>\n"); |
+ SkString subject = escape_xml( |
+ get(fInfo, "Subject"), |
+ "<dc:description><rdf:Alt><rdf:li xml:lang=\"x-default\">", |
+ "</rdf:li></rdf:Alt></dc:description>\n"); |
+ SkString keywords1 = escape_xml( |
+ get(fInfo, "Keywords"), "<dc:subject><rdf:Bag><rdf:li>", |
+ "</rdf:li></rdf:Bag></dc:subject>\n"); |
+ SkString keywords2 = escape_xml( |
+ get(fInfo, "Keywords"), "<pdf:Keywords>", |
+ "</pdf:Keywords>\n"); |
// TODO: in theory, keywords can be a list too. |
SkString creator = escape_xml(get(fInfo, "Creator"), "<xmp:CreatorTool>", |
@@ -347,7 +345,7 @@ SkPDFObject* SkPDFMetadata::createXMPObject(const UUID& doc, |
SkASSERT(0 == count_xml_escape_size(instanceID)); |
return new PDFXMLObject(sk_string_printf( |
templateString, modificationDate.c_str(), creationDate.c_str(), |
- metadataDate.c_str(), creator.c_str(), title.c_str(), |
+ creator.c_str(), title.c_str(), |
subject.c_str(), author.c_str(), keywords1.c_str(), |
documentID.c_str(), instanceID.c_str(), keywords2.c_str())); |
} |