mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-27 06:35:16 +00:00
Check invalid usage of drop_range_op() function
This commit is contained in:
parent
dd2f10bcd8
commit
7fb32ab45a
@ -40,6 +40,12 @@ static DocumentRange drop_range_op(
|
||||
Document* doc, Op op, const DocumentRange& from,
|
||||
DocumentRangePlace place, const DocumentRange& to)
|
||||
{
|
||||
if (place != kDocumentRangeBefore &&
|
||||
place != kDocumentRangeAfter) {
|
||||
ASSERT(false);
|
||||
throw std::invalid_argument("Invalid 'place' argument");
|
||||
}
|
||||
|
||||
Sprite* sprite = doc->sprite();
|
||||
|
||||
// Check noop/trivial/do nothing cases, i.e., move a range to the same place.
|
||||
@ -83,6 +89,9 @@ static DocumentRange drop_range_op(
|
||||
switch (op) {
|
||||
case Move: undoLabel = "Move Range"; break;
|
||||
case Copy: undoLabel = "Copy Range"; break;
|
||||
default:
|
||||
ASSERT(false);
|
||||
throw std::invalid_argument("Invalid 'op' argument");
|
||||
}
|
||||
DocumentRange resultRange;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user