summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2019-02-19 12:57:18 +0000
committerTavmjong Bah <tavmjong@free.fr>2019-02-19 12:57:18 +0000
commit1ce07672bee15d83fa25d43241fb00193604bc8a (patch)
tree3a91f422e629fc8481e44696de3569629cbd2cb2 /src
parentFix bugs pointed by Patrick (diff)
downloadinkscape-1ce07672bee15d83fa25d43241fb00193604bc8a.tar.gz
inkscape-1ce07672bee15d83fa25d43241fb00193604bc8a.zip
Fix code to avoid error message "descr without font family".
Diffstat (limited to 'src')
-rw-r--r--src/libnrtype/font-lister.cpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/libnrtype/font-lister.cpp b/src/libnrtype/font-lister.cpp
index 9c9e07ad2..701c5c3d6 100644
--- a/src/libnrtype/font-lister.cpp
+++ b/src/libnrtype/font-lister.cpp
@@ -25,8 +25,17 @@
#include "preferences.h"
#include "object/sp-object.h"
+
+// Following are needed to limit the source of updating font data to text and containers.
#include "object/sp-root.h"
-#include "object/sp-namedview.h"
+#include "object/sp-object-group.h"
+#include "object/sp-anchor.h"
+#include "object/sp-text.h"
+#include "object/sp-tspan.h"
+#include "object/sp-textpath.h"
+#include "object/sp-tref.h"
+#include "object/sp-flowtext.h"
+#include "object/sp-flowdiv.h"
#include "xml/repr.h"
@@ -413,9 +422,20 @@ void FontLister::update_font_data_recursive(SPObject& r, std::map<Glib::ustring,
}
pango_font_description_free(descr);
- for (auto& child: r.children) {
- if (SP_IS_NAMEDVIEW(&r)) continue;
- update_font_data_recursive(child, font_data);
+ if (SP_IS_GROUP(&r) ||
+ SP_IS_ANCHOR(&r) ||
+ SP_IS_ROOT(&r) ||
+ SP_IS_TEXT(&r) ||
+ SP_IS_TSPAN(&r) ||
+ SP_IS_TEXTPATH(&r) ||
+ SP_IS_TREF(&r) ||
+ SP_IS_FLOWTEXT(&r) ||
+ SP_IS_FLOWDIV(&r) ||
+ SP_IS_FLOWPARA(&r) ||
+ SP_IS_FLOWLINE(&r)) {
+ for (auto& child: r.children) {
+ update_font_data_recursive(child, font_data);
+ }
}
}