diff options
| author | Alexander Valavanis <valavanisalex@gmail.com> | 2019-06-05 19:33:55 +0000 |
|---|---|---|
| committer | Alexander Valavanis <valavanisalex@gmail.com> | 2019-06-05 19:33:55 +0000 |
| commit | 2e40143d6e75d50bf659abddc5c7c25fb1bc2436 (patch) | |
| tree | e2fa747c95569dc3f77fcdfa770b3d404ff065cc /src/attributes.cpp | |
| parent | Hackfest2019: Rm tautological tests (diff) | |
| parent | Use a flowbox when there are more than two options for font feature settings. (diff) | |
| download | inkscape-2e40143d6e75d50bf659abddc5c7c25fb1bc2436.tar.gz inkscape-2e40143d6e75d50bf659abddc5c7c25fb1bc2436.zip | |
Merge changes
Diffstat (limited to 'src/attributes.cpp')
| -rw-r--r-- | src/attributes.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/attributes.cpp b/src/attributes.cpp index d7081d4c9..7353c35ed 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 <cstring> #include <map> +#include <algorithm> #include <glib.h> // g_assert() -#include "attributes.h" + struct SPStyleProp { SPAttributeEnum code; @@ -602,6 +604,27 @@ sp_attribute_name(SPAttributeEnum id) return props[id].name; } +std::vector<Glib::ustring> sp_attribute_name_list(bool cssattr, bool attr) +{ + std::vector<Glib::ustring> 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.emplace_back(prop.name); + } + } + std::sort(result.begin(), result.end()); + return result; +} + /* Local Variables: |
