[Libreoffice-commits] core.git: vcl/osx
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Oct 4 19:40:44 UTC 2018
vcl/osx/DataFlavorMapping.cxx | 12 ++++++
vcl/osx/DropTarget.cxx | 4 ++
vcl/osx/OSXTransferable.cxx | 4 ++
vcl/osx/saldata.cxx | 4 ++
vcl/osx/salframe.cxx | 14 +++++++
vcl/osx/salmenu.cxx | 8 ++++
vcl/osx/salnsmenu.mm | 5 ++
vcl/osx/salobj.cxx | 79 ++++++++++++++++++++++++++++++++++++++++++
8 files changed, 130 insertions(+)
New commits:
commit 2f2c9df8e270ede0fd71b146380c3883b75d8f0d
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu Oct 4 10:14:00 2018 +0200
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Thu Oct 4 21:40:18 2018 +0200
-Werror,-Wdeprecated-declarations (--with-macosx-version-min-required=10.14)
These are all the cases where the warning doesn't suggest a direct replacement,
so the existing code is just wrapped in SAL_WNODEPRECATED_PUSH/POP for now. A
companion commit will cover cases where there is a direct replacement that can
probably be applied (even backwards-compatibly with our current baseline,
hopefully).
Change-Id: I899537cb36dd69e08b5442ad4af7ce69ce2ddaec
Reviewed-on: https://gerrit.libreoffice.org/61354
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/vcl/osx/DataFlavorMapping.cxx b/vcl/osx/DataFlavorMapping.cxx
index 5ae33e660755..96f69a42546e 100644
--- a/vcl/osx/DataFlavorMapping.cxx
+++ b/vcl/osx/DataFlavorMapping.cxx
@@ -115,7 +115,11 @@ namespace
{ NSRTFPboardType, "text/rtf", "Rich Text Format", false },
{ NSTIFFPboardType, "image/png", "Portable Network Graphics", false },
{ NSHTMLPboardType, "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"
{ NSFilenamesPboardType, "application/x-openoffice-filelist;windows_formatname=\"FileList\"", "FileList", false },
+SAL_WNODEPRECATED_DECLARATIONS_POP
{ PBTYPE_SESX, FLAVOR_SESX, "Star Embed Source (XML)", false },
{ PBTYPE_SLSDX, FLAVOR_SLSDX, "Star Link Source Descriptor (XML)", false },
{ PBTYPE_ESX, FLAVOR_ESX, "Star Embed Source (XML)", false },
@@ -567,7 +571,11 @@ DataProviderPtr_t DataFlavorMapper::getDataProvider( const NSString* systemFlavo
{
dp = DataProviderPtr_t( new PNGDataProvider( data, NSTIFFFileType));
}
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'NSFilenamesPboardType' is deprecated: first deprecated in macOS 10.14 - Create
+ // multiple pasteboard items with NSPasteboardTypeFileURL or kUTTypeFileURL instead"
else if ([systemFlavor caseInsensitiveCompare: NSFilenamesPboardType] == NSOrderedSame)
+SAL_WNODEPRECATED_DECLARATIONS_POP
{
dp = DataProviderPtr_t(new FileListDataProvider(data));
}
@@ -614,7 +622,11 @@ DataProviderPtr_t DataFlavorMapper::getDataProvider( const NSString* systemFlavo
{
dp = DataProviderPtr_t( new PNGDataProvider(systemData, NSTIFFFileType));
}
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'NSFilenamesPboardType' is deprecated: first deprecated in macOS 10.14 - Create multiple
+ // pasteboard items with NSPasteboardTypeFileURL or kUTTypeFileURL instead"
else if ([systemFlavor caseInsensitiveCompare: NSFilenamesPboardType] == NSOrderedSame)
+SAL_WNODEPRECATED_DECLARATIONS_POP
{
//dp = DataProviderPtr_t(new FileListDataProvider(systemData));
}
diff --git a/vcl/osx/DropTarget.cxx b/vcl/osx/DropTarget.cxx
index c294a3157f46..4ab4f9ac6eca 100644
--- a/vcl/osx/DropTarget.cxx
+++ b/vcl/osx/DropTarget.cxx
@@ -381,7 +381,11 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
if (parentWnd == nil && (wndStyles == topWndStyle))
{
[wnd registerDraggingDestinationHandler:mDropTargetHelper];
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'NSFilenamesPboardType' is deprecated: first deprecated in macOS 10.14 - Create
+ // multiple pasteboard items with NSPasteboardTypeFileURL or kUTTypeFileURL instead"
[wnd registerForDraggedTypes: [NSArray arrayWithObjects: NSFilenamesPboardType, nil]];
+SAL_WNODEPRECATED_DECLARATIONS_POP
}
}
diff --git a/vcl/osx/OSXTransferable.cxx b/vcl/osx/OSXTransferable.cxx
index 87f4c4e14004..426b618c95bd 100644
--- a/vcl/osx/OSXTransferable.cxx
+++ b/vcl/osx/OSXTransferable.cxx
@@ -112,7 +112,11 @@ Any SAL_CALL OSXTransferable::getTransferData( const DataFlavor& aFlavor )
: mDataFlavorMapper->openOfficeToSystemFlavor(aFlavor, bInternal);
DataProviderPtr_t dp;
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'NSFilenamesPboardType' is deprecated: first deprecated in macOS 10.14 - Create multiple
+ // pasteboard items with NSPasteboardTypeFileURL or kUTTypeFileURL instead"
if ([sysFormat caseInsensitiveCompare: NSFilenamesPboardType] == NSOrderedSame)
+SAL_WNODEPRECATED_DECLARATIONS_POP
{
NSArray* sysData = [mPasteboard propertyListForType: const_cast<NSString *>(sysFormat)];
dp = DataFlavorMapper::getDataProvider(sysFormat, sysData);
diff --git a/vcl/osx/saldata.cxx b/vcl/osx/saldata.cxx
index 033114dae7e1..662a5c1bd7b2 100644
--- a/vcl/osx/saldata.cxx
+++ b/vcl/osx/saldata.cxx
@@ -255,7 +255,11 @@ NSStatusItem* SalData::getStatusItem()
pData->mpStatusItem = [pStatBar statusItemWithLength: NSVariableStatusItemLength];
[pData->mpStatusItem retain];
OOStatusItemView* pView = [[OOStatusItemView alloc] init];
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'setView:' is deprecated: first deprecated in macOS 10.14 - Use the standard
+ // button property instead"
[pData->mpStatusItem setView: pView ];
+SAL_WNODEPRECATED_DECLARATIONS_POP
[pView display];
}
}
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 50dade6ff32c..e0ec4ccb0d5f 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1094,7 +1094,11 @@ static Color getColor( NSColor* pSysColor, const Color& rDefault, NSWindow* pWin
if( pSysColor )
{
// transform to RGB
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'colorUsingColorSpaceName:device:' is deprecated: first deprecated in macOS 10.14 -
+ // Use -colorUsingType: or -colorUsingColorSpace: instead"
NSColor* pRBGColor = [pSysColor colorUsingColorSpaceName: NSDeviceRGBColorSpace device: [pWin deviceDescription]];
+SAL_WNODEPRECATED_DECLARATIONS_POP
if( pRBGColor )
{
CGFloat r = 0, g = 0, b = 0, a = 0;
@@ -1150,7 +1154,12 @@ void AquaSalFrame::UpdateSettings( AllSettings& rSettings )
OSX_SALDATA_RUNINMAIN( UpdateSettings( rSettings ) )
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'lockFocus' is deprecated: first deprecated in macOS 10.14 - To draw, subclass NSView
+ // and implement -drawRect:; AppKit's automatic deferred display mechanism will call
+ // -drawRect: as necessary to display the view."
[mpNSView lockFocus];
+SAL_WNODEPRECATED_DECLARATIONS_POP
StyleSettings aStyleSettings = rSettings.GetStyleSettings();
@@ -1230,7 +1239,12 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
// don't draw frame around each and every toolbar
ImplGetSVData()->maNWFData.mbDockingAreaAvoidTBFrames = true;
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'unlockFocus' is deprecated: first deprecated in macOS 10.14 - To draw, subclass NSView
+ // and implement -drawRect:; AppKit's automatic deferred display mechanism will call
+ // -drawRect: as necessary to display the view."
[mpNSView unlockFocus];
+SAL_WNODEPRECATED_DECLARATIONS_POP
}
const SystemEnvData* AquaSalFrame::GetSystemData() const
diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx
index 4ec9e7d70871..5a7c80a4a12d 100644
--- a/vcl/osx/salmenu.cxx
+++ b/vcl/osx/salmenu.cxx
@@ -760,7 +760,11 @@ void AquaSalMenu::statusLayout()
{
if( GetSalData()->mpStatusItem )
{
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'view' is deprecated: first deprecated in macOS 10.14 - Use the standard button
+ // property instead"
NSView* pNSView = [GetSalData()->mpStatusItem view];
+SAL_WNODEPRECATED_DECLARATIONS_POP
if( [pNSView isMemberOfClass: [OOStatusItemView class]] ) // well of course it is
[static_cast<OOStatusItemView*>(pNSView) layout];
else
@@ -826,7 +830,11 @@ tools::Rectangle AquaSalMenu::GetMenuBarButtonRectPixel( sal_uInt16 i_nItemId, S
if( ! pItem )
return tools::Rectangle();
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'view' is deprecated: first deprecated in macOS 10.14 - Use the standard button property
+ // instead"
NSView* pNSView = [pItem view];
+SAL_WNODEPRECATED_DECLARATIONS_POP
if( ! pNSView )
return tools::Rectangle();
NSWindow* pNSWin = [pNSView window];
diff --git a/vcl/osx/salnsmenu.mm b/vcl/osx/salnsmenu.mm
index 8a00b4105964..e823bcfcbd1d 100644
--- a/vcl/osx/salnsmenu.mm
+++ b/vcl/osx/salnsmenu.mm
@@ -166,7 +166,12 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
{
NSGraphicsContext* pContext = [NSGraphicsContext currentContext];
[pContext saveGraphicsState];
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'drawStatusBarBackgroundInRect:withHighlight:' is deprecated: first deprecated in macOS
+ // 10.14 - Use the standard button instead which handles highlight drawing, making this
+ // method obsolete"
[SalData::getStatusItem() drawStatusBarBackgroundInRect: aRect withHighlight: NO];
+SAL_WNODEPRECATED_DECLARATIONS_POP
if( AquaSalMenu::pCurrentMenuBar )
{
const std::vector< AquaSalMenu::MenuBarButtonEntry >& rButtons( AquaSalMenu::pCurrentMenuBar->getButtons() );
diff --git a/vcl/osx/salobj.cxx b/vcl/osx/salobj.cxx
index 85eb5bae2708..fd2eba1badc2 100644
--- a/vcl/osx/salobj.cxx
+++ b/vcl/osx/salobj.cxx
@@ -56,12 +56,29 @@ AquaSalObject::AquaSalObject( AquaSalFrame* pFrame, SystemWindowData const * pWi
if (pWindowData && pWindowData->bOpenGL)
{
maSysData.mbOpenGL = true;
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'NSOpenGLPixelFormat' is deprecated: first deprecated in macOS 10.14 - Please use
+ // Metal or MetalKit."
NSOpenGLPixelFormat* pixFormat = nullptr;
+SAL_WNODEPRECATED_DECLARATIONS_POP
if (pWindowData->bLegacy)
{
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'NSOpenGLPixelFormatAttribute' is deprecated: first deprecated in macOS 10.14"
NSOpenGLPixelFormatAttribute const aAttributes[] =
+SAL_WNODEPRECATED_DECLARATIONS_POP
{
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'NSOpenGLPFADoubleBuffer' is deprecated: first deprecated in macOS 10.14",
+ // "'NSOpenGLPFAAlphaSize' is deprecated: first deprecated in macOS 10.14",
+ // "'NSOpenGLPFAColorSize' is deprecated: first deprecated in macOS 10.14",
+ // "'NSOpenGLPFADepthSize' is deprecated: first deprecated in macOS 10.14",
+ // "'NSOpenGLPFAMultisample' is deprecated: first deprecated in macOS 10.14",
+ // "'NSOpenGLPFASampleBuffers' is deprecated: first deprecated in macOS 10.14",
+ // "'NSOpenGLPixelFormatAttribute' is deprecated: first deprecated in macOS
+ // 10.14",
+ // "'NSOpenGLPFASamples' is deprecated: first deprecated in macOS 10.14"
NSOpenGLPFADoubleBuffer,
NSOpenGLPFAAlphaSize, 8,
NSOpenGLPFAColorSize, 24,
@@ -69,14 +86,35 @@ AquaSalObject::AquaSalObject( AquaSalFrame* pFrame, SystemWindowData const * pWi
NSOpenGLPFAMultisample,
NSOpenGLPFASampleBuffers, NSOpenGLPixelFormatAttribute(1),
NSOpenGLPFASamples, NSOpenGLPixelFormatAttribute(4),
+SAL_WNODEPRECATED_DECLARATIONS_POP
0
};
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'NSOpenGLPixelFormat' is deprecated: first deprecated in macOS 10.14 - Please
+ // use Metal or MetalKit."
pixFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:aAttributes];
+SAL_WNODEPRECATED_DECLARATIONS_POP
}
else
{
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'NSOpenGLPixelFormatAttribute' is deprecated: first deprecated in macOS 10.14"
NSOpenGLPixelFormatAttribute const aAttributes[] =
+SAL_WNODEPRECATED_DECLARATIONS_POP
{
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'NSOpenGLPFAOpenGLProfile' is deprecated: first deprecated in macOS 10.14",
+ // "'NSOpenGLProfileVersion3_2Core' is deprecated: first deprecated in macOS
+ // 10.14",
+ // "'NSOpenGLPFADoubleBuffer' is deprecated: first deprecated in macOS 10.14",
+ // "'NSOpenGLPFAAlphaSize' is deprecated: first deprecated in macOS 10.14",
+ // "'NSOpenGLPFAColorSize' is deprecated: first deprecated in macOS 10.14",
+ // "'NSOpenGLPFADepthSize' is deprecated: first deprecated in macOS 10.14",
+ // "'NSOpenGLPFAMultisample' is deprecated: first deprecated in macOS 10.14",
+ // "'NSOpenGLPFASampleBuffers' is deprecated: first deprecated in macOS 10.14",
+ // "'NSOpenGLPixelFormatAttribute' is deprecated: first deprecated in macOS
+ // 10.14",
+ // "'NSOpenGLPFASamples' is deprecated: first deprecated in macOS 10.14"
NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core,
NSOpenGLPFADoubleBuffer,
NSOpenGLPFAAlphaSize, 8,
@@ -85,12 +123,21 @@ AquaSalObject::AquaSalObject( AquaSalFrame* pFrame, SystemWindowData const * pWi
NSOpenGLPFAMultisample,
NSOpenGLPFASampleBuffers, NSOpenGLPixelFormatAttribute(1),
NSOpenGLPFASamples, NSOpenGLPixelFormatAttribute(4),
+SAL_WNODEPRECATED_DECLARATIONS_POP
0
};
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'NSOpenGLPixelFormat' is deprecated: first deprecated in macOS 10.14 - Please
+ // use Metal or MetalKit."
pixFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:aAttributes];
+SAL_WNODEPRECATED_DECLARATIONS_POP
}
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'NSOpenGLView' is deprecated: first deprecated in macOS 10.14 - Please use MTKView
+ // instead."
maSysData.mpNSView = [[NSOpenGLView alloc] initWithFrame: aInitFrame pixelFormat:pixFormat];
+SAL_WNODEPRECATED_DECLARATIONS_POP
}
else
{
@@ -250,7 +297,11 @@ private:
virtual const GLWindow& getOpenGLWindow() const override { return m_aGLWin; }
virtual GLWindow& getModifiableOpenGLWindow() override { return m_aGLWin; }
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'NSOpenGLView' is deprecated: first deprecated in macOS 10.14 - Please use MTKView
+ // instead."
NSOpenGLView* getOpenGLView();
+SAL_WNODEPRECATED_DECLARATIONS_POP
virtual bool ImplInit() override;
virtual SystemWindowData generateWinData(vcl::Window* pParent, bool bRequestLegacyContext) override;
virtual void makeCurrent() override;
@@ -268,7 +319,11 @@ void AquaOpenGLContext::resetCurrent()
OpenGLZone aZone;
(void) this; // loplugin:staticmethods
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'NSOpenGLContext' is deprecated: first deprecated in macOS 10.14 - Please use Metal or
+ // MetalKit."
[NSOpenGLContext clearCurrentContext];
+SAL_WNODEPRECATED_DECLARATIONS_POP
}
void AquaOpenGLContext::makeCurrent()
@@ -282,7 +337,11 @@ void AquaOpenGLContext::makeCurrent()
clearCurrent();
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'NSOpenGLView' is deprecated: first deprecated in macOS 10.14 - Please use MTKView
+ // instead."
NSOpenGLView* pView = getOpenGLView();
+SAL_WNODEPRECATED_DECLARATIONS_POP
[[pView openGLContext] makeCurrentContext];
registerAsCurrent();
@@ -294,7 +353,11 @@ void AquaOpenGLContext::swapBuffers()
OpenGLZone aZone;
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'NSOpenGLView' is deprecated: first deprecated in macOS 10.14 - Please use MTKView
+ // instead."
NSOpenGLView* pView = getOpenGLView();
+SAL_WNODEPRECATED_DECLARATIONS_POP
[[pView openGLContext] flushBuffer];
BuffersSwapped();
@@ -311,7 +374,11 @@ SystemWindowData AquaOpenGLContext::generateWinData(vcl::Window* /*pParent*/, bo
void AquaOpenGLContext::destroyCurrentContext()
{
OSX_SALDATA_RUNINMAIN( destroyCurrentContext() )
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'NSOpenGLContext' is deprecated: first deprecated in macOS 10.14 - Please use Metal or
+ // MetalKit."
[NSOpenGLContext clearCurrentContext];
+SAL_WNODEPRECATED_DECLARATIONS_POP
}
void AquaOpenGLContext::initWindow()
@@ -337,7 +404,11 @@ bool AquaOpenGLContext::ImplInit()
OpenGLZone aZone;
VCL_GL_INFO("OpenGLContext::ImplInit----start");
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'NSOpenGLView' is deprecated: first deprecated in macOS 10.14 - Please use MTKView
+ // instead."
NSOpenGLView* pView = getOpenGLView();
+SAL_WNODEPRECATED_DECLARATIONS_POP
[[pView openGLContext] makeCurrentContext];
bool bRet = InitGL();
@@ -345,9 +416,17 @@ bool AquaOpenGLContext::ImplInit()
return bRet;
}
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'NSOpenGLView' is deprecated: first deprecated in macOS 10.14 - Please use MTKView
+ // instead."
NSOpenGLView* AquaOpenGLContext::getOpenGLView()
+SAL_WNODEPRECATED_DECLARATIONS_POP
{
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ // "'NSOpenGLView' is deprecated: first deprecated in macOS 10.14 - Please use MTKView
+ // instead."
return reinterpret_cast<NSOpenGLView*>(m_pChildWindow->GetSystemData()->mpNSView);
+SAL_WNODEPRECATED_DECLARATIONS_POP
}
OpenGLContext* AquaSalInstance::CreateOpenGLContext()
More information about the Libreoffice-commits
mailing list