Title: [104870] branches/safari-534.54-branch/Source/WebKit2
Revision
104870
Author
lforsch...@apple.com
Date
2012-01-12 15:48:52 -0800 (Thu, 12 Jan 2012)

Log Message

Merged r95607.

Modified Paths

Diff

Modified: branches/safari-534.54-branch/Source/WebKit2/ChangeLog (104869 => 104870)


--- branches/safari-534.54-branch/Source/WebKit2/ChangeLog	2012-01-12 23:46:41 UTC (rev 104869)
+++ branches/safari-534.54-branch/Source/WebKit2/ChangeLog	2012-01-12 23:48:52 UTC (rev 104870)
@@ -1,5 +1,25 @@
 2011-1-12  Lucas Forschler  <lforsch...@apple.com>
 
+    Merge 95607
+
+    2011-09-21  Mark Rowe  <mr...@apple.com>
+
+            <rdar://problem/9890932> "Open PDF in Preview" on two PDFs of the same name does nothing the second time
+
+            The logic in PDFViewController::pathToPDFOnDisk that deals with constructing a unique
+            file name if a file of the suggested name already exists was incorrect. It was appending
+            the template used by mkstemps to the directory name component of the path rather than
+            using it as a prefix on the filename portion of the path. This resulted in a template path
+            like WebKitPDFs-ABCDEFXXXXXX-/foo.pdf where WebKitPDFs-ABCDEF/XXXXXX-foo.pdf was expected.
+
+            Reviewed by Jon Honeycutt.
+
+            * UIProcess/API/mac/PDFViewController.mm:
+            (WebKit::PDFViewController::pathToPDFOnDisk): Append the template as a new path component,
+            then append the suggested file name to that component.
+
+2011-1-12  Lucas Forschler  <lforsch...@apple.com>
+
     Merge 94317
 
     2011-09-01  Tim Horton  <timothy_hor...@apple.com>

Modified: branches/safari-534.54-branch/Source/WebKit2/UIProcess/API/mac/PDFViewController.mm (104869 => 104870)


--- branches/safari-534.54-branch/Source/WebKit2/UIProcess/API/mac/PDFViewController.mm	2012-01-12 23:46:41 UTC (rev 104869)
+++ branches/safari-534.54-branch/Source/WebKit2/UIProcess/API/mac/PDFViewController.mm	2012-01-12 23:48:52 UTC (rev 104870)
@@ -584,8 +584,8 @@
 
     NSFileManager *fileManager = [NSFileManager defaultManager];
     if ([fileManager fileExistsAtPath:path]) {
-        NSString *pathTemplatePrefix = [pdfDirectoryPath stringByAppendingString:@"XXXXXX-"];
-        NSString *pathTemplate = [pathTemplatePrefix stringByAppendingPathComponent:m_suggestedFilename.get()];
+        NSString *pathTemplatePrefix = [pdfDirectoryPath stringByAppendingPathComponent:@"XXXXXX-"];
+        NSString *pathTemplate = [pathTemplatePrefix stringByAppendingString:m_suggestedFilename.get()];
         CString pathTemplateRepresentation = [pathTemplate fileSystemRepresentation];
 
         int fd = mkstemps(pathTemplateRepresentation.mutableData(), pathTemplateRepresentation.length() - strlen([pathTemplatePrefix fileSystemRepresentation]) + 1);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to