Kaydet (Commit) cd3c315e authored tarafından Stephan Bergmann's avatar Stephan Bergmann

-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 2f2c9df8
"-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: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 9943f37e
......@@ -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);
}
......
......@@ -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:
......
......@@ -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];
}
}
......
......@@ -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
{
......
......@@ -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;
......
......@@ -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)
......
......@@ -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];
}
}
......
......@@ -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];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment