[gnumeric] compilation: avoid overriding link.



commit 014f19d3ff768c03f72b150e74cd0d9fe04170f5
Author: Morten Welinder <terra gnome org>
Date:   Wed Mar 8 11:44:33 2017 -0500

    compilation: avoid overriding link.
    
    Also remove some dead code.

 plugins/excel/xlsx-read.c  |   10 +++++-----
 plugins/excel/xlsx-write.c |   19 ++++++++++---------
 2 files changed, 15 insertions(+), 14 deletions(-)
---
diff --git a/plugins/excel/xlsx-read.c b/plugins/excel/xlsx-read.c
index 0214170..c148503 100644
--- a/plugins/excel/xlsx-read.c
+++ b/plugins/excel/xlsx-read.c
@@ -3133,7 +3133,7 @@ xlsx_CT_HyperLinks (GsfXMLIn *xin, xmlChar const **attrs)
        GnmStyle *style;
        GnmRange r;
        GType link_type = 0;
-       GnmHLink *link = NULL;
+       GnmHLink *lnk = NULL;
        xmlChar const *target = NULL;
        xmlChar const *tooltip = NULL;
        xmlChar const *extern_id = NULL;
@@ -3181,11 +3181,11 @@ xlsx_CT_HyperLinks (GsfXMLIn *xin, xmlChar const **attrs)
                return;
        }
 
-       link = gnm_hlink_new (link_type, state->sheet);
-       gnm_hlink_set_target (link, target);
-       gnm_hlink_set_tip (link, tooltip);
+       lnk = gnm_hlink_new (link_type, state->sheet);
+       gnm_hlink_set_target (lnk, target);
+       gnm_hlink_set_tip (lnk, tooltip);
        style = gnm_style_new ();
-       gnm_style_set_hlink (style, link);
+       gnm_style_set_hlink (style, lnk);
        sheet_style_apply_range (state->sheet, &r, style);
 }
 
diff --git a/plugins/excel/xlsx-write.c b/plugins/excel/xlsx-write.c
index b344aee..8d47206 100644
--- a/plugins/excel/xlsx-write.c
+++ b/plugins/excel/xlsx-write.c
@@ -2065,13 +2065,12 @@ xlsx_write_validations (XLSXWriteState *state, GsfXMLOut *xml, G_GNUC_UNUSED Gnm
 }
 
 static void
-xlsx_write_hlink (GnmHLink const *link, GSList *ranges, XLSXClosure *info)
+xlsx_write_hlink (GnmHLink const *lnk, GSList *ranges, XLSXClosure *info)
 {
-       gchar const *target = gnm_hlink_get_target (link);
-       gchar const *location = NULL;
+       gchar const *target = gnm_hlink_get_target (lnk);
        gchar const *rid = NULL;
-       gchar const *tip;
-       GType const t = G_OBJECT_TYPE (link);
+       gchar const *tip = gnm_hlink_get_tip (lnk);
+       GType const t = G_OBJECT_TYPE (lnk);
 
        if (t == gnm_hlink_url_get_type () ||
            t == gnm_hlink_email_get_type ()) {
@@ -2082,17 +2081,19 @@ xlsx_write_hlink (GnmHLink const *link, GSList *ranges, XLSXClosure *info)
                return;
 
        for (; ranges  != NULL ; ranges = ranges->next) {
+               GnmRange const *range = ranges->data;
+
                gsf_xml_out_start_element (info->xml, "hyperlink");
-               xlsx_add_range (info->xml, "ref", ranges->data);
+               xlsx_add_range (info->xml, "ref", range);
 
                if (t == gnm_hlink_cur_wb_get_type ())
                        gsf_xml_out_add_cstr (info->xml, "location", target);
                else if (NULL != rid)
                        gsf_xml_out_add_cstr (info->xml, "r:id", rid);
-               if (NULL != location)
-                       gsf_xml_out_add_cstr (info->xml, "tooltip", location);
-               if (NULL != (tip = gnm_hlink_get_tip (link)))
+
+               if (tip)
                        gsf_xml_out_add_cstr (info->xml, "tooltip", tip);
+
                gsf_xml_out_end_element (info->xml); /*  </hyperlink> */
        }
 }


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