From c140c53e787b4fa24534bd4eab6b1cead0ef28ae Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Sun, 2 Jun 2019 11:45:23 +0200 Subject: Add popup with CSS properties --- src/attributes.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'src/attributes.cpp') diff --git a/src/attributes.cpp b/src/attributes.cpp index d7081d4c9..575e40b5c 100644 --- a/src/attributes.cpp +++ b/src/attributes.cpp @@ -9,11 +9,13 @@ * Released under GNU GPL v2+, read the file 'COPYING' for more information. */ +#include "attributes.h" #include #include +#include #include // g_assert() -#include "attributes.h" + struct SPStyleProp { SPAttributeEnum code; @@ -602,6 +604,28 @@ sp_attribute_name(SPAttributeEnum id) return props[id].name; } +std::vector +sp_attribute_name_list(bool cssattr, bool attr) +{ + std::vector result; + static AttributeLookupImpl const _instance; + bool add = attr; + for (auto prop : props) { + if (prop.code == SP_ATTR_D) { + if (cssattr) { + add = true; + } else if (attr) { + add = false; + } + } + if (add) { + result.push_back(Glib::ustring(prop.name)); + } + } + std::sort(result.begin(), result.end()); + return result; +} + /* Local Variables: -- cgit v1.2.3 From e8cc89a8433af94c38db86f765565e912cc878c7 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Sun, 2 Jun 2019 12:20:33 +0200 Subject: Fixing coding style --- src/attributes.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/attributes.cpp') diff --git a/src/attributes.cpp b/src/attributes.cpp index 575e40b5c..3fa8c0fff 100644 --- a/src/attributes.cpp +++ b/src/attributes.cpp @@ -604,8 +604,7 @@ sp_attribute_name(SPAttributeEnum id) return props[id].name; } -std::vector -sp_attribute_name_list(bool cssattr, bool attr) +std::vector sp_attribute_name_list(bool cssattr, bool attr) { std::vector result; static AttributeLookupImpl const _instance; -- cgit v1.2.3