Index: src/views/SkOSMenu.cpp |
diff --git a/src/views/SkOSMenu.cpp b/src/views/SkOSMenu.cpp |
index ec92a7b4a5f4e577f313ed79be07cfe107f9c616..50d53480dbf094f41abeb864e3f73a3848617143 100644 |
--- a/src/views/SkOSMenu.cpp |
+++ b/src/views/SkOSMenu.cpp |
@@ -148,21 +148,16 @@ int SkOSMenu::appendAction(const char label[], SkEventSinkID target) { |
} |
int SkOSMenu::appendList(const char label[], const char slotName[], |
- SkEventSinkID target, int index, const char option[], ...) { |
+ SkEventSinkID target, int index, const SkTArray<const char*>& entries) { |
SkEvent* evt = new SkEvent(gMenuEventType, target); |
- va_list args; |
- if (option) { |
- SkString str(option); |
- va_start(args, option); |
- int count = 1; |
- for (const char* arg = va_arg(args, const char*); arg != nullptr; arg = va_arg(args, const char*)) { |
+ if (!entries.empty()) { |
+ SkString str(entries[0]); |
+ for (int i = 1; i < entries.count(); ++i) { |
str += gDelimiter; |
- str += arg; |
- ++count; |
+ str += entries[i]; |
} |
- va_end(args); |
evt->setString(gList_Items_Str, str); |
- evt->setS32(gList_ItemCount_S32, count); |
+ evt->setS32(gList_ItemCount_S32, entries.count()); |
evt->setS32(slotName, index); |
} |
return appendItem(label, SkOSMenu::kList_Type, slotName, evt); |