diff options
| author | Thomas Holder <thomas@thomas-holder.de> | 2019-11-03 19:02:46 +0000 |
|---|---|---|
| committer | Thomas Holder <thomas@thomas-holder.de> | 2019-11-03 19:59:20 +0000 |
| commit | 7308f9e1e734fc54661b3d79c4ff8e8fbeb84867 (patch) | |
| tree | 1c4287533b3727dcc74b6bd85de7f3834bedab7c /src/ui | |
| parent | make SP_ATTRIBUTE_IS_CSS a function (diff) | |
| download | inkscape-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/ui')
| -rw-r--r-- | src/ui/dialog/font-substitution.cpp | 10 | ||||
| -rw-r--r-- | src/ui/toolbar/text-toolbar.cpp | 4 | ||||
| -rw-r--r-- | src/ui/tools/text-tool.cpp | 5 | ||||
| -rw-r--r-- | src/ui/widget/font-variants.cpp | 5 |
4 files changed, 11 insertions, 13 deletions
diff --git a/src/ui/dialog/font-substitution.cpp b/src/ui/dialog/font-substitution.cpp index bf371588a..5616b4bfa 100644 --- a/src/ui/dialog/font-substitution.cpp +++ b/src/ui/dialog/font-substitution.cpp @@ -175,13 +175,11 @@ std::vector<SPItem*> FontSubstitution::getFontReplacedItems(SPDocument* doc, Gli if (style) { gchar const *style_font = nullptr; if (style->font_family.set) - style_font = style->font_family.value; + style_font = style->font_family.value(); else if (style->font_specification.set) - style_font = style->font_specification.value; - else if (style->font_family.value) - style_font = style->font_family.value; - else if (style->font_specification.value) - style_font = style->font_specification.value; + style_font = style->font_specification.value(); + else + style_font = style->font_family.value(); if (style_font) { if (has_visible_text(item)) { diff --git a/src/ui/toolbar/text-toolbar.cpp b/src/ui/toolbar/text-toolbar.cpp index 9743ce524..0dd94cadf 100644 --- a/src/ui/toolbar/text-toolbar.cpp +++ b/src/ui/toolbar/text-toolbar.cpp @@ -181,11 +181,11 @@ static void sp_text_toolbox_select_cb( GtkEntry* entry, GtkEntryIconPosition /*p Glib::ustring family_style; if (style->font_family.set) { - family_style = style->font_family.value; + family_style = style->font_family.value(); //std::cout << " family style from font_family: " << family_style << std::endl; } else if (style->font_specification.set) { - family_style = style->font_specification.value; + family_style = style->font_specification.value(); //std::cout << " family style from font_spec: " << family_style << std::endl; } diff --git a/src/ui/tools/text-tool.cpp b/src/ui/tools/text-tool.cpp index 203ce027e..6eb02b7b5 100644 --- a/src/ui/tools/text-tool.cpp +++ b/src/ui/tools/text-tool.cpp @@ -657,7 +657,7 @@ bool TextTool::root_handler(GdkEvent* event) { SPItem *text = create_text_with_rectangle (desktop, this->p0, p1); /* Get "shape-inside" */ - gchar* shape_inside = g_strdup(text->style->shape_inside.value); + auto shape_inside = text->style->shape_inside; /* Set style */ sp_desktop_apply_style_tool(desktop, text->getRepr(), "/tools/text", true); @@ -670,8 +670,7 @@ bool TextTool::root_handler(GdkEvent* event) { text->setCSS(css,"style"); sp_repr_css_attr_unref(css); /* Restore "shape-inside" */ - text->style->shape_inside.read( shape_inside ); - g_free( shape_inside ); + text->style->shape_inside = shape_inside; text->updateRepr(); desktop->getSelection()->set(text); diff --git a/src/ui/widget/font-variants.cpp b/src/ui/widget/font-variants.cpp index 28ba7dc14..10874318b 100644 --- a/src/ui/widget/font-variants.cpp +++ b/src/ui/widget/font-variants.cpp @@ -716,10 +716,11 @@ namespace Widget { std::string setting; // Set feature radiobutton (if it exists) or add to _feature_entry string. - if (query->font_feature_settings.value) { + char const *val = query->font_feature_settings.value(); + if (val) { std::vector<Glib::ustring> tokens = - Glib::Regex::split_simple("\\s*,\\s*", query->font_feature_settings.value); + Glib::Regex::split_simple("\\s*,\\s*", val); for (auto token: tokens) { regex->match(token, matchInfo); |
