[PATCH libreoffice-3-6] Resolves: rhbz#906137 slide show inverts outputs

Caolán McNamara (via_Code_Review) gerrit at gerrit.libreoffice.org
Fri Mar 15 05:43:28 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2746

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/46/2746/1

Resolves: rhbz#906137 slide show inverts outputs

we go to some effort to determine the right value of ret
and then throw it away and return 0

regression since 4a7e3482912c90b73d6e12c82bcd9ce31975e3f1

Change-Id: I652cfbe44fdab6560c1c8dc8fe25d6211b5357cb

Related: rhbz#906137 g_module_symbol returned nothing

for gdk_screen_get_primary_monitor but osl_getAsciiFunctionSymbol does the
right thing

Change-Id: Ibf1a17724a9393d95c4fbe0d26aa82148eea33a9
---
M vcl/unx/gtk/app/gtksys.cxx
1 file changed, 6 insertions(+), 10 deletions(-)



diff --git a/vcl/unx/gtk/app/gtksys.cxx b/vcl/unx/gtk/app/gtksys.cxx
index cc921b8..4c3abf1 100644
--- a/vcl/unx/gtk/app/gtksys.cxx
+++ b/vcl/unx/gtk/app/gtksys.cxx
@@ -28,7 +28,6 @@
  * instead of those above.
  */
 #include <string.h>
-#include <gmodule.h>
 #include <gtk/gtk.h>
 #include <unx/gtk/gtkinst.hxx>
 #include <unx/gtk/gtksys.hxx>
@@ -190,14 +189,14 @@
 static int _fallback_get_primary_monitor (GdkScreen *pScreen)
 {
     // Use monitor name as primacy heuristic
-    int ret = -1;
     int max = gdk_screen_get_n_monitors (pScreen);
-    for (int i = 0; i < max && ret < 0; i++)
+    for (int i = 0; i < max; ++i)
     {
         char *name = gdk_screen_get_monitor_plug_name (pScreen, i);
-        if (name && !g_ascii_strncasecmp (name, "LVDS", 4))
-            ret = i;
+        bool bLaptop = (name && !g_ascii_strncasecmp (name, "LVDS", 4));
         g_free (name);
+        if (bLaptop)
+            return i;
     }
     return 0;
 }
@@ -212,11 +211,8 @@
     // Perhaps we have a newer gtk+ with this symbol:
     if (!get_fn)
     {
-        GModule *module = g_module_open (NULL, (GModuleFlags) 0);
-        if (!g_module_symbol (module, "gdk_screen_get_primary_monitor",
-                              (gpointer *)&get_fn))
-            get_fn = NULL;
-        g_module_close (module);
+        get_fn = (int(*)(GdkScreen*))osl_getAsciiFunctionSymbol(NULL,
+            "gdk_screen_get_primary_monitor");
     }
 #if GTK_CHECK_VERSION(2,14,0)
     if (!get_fn)

-- 
To view, visit https://gerrit.libreoffice.org/2746
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibf1a17724a9393d95c4fbe0d26aa82148eea33a9
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-3-6
Gerrit-Owner: Caolán McNamara <caolanm at redhat.com>



More information about the LibreOffice mailing list