[gnumeric] pdf: enable --export-file-per-sheet
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] pdf: enable --export-file-per-sheet
- Date: Fri, 11 May 2018 00:12:03 +0000 (UTC)
commit 5b820e7d7a68a862e6031120983880eec282055e
Author: Morten Welinder <terra gnome org>
Date: Thu May 10 20:11:35 2018 -0400
pdf: enable --export-file-per-sheet
NEWS | 2 +-
src/print-info.c | 10 ++++++++--
src/print.c | 2 +-
3 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/NEWS b/NEWS
index a6717d2..2cf6f19 100644
--- a/NEWS
+++ b/NEWS
@@ -5,7 +5,7 @@ Morten:
* Introspection fixes.
* Work around gtk+ breakage re. link colors.
* Fix problems with ssconvert --export-file-per-sheet. [#694408]
- * Enable --export-file-per-sheet for html and latex.
+ * Enable --export-file-per-sheet for html, latex, and pdf.
--------------------------------------------------------------------------
Gnumeric 1.12.41
diff --git a/src/print-info.c b/src/print-info.c
index 72ff82f..3bd9d70 100644
--- a/src/print-info.c
+++ b/src/print-info.c
@@ -37,6 +37,8 @@
#include <locale.h>
#include <time.h>
+#define SHEET_SELECTION_KEY "sheet-selection"
+
#define PDF_SAVER_ID "Gnumeric_pdf:pdf_assistant"
#define MAX_SAVED_CUSTOM_HF_FORMATS 9
@@ -833,7 +835,10 @@ pdf_write_workbook (G_GNUC_UNUSED GOFileSaver const *fs,
WorkbookView const *wbv, GsfOutput *output)
{
Workbook const *wb = wb_view_get_workbook (wbv);
- GPtrArray *sheets = g_object_get_data (G_OBJECT (wb), "pdf-sheets");
+ GPtrArray *sheets;
+
+ sheets = g_object_get_data (G_OBJECT (wb), "pdf-sheets");
+ if (!sheets) sheets = g_object_get_data (G_OBJECT (wb), SHEET_SELECTION_KEY);
if (sheets) {
int i;
@@ -854,7 +859,7 @@ pdf_write_workbook (G_GNUC_UNUSED GOFileSaver const *fs,
static void
pdf_export (GOFileSaver const *fs, GOIOContext *context,
- GoView const *view, GsfOutput *output)
+ GoView const *view, GsfOutput *output)
{
WorkbookView const *wbv = GNM_WORKBOOK_VIEW (view);
Workbook const *wb = wb_view_get_workbook (wbv);
@@ -984,6 +989,7 @@ print_init (void)
PDF_SAVER_ID, "pdf",
_("PDF export"),
GO_FILE_FL_WRITE_ONLY, pdf_export);
+ g_object_set (G_OBJECT (saver), "sheet-selection", TRUE, NULL);
g_signal_connect (G_OBJECT (saver), "set-export-options",
G_CALLBACK (pdf_set_export_options),
NULL);
diff --git a/src/print.c b/src/print.c
index a514774..ed9eeb6 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1804,7 +1804,7 @@ gnm_print_sheet (WorkbookControl *wbc, Sheet *sheet,
gtk_print_settings_set_use_color (settings,
!sheet->print_info->print_black_and_white);
if (!export_dst && !preview_via_pdf && !preview) {
- /* We should be setting the output file name to somethig */
+ /* We should be setting the output file name to something */
/* reasonable */
saved_uri = print_info_get_printtofile_uri (sheet->print_info);
if (saved_uri != NULL &&
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]