summaryrefslogtreecommitdiff
path: root/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp')
-rw-r--r--core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp b/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
index 9693bc48ff..e2fa801a58 100644
--- a/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
+++ b/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
@@ -264,13 +264,20 @@ const CPDF_ContentMark* CPDF_PageContentGenerator::ProcessContentMarks(
}
// If there are parameters, write properties, direct or indirect.
- if (item->GetParamType() == CPDF_ContentMarkItem::DirectDict) {
- CPDF_StringArchiveStream archive_stream(buf);
- item->GetParam()->WriteTo(&archive_stream, nullptr);
- *buf << " ";
- } else {
- ASSERT(item->GetParamType() == CPDF_ContentMarkItem::PropertiesDict);
- *buf << "/" << item->GetPropertyName() << " ";
+ switch (item->GetParamType()) {
+ case CPDF_ContentMarkItem::DirectDict: {
+ CPDF_StringArchiveStream archive_stream(buf);
+ item->GetParam()->WriteTo(&archive_stream, nullptr);
+ *buf << " ";
+ break;
+ }
+ case CPDF_ContentMarkItem::PropertiesDict: {
+ *buf << "/" << item->GetPropertyName() << " ";
+ break;
+ }
+ default:
+ NOTREACHED();
+ break;
}
// Write BDC (begin dictionary content) operator.