diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2019-06-02 12:49:26 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marc@jeanmougin.fr> | 2019-06-02 12:49:26 +0000 |
| commit | 114a38206233122984b134e5d33bae494a5ba7e9 (patch) | |
| tree | 881dae040e601c85dc6d0153a2397ee4ff8ef50b /src/attributes.cpp | |
| parent | Cache bounding box of shapes (diff) | |
| parent | add stylesheet popup (diff) | |
| download | inkscape-114a38206233122984b134e5d33bae494a5ba7e9.tar.gz inkscape-114a38206233122984b134e5d33bae494a5ba7e9.zip | |
Merge branch 'CSSDialogSimplify'
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..3fa8c0fff 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.push_back(Glib::ustring(prop.name)); + } + } + std::sort(result.begin(), result.end()); + return result; +} + /* Local Variables: |
