[gnumeric] xls: import also protection block in conditional formatting.



commit 3adda4b289ef52aa916c3fb660b7828f04a88d98
Author: Morten Welinder <terra gnome org>
Date:   Fri Mar 14 15:26:32 2014 -0400

    xls: import also protection block in conditional formatting.
    
    Well, ignore it.  But this should pass the length check now.

 plugins/excel/ms-excel-read.c  |    4 ++++
 plugins/excel/ms-excel-write.c |    1 +
 2 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/plugins/excel/ms-excel-read.c b/plugins/excel/ms-excel-read.c
index 1a2bdb6..7081e4e 100644
--- a/plugins/excel/ms-excel-read.c
+++ b/plugins/excel/ms-excel-read.c
@@ -5384,6 +5384,10 @@ excel_read_CF (BiffQuery *q, ExcelReadSheet *esheet, GnmStyleConditions *sc)
                offset += 4;
        }
 
+       if (flags & 0x40000000) { /* protection */
+               offset += 2;
+       }
+
        XL_CHECK_CONDITION (q->length == offset + expr0_len + expr1_len);
 
        d (1, gnm_style_dump (overlay););
diff --git a/plugins/excel/ms-excel-write.c b/plugins/excel/ms-excel-write.c
index 161aabe..72b5902 100644
--- a/plugins/excel/ms-excel-write.c
+++ b/plugins/excel/ms-excel-write.c
@@ -1219,6 +1219,7 @@ cb_write_condition (GnmStyleConditions const *sc, CondDetails *cd,
 
                        if (gnm_style_is_element_set (s, MSTYLE_INDENT)) {
                                d2 |= ((gnm_style_get_indent (s) & 0xf) << 0);
+                               d3 = 0xffff;
                        } else
                                flags |= 0x20;
 


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