Revision: 15471
http://sourceforge.net/p/skim-app/code/15471
Author: hofman
Date: 2025-06-16 15:19:37 +0000 (Mon, 16 Jun 2025)
Log Message:
-----------
convenience accessor for undoManager of PDFPage
Modified Paths:
--------------
trunk/PDFPage_SKExtensions.m
Modified: trunk/PDFPage_SKExtensions.m
===================================================================
--- trunk/PDFPage_SKExtensions.m 2025-06-16 14:20:37 UTC (rev 15470)
+++ trunk/PDFPage_SKExtensions.m 2025-06-16 15:19:37 UTC (rev 15471)
@@ -552,6 +552,10 @@
return [[self document] containingDocument];
}
+- (NSUndoManager *)undoManager {
+ return [[self containingDocument] undoManager];
+}
+
- (NSUInteger)index {
return [self pageIndex] + 1;
}
@@ -562,7 +566,7 @@
- (void)setRotationAngle:(NSInteger)angle {
if ([self isEditable] && angle != [self rotation]) {
- NSUndoManager *undoManager = [[self containingDocument] undoManager];
+ NSUndoManager *undoManager = [self undoManager];
[(PDFPage *)[undoManager prepareWithInvocationTarget:self]
setRotationAngle:[self rotation]];
[undoManager setActionName:NSLocalizedString(@"Rotate Page", @"Undo
action name")];
[undoManager setActionIsDiscardable:YES];
@@ -580,7 +584,7 @@
- (void)setBoundsAsQDRect:(NSData *)inQDBoundsAsData {
if ([self isEditable] && inQDBoundsAsData && [inQDBoundsAsData
isEqual:[NSNull null]] == NO) {
- NSUndoManager *undoManager = [[self containingDocument] undoManager];
+ NSUndoManager *undoManager = [self undoManager];
[[undoManager prepareWithInvocationTarget:self]
setBoundsAsQDRect:[self boundsAsQDRect]];
[undoManager setActionName:NSLocalizedString(@"Crop Page", @"Undo
action name")];
[undoManager setActionIsDiscardable:YES];
@@ -603,7 +607,7 @@
- (void)setMediaBoundsAsQDRect:(NSData *)inQDBoundsAsData {
if ([self isEditable] && inQDBoundsAsData && [inQDBoundsAsData
isEqual:[NSNull null]] == NO) {
- NSUndoManager *undoManager = [[self containingDocument] undoManager];
+ NSUndoManager *undoManager = [self undoManager];
[[undoManager prepareWithInvocationTarget:self]
setMediaBoundsAsQDRect:[self mediaBoundsAsQDRect]];
[undoManager setActionName:NSLocalizedString(@"Crop Page", @"Undo
action name")];
[undoManager setActionIsDiscardable:YES];
@@ -675,7 +679,7 @@
- (void)insertObject:(PDFAnnotation *)newNote
inNotesAtIndex:(NSUInteger)anIndex {
if ([self isEditable] && [[self document] allowsNotes]) {
[[self document] addAnnotation:newNote toPage:self];
- [[[self containingDocument] undoManager]
setActionName:NSLocalizedString(@"Add Note", @"Undo action name")];
+ [[self undoManager] setActionName:NSLocalizedString(@"Add Note",
@"Undo action name")];
}
}
@@ -683,7 +687,7 @@
if ([self isEditable] && [[self document] allowsNotes]) {
PDFAnnotation *note = [[self notes] objectAtIndex:anIndex];
[[self document] removeAnnotation:note];
- [[[self containingDocument] undoManager]
setActionName:NSLocalizedString(@"Remove Note", @"Undo action name")];
+ [[self undoManager] setActionName:NSLocalizedString(@"Remove Note",
@"Undo action name")];
}
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit