[Libreoffice-commits] core.git: vcl/unx

Michael Weghorn (via logerrit) logerrit at kemper.freedesktop.org
Fri Sep 17 10:07:24 UTC 2021


 vcl/unx/gtk3/gtkinst.cxx              |    8 ++++----
 vcl/unx/gtk3/salnativewidgets-gtk.cxx |    7 ++++---
 2 files changed, 8 insertions(+), 7 deletions(-)

New commits:
commit 8ded3f9562aec04e54dd36677f5a99e0d6cbec23
Author:     Michael Weghorn <m.weghorn at posteo.de>
AuthorDate: Fri Sep 17 09:31:22 2021 +0200
Commit:     Michael Weghorn <m.weghorn at posteo.de>
CommitDate: Fri Sep 17 12:06:48 2021 +0200

    Fix gtk4 build ('--enable-werror')
    
    Fixes
    
        [CXX] vcl/unx/gtk4/transferableprovider.cxx
        In file included from vcl/unx/gtk4/salnativewidgets-gtk.cxx:10:
        vcl/unx/gtk4/../gtk3/salnativewidgets-gtk.cxx:364:19: error: ‘gTreeViewWidget’ defined but not used [-Werror=unused-variable]
          364 | static GtkWidget* gTreeViewWidget;
              |                   ^~~~~~~~~~~~~~~
        vcl/unx/gtk4/../gtk3/salnativewidgets-gtk.cxx:363:19: error: ‘gListBox’ defined but not used [-Werror=unused-variable]
          363 | static GtkWidget* gListBox;
              |                   ^~~~~~~~
        vcl/unx/gtk4/../gtk3/salnativewidgets-gtk.cxx:362:19: error: ‘gComboBox’ defined but not used [-Werror=unused-variable]
          362 | static GtkWidget* gComboBox;
              |                   ^~~~~~~~~
        vcl/unx/gtk4/../gtk3/salnativewidgets-gtk.cxx:355:19: error: ‘gSpinBox’ defined but not used [-Werror=unused-variable]
          355 | static GtkWidget* gSpinBox;
              |                   ^~~~~~~~
        cc1plus: all warnings being treated as errors
        make[1]: *** [solenv/gbuild/LinkTarget.mk:307: workdir/CxxObject/vcl/unx/gtk4/salnativewidgets-gtk.o] Error 1
        make[1]: *** Waiting for unfinished jobs....
        In file included from vcl/unx/gtk4/notifyinglayout.hxx:13,
                         from vcl/unx/gtk4/gtkinst.cxx:14:
        vcl/unx/gtk4/../gtk3/gtkinst.cxx:4385:11: error: ‘static void {anonymous}::GtkInstanceWidget::LinkStubasync_drag_cancel(void*, void*)’ defined but not used [-Werror=unused-function]
         4385 | IMPL_LINK(GtkInstanceWidget, async_drag_cancel, void*, arg, void)
              |           ^~~~~~~~~~~~~~~~~
        include/tools/link.hxx:45:13: note: in definition of macro ‘IMPL_LINK’
           45 |     RetType Class::LinkStub##Member(void * instance, ArgType data) { \
              |             ^~~~~
        cc1plus: all warnings being treated as errors
        make[1]: *** [solenv/gbuild/LinkTarget.mk:304: workdir/CxxObject/vcl/unx/gtk4/gtkinst.o] Error 1
        make: *** [Makefile:288: build] Error 2
    
    Change-Id: Id570c22aa66bf134fdc4dda31a0cf1f867f3653d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122235
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.weghorn at posteo.de>

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 9f0cada7e763..b09e7f56d503 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -2514,7 +2514,9 @@ protected:
     GtkWidget* m_pMouseEventBox;
     GtkInstanceBuilder* m_pBuilder;
 
+#if !GTK_CHECK_VERSION(4, 0, 0)
     DECL_LINK(async_drag_cancel, void*, void);
+#endif
 
     bool IsFirstFreeze() const { return m_nFreezeCount == 0; }
     bool IsLastThaw() const { return m_nFreezeCount == 1; }
@@ -4382,9 +4384,9 @@ public:
 
 }
 
+#if !GTK_CHECK_VERSION(4, 0, 0)
 IMPL_LINK(GtkInstanceWidget, async_drag_cancel, void*, arg, void)
 {
-#if !GTK_CHECK_VERSION(4, 0, 0)
     m_pDragCancelEvent = nullptr;
     GdkDragContext* context = static_cast<GdkDragContext*>(arg);
 
@@ -4396,10 +4398,8 @@ IMPL_LINK(GtkInstanceWidget, async_drag_cancel, void*, arg, void)
     g_signal_emit_by_name(context, "cancel", 0, GDK_DRAG_CANCEL_USER_CANCELLED);
 
     g_object_unref(context);
-#else
-    (void)arg;
-#endif
 }
+#endif
 
 namespace
 {
diff --git a/vcl/unx/gtk3/salnativewidgets-gtk.cxx b/vcl/unx/gtk3/salnativewidgets-gtk.cxx
index c034c1135d89..8fe550371d7e 100644
--- a/vcl/unx/gtk3/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/salnativewidgets-gtk.cxx
@@ -352,16 +352,17 @@ tools::Rectangle GtkSalGraphics::NWGetScrollButtonRect( ControlPart nPart, tools
 
 static GtkWidget* gCacheWindow;
 static GtkWidget* gDumbContainer;
-static GtkWidget* gSpinBox;
 #if GTK_CHECK_VERSION(4, 0, 0)
 static GtkWidget* gVScrollbar;
 static GtkWidget* gHScrollbar;
 static GtkWidget* gTextView;
-#endif
-static GtkWidget* gEntryBox;
+#else
 static GtkWidget* gComboBox;
 static GtkWidget* gListBox;
+static GtkWidget* gSpinBox;
 static GtkWidget* gTreeViewWidget;
+#endif
+static GtkWidget* gEntryBox;
 
 namespace
 {


More information about the Libreoffice-commits mailing list