[pango/pango-1-48: 1/7] gravity: Remove redundant code




commit 78172a9d50f5cec869c0d23742d6d52219ae8042
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Aug 2 01:15:28 2021 -0400

    gravity: Remove redundant code
    
    Just pass PANGO_GRAVITY_AUTO on to
    pango_gravity_get_for_script_and_width.
    It has just the same fallback handling.

 pango/pango-gravity.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)
---
diff --git a/pango/pango-gravity.c b/pango/pango-gravity.c
index 30e99eb0..0eb3cfe2 100644
--- a/pango/pango-gravity.c
+++ b/pango/pango-gravity.c
@@ -362,16 +362,13 @@ get_script_properties (PangoScript script)
  */
 PangoGravity
 pango_gravity_get_for_script (PangoScript      script,
-                             PangoGravity     base_gravity,
-                             PangoGravityHint hint)
+                              PangoGravity     base_gravity,
+                              PangoGravityHint hint)
 {
   PangoScriptProperties props = get_script_properties (script);
 
-  if (G_UNLIKELY (base_gravity == PANGO_GRAVITY_AUTO))
-    base_gravity = props.preferred_gravity;
-
   return pango_gravity_get_for_script_and_width (script, props.wide,
-                                                base_gravity, hint);
+                                                 base_gravity, hint);
 }
 
 /**
@@ -403,15 +400,14 @@ pango_gravity_get_for_script (PangoScript      script,
  * Since: 1.26
  */
 PangoGravity
-pango_gravity_get_for_script_and_width (PangoScript        script,
-                                       gboolean           wide,
-                                       PangoGravity       base_gravity,
-                                       PangoGravityHint   hint)
+pango_gravity_get_for_script_and_width (PangoScript      script,
+                                        gboolean         wide,
+                                        PangoGravity     base_gravity,
+                                        PangoGravityHint hint)
 {
   PangoScriptProperties props = get_script_properties (script);
   gboolean vertical;
 
-
   if (G_UNLIKELY (base_gravity == PANGO_GRAVITY_AUTO))
     base_gravity = props.preferred_gravity;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]