summaryrefslogtreecommitdiffstats
path: root/src/libnrtype
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/libnrtype
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/libnrtype')
-rw-r--r--src/libnrtype/FontFactory.cpp9
-rw-r--r--src/libnrtype/font-lister.cpp2
2 files changed, 6 insertions, 5 deletions
diff --git a/src/libnrtype/FontFactory.cpp b/src/libnrtype/FontFactory.cpp
index 0260a9c4b..7844925b7 100644
--- a/src/libnrtype/FontFactory.cpp
+++ b/src/libnrtype/FontFactory.cpp
@@ -79,7 +79,7 @@ PangoFontDescription* ink_font_description_from_style(SPStyle const *style)
{
PangoFontDescription *descr = pango_font_description_new();
- pango_font_description_set_family(descr, style->font_family.value);
+ pango_font_description_set_family(descr, style->font_family.value());
// This duplicates Layout::EnumConversionItem... perhaps we can share code?
switch ( style->font_style.computed ) {
@@ -572,11 +572,12 @@ font_instance* font_factory::FaceFromStyle(SPStyle const *style)
if (style) {
// First try to use the font specification if it is set
+ char const *val;
if (style->font_specification.set
- && style->font_specification.value
- && *style->font_specification.value) {
+ && (val = style->font_specification.value())
+ && val[0]) {
- font = FaceFromFontSpecification(style->font_specification.value);
+ font = FaceFromFontSpecification(val);
}
// If that failed, try using the CSS information in the style
diff --git a/src/libnrtype/font-lister.cpp b/src/libnrtype/font-lister.cpp
index 30283e624..dcd94d972 100644
--- a/src/libnrtype/font-lister.cpp
+++ b/src/libnrtype/font-lister.cpp
@@ -542,7 +542,7 @@ std::pair<Glib::ustring, Glib::ustring> FontLister::selection_update()
//std::cout << " Attempting selected style" << std::endl;
if (result != QUERY_STYLE_NOTHING && query.font_specification.set) {
- fontspec = query.font_specification.value;
+ fontspec = query.font_specification.value();
//std::cout << " fontspec from query :" << fontspec << ":" << std::endl;
}