Revision: 2994
          http://skim-app.svn.sourceforge.net/skim-app/?rev=2994&view=rev
Author:   amaxwell
Date:     2007-09-28 16:58:26 -0700 (Fri, 28 Sep 2007)

Log Message:
-----------
Fix crash that occurs when the outline goes away in a revert situation.  This
can happen in a TeX situation due to a failed compile, or commenting out
hyperref.  Make sure the side view is set appropriately when this occurs also.

Modified Paths:
--------------
    trunk/SKMainWindowController.m

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2007-09-28 23:38:23 UTC (rev 2993)
+++ trunk/SKMainWindowController.m      2007-09-28 23:58:26 UTC (rev 2994)
@@ -839,14 +839,21 @@
     [pdfOutline release];
     pdfOutline = [[pdfDoc outlineRoot] retain];
     [pdfOutlineItems removeAllObjects];
-    if (pdfOutline) {
-        updatingOutlineSelection = YES;
-        [outlineView reloadData];
-        if ([outlineView numberOfRows] == 1)
-            [outlineView expandItem: [outlineView itemAtRow: 0] 
expandChildren: NO];
-        updatingOutlineSelection = NO;
-        [self updateOutlineSelection];
+    
+    updatingOutlineSelection = YES;
+    // If this is a reload following a TeX run and the user just killed the 
outline for some reason, we get a crash if the outlineView isn't reloaded, so 
no longer make it conditional on pdfOutline != nil
+    [outlineView reloadData];
+    if ([outlineView numberOfRows] == 1)
+        [outlineView expandItem: [outlineView itemAtRow: 0] expandChildren: 
NO];
+    updatingOutlineSelection = NO;
+    [self updateOutlineSelection];
+    
+    // handle the case as above where the outline has disappeared in a reload 
situation
+    if (nil == pdfOutline && currentLeftSideView == tocView) {
+        [self fadeInThumbnailView];
+        [leftSideButton setSelectedSegment:SKThumbnailSidePaneState];
     }
+
     [leftSideButton setEnabled:pdfOutline != nil 
forSegment:SKOutlineSidePaneState];
 }
 


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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to