Merge remote-tracking branch 'upstream/main' into Aristo3

This commit is contained in:
daboe01 committed 2026-05-19 18:53:15 +02:00
commit f06bdbb14f
5 files changed
+106 -17

No files matched your search

+78 -6
View File
@@ -395,6 +395,8 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
CPInteger _editingColumn;
SEL _doubleAction;
id _doubleClickTarget @accessors(property=doubleClickTarget);
id _doubleClickArgument @accessors(property=doubleClickArgument);
CPInteger _clickedRow;
CPInteger _clickedColumn;
unsigned _columnAutoResizingStyle;
@@ -3709,13 +3711,73 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
[removeIndexes addIndex:columnIdx];
}
var rowIndexes = [CPIndexSet indexSetWithIndexesInRange:CPMakeRange(0, [self numberOfRows])];
[self _unloadDataViewsInRows:rowIndexes columns:removeIndexes];
if ([removeIndexes count] > 0)
{
var rowIndexes = [CPIndexSet indexSetWithIndexesInRange:CPMakeRange(0, [self numberOfRows])];
[self _unloadDataViewsInRows:rowIndexes columns:removeIndexes];
[_tableColumns removeObjectsAtIndexes:removeIndexes];
[_tableColumns removeObjectsAtIndexes:removeIndexes];
_dirtyTableColumnRangeIndex = 0;
[self _recalculateTableColumnRanges];
_dirtyTableColumnRangeIndex = 0;
[self _recalculateTableColumnRanges];
// Shift cached index sets downwards to account for the removed columns
var shiftIndexSet = function(indexSet)
{
var newSet = [CPIndexSet indexSet];
[indexSet enumerateIndexesUsingBlock:function(idx, stop)
{
if (![removeIndexes containsIndex:idx])
{
var shift = 0,
remIdx = [removeIndexes firstIndex];
while (remIdx !== CPNotFound && remIdx < idx)
{
shift++;
remIdx = [removeIndexes indexGreaterThanIndex:remIdx];
}
[newSet addIndex:idx - shift];
}
}];
return newSet;
};
_exposedColumns = shiftIndexSet(_exposedColumns);
_selectedColumnIndexes = shiftIndexSet(_selectedColumnIndexes);
// Shift individual index variables
var shiftIndex = function(idx)
{
if (idx === CPNotFound || idx === -1)
return idx;
if ([removeIndexes containsIndex:idx])
return CPNotFound;
var shift = 0,
remIdx = [removeIndexes firstIndex];
while (remIdx !== CPNotFound && remIdx < idx)
{
shift++;
remIdx = [removeIndexes indexGreaterThanIndex:remIdx];
}
return idx - shift;
};
_editingColumn = shiftIndex(_editingColumn);
_draggedColumnIndex = shiftIndex(_draggedColumnIndex);
if (_draggedColumnIndex === CPNotFound)
_draggedColumnIndex = -1;
_clickedColumn = shiftIndex(_clickedColumn);
if (_clickedColumn === CPNotFound)
_clickedColumn = -1;
}
[_differedColumnDataToRemove removeAllObjects];
_needsDifferedTableColumnRemove = NO;
@@ -4733,7 +4795,12 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
//double click actions
if ([[CPApp currentEvent] clickCount] === 2 && _doubleAction)
[self sendAction:_doubleAction to:_target];
{
var target = _doubleClickTarget || _target,
argument = [self infoForBinding:@"doubleClickArgument"] ? _doubleClickArgument : self;
[CPApp sendAction:_doubleAction to:target from:argument];
}
}
/*
@@ -6148,6 +6215,11 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
{
if (aBinding == @"content")
_contentBindingExplicitlySet = YES;
else if (aBinding == @"doubleClickTarget")
{
if ([options objectForKey:CPSelectorNameBindingOption])
[self setDoubleAction:CPSelectorFromString([options objectForKey:CPSelectorNameBindingOption])];
}
[super bind:aBinding toObject:anObject withKeyPath:aKeyPath options:options];
}
+2
View File
@@ -286,6 +286,8 @@ _oncontextmenuhandler = function () { return false; };
if (removeRange.length)
_removeInvalidLineFragmentsRange = CPMakeRangeCopy(removeRange);
else
_removeInvalidLineFragmentsRange = nil;
// We erased all lines
if (!startIndex)
+11
View File
@@ -365,6 +365,17 @@ var CPSystemTypesetterFactory,
wrapWidth = rangeWidth;
wrapRange._height = _lineHeight;
wrapRange._base = _lineBase;
// Optimization: Start measuring from the next character to avoid O(n^2)
// string width calculation within a line since spaces do not carry ligatures or kerning.
// Only reset the measuring range if the next character is NOT another space.
// This prevents compounded subpixel rounding errors with contiguous spaces.
if (theString.charCodeAt(glyphIndex + 1) !== 32)
{
currentAnchor = rangeWidth;
measuringRange = CPMakeRange(glyphIndex + 1, 0);
}
break;
case 10: