summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2022-05-31 22:24:18 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2022-05-31 22:24:18 -0400
commit816c9d20cb322dade1af9e94cb4b5e0251c47966 (patch)
treebb06a3004e6d8ed791446a6366da8da417a9f937
parent0fbfcc740f91d1c6e3f3fa062e009a69437b3f24 (diff)
downloadorcus-816c9d20cb322dade1af9e94cb4b5e0251c47966.tar.gz
Remove the old interface for fill style
-rw-r--r--include/orcus/spreadsheet/factory.hpp4
-rw-r--r--include/orcus/spreadsheet/import_interface_styles.hpp39
-rw-r--r--src/include/mock_spreadsheet.hpp5
-rw-r--r--src/spreadsheet/factory_styles.cpp26
4 files changed, 1 insertions, 73 deletions
diff --git a/include/orcus/spreadsheet/factory.hpp b/include/orcus/spreadsheet/factory.hpp
index c3081653..18341018 100644
--- a/include/orcus/spreadsheet/factory.hpp
+++ b/include/orcus/spreadsheet/factory.hpp
@@ -79,10 +79,6 @@ public:
virtual void set_font_count(size_t n) override;
virtual void set_fill_count(size_t n) override;
- virtual void set_fill_pattern_type(fill_pattern_t fp) override;
- virtual void set_fill_fg_color(color_elem_t alpha, color_elem_t red, color_elem_t green, color_elem_t blue) override;
- virtual void set_fill_bg_color(color_elem_t alpha, color_elem_t red, color_elem_t green, color_elem_t blue) override;
- virtual size_t commit_fill() override;
virtual void set_border_count(size_t n) override;
virtual void set_border_style(border_direction_t dir, border_style_t style) override;
diff --git a/include/orcus/spreadsheet/import_interface_styles.hpp b/include/orcus/spreadsheet/import_interface_styles.hpp
index da2250d4..6be18e21 100644
--- a/include/orcus/spreadsheet/import_interface_styles.hpp
+++ b/include/orcus/spreadsheet/import_interface_styles.hpp
@@ -79,45 +79,6 @@ public:
virtual void set_fill_count(size_t n) = 0;
/**
- * Set the type of fill pattern.
- *
- * @param fp fill pattern type.
- */
- virtual void set_fill_pattern_type(fill_pattern_t fp) = 0;
-
- /**
- * Set the foreground color of a fill. <i>Note that for a solid fill
- * type, the foreground color will be used.</i>
- *
- * @param alpha alpha component ranging from 0 (fully transparent) to 255
- * (fully opaque).
- * @param red red component ranging from 0 to 255.
- * @param green green component ranging from 0 to 255.
- * @param blue blue component ranging from 0 to 255.
- */
- virtual void set_fill_fg_color(color_elem_t alpha, color_elem_t red, color_elem_t green, color_elem_t blue) = 0;
-
- /**
- * Set the background color of a fill. <i>Note that this color will
- * be ignored for a solid fill type.</i>
- *
- * @param alpha alpha component ranging from 0 (fully transparent) to 255
- * (fully opaque).
- * @param red red component ranging from 0 to 255.
- * @param green green component ranging from 0 to 255.
- * @param blue blue component ranging from 0 to 255.
- */
- virtual void set_fill_bg_color(color_elem_t alpha, color_elem_t red, color_elem_t green, color_elem_t blue) = 0;
-
- /**
- * Commit the fill style currently in the buffer.
- *
- * @return the ID of the committed fill style, to be passed on to the
- * set_xf_fill() method as its argument.
- */
- virtual size_t commit_fill() = 0;
-
- /**
* Set the total number of border styles. This may be called before
* importing any of the border styles. This will give the implementer a
* chance to allocate storage. Note that it may not always be called.
diff --git a/src/include/mock_spreadsheet.hpp b/src/include/mock_spreadsheet.hpp
index ccae1d55..3b02f32f 100644
--- a/src/include/mock_spreadsheet.hpp
+++ b/src/include/mock_spreadsheet.hpp
@@ -45,10 +45,7 @@ public:
// fill
virtual void set_fill_count(size_t n) override;
- virtual void set_fill_pattern_type(fill_pattern_t fp) override;
- virtual void set_fill_fg_color(color_elem_t alpha, color_elem_t red, color_elem_t green, color_elem_t blue) override;
- virtual void set_fill_bg_color(color_elem_t alpha, color_elem_t red, color_elem_t green, color_elem_t blue) override;
- virtual size_t commit_fill() override;
+ virtual iface::import_fill_style* get_fill_style() override;
// border
diff --git a/src/spreadsheet/factory_styles.cpp b/src/spreadsheet/factory_styles.cpp
index 4a730410..be9ad608 100644
--- a/src/spreadsheet/factory_styles.cpp
+++ b/src/spreadsheet/factory_styles.cpp
@@ -125,32 +125,6 @@ void import_styles::set_fill_count(size_t n)
mp_impl->styles_model.reserve_fill_store(n);
}
-void import_styles::set_fill_pattern_type(fill_pattern_t fp)
-{
- mp_impl->cur_fill.pattern_type = fp;
- mp_impl->cur_fill_active.pattern_type = true;
-}
-
-void import_styles::set_fill_fg_color(color_elem_t alpha, color_elem_t red, color_elem_t green, color_elem_t blue)
-{
- mp_impl->cur_fill.fg_color = color_t(alpha, red, green, blue);
- mp_impl->cur_fill_active.fg_color = true;
-}
-
-void import_styles::set_fill_bg_color(color_elem_t alpha, color_elem_t red, color_elem_t green, color_elem_t blue)
-{
- mp_impl->cur_fill.bg_color = color_t(alpha, red, green, blue);
- mp_impl->cur_fill_active.bg_color = true;
-}
-
-size_t import_styles::commit_fill()
-{
- size_t fill_id = mp_impl->styles_model.append_fill(mp_impl->cur_fill, mp_impl->cur_fill_active);
- mp_impl->cur_fill.reset();
- mp_impl->cur_fill_active.reset();
- return fill_id;
-}
-
void import_styles::set_border_count(size_t n)
{
mp_impl->styles_model.reserve_border_store(n);