summaryrefslogtreecommitdiffstats
path: root/src/object/sp-style-elem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/object/sp-style-elem.cpp')
-rw-r--r--src/object/sp-style-elem.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/object/sp-style-elem.cpp b/src/object/sp-style-elem.cpp
index 14e4a8d90..de2041764 100644
--- a/src/object/sp-style-elem.cpp
+++ b/src/object/sp-style-elem.cpp
@@ -450,6 +450,23 @@ void update_style_recursively( SPObject *object ) {
}
}
+/*
+ * Returns each statement as an SPStyle
+ */
+std::vector<SPStyle *> SPStyleElem::getStyles() {
+ std::vector<SPStyle *> ret;
+ gint count = cr_stylesheet_nr_rules(style_sheet);
+
+ for (gint x = 0; x < count; x++) {
+ SPStyle *item = new SPStyle(nullptr, nullptr);
+ CRStatement *statement = cr_stylesheet_statement_get_from_list(style_sheet, x);
+ item->mergeStatement(statement);
+ ret.push_back(item);
+ }
+
+ return ret;
+}
+
void SPStyleElem::read_content() {
// First, create the style-sheet object and track it in this