0031021: Coding Rules - Deprecation warnings on OSX within Draw_Window_1.mm
authorkgv <kgv@opencascade.com>
Tue, 15 Oct 2019 17:46:57 +0000 (20:46 +0300)
committerapn <apn@opencascade.com>
Tue, 22 Oct 2019 12:15:40 +0000 (15:15 +0300)
Use new renamed enumeration values instead of deprecated ones.

src/Draw/Draw_Window_1.mm

index d17b2cb..ce12c46 100644 (file)
 
   #define NSCompositingOperationSourceOver NSCompositeSourceOver
 #endif
+#if !defined(MAC_OS_X_VERSION_10_14) || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_14)
+  #define NSBitmapImageFileTypePNG  NSPNGFileType
+  #define NSBitmapImageFileTypeBMP  NSBMPFileType
+  #define NSBitmapImageFileTypeJPEG NSJPEGFileType
+  #define NSBitmapImageFileTypeGIF  NSGIFFileType
+#endif
 
 @interface Draw_CocoaView : NSView
 {
@@ -561,10 +567,10 @@ Standard_Boolean Draw_Window::Save (Standard_CString theFileName) const
   NSString* aFileExtension = [[aFileName pathExtension] lowercaseString];
 
   NSDictionary* aFileTypeDict = [NSDictionary dictionaryWithObjectsAndKeys:
-                                  [NSNumber numberWithInt: NSPNGFileType],  @"png",
-                                  [NSNumber numberWithInt: NSBMPFileType],  @"bmp",
-                                  [NSNumber numberWithInt: NSJPEGFileType], @"jpg",
-                                  [NSNumber numberWithInt: NSGIFFileType],  @"gif",
+                                  [NSNumber numberWithInt: NSBitmapImageFileTypePNG],  @"png",
+                                  [NSNumber numberWithInt: NSBitmapImageFileTypeBMP],  @"bmp",
+                                  [NSNumber numberWithInt: NSBitmapImageFileTypeJPEG], @"jpg",
+                                  [NSNumber numberWithInt: NSBitmapImageFileTypeGIF],  @"gif",
                                   nil];
   if ([aFileTypeDict valueForKey: aFileExtension] == NULL)
   {