From 1c0ecec225130bcb318474bf01dddc3c4e5c0004 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 21 Dec 2016 20:47:42 +0100 Subject: [PATCH] Better fix for 32 bit wxOSX build Instead of disabling vertical alignment support in wxDataViewCtrl, move the private variables to the header file: this is supported by all versions of the Objective-C runtime, including the old one used for 32 bit applications, unlike the new way based on declaring the variable in an anonymous extension. This replaces the changes of 22216b70e7281432c0846ae48b0462c470ee514b. --- include/wx/osx/cocoa/dataview.h | 6 ++++++ src/osx/cocoa/dataview.mm | 17 ----------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/include/wx/osx/cocoa/dataview.h b/include/wx/osx/cocoa/dataview.h index 5f6583b886..7b9a8611a9 100644 --- a/include/wx/osx/cocoa/dataview.h +++ b/include/wx/osx/cocoa/dataview.h @@ -376,6 +376,12 @@ private: #define wxTextFieldCell NSTextFieldCell #else @interface wxTextFieldCell : NSTextFieldCell +{ +@private + int _wxAlignment; + BOOL _adjustRect; +} + -(void) setWXAlignment:(int)alignment; @end #endif diff --git a/src/osx/cocoa/dataview.mm b/src/osx/cocoa/dataview.mm index deb772f508..3d2af4c3ad 100644 --- a/src/osx/cocoa/dataview.mm +++ b/src/osx/cocoa/dataview.mm @@ -1252,20 +1252,6 @@ outlineView:(NSOutlineView*)outlineView // wxTextFieldCell // ============================================================================ -#ifndef _LP64 - // The code below doesn't compile in 32 bits failing with - // - // error: instance variables may not be placed in class extension - // - // Until this can be fixed, disable it to at least fix compilation. -#else -@interface wxTextFieldCell () -{ - int _wxAlignment; - BOOL _adjustRect; -} -@end - @implementation wxTextFieldCell - (void)setWXAlignment:(int)alignment @@ -1331,7 +1317,6 @@ outlineView:(NSOutlineView*)outlineView } @end -#endif // 32/64 bits // ============================================================================ @@ -2763,10 +2748,8 @@ void wxDataViewRenderer::OSXUpdateAlignment() int align = GetEffectiveAlignment(); NSCell *cell = GetNativeData()->GetColumnCell(); [cell setAlignment:ConvertToNativeHorizontalTextAlignment(align)]; -#ifdef _LP64 if ([cell respondsToSelector:@selector(setWXAlignment:)]) [(wxTextFieldCell*)cell setWXAlignment:align]; -#endif // _LP64 } void wxDataViewRenderer::SetMode(wxDataViewCellMode mode)