From 95ca51e5c8c5a86b6814cde790114b2afb1fcd2c Mon Sep 17 00:00:00 2001 From: Crzyrndm Date: Mon, 2 Jul 2018 10:43:09 +1200 Subject: [PATCH] unimplemented functions under styles/ --- source/styles/color.cpp | 10 ++++++++++ source/styles/conditional_format.cpp | 15 +++++++++++++++ source/styles/protection.cpp | 20 ++++++++++++++++++++ source/styles/style.cpp | 5 +++++ 4 files changed, 50 insertions(+) diff --git a/source/styles/color.cpp b/source/styles/color.cpp index e9e1c739..3eccd394 100644 --- a/source/styles/color.cpp +++ b/source/styles/color.cpp @@ -57,6 +57,11 @@ std::size_t indexed_color::index() const return index_; } +void indexed_color::index(std::size_t index) +{ + index_ = index; +} + // theme_color implementation theme_color::theme_color(std::size_t index) : index_(index) @@ -68,6 +73,11 @@ std::size_t theme_color::index() const return index_; } +void theme_color::index(std::size_t index) +{ + index_ = index; +} + // rgb_color implementation std::string rgb_color::hex_string() const diff --git a/source/styles/conditional_format.cpp b/source/styles/conditional_format.cpp index 52736b47..9a5852d5 100644 --- a/source/styles/conditional_format.cpp +++ b/source/styles/conditional_format.cpp @@ -81,6 +81,11 @@ bool conditional_format::operator!=(const conditional_format &other) const return !(*this == other); } +bool conditional_format::has_border() const +{ + return d_->border_id.is_set(); +} + xlnt::border conditional_format::border() const { return d_->parent->borders.at(d_->border_id.get()); @@ -92,6 +97,11 @@ conditional_format conditional_format::border(const xlnt::border &new_border) return *this; } +bool conditional_format::has_fill() const +{ + return d_->fill_id.is_set(); +} + xlnt::fill conditional_format::fill() const { return d_->parent->fills.at(d_->fill_id.get()); @@ -103,6 +113,11 @@ conditional_format conditional_format::fill(const xlnt::fill &new_fill) return *this; } +bool conditional_format::has_font() const +{ + return d_->font_id.is_set(); +} + xlnt::font conditional_format::font() const { return d_->parent->fonts.at(d_->font_id.get()); diff --git a/source/styles/protection.cpp b/source/styles/protection.cpp index 96b32785..3d1fd326 100644 --- a/source/styles/protection.cpp +++ b/source/styles/protection.cpp @@ -26,6 +26,26 @@ namespace xlnt { +protection protection::unlocked_and_visible() +{ + return protection(); +} + +protection protection::locked_and_visible() +{ + return protection().locked(true); +} + +protection protection::unlocked_and_hidden() +{ + return protection().hidden(true); +} + +protection protection::locked_and_hidden() +{ + return protection().locked(true).hidden(true); +} + protection::protection() : locked_(false), hidden_(false) { diff --git a/source/styles/style.cpp b/source/styles/style.cpp index d10f6896..10f145b8 100755 --- a/source/styles/style.cpp +++ b/source/styles/style.cpp @@ -66,6 +66,11 @@ std::size_t style::builtin_id() const return d_->builtin_id.get(); } +bool style::builtin() const +{ + d_->builtin_id.is_set(); +} + std::string style::name() const { return d_->name;