[05fb3c9a7f20d8c60ade227ba6ed41510428c5d3e3847eac78eb486b06d2fae4] Redraw: don't redraw during load.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [05fb3c9a7f20d8c60ade227ba6ed41510428c5d3e3847eac78eb486b06d2fae4] Redraw: don't redraw during load.
- Date: Wed, 8 Jul 2020 00:37:56 +0000 (UTC)
commit b3df4cc2a4822e52bf24b10cf8392953485dead5
Author: Morten Welinder <terra gnome org>
Date: Tue Jul 7 20:37:28 2020 -0400
Redraw: don't redraw during load.
ChangeLog | 5 +++++
NEWS | 1 +
src/sheet.c | 8 +++++++-
src/workbook-priv.h | 1 +
src/workbook-view.c | 2 ++
src/workbook.c | 1 +
6 files changed, 17 insertions(+), 1 deletion(-)
---
diff --git a/ChangeLog b/ChangeLog
index a10f1afc9..ee5105101 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2020-07-07 Morten Welinder <terra gnome org>
+
+ * src/sheet.c (sheet_queue_redraw_range): Ignore requests during
+ loading of a file.
+
2020-07-06 Morten Welinder <terra gnome org>
* src/dependent.c (bucket_start_row): Improve performance.
diff --git a/NEWS b/NEWS
index 5787ad2b9..de5716bb3 100644
--- a/NEWS
+++ b/NEWS
@@ -28,6 +28,7 @@ Morten:
* Re-tune style quad tree. [#234]
* Re-tune dependency bucket system. [#502]
* Fix global name parsing problem with non-uniform sheet sizing.
+ * Avoid style dependency redraw during file load.
--------------------------------------------------------------------------
Gnumeric 1.12.47
diff --git a/src/sheet.c b/src/sheet.c
index 23a5de82d..d516b73cb 100644
--- a/src/sheet.c
+++ b/src/sheet.c
@@ -3384,8 +3384,14 @@ sheet_queue_redraw_range (Sheet *sheet, GnmRange const *range)
g_return_if_fail (IS_SHEET (sheet));
g_return_if_fail (range != NULL);
+ if (sheet->workbook->being_loaded) {
+ if (debug_redraw)
+ g_printerr ("Ignoring redraw of %s during loading\n", range_as_string (range));
+ return;
+ }
+
if (debug_redraw)
- g_printerr ("Adding %s\n", range_as_string (range));
+ g_printerr ("Adding redraw %s\n", range_as_string (range));
g_array_append_val (sheet->pending_redraw, *range);
diff --git a/src/workbook-priv.h b/src/workbook-priv.h
index 42a6a4b51..c7347e54c 100644
--- a/src/workbook-priv.h
+++ b/src/workbook-priv.h
@@ -45,6 +45,7 @@ struct _Workbook {
gboolean during_destruction;
gboolean being_reordered;
gboolean recursive_dirty_enabled;
+ gboolean being_loaded;
};
typedef struct {
diff --git a/src/workbook-view.c b/src/workbook-view.c
index 85e63f9d8..69d0fa0f1 100644
--- a/src/workbook-view.c
+++ b/src/workbook-view.c
@@ -1377,8 +1377,10 @@ workbook_view_new_from_input (GsfInput *input,
/* disable recursive dirtying while loading */
old = workbook_enable_recursive_dirty (new_wb, FALSE);
+ new_wb->being_loaded = TRUE;
go_file_opener_open (file_opener, encoding, io_context,
GO_VIEW (new_wbv), input);
+ new_wb->being_loaded = FALSE;
workbook_enable_recursive_dirty (new_wb, old);
if (go_io_error_occurred (io_context)) {
diff --git a/src/workbook.c b/src/workbook.c
index bad5fd5d3..530ba6020 100644
--- a/src/workbook.c
+++ b/src/workbook.c
@@ -250,6 +250,7 @@ workbook_init (GObject *object)
wb->during_destruction = FALSE;
wb->being_reordered = FALSE;
wb->recursive_dirty_enabled = TRUE;
+ wb->being_loaded = FALSE;
gnm_app_workbook_list_add (wb);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]