summaryrefslogtreecommitdiffstats
path: root/src/object
diff options
context:
space:
mode:
authorThomas Holder <thomas@thomas-holder.de>2019-11-03 19:02:46 +0000
committerThomas Holder <thomas@thomas-holder.de>2019-11-03 19:59:20 +0000
commit7308f9e1e734fc54661b3d79c4ff8e8fbeb84867 (patch)
tree1c4287533b3727dcc74b6bd85de7f3834bedab7c /src/object
parentmake SP_ATTRIBUTE_IS_CSS a function (diff)
downloadinkscape-7308f9e1e734fc54661b3d79c4ff8e8fbeb84867.tar.gz
inkscape-7308f9e1e734fc54661b3d79c4ff8e8fbeb84867.zip
refactor: Eliminate SPIString::value_default
- eliminate value_default - make value private (-> _value) - add value() method
Diffstat (limited to 'src/object')
-rw-r--r--src/object/sp-path.cpp4
-rw-r--r--src/object/sp-shape.cpp6
-rw-r--r--src/object/sp-text.cpp10
3 files changed, 10 insertions, 10 deletions
diff --git a/src/object/sp-path.cpp b/src/object/sp-path.cpp
index 9d7ef1fe0..58a823543 100644
--- a/src/object/sp-path.cpp
+++ b/src/object/sp-path.cpp
@@ -133,14 +133,14 @@ void SPPath::build(SPDocument *document, Inkscape::XML::Node *repr) {
(d_source == SP_STYLE_SRC_STYLE_PROP || d_source == SP_STYLE_SRC_STYLE_SHEET) ) {
- if (style->d.value) {
+ if (char const *d_val = style->d.value()) {
// Chrome shipped with a different syntax for property vs attribute.
// The SVG Working group decided to follow the Chrome syntax (which may
// allow future extensions of the 'd' property). The property syntax
// wraps the path data with "path(...)". We must strip that!
// Must be Glib::ustring or we get conversion errors!
- Glib::ustring input = style->d.value;
+ Glib::ustring input = d_val;
Glib::ustring expression = R"A(path\("(.*)"\))A";
Glib::RefPtr<Glib::Regex> regex = Glib::Regex::create(expression);
Glib::MatchInfo matchInfo;
diff --git a/src/object/sp-shape.cpp b/src/object/sp-shape.cpp
index be68aae1f..c342fba85 100644
--- a/src/object/sp-shape.cpp
+++ b/src/object/sp-shape.cpp
@@ -67,7 +67,7 @@ void SPShape::build(SPDocument *document, Inkscape::XML::Node *repr) {
SPLPEItem::build(document, repr);
for (int i = 0 ; i < SP_MARKER_LOC_QTY ; i++) {
- sp_shape_set_marker (this, i, this->style->marker_ptrs[i]->value);
+ sp_shape_set_marker (this, i, this->style->marker_ptrs[i]->value());
}
}
@@ -133,7 +133,7 @@ void SPShape::update(SPCtx* ctx, guint flags) {
* match the style.
*/
for (int i = 0 ; i < SP_MARKER_LOC_QTY ; i++) {
- sp_shape_set_marker (this, i, this->style->marker_ptrs[i]->value);
+ sp_shape_set_marker (this, i, this->style->marker_ptrs[i]->value());
}
if (flags & (SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
@@ -856,7 +856,7 @@ Inkscape::DrawingItem* SPShape::show(Inkscape::Drawing &drawing, unsigned int /*
* match the style.
*/
for (int i = 0 ; i < SP_MARKER_LOC_QTY ; i++) {
- sp_shape_set_marker (this, i, this->style->marker_ptrs[i]->value);
+ sp_shape_set_marker (this, i, this->style->marker_ptrs[i]->value());
}
if (has_markers) {
diff --git a/src/object/sp-text.cpp b/src/object/sp-text.cpp
index 3cfae54cb..714ebe1d2 100644
--- a/src/object/sp-text.cpp
+++ b/src/object/sp-text.cpp
@@ -352,7 +352,7 @@ gchar* SPText::description() const {
SPStyle *style = this->style;
- char *n = xml_quote_strdup( style->font_family.value );
+ char *n = xml_quote_strdup(style->font_family.value());
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
int unit = prefs->getInt("/options/font/unitType", SP_CSS_UNIT_PT);
@@ -1024,7 +1024,7 @@ Inkscape::XML::Node* SPText::get_first_rectangle()
Inkscape::XML::Node *our_ref = getRepr();
- if (style->shape_inside.set && style->shape_inside.value) {
+ if (style->shape_inside.set) {
std::vector<Glib::ustring> shapes = get_shapes();
@@ -1047,11 +1047,11 @@ Inkscape::XML::Node* SPText::get_first_rectangle()
std::vector<Glib::ustring> SPText::get_shapes() const
{
std::vector<Glib::ustring> shapes;
- if (style->shape_inside.set && style->shape_inside.value) {
-
+ char const *val;
+ if (style->shape_inside.set && (val = style->shape_inside.value())) {
static Glib::RefPtr<Glib::Regex> regex = Glib::Regex::create("url\\(#([A-z0-9#]*)\\)");
Glib::MatchInfo matchInfo;
- regex->match(style->shape_inside.value, matchInfo);
+ regex->match(val, matchInfo);
while (matchInfo.matches()) {
shapes.push_back(matchInfo.fetch(1));