From cea15b4dee3ca87ec56f0d034c896ac3cee041e5 Mon Sep 17 00:00:00 2001 From: Oleg Pekhovskiy Date: Thu, 3 Oct 2013 16:51:56 +0400 Subject: [PATCH] 8013553: [macosx] java.awt.FileDialog removes file extensions Reviewed-by: leonidr, serb --- jdk/src/macosx/native/sun/awt/CFileDialog.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/jdk/src/macosx/native/sun/awt/CFileDialog.m b/jdk/src/macosx/native/sun/awt/CFileDialog.m index af92c77bed3..74ea1fb6883 100644 --- a/jdk/src/macosx/native/sun/awt/CFileDialog.m +++ b/jdk/src/macosx/native/sun/awt/CFileDialog.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -93,6 +93,14 @@ canChooseDirectories:(BOOL)inChooseDirectories - (void)safeSaveOrLoad { NSSavePanel *thePanel = nil; + /* + * 8013553: turns off extension hiding for the native file dialog. + * This way is used because setExtensionHidden(NO) doesn't work + * as expected. + */ + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + [defaults setBool:NO forKey:@"NSNavLastUserSetHideExtensionButtonState"]; + if (fMode == java_awt_FileDialog_SAVE) { thePanel = [NSSavePanel savePanel]; [thePanel setAllowsOtherFileTypes:YES];