[gnumeric] Introspection fixes.



commit 93a468d661e44217635aeb1638b6386ccc9369c6
Author: Morten Welinder <terra gnome org>
Date:   Sat Apr 17 14:13:52 2021 -0400

    Introspection fixes.
    
    Introspection was unhappy with workbook_sheets.  Hack around that.

 NEWS           |  1 +
 src/workbook.c | 29 ++++++++++++++++++++++++++++-
 src/workbook.h |  3 +++
 3 files changed, 32 insertions(+), 1 deletion(-)
---
diff --git a/NEWS b/NEWS
index 78c00c0ad..3b5b48184 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ Morten:
        * Export file:// links to html.  [#569]
        * Export file:// links to xlsx.  [#569]
        * Improve handling of invalid formulae from xlsx.  [#574]
+       * Introspection fixes.
 
 --------------------------------------------------------------------------
 Gnumeric 1.12.49
diff --git a/src/workbook.c b/src/workbook.c
index 4df508225..25e7a8c83 100644
--- a/src/workbook.c
+++ b/src/workbook.c
@@ -833,7 +833,7 @@ workbook_detach_view (WorkbookView *wbv)
 /*****************************************************************************/
 
 /**
- * workbook_sheets:
+ * workbook_sheets: (skip)
  * @wb: #Workbook
  *
  * Get an ordered list of the sheets in the workbook
@@ -847,6 +847,33 @@ workbook_sheets (Workbook const *wb)
        return g_ptr_array_ref (wb->sheets);
 }
 
+// Alternate version for the sake of introspection which is unhappy with
+// the GPtrArray api.
+
+/**
+ * gnm_workbook_sheets0: (rename-to workbook_sheets)
+ * @wb: #Workbook
+ *
+ * Get an ordered list of the sheets in the workbook
+ *
+ * Returns: (element-type Sheet) (transfer full): the sheets list.
+ */
+GSList *
+gnm_workbook_sheets0 (Workbook const *wb)
+{
+       GSList *res = NULL;
+       unsigned ui;
+
+       g_return_val_if_fail (GNM_IS_WORKBOOK (wb), NULL);
+
+       for (ui = wb->sheets->len; ui--; ) {
+               Sheet *sheet = g_ptr_array_index (wb->sheets, ui);
+               res = g_slist_prepend (res, g_object_ref (sheet));
+       }
+
+       return g_slist_reverse (res);
+}
+
 int
 workbook_sheet_count (Workbook const *wb)
 {
diff --git a/src/workbook.h b/src/workbook.h
index c62d6da23..435c0e700 100644
--- a/src/workbook.h
+++ b/src/workbook.h
@@ -98,6 +98,9 @@ int workbook_sheet_state_size (WorkbookSheetState const *wss);
 char *workbook_sheet_state_diff (WorkbookSheetState const *wss_a,
                                 WorkbookSheetState const *wss_b);
 
+// For bindings only!
+GSList *gnm_workbook_sheets0 (Workbook const *wb);
+
 #define WORKBOOK_FOREACH_SHEET(wb, sheet, code)                                \
   do {                                                                 \
          const Workbook *wb_ = (wb);                                   \


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