diff --git a/Frameworks/OakAppKit/src/OakPasteboardSelector.mm b/Frameworks/OakAppKit/src/OakPasteboardSelector.mm index cbe644fc..a73c1043 100644 --- a/Frameworks/OakAppKit/src/OakPasteboardSelector.mm +++ b/Frameworks/OakAppKit/src/OakPasteboardSelector.mm @@ -136,6 +136,7 @@ static size_t line_count (std::string const& text) } - (void)setTableView:(NSTableView*)aTableView; @property (nonatomic) BOOL shouldClose; +@property (nonatomic) BOOL shouldCancel; @end @implementation OakPasteboardSelectorTableViewHelper @@ -234,7 +235,8 @@ static size_t line_count (std::string const& text) - (void)cancel:(id)sender { - _shouldClose = YES; + _shouldCancel = YES; + _shouldClose = YES; } - (void)doCommandBySelector:(SEL)aSelector @@ -335,7 +337,7 @@ static size_t line_count (std::string const& text) [parentWindow removeChildWindow:window]; [window orderOut:self]; - return [tableView selectedRow]; + return tableViewHelper.shouldCancel ? -1 : [tableView selectedRow]; } - (void)setWidth:(CGFloat)width;