[gnumeric] ssdiff: fix crash in --highlight mode.



commit b414ed84d384dbe4f8ca5c9c094f208cc411292d
Author: Morten Welinder <terra gnome org>
Date:   Sun Dec 3 18:45:14 2017 -0500

    ssdiff: fix crash in --highlight mode.

 ChangeLog    |    1 +
 src/ssdiff.c |   10 +++++++---
 2 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 3c8a3c2..faa0b40 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
        * src/ssdiff.c (diff_sheets_colrow): New function to compare
        row/column sizes.
+       (highlight_cell_changed): Survive missing cell.
 
 2017-12-01  Morten Welinder <terra gnome org>
 
diff --git a/src/ssdiff.c b/src/ssdiff.c
index c785ba7..146418c 100644
--- a/src/ssdiff.c
+++ b/src/ssdiff.c
@@ -823,9 +823,13 @@ highlight_cell_changed (GnmDiffState *state,
                        GnmCell const *oc, GnmCell const *nc)
 {
        GnmRange r;
-       r.start = nc->pos;
-       r.end = nc->pos;
-       highlight_apply (state, nc->base.sheet->name_unquoted, &r);
+       const char *sheetname;
+
+       r.start = nc ? nc->pos : oc->pos;
+       r.end = r.start;
+
+       sheetname = nc ? nc->base.sheet->name_unquoted : oc->base.sheet->name_unquoted;
+       highlight_apply (state, sheetname, &r);
 }
 
 static void


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