diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-10-10 21:26:08 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-10-11 08:13:20 +0200 |
commit | cd3c315e5a5c7d0a961418cfce3b1683f9ab5ad9 (patch) | |
tree | c919594ead1deeaa2d7e24886c06b1133994ad41 | |
parent | 9943f37e8a80f2c4df6d58da4c50f3e7f3d6f3ce (diff) |
-Werror,-Wdeprecated-declarations (--with-macosx-version-min-required=10.14)
These are all the cases where the warning suggests a direct replacement.
This is a companion to 2f2c9df8e270ede0fd71b146380c3883b75d8f0d
"-Werror,-Wdeprecated-declarations (--with-macosx-version-min-required=10.14)"
which covered all the other cases (via SAL_WNODEPRECATED_PUSH/POP) that offered
no direct replacement.
Change-Id: If22a3f8cec1ff22fd1ac4b9d2f2bffde50e11e86
Reviewed-on: https://gerrit.libreoffice.org/61633
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | fpicker/source/aqua/AquaFilePickerDelegate.mm | 2 | ||||
-rw-r--r-- | fpicker/source/aqua/ControlHelper.hxx | 2 | ||||
-rw-r--r-- | fpicker/source/aqua/ControlHelper.mm | 10 | ||||
-rw-r--r-- | vcl/osx/DataFlavorMapping.cxx | 24 | ||||
-rw-r--r-- | vcl/osx/PictToBmpFlt.cxx | 2 | ||||
-rw-r--r-- | vcl/osx/printaccessoryview.mm | 8 | ||||
-rw-r--r-- | vcl/osx/salmenu.cxx | 2 | ||||
-rw-r--r-- | vcl/quartz/salgdicommon.cxx | 2 |
8 files changed, 26 insertions, 26 deletions
diff --git a/fpicker/source/aqua/AquaFilePickerDelegate.mm b/fpicker/source/aqua/AquaFilePickerDelegate.mm index e6eaf32c37ea..d9506c2c72e8 100644 --- a/fpicker/source/aqua/AquaFilePickerDelegate.mm +++ b/fpicker/source/aqua/AquaFilePickerDelegate.mm @@ -105,7 +105,7 @@ return; } uno::Any aValue; - aValue <<= ([static_cast<NSButton*>(sender) state] == NSOnState); + aValue <<= ([static_cast<NSButton*>(sender) state] == NSControlStateValueOn); filePicker->setValue(css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION, 0, aValue); } diff --git a/fpicker/source/aqua/ControlHelper.hxx b/fpicker/source/aqua/ControlHelper.hxx index 227e5472f6af..f984b5281c0f 100644 --- a/fpicker/source/aqua/ControlHelper.hxx +++ b/fpicker/source/aqua/ControlHelper.hxx @@ -116,7 +116,7 @@ public: } bool isAutoExtensionEnabled() { - return ([static_cast<NSButton*>(m_pToggles[AUTOEXTENSION]) state] == NSOnState); + return ([static_cast<NSButton*>(m_pToggles[AUTOEXTENSION]) state] == NSControlStateValueOn); } private: diff --git a/fpicker/source/aqua/ControlHelper.mm b/fpicker/source/aqua/ControlHelper.mm index dccedf69a4a9..1b10248630b2 100644 --- a/fpicker/source/aqua/ControlHelper.mm +++ b/fpicker/source/aqua/ControlHelper.mm @@ -335,7 +335,7 @@ void ControlHelper::setValue( sal_Int16 nControlId, sal_Int16 nControlAction, co bool bChecked = false; rValue >>= bChecked; SAL_INFO("fpicker.aqua"," value is a bool: " << bChecked); - [static_cast<NSButton*>(pControl) setState:(bChecked ? NSOnState : NSOffState)]; + [static_cast<NSButton*>(pControl) setState:(bChecked ? NSControlStateValueOn : NSControlStateValueOff)]; } else { SAL_INFO("fpicker.aqua","Can't set value on button / list " << nControlId << " " << nControlAction); @@ -358,7 +358,7 @@ uno::Any ControlHelper::getValue( sal_Int16 nControlId, sal_Int16 nControlAction aRetval = HandleGetListValue(pControl, nControlAction); } else if( [pControl class] == [NSButton class] ) { //NSLog(@"control: %@", [[pControl cell] title]); - bool bValue = [static_cast<NSButton*>(pControl) state] == NSOnState; + bool bValue = [static_cast<NSButton*>(pControl) state] == NSControlStateValueOn; aRetval <<= bValue; SAL_INFO("fpicker.aqua","value is a bool (checkbox): " << bValue); } @@ -566,9 +566,9 @@ void ControlHelper::createControls() NSButton *button = [NSButton new]; [button setTitle:sLabel]; - [button setButtonType:NSSwitchButton]; + [button setButtonType:NSButtonTypeSwitch]; - [button setState:NSOffState]; + [button setState:NSControlStateValueOff]; if (i == AUTOEXTENSION) { [button setTarget:m_pDelegate]; @@ -587,7 +587,7 @@ void ControlHelper::createControls() NSControl *pPreviewBox = m_pToggles[PREVIEW]; if (pPreviewBox != nil) { [pPreviewBox setEnabled:NO]; - [static_cast<NSButton*>(pPreviewBox) setState:NSOnState]; + [static_cast<NSButton*>(pPreviewBox) setState:NSControlStateValueOn]; } } diff --git a/vcl/osx/DataFlavorMapping.cxx b/vcl/osx/DataFlavorMapping.cxx index 96f69a42546e..4a785129ea28 100644 --- a/vcl/osx/DataFlavorMapping.cxx +++ b/vcl/osx/DataFlavorMapping.cxx @@ -111,10 +111,10 @@ namespace */ static const FlavorMap flavorMap[] = { - { NSStringPboardType, "text/plain;charset=utf-16", "Unicode Text (UTF-16)", true }, - { NSRTFPboardType, "text/rtf", "Rich Text Format", false }, - { NSTIFFPboardType, "image/png", "Portable Network Graphics", false }, - { NSHTMLPboardType, "text/html", "Plain Html", false }, + { NSPasteboardTypeString, "text/plain;charset=utf-16", "Unicode Text (UTF-16)", true }, + { NSPasteboardTypeRTF, "text/rtf", "Rich Text Format", false }, + { NSPasteboardTypeTIFF, "image/png", "Portable Network Graphics", false }, + { NSPasteboardTypeHTML, "text/html", "Plain Html", false }, SAL_WNODEPRECATED_DECLARATIONS_PUSH // "'NSFilenamesPboardType' is deprecated: first deprecated in macOS 10.14 - Create // multiple pasteboard items with NSPasteboardTypeFileURL or kUTTypeFileURL instead" @@ -538,7 +538,7 @@ const NSString* DataFlavorMapper::openOfficeToSystemFlavor( const DataFlavor& oO NSString* DataFlavorMapper::openOfficeImageToSystemFlavor(NSPasteboard* pPasteboard) { - NSArray *supportedTypes = [NSArray arrayWithObjects: NSTIFFPboardType, nil]; + NSArray *supportedTypes = [NSArray arrayWithObjects: NSPasteboardTypeTIFF, nil]; NSString *sysFlavor = [pPasteboard availableTypeFromArray:supportedTypes]; return sysFlavor; } @@ -567,9 +567,9 @@ DataProviderPtr_t DataFlavorMapper::getDataProvider( const NSString* systemFlavo } else */ - if ([systemFlavor caseInsensitiveCompare: NSTIFFPboardType] == NSOrderedSame) + if ([systemFlavor caseInsensitiveCompare: NSPasteboardTypeTIFF] == NSOrderedSame) { - dp = DataProviderPtr_t( new PNGDataProvider( data, NSTIFFFileType)); + dp = DataProviderPtr_t( new PNGDataProvider( data, NSBitmapImageFileTypeTIFF)); } SAL_WNODEPRECATED_DECLARATIONS_PUSH // "'NSFilenamesPboardType' is deprecated: first deprecated in macOS 10.14 - Create @@ -610,17 +610,17 @@ DataProviderPtr_t DataFlavorMapper::getDataProvider( const NSString* systemFlavo { DataProviderPtr_t dp; - if ([systemFlavor caseInsensitiveCompare: NSStringPboardType] == NSOrderedSame) + if ([systemFlavor caseInsensitiveCompare: NSPasteboardTypeString] == NSOrderedSame) { dp = DataProviderPtr_t(new UniDataProvider(systemData)); } - else if ([systemFlavor caseInsensitiveCompare: NSHTMLPboardType] == NSOrderedSame) + else if ([systemFlavor caseInsensitiveCompare: NSPasteboardTypeHTML] == NSOrderedSame) { dp = DataProviderPtr_t(new HTMLFormatDataProvider(systemData)); } - else if ([systemFlavor caseInsensitiveCompare: NSTIFFPboardType] == NSOrderedSame) + else if ([systemFlavor caseInsensitiveCompare: NSPasteboardTypeTIFF] == NSOrderedSame) { - dp = DataProviderPtr_t( new PNGDataProvider(systemData, NSTIFFFileType)); + dp = DataProviderPtr_t( new PNGDataProvider(systemData, NSBitmapImageFileTypeTIFF)); } SAL_WNODEPRECATED_DECLARATIONS_PUSH // "'NSFilenamesPboardType' is deprecated: first deprecated in macOS 10.14 - Create multiple @@ -665,7 +665,7 @@ NSArray* DataFlavorMapper::flavorSequenceToTypesArray(const css::uno::Sequence<c { if( flavors[i].MimeType.startsWith("image/bmp") ) { - [array addObject: NSTIFFPboardType]; + [array addObject: NSPasteboardTypeTIFF]; } else { diff --git a/vcl/osx/PictToBmpFlt.cxx b/vcl/osx/PictToBmpFlt.cxx index 796a119811ba..fda099643c06 100644 --- a/vcl/osx/PictToBmpFlt.cxx +++ b/vcl/osx/PictToBmpFlt.cxx @@ -36,7 +36,7 @@ bool ImageToPNG( css::uno::Sequence<sal_Int8> const & rImgData, if( !pRep) return false; - NSData* pOut = [pRep representationUsingType: NSPNGFileType properties: @{ }]; + NSData* pOut = [pRep representationUsingType: NSBitmapImageFileTypePNG properties: @{ }]; if( !pOut) return false; diff --git a/vcl/osx/printaccessoryview.mm b/vcl/osx/printaccessoryview.mm index 958686c70c4f..3c3e3f675fbd 100644 --- a/vcl/osx/printaccessoryview.mm +++ b/vcl/osx/printaccessoryview.mm @@ -349,7 +349,7 @@ static OUString filterAccelerator( rtl::OUString const & rText ) { NSButton* pBtn = static_cast<NSButton*>(pSender); int nTag = [pBtn tag]; - mpController->changePropertyWithBoolValue( nTag, [pBtn state] == NSOnState ); + mpController->changePropertyWithBoolValue( nTag, [pBtn state] == NSControlStateValueOn ); } else if( [pSender isMemberOfClass: [NSMatrix class]] ) { @@ -660,8 +660,8 @@ static void addBool( NSView* pCurParent, long rCurX, long& rCurY, long nAttachOf { NSRect aCheckRect = { { static_cast<CGFloat>(rCurX + nAttachOffset), 0 }, { 0, 15 } }; NSButton* pBtn = [[NSButton alloc] initWithFrame: aCheckRect]; - [pBtn setButtonType: NSSwitchButton]; - [pBtn setState: bValue ? NSOnState : NSOffState]; + [pBtn setButtonType: NSButtonTypeSwitch]; + [pBtn setState: bValue ? NSControlStateValueOn : NSControlStateValueOff]; if( ! bEnabled ) [pBtn setEnabled: NO]; linebreakCell( [pBtn cell], rText ); @@ -731,7 +731,7 @@ static void addRadio( NSView* pCurParent, long rCurX, long& rCurY, long nAttachO { static_cast<CGFloat>(280 - rCurX), static_cast<CGFloat>(5*rChoices.getLength()) } }; [pProto setTitle: @"RadioButtonGroup"]; - [pProto setButtonType: NSRadioButton]; + [pProto setButtonType: NSButtonTypeRadio]; NSMatrix* pMatrix = [[NSMatrix alloc] initWithFrame: aRadioRect mode: NSRadioModeMatrix prototype: static_cast<NSCell*>(pProto) diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx index 5a7c80a4a12d..4a99e4305324 100644 --- a/vcl/osx/salmenu.cxx +++ b/vcl/osx/salmenu.cxx @@ -562,7 +562,7 @@ void AquaSalMenu::CheckItem( unsigned nPos, bool bCheck ) if( nPos < maItems.size() ) { NSMenuItem* pItem = maItems[nPos]->mpMenuItem; - [pItem setState: bCheck ? NSOnState : NSOffState]; + [pItem setState: bCheck ? NSControlStateValueOn : NSControlStateValueOff]; } } diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx index 3db3f20336d5..40ae59121653 100644 --- a/vcl/quartz/salgdicommon.cxx +++ b/vcl/quartz/salgdicommon.cxx @@ -766,7 +766,7 @@ bool AquaSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, [pOrigNSCtx retain]; // create new context - NSGraphicsContext* pDrawNSCtx = [NSGraphicsContext graphicsContextWithGraphicsPort: mrContext flipped: IsFlipped()]; + NSGraphicsContext* pDrawNSCtx = [NSGraphicsContext graphicsContextWithCGContext: mrContext flipped: IsFlipped()]; // set it, setCurrentContext also releases the prviously set one [NSGraphicsContext setCurrentContext: pDrawNSCtx]; |