X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fui%2Fgui%2Fpsppire-spreadsheet-model.c;h=f5be69d8705981d52300008499046662675ebafc;hb=42993d3ae61750a8f1e291297d8ac91465afcff2;hp=3a14ce6c4695202f31c50d86b3ba956fa1c013f6;hpb=5c7ef80c2934c94d9739940d4f62f0f9815b852e;p=pspp
diff --git a/src/ui/gui/psppire-spreadsheet-model.c b/src/ui/gui/psppire-spreadsheet-model.c
index 3a14ce6c46..f5be69d870 100644
--- a/src/ui/gui/psppire-spreadsheet-model.c
+++ b/src/ui/gui/psppire-spreadsheet-model.c
@@ -14,16 +14,23 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
+/* This file implements a GtkTreeModel. It allows GtkComboBox and
+ GtkTreeView to display the names and non-empty cell ranges of the
+ sheets aka "Tables" of spreadsheet files.
+ It doesn't take any notice of the spreadsheet data itself.
+*/
#include
#include
-#include "psppire-spreadsheet-model.h"
+#include
+#define _(msgid) gettext (msgid)
+#define N_(msgid) msgid
+
+#include "psppire-spreadsheet-model.h"
#include "data/spreadsheet-reader.h"
-#include "data/gnumeric-reader.h"
-#include "data/ods-reader.h"
static void psppire_spreadsheet_model_init (PsppireSpreadsheetModel *
spreadsheetModel);
@@ -246,7 +253,7 @@ tree_model_get_value (GtkTreeModel * model, GtkTreeIter * iter,
case PSPPIRE_SPREADSHEET_MODEL_COL_NAME:
{
const char *x =
- ods_get_sheet_name (spreadsheetModel->spreadsheet,
+ spreadsheet_get_sheet_name (spreadsheetModel->spreadsheet,
(gint) iter->user_data);
g_value_set_string (value, x);
@@ -255,9 +262,10 @@ tree_model_get_value (GtkTreeModel * model, GtkTreeIter * iter,
case PSPPIRE_SPREADSHEET_MODEL_COL_RANGE:
{
char *x =
- ods_get_sheet_range (spreadsheetModel->spreadsheet,
+ spreadsheet_get_sheet_range (spreadsheetModel->spreadsheet,
(gint) iter->user_data);
- g_value_set_string (value, x);
+
+ g_value_set_string (value, x ? x : _("(empty)"));
g_free (x);
}
break;