summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2022-06-02 20:24:52 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2022-06-02 20:24:52 -0400
commitcf68531c016440668fb830ff99b5e79e850c4535 (patch)
tree0aadd03a326535c833202e4c69bbdbd5b6c3c73b
parent39e9628bc6516614808a870292be75393c851ae8 (diff)
downloadorcus-cf68531c016440668fb830ff99b5e79e850c4535.tar.gz
Use import_cell_protection in gnumeric
-rw-r--r--src/liborcus/gnumeric_sheet_context.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/liborcus/gnumeric_sheet_context.cpp b/src/liborcus/gnumeric_sheet_context.cpp
index 2f83d67c..f42bd8bf 100644
--- a/src/liborcus/gnumeric_sheet_context.cpp
+++ b/src/liborcus/gnumeric_sheet_context.cpp
@@ -608,6 +608,10 @@ void gnumeric_sheet_context::start_style(const xml_attrs_t& attrs)
if (!fill_style)
throw interface_error("implementer must provide a concrete instance of import_fill_style.");
+ auto* cell_protection = styles->get_cell_protection();
+ if (!cell_protection)
+ throw interface_error("implementer must provide a concrete instance of import_cell_protection.");
+
bool fill_set = false;
bool protection_set = false;
@@ -640,7 +644,7 @@ void gnumeric_sheet_context::start_style(const xml_attrs_t& attrs)
case XML_Hidden:
{
bool b = atoi(attr.value.data());
- styles->set_cell_hidden(b);
+ cell_protection->set_hidden(b);
protection_set = true;
break;
@@ -648,7 +652,7 @@ void gnumeric_sheet_context::start_style(const xml_attrs_t& attrs)
case XML_Locked:
{
bool b = atoi(attr.value.data());
- styles->set_cell_locked(b);
+ cell_protection->set_locked(b);
protection_set = true;
break;
@@ -713,7 +717,7 @@ void gnumeric_sheet_context::start_style(const xml_attrs_t& attrs)
}
if (protection_set)
{
- size_t protection_id = styles->commit_cell_protection();
+ size_t protection_id = cell_protection->commit();
styles->set_xf_protection(protection_id);
}
}