Revision: 6605
          http://skim-app.svn.sourceforge.net/skim-app/?rev=6605&view=rev
Author:   hofman
Date:     2010-07-04 21:23:25 +0000 (Sun, 04 Jul 2010)

Log Message:
-----------
set contents of converted markup, circle, square notes to enclosed text when it 
was empty

Modified Paths:
--------------
    trunk/SKMainDocument.m
    trunk/SKPDFView.m
    trunk/SKStringConstants.h
    trunk/SKStringConstants.m

Modified: trunk/SKMainDocument.m
===================================================================
--- trunk/SKMainDocument.m      2010-07-04 10:21:48 UTC (rev 6604)
+++ trunk/SKMainDocument.m      2010-07-04 21:23:25 UTC (rev 6605)
@@ -941,6 +941,17 @@
                 if (newAnnotation) {
                     [[self pdfView] removeAnnotation:annotation];
                     [[self pdfView] addAnnotation:newAnnotation toPage:page];
+                    if ([[newAnnotation contents] length] == 0) {
+                        NSString *text = nil;
+                        if ([newAnnotation isMarkup]) {
+                            text = [[(PDFAnnotationMarkup *)newAnnotation 
selection] cleanedString];
+                        } else if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKDisableUpdateContentsFromEnclosedTextKey] == NO &&
+                                   ([[newAnnotation type] 
isEqualToString:SKNCircleString] || [[newAnnotation type] 
isEqualToString:SKNSquareString])) {
+                            text = [[page selectionForRect:[newAnnotation 
bounds]] cleanedString];
+                        }
+                        if ([text length])
+                            [newAnnotation setContents:text];
+                    }
                     [newAnnotation release];
                     didConvert = YES;
                 }

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2010-07-04 10:21:48 UTC (rev 6604)
+++ trunk/SKPDFView.m   2010-07-04 21:23:25 UTC (rev 6605)
@@ -96,7 +96,6 @@
 #define SKLargeMagnificationHeightKey @"SKLargeMagnificationHeight"
 #define SKMoveReadingBarModifiersKey @"SKMoveReadingBarModifiers"
 #define SKResizeReadingBarModifiersKey @"SKResizeReadingBarModifiers"
-#define SKDisableUpdateContentsFromEnclosedTextKey 
@"SKDisableUpdateContentsFromEnclosedText"
 #define SKDefaultFreeTextNoteContentsKey @"SKDefaultFreeTextNoteContents"
 #define SKDefaultAnchoredNoteContentsKey @"SKDefaultAnchoredNoteContents"
 #define SKUseToolModeCursorsKey @"SKUseToolModeCursors"

Modified: trunk/SKStringConstants.h
===================================================================
--- trunk/SKStringConstants.h   2010-07-04 10:21:48 UTC (rev 6604)
+++ trunk/SKStringConstants.h   2010-07-04 21:23:25 UTC (rev 6605)
@@ -125,3 +125,4 @@
 extern NSString *SKDisablePinchZoomKey;
 extern NSString *SKDisableModificationDateKey;
 extern NSString *SKDisableAnimationsKey;
+extern NSString *SKDisableUpdateContentsFromEnclosedTextKey;

Modified: trunk/SKStringConstants.m
===================================================================
--- trunk/SKStringConstants.m   2010-07-04 10:21:48 UTC (rev 6604)
+++ trunk/SKStringConstants.m   2010-07-04 21:23:25 UTC (rev 6605)
@@ -126,3 +126,4 @@
 NSString *SKDisablePinchZoomKey = @"SKDisablePinchZoom";
 NSString *SKDisableModificationDateKey = @"SKDisableModificationDate";
 NSString *SKDisableAnimationsKey = @"SKDisableAnimations";
+NSString *SKDisableUpdateContentsFromEnclosedTextKey = 
@"SKDisableUpdateContentsFromEnclosedText";


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to