[Libreoffice-commits] .: 12 commits - solenv/gbuild solenv/inc vcl/aqua vcl/source

Tor Lillqvist tml at kemper.freedesktop.org
Wed Sep 28 07:43:53 PDT 2011


 solenv/gbuild/platform/ios.mk                 |    4 ++--
 solenv/gbuild/platform/macosx.mk              |    4 ++--
 solenv/gbuild/platform/unxgcc.mk              |    4 ++--
 solenv/gbuild/platform/windows.mk             |    4 ++--
 solenv/gbuild/platform/winmingw.mk            |    4 ++--
 solenv/inc/unxgcc.mk                          |    2 +-
 solenv/inc/unxiosr.mk                         |    2 +-
 solenv/inc/unxmacx.mk                         |    2 +-
 solenv/inc/unxsoli4.mk                        |    4 ++--
 solenv/inc/unxsols4.mk                        |    4 ++--
 solenv/inc/unxsolu4.mk                        |    4 ++--
 solenv/inc/wntgcci.mk                         |    4 ++--
 solenv/inc/wntmsc.mk                          |    2 +-
 vcl/aqua/source/a11y/aqua11yfocuslistener.hxx |    4 ++--
 vcl/aqua/source/app/vclnsapp.mm               |   15 ++++++++++++++-
 vcl/aqua/source/dtrans/DataFlavorMapping.cxx  |   17 ++++++++++++++---
 vcl/aqua/source/dtrans/DataFlavorMapping.hxx  |    2 +-
 vcl/aqua/source/gdi/aquaprintaccessoryview.mm |   21 ++++++++++++++++++++-
 vcl/aqua/source/gdi/salatslayout.cxx          |   13 ++++++++++++-
 vcl/aqua/source/gdi/salatsuifontutils.cxx     |   10 ++++++++++
 vcl/aqua/source/gdi/salgdi.cxx                |   10 ++++++++++
 vcl/aqua/source/window/salframe.cxx           |   13 ++++++++++++-
 vcl/aqua/source/window/salmenu.cxx            |   12 +++++++++++-
 vcl/source/gdi/pdfextoutdevdata.cxx           |    2 +-
 24 files changed, 129 insertions(+), 34 deletions(-)

New commits:
commit 69a1f550625b967c34a1468c7e83e22003bb0796
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Sep 28 17:29:27 2011 +0300

    Make deprecation warnings non-fatal even in a -Werror compilation

diff --git a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
index 7d55f07..2e2e0c2 100644
--- a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
+++ b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
@@ -126,13 +126,15 @@ namespace // private
 
 // NSPICTPboardType is deprecated in 10.6 and later
 
-#if defined __GNUC__
+// Make deprecation warnings just warnings even in a -Werror
+// compilation.
+
+#if defined LIBO_WERROR && defined __GNUC__
 #define GCC_VERSION (__GNUC__ * 10000 \
                      + __GNUC_MINOR__ * 100 \
                      + __GNUC_PATCHLEVEL__)
 #if GCC_VERSION >= 40201
-// #pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#pragma GCC diagnostic warning "-Wdeprecated-declarations"
 #endif
 #endif
 
diff --git a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
index 1afad67..728b83f 100644
--- a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
+++ b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
@@ -1107,13 +1107,15 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
 // In 10.5 and later:
 // 'setAccessoryView:' is deprecated
 
-#if defined __GNUC__
+// Make deprecation warnings just warnings in a -Werror compilation.
+
+#if defined LIBO_WERROR && defined __GNUC__
 #define GCC_VERSION (__GNUC__ * 10000 \
                      + __GNUC_MINOR__ * 100 \
                      + __GNUC_PATCHLEVEL__)
 #if GCC_VERSION >= 40201
 // #pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#pragma GCC diagnostic warning "-Wdeprecated-declarations"
 #endif
 #endif
 
@@ -1402,7 +1404,7 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
     return pCtrlTarget;
 }
 
-#if defined __GNUC__ && GCC_VERSION >= 40201
+#if defined LIBO_WERROR && defined __GNUC__ && GCC_VERSION >= 40201
 // #pragma GCC diagnostic pop
 #endif
 
diff --git a/vcl/aqua/source/gdi/salatslayout.cxx b/vcl/aqua/source/gdi/salatslayout.cxx
index 21fbba1..a41d40d 100644
--- a/vcl/aqua/source/gdi/salatslayout.cxx
+++ b/vcl/aqua/source/gdi/salatslayout.cxx
@@ -38,12 +38,12 @@
 #include <math.h>
 
 // ATSUI is deprecated in 10.6 (or already 10.5?)
-#if defined __GNUC__
+#if defined LIBO_WERROR && defined __GNUC__
 #define GCC_VERSION (__GNUC__ * 10000 \
                      + __GNUC_MINOR__ * 100 \
                      + __GNUC_PATCHLEVEL__)
 #if GCC_VERSION >= 40201
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#pragma GCC diagnostic warning "-Wdeprecated-declarations"
 #endif
 #endif
 
diff --git a/vcl/aqua/source/gdi/salatsuifontutils.cxx b/vcl/aqua/source/gdi/salatsuifontutils.cxx
index c92fec6..e124b3c 100644
--- a/vcl/aqua/source/gdi/salatsuifontutils.cxx
+++ b/vcl/aqua/source/gdi/salatsuifontutils.cxx
@@ -40,12 +40,12 @@
 #include "aqua/salatsuifontutils.hxx"
 
 // ATSUI is deprecated in 10.6 (or already 10.5?)
-#if defined __GNUC__
+#if defined LIBO_WERROR && defined __GNUC__
 #define GCC_VERSION (__GNUC__ * 10000 \
                      + __GNUC_MINOR__ * 100 \
                      + __GNUC_PATCHLEVEL__)
 #if GCC_VERSION >= 40201
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#pragma GCC diagnostic warning "-Wdeprecated-declarations"
 #endif
 #endif
 
diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx
index 6b1a64c..19f073d 100644
--- a/vcl/aqua/source/gdi/salgdi.cxx
+++ b/vcl/aqua/source/gdi/salgdi.cxx
@@ -67,12 +67,12 @@ typedef std::vector<unsigned char> ByteVector;
 
 
 // ATSUI is deprecated in 10.6 (or already 10.5?)
-#if defined __GNUC__
+#if defined LIBO_WERROR && defined __GNUC__
 #define GCC_VERSION (__GNUC__ * 10000 \
                      + __GNUC_MINOR__ * 100 \
                      + __GNUC_PATCHLEVEL__)
 #if GCC_VERSION >= 40201
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#pragma GCC diagnostic warning "-Wdeprecated-declarations"
 #endif
 #endif
 
commit 6904e7d8ba33e09e9254b7d569205ef2b4d8f9bb
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Sep 28 17:28:40 2011 +0300

    Define LIBO_WERROR when warnings are errors

diff --git a/solenv/gbuild/platform/ios.mk b/solenv/gbuild/platform/ios.mk
index e9653ed..97cbafb 100644
--- a/solenv/gbuild/platform/ios.mk
+++ b/solenv/gbuild/platform/ios.mk
@@ -97,8 +97,8 @@ gb_OBJCXXFLAGS := -x objective-c++ $(gb_OBJC_OBJCXX_COMMON_FLAGS)
 gb_OBJCFLAGS := -x objective-c $(gb_OBJC_OBJCXX_COMMON_FLAGS)
 
 ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE)
-gb_CFLAGS_WERROR := -Werror
-gb_CXXFLAGS_WERROR := -Werror
+gb_CFLAGS_WERROR := -Werror -DLIBO_WERROR
+gb_CXXFLAGS_WERROR := -Werror -DLIBO_WERROR
 endif
 
 gb_LinkTarget_EXCEPTIONFLAGS := \
diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk
index 01ff9d0..f076256 100644
--- a/solenv/gbuild/platform/macosx.mk
+++ b/solenv/gbuild/platform/macosx.mk
@@ -116,8 +116,8 @@ gb_OBJCXXFLAGS := -x objective-c++ -fobjc-exceptions
 gb_OBJCFLAGS := -x objective-c
 
 ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE)
-gb_CFLAGS_WERROR := -Werror
-gb_CXXFLAGS_WERROR := -Werror
+gb_CFLAGS_WERROR := -Werror -DLIBO_WERROR
+gb_CXXFLAGS_WERROR := -Werror -DLIBO_WERROR
 endif
 
 ifeq ($(ENABLE_LTO),TRUE)
diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index f1c1989..5d0ffbe 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -120,8 +120,8 @@ gb_CXXFLAGS += -fno-strict-aliasing
 endif
 
 ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE)
-gb_CFLAGS_WERROR := -Werror
-gb_CXXFLAGS_WERROR := -Werror
+gb_CFLAGS_WERROR := -Werror -DLIBO_WERROR
+gb_CXXFLAGS_WERROR := -Werror -DLIBO_WERROR
 endif
 
 ifeq ($(HAVE_CXX0X),TRUE)
diff --git a/solenv/gbuild/platform/windows.mk b/solenv/gbuild/platform/windows.mk
index 901b57a..8315f14 100644
--- a/solenv/gbuild/platform/windows.mk
+++ b/solenv/gbuild/platform/windows.mk
@@ -181,8 +181,8 @@ gb_STDLIBS := \
 	advapi32 \
 
 ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE)
-gb_CFLAGS_WERROR := -WX
-gb_CXXFLAGS_WERROR := -WX
+gb_CFLAGS_WERROR := -WX -DLIBO_WERROR
+gb_CXXFLAGS_WERROR := -WX -DLIBO_WERROR
 endif
 
 gb_LinkTarget_EXCEPTIONFLAGS := \
diff --git a/solenv/gbuild/platform/winmingw.mk b/solenv/gbuild/platform/winmingw.mk
index bf81120..4f0a188 100644
--- a/solenv/gbuild/platform/winmingw.mk
+++ b/solenv/gbuild/platform/winmingw.mk
@@ -91,8 +91,8 @@ gb_CXXFLAGS := \
 	-pipe \
 
 ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE)
-gb_CFLAGS_WERROR := -Werror
-gb_CXXFLAGS_WERROR := -Werror
+gb_CFLAGS_WERROR := -Werror -DLIBO_WERROR
+gb_CXXFLAGS_WERROR := -Werror -DLIBO_WERROR
 endif
 
 ifneq ($(SYSBASE),)
diff --git a/solenv/inc/unxgcc.mk b/solenv/inc/unxgcc.mk
index a7eeaa4..028e954 100644
--- a/solenv/inc/unxgcc.mk
+++ b/solenv/inc/unxgcc.mk
@@ -138,7 +138,7 @@ CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wshadow -Wno-ctor-dtor-privacy \
     -Wno-non-virtual-dtor -Woverloaded-virtual
 CFLAGSWALLCC=$(CFLAGSWARNCC)
 CFLAGSWALLCXX=$(CFLAGSWARNCXX)
-CFLAGSWERRCC=-Werror
+CFLAGSWERRCC=-Werror -DLIBO_WERROR
 
 COMPILER_WARN_ERRORS=TRUE
 
diff --git a/solenv/inc/unxiosr.mk b/solenv/inc/unxiosr.mk
index 773457a..06f1168 100644
--- a/solenv/inc/unxiosr.mk
+++ b/solenv/inc/unxiosr.mk
@@ -95,7 +95,7 @@ CFLAGSWARNCC=-Wall -Wendif-labels
 CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor
 CFLAGSWALLCC=$(CFLAGSWARNCC)
 CFLAGSWALLCXX=$(CFLAGSWARNCXX)
-CFLAGSWERRCC=-Werror
+CFLAGSWERRCC=-Werror -DLIBO_WERROR
 
 LINK*=$(CXX)
 LINKC*=$(CC)
diff --git a/solenv/inc/unxmacx.mk b/solenv/inc/unxmacx.mk
index b5351cb..17575ad 100644
--- a/solenv/inc/unxmacx.mk
+++ b/solenv/inc/unxmacx.mk
@@ -149,7 +149,7 @@ CFLAGSWARNCC=-Wall -Wendif-labels
 CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor
 CFLAGSWALLCC=$(CFLAGSWARNCC)
 CFLAGSWALLCXX=$(CFLAGSWARNCXX)
-CFLAGSWERRCC=-Werror
+CFLAGSWERRCC=-Werror -DLIBO_WERROR
 
 # All modules on this platform compile without warnings.
 # If you need to set MODULES_WITH_WARNINGS here, comment
diff --git a/solenv/inc/unxsoli4.mk b/solenv/inc/unxsoli4.mk
index 8fce32c..c21c362 100644
--- a/solenv/inc/unxsoli4.mk
+++ b/solenv/inc/unxsoli4.mk
@@ -100,8 +100,8 @@ CFLAGSWARNCC=
 CFLAGSWARNCXX=+w2 -erroff=doubunder,identexpected,inllargeuse,inllargeint,notemsource,reftotemp,truncwarn,wnoretvalue,anonnotype
 CFLAGSWALLCC=$(CFLAGSWARNCC)
 CFLAGSWALLCXX=$(CFLAGSWARNCXX)
-CFLAGSWERRCC=-errwarn=%all
-CFLAGSWERRCXX=-xwe
+CFLAGSWERRCC=-errwarn=%all -DLIBO_WERROR
+CFLAGSWERRCXX=-xwe -DLIBO_WERROR
 
 # Once all modules on this platform compile without warnings, set
 # COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
diff --git a/solenv/inc/unxsols4.mk b/solenv/inc/unxsols4.mk
index 02c01f4..b609951 100644
--- a/solenv/inc/unxsols4.mk
+++ b/solenv/inc/unxsols4.mk
@@ -106,8 +106,8 @@ CFLAGSWARNCC=
 CFLAGSWARNCXX=+w2 -erroff=doubunder,identexpected,inllargeuse,inllargeint,notemsource,reftotemp,truncwarn,wnoretvalue,anonnotype
 CFLAGSWALLCC=$(CFLAGSWARNCC)
 CFLAGSWALLCXX=$(CFLAGSWARNCXX)
-CFLAGSWERRCC=-errwarn=%all
-CFLAGSWERRCXX=-xwe
+CFLAGSWERRCC=-errwarn=%all -DLIBO_WERROR
+CFLAGSWERRCXX=-xwe -DLIBO_WERROR
 
 # Once all modules on this platform compile without warnings, set
 # COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
diff --git a/solenv/inc/unxsolu4.mk b/solenv/inc/unxsolu4.mk
index 91a6c89..ab276cb 100644
--- a/solenv/inc/unxsolu4.mk
+++ b/solenv/inc/unxsolu4.mk
@@ -105,8 +105,8 @@ CFLAGSWARNCC=
 CFLAGSWARNCXX=+w2 -erroff=doubunder,identexpected,inllargeuse,inllargeint,notemsource,reftotemp,truncwarn,wnoretvalue,hidef,anonnotype,unassigned,badargtype2w
 CFLAGSWALLCC=$(CFLAGSWARNCC)
 CFLAGSWALLCXX=$(CFLAGSWARNCXX)
-CFLAGSWERRCC=-errwarn=%all
-CFLAGSWERRCXX=-xwe
+CFLAGSWERRCC=-errwarn=%all -DLIBO_WERROR
+CFLAGSWERRCXX=-xwe -DLIBO_WERROR
 
 # Once all modules on this platform compile without warnings, set
 # COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
diff --git a/solenv/inc/wntgcci.mk b/solenv/inc/wntgcci.mk
index 85b6a91..f62c96a 100644
--- a/solenv/inc/wntgcci.mk
+++ b/solenv/inc/wntgcci.mk
@@ -84,8 +84,8 @@ CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wshadow -Wno-ctor-dtor-privacy \
     -Wno-non-virtual-dtor
 CFLAGSWALLCC=$(CFLAGSWARNCC)
 CFLAGSWALLCXX=$(CFLAGSWARNCXX)
-CFLAGSWERRCC=-Werror
-CFLAGSWERRCXX=-Werror
+CFLAGSWERRCC=-Werror -DLIBO_WERROR
+CFLAGSWERRCXX=-Werror -DLIBO_WERROR
 
 MODULES_WITH_WARNINGS := \
     b_server \
diff --git a/solenv/inc/wntmsc.mk b/solenv/inc/wntmsc.mk
index bf94a0f..efb5329 100644
--- a/solenv/inc/wntmsc.mk
+++ b/solenv/inc/wntmsc.mk
@@ -201,7 +201,7 @@ CFLAGSWARNCXX=-Wall -wd4061 -wd4127 -wd4191 -wd4217 -wd4250 -wd4251 -wd4275 \
 CFLAGSWARNCC=$(CFLAGSWARNCXX) -wd4255
 CFLAGSWALLCC=$(CFLAGSWARNCC)
 CFLAGSWALLCXX=$(CFLAGSWARNCXX)
-CFLAGSWERRCC=-WX
+CFLAGSWERRCC=-WX -DLIBO_WERROR
 
 # Once all modules on this platform compile without warnings, set
 # COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
commit bbec6182140209774390a6adda967e94f14b9c95
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Sep 28 17:19:40 2011 +0300

    WaE: foo does not implement the fooDelegate protocol

diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx
index 56eff66..5ac2842 100644
--- a/vcl/aqua/source/window/salframe.cxx
+++ b/vcl/aqua/source/window/salframe.cxx
@@ -51,6 +51,7 @@
 #include "salwtype.hxx"
 
 #include "premac.h"
+#include <objc/objc-runtime.h>
 // needed for theming
 // FIXME: move theming code to salnativewidgets.cxx
 #include <Carbon/Carbon.h>
@@ -212,7 +213,17 @@ void AquaSalFrame::initWindowAndView()
     else
         [mpWindow setAcceptsMouseMovedEvents: YES];
     [mpWindow setHasShadow: YES];
-    [mpWindow setDelegate: mpWindow];
+
+    // WTF? With the 10.6 SDK and gcc 4.2.1, we get: class 'NSWindow'
+    // does not implement the 'NSWindowDelegate' protocol. Anyway,
+    // having the window object be its own delegate object is
+    // apparently what the code does on purpose, see discussion in
+    // https://issues.apache.org/ooo/show_bug.cgi?id=91990
+
+    // So to silence the warning when compiling with -Werror, instead of:
+    // [mpWindow setDelegate: mpWindow];
+    // do this:
+    objc_msgSend(mpWindow, @selector(setDelegate:), mpWindow);
 
     NSRect aRect = { { 0,0 }, { maGeometry.nWidth, maGeometry.nHeight } };
     mnTrackingRectTag = [mpView addTrackingRect: aRect owner: mpView userData: nil assumeInside: NO];
diff --git a/vcl/aqua/source/window/salmenu.cxx b/vcl/aqua/source/window/salmenu.cxx
index ef76f4c..d719ec5 100644
--- a/vcl/aqua/source/window/salmenu.cxx
+++ b/vcl/aqua/source/window/salmenu.cxx
@@ -44,6 +44,8 @@
 #include "svids.hrc"
 #include "window.h"
 
+#include <objc/objc-runtime.h>
+
 const AquaSalMenu* AquaSalMenu::pCurrentMenuBar = NULL;
 
 @interface MainMenuSelector : NSObject
@@ -260,7 +262,15 @@ AquaSalMenu::AquaSalMenu( bool bMenuBar ) :
     if( ! mbMenuBar )
     {
         mpMenu = [[SalNSMenu alloc] initWithMenu: this];
-        [mpMenu setDelegate: mpMenu];
+        // With the 10.6 SDK and gcc 4.2.1, we get: class 'NSMenu'
+        // does not implement the 'NSMenuDelegate' protocol. Anyway,
+        // having the menu object be its own delegate object is
+        // apparently what the code does on purpose.
+
+        // So to silcense the warning, instead of:
+        // [mpMenu setDelegate: mpMenu];
+        // do this:
+        objc_msgSend(mpMenu, @selector(setDelegate:), mpMenu);
     }
     else
     {
commit e688d55100de08fe4ac95d6c40c2de0d2ffa6f8b
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Sep 28 16:19:45 2011 +0300

    WaE: suggest a space before ';' or explicit braces around empty body in 'while' statement

diff --git a/vcl/aqua/source/gdi/salatslayout.cxx b/vcl/aqua/source/gdi/salatslayout.cxx
index 9cb413b..21fbba1 100644
--- a/vcl/aqua/source/gdi/salatslayout.cxx
+++ b/vcl/aqua/source/gdi/salatslayout.cxx
@@ -987,7 +987,8 @@ bool ATSLayout::InitGIA( ImplLayoutArgs* pArgs ) const
                     // get to the end of the current sub-portion
                     // prevent splitting up at diacritics etc.
                     int j = i;
-                    while( (++j < mnCharCount) && !mpCharWidths[j] );
+                    while( (++j < mnCharCount) && !mpCharWidths[j] )
+                        ;
                     aSubPortion.mnEndCharPos = mnMinCharPos + j;
                     // emit current sub-portion
                     maSubPortions.push_back( aSubPortion );
commit 2ae1b4eb996bd5665559837b0c24bb78e72acf4e
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Sep 28 16:18:44 2011 +0300

    WaE: ATSUI is deprecated in newer SDKs
    
    So when using gcc 4.2.1, turn deprecation warnings off for most of
    these source files, sigh.

diff --git a/vcl/aqua/source/gdi/salatslayout.cxx b/vcl/aqua/source/gdi/salatslayout.cxx
index 1c19337..9cb413b 100644
--- a/vcl/aqua/source/gdi/salatslayout.cxx
+++ b/vcl/aqua/source/gdi/salatslayout.cxx
@@ -37,6 +37,16 @@
 
 #include <math.h>
 
+// ATSUI is deprecated in 10.6 (or already 10.5?)
+#if defined __GNUC__
+#define GCC_VERSION (__GNUC__ * 10000 \
+                     + __GNUC_MINOR__ * 100 \
+                     + __GNUC_PATCHLEVEL__)
+#if GCC_VERSION >= 40201
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+#endif
+
 // =======================================================================
 
 class ATSLayout : public SalLayout
diff --git a/vcl/aqua/source/gdi/salatsuifontutils.cxx b/vcl/aqua/source/gdi/salatsuifontutils.cxx
index a8ded31..c92fec6 100644
--- a/vcl/aqua/source/gdi/salatsuifontutils.cxx
+++ b/vcl/aqua/source/gdi/salatsuifontutils.cxx
@@ -39,6 +39,16 @@
 #include "aqua/saldata.hxx"
 #include "aqua/salatsuifontutils.hxx"
 
+// ATSUI is deprecated in 10.6 (or already 10.5?)
+#if defined __GNUC__
+#define GCC_VERSION (__GNUC__ * 10000 \
+                     + __GNUC_MINOR__ * 100 \
+                     + __GNUC_PATCHLEVEL__)
+#if GCC_VERSION >= 40201
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+#endif
+
 // we have to get the font attributes from the name table
 // since neither head's macStyle nor OS/2's panose are easily available
 // during font enumeration. macStyle bits would be not sufficient anyway
diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx
index 3f8829b..6b1a64c 100644
--- a/vcl/aqua/source/gdi/salgdi.cxx
+++ b/vcl/aqua/source/gdi/salgdi.cxx
@@ -66,6 +66,16 @@ using namespace vcl;
 typedef std::vector<unsigned char> ByteVector;
 
 
+// ATSUI is deprecated in 10.6 (or already 10.5?)
+#if defined __GNUC__
+#define GCC_VERSION (__GNUC__ * 10000 \
+                     + __GNUC_MINOR__ * 100 \
+                     + __GNUC_PATCHLEVEL__)
+#if GCC_VERSION >= 40201
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+#endif
+
 // =======================================================================
 
 ImplMacFontData::ImplMacFontData( const ImplDevFontAttributes& rDFA, ATSUFontID nFontId )
commit 63efb738e9aa833c65606b96ba1e8a7ea028f040
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Sep 28 16:14:39 2011 +0300

    WaE: drop some unused variables

diff --git a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
index 8514d9a..7d55f07 100644
--- a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
+++ b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
@@ -89,9 +89,6 @@ namespace // private
   }
 
 
-  const NSString* PBTYPE_UT16 = @"CorePasteboardFlavorType 0x75743136";
-  const NSString* PBTYPE_PICT = @"CorePasteboardFlavorType 0x50494354";
-  const NSString* PBTYPE_HTML = @"CorePasteboardFlavorType 0x48544D4C";
   const NSString* PBTYPE_SODX = @"application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"";
   const NSString* PBTYPE_SESX = @"application/x-openoffice-embed-source-xml;windows_formatname=\"Star Embed Source (XML)\"";
   const NSString* PBTYPE_SLSDX = @"application/x-openoffice-linksrcdescriptor-xml;windows_formatname=\"Star Link Source Descriptor (XML)\"";
commit 9db079b96b7682f6635f7a329751bf83844079ca
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Sep 28 16:11:03 2011 +0300

    WaE: NSPICTPboardType is deprecated in 10.6 and later
    
    So turn off -Wdeprecated-declarations for most of this source file
    when using gcc 4.2.1 or later.

diff --git a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
index 5c2259f..8514d9a 100644
--- a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
+++ b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
@@ -127,6 +127,18 @@ namespace // private
     Type DataType;
   };
 
+// NSPICTPboardType is deprecated in 10.6 and later
+
+#if defined __GNUC__
+#define GCC_VERSION (__GNUC__ * 10000 \
+                     + __GNUC_MINOR__ * 100 \
+                     + __GNUC_PATCHLEVEL__)
+#if GCC_VERSION >= 40201
+// #pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+#endif
+
   /* At the moment it appears as if only MS Office pastes "public.html" to the clipboard.
    */
   FlavorMap flavorMap[] =
commit 9943a3ff49008576f9ec3aba72947687633eda37
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Sep 28 16:08:57 2011 +0300

    Fix syntax error that earlier compiler versions didn't mind

diff --git a/vcl/aqua/source/dtrans/DataFlavorMapping.hxx b/vcl/aqua/source/dtrans/DataFlavorMapping.hxx
index 51e29ef..adb38a6 100644
--- a/vcl/aqua/source/dtrans/DataFlavorMapping.hxx
+++ b/vcl/aqua/source/dtrans/DataFlavorMapping.hxx
@@ -128,7 +128,7 @@ public:
 
   /* Returns an NSArray containing all pasteboard types supported by OOo
    */
-  NSArray* DataFlavorMapper::getAllSupportedPboardTypes() const;
+  NSArray* getAllSupportedPboardTypes() const;
 
 private:
   /* Determines if the provided Mime content type is valid.
commit 87259f9afefdcda18856eb008e2d13803577f9d0
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Sep 28 16:04:13 2011 +0300

    WaE: setAccessoryView is deprecated in 10.5 and later
    
    Don't know how to fix it properly (i.e. use the corresponding
    non-deprecated API instead), so just using the pragma to ignore that
    warning for now...
    
    Unfortunately gcc 4.2.1 doesn't seem to implement the 'GCC diagnostic
    push/pop' pragmas, so we just have to ignore the warning for the
    method in question and the rest of the file. But luckily it is the
    last method;)

diff --git a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
index abe314f..1afad67 100644
--- a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
+++ b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
@@ -1104,6 +1104,19 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
     rCurY = aFieldRect.origin.y - 5;
 }
 
+// In 10.5 and later:
+// 'setAccessoryView:' is deprecated
+
+#if defined __GNUC__
+#define GCC_VERSION (__GNUC__ * 10000 \
+                     + __GNUC_MINOR__ * 100 \
+                     + __GNUC_PATCHLEVEL__)
+#if GCC_VERSION >= 40201
+// #pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+#endif
+
 @implementation AquaPrintAccessoryView
 +(NSObject*)setupPrinterPanel: (NSPrintOperation*)pOp withController: (vcl::PrinterController*)pController  withState: (PrintAccessoryViewState*)pState;
 {
@@ -1381,7 +1394,7 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
 
     // set the accessory view
     [pOp setAccessoryView: [pAccessoryView autorelease]];
-    
+
     // set the current selecte tab item
     if( pState->nLastPage >= 0 && pState->nLastPage < [pTabView numberOfTabViewItems] )
         [pTabView selectTabViewItemAtIndex: pState->nLastPage];
@@ -1389,6 +1402,10 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
     return pCtrlTarget;
 }
 
+#if defined __GNUC__ && GCC_VERSION >= 40201
+// #pragma GCC diagnostic pop
+#endif
+
 @end
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 0e0393b06a0546335664884069d2e5388832b0f1
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Sep 28 15:44:29 2011 +0300

    WaE: 'NSWindow' may not respond to '-windowShouldClose:'
    
    We get this warning when compiling with g++ 4.2.1 from the 10.6
    SDK. As far as I see there is no command-line option to get rid of it,
    and thus also no pragma to avoid it just for the lines of code in
    question.
    
    So to make it compile with -Werror also using this compiler/SDK,
    expand the Objective-C message call syntactic sugar into a
    objc_msgSend() call instead. That should be equivalent, shouldn't it?

diff --git a/vcl/aqua/source/app/vclnsapp.mm b/vcl/aqua/source/app/vclnsapp.mm
index 2424d37..612aca6 100644
--- a/vcl/aqua/source/app/vclnsapp.mm
+++ b/vcl/aqua/source/app/vclnsapp.mm
@@ -44,6 +44,7 @@
 #include "impimagetree.hxx"
 
 #include "premac.h"
+#include <objc/objc-runtime.h>
 #import "Carbon/Carbon.h"
 #import "apple_remote/RemoteControl.h"
 #include "postmac.h"
@@ -88,7 +89,19 @@
                 if( nModMask == NSCommandKeyMask
                     && [[pEvent charactersIgnoringModifiers] isEqualToString: @"w"] )
                 {
-                    [pFrame->getWindow() windowShouldClose: nil];
+                    // Note: gcc 4.2.1 (in the 10.6 SDK) tells us
+                    // 'NSWindow' may not respond to
+                    // '-windowShouldClose:' . Is that a bogus
+                    // warning, or is this code bogus? No idea.
+                    // Anyway, so that we can compile also against
+                    // this SDK with -Werror, use objc_msgSend
+                    // instead.
+
+                    // Instead of:
+                    // [pFrame->getWindow() windowShouldClose: nil];
+                    // do:
+                    objc_msgSend(pFrame->getWindow(), @selector(windowShouldClose:), nil);
+
                     return;
                 }
             }
commit 82129a0d351cb26203fb8574fbc72c8e91fa9e42
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Sep 28 14:12:14 2011 +0300

    Fix syntax error that earlier compiler versions didn't mind

diff --git a/vcl/aqua/source/a11y/aqua11yfocuslistener.hxx b/vcl/aqua/source/a11y/aqua11yfocuslistener.hxx
index bdfc908..96758d4 100644
--- a/vcl/aqua/source/a11y/aqua11yfocuslistener.hxx
+++ b/vcl/aqua/source/a11y/aqua11yfocuslistener.hxx
@@ -42,8 +42,8 @@ class AquaA11yFocusListener :
 
     static rtl::Reference< AquaA11yFocusListener > theListener;
 
-    AquaA11yFocusListener::AquaA11yFocusListener();
-    virtual AquaA11yFocusListener::~AquaA11yFocusListener() {};
+    AquaA11yFocusListener();
+    virtual ~AquaA11yFocusListener() {};
 public:
 
     static rtl::Reference< AquaA11yFocusListener > get();
commit 0f644656af1a184d95b6227853ffcdfd66b62b42
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Sep 28 14:01:47 2011 +0300

    WaE: declared with greater visibility than the type of its field
    
    To be specific, 'vcl::PageSyncData' declared with greater visibility
    than the type of its field 'vcl::PageSyncData::mActions'
    
    Adding a SAL_DLLPRIVATE to the PageSyncData struct, too, then.
    
    Warning was emitted by g++ 4.2.1 against the MacOSX 10.6 SDK.

diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx
index 868163d..99326c2 100644
--- a/vcl/source/gdi/pdfextoutdevdata.cxx
+++ b/vcl/source/gdi/pdfextoutdevdata.cxx
@@ -298,7 +298,7 @@ void GlobalSyncData::PlayGlobalActions( PDFWriter& rWriter )
     }
 }
 
-struct PageSyncData
+struct SAL_DLLPRIVATE PageSyncData
 {
     std::deque< PDFExtOutDevDataSync >              mActions;
     std::deque< Rectangle >                         mParaRects;


More information about the Libreoffice-commits mailing list