diff --git a/src/sp-text.cpp b/src/sp-text.cpp
index cc575d99f7dc473e042a4364334066737590eb22..810df25307da1ddc6ba06cb249e62ab7cee6baa6 100644 (file)
--- a/src/sp-text.cpp
+++ b/src/sp-text.cpp
@@ -194,7 +194,7 @@ sp_text_child_added (SPObject *object, Inkscape::XML::Node *rch, Inkscape::XML::
if (((SPObjectClass *) text_parent_class)->child_added)
((SPObjectClass *) text_parent_class)->child_added (object, rch, ref);
- text->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_TEXT_CONTENT_MODIFIED_FLAG);
+ text->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_TEXT_CONTENT_MODIFIED_FLAG | SP_TEXT_LAYOUT_MODIFIED_FLAG);
}
static void
@@ -356,7 +356,7 @@ sp_text_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &transform, unsi
// Add stroke width
SPStyle* style=SP_OBJECT_STYLE (item);
- if (style->stroke.type != SP_PAINT_TYPE_NONE) {
+ if (!style->stroke.isNone()) {
double const scale = expansion(transform);
if ( fabs(style->stroke_width.computed * scale) > 0.01 ) { // sinon c'est 0=oon veut pas de bord
double const width = MAX(0.125, style->stroke_width.computed * scale);
SPText *text = (SPText *) item;
SPStyle *style = SP_OBJECT_STYLE(text);
- font_instance *tf = (font_factory::Default())->Face(style->text->font_family.value,
- font_style_to_pos(*style));
+ font_instance *tf = font_factory::Default()->FaceFromStyle(style);
+
char name_buf[256];
char *n;
if (tf) {
@@ -748,11 +748,14 @@ void TextTagAttributes::mergeInto(Inkscape::Text::Layout::OptionalTextTagAttrs *
void TextTagAttributes::mergeSingleAttribute(std::vector<SVGLength> *output_list, std::vector<SVGLength> const &parent_list, unsigned parent_offset, std::vector<SVGLength> const *overlay_list)
{
+ output_list->clear();
if (overlay_list == NULL) {
- output_list->resize(std::max(0, (int)parent_list.size() - (int)parent_offset));
- std::copy(parent_list.begin() + parent_offset, parent_list.end(), output_list->begin());
+ if (parent_list.size() > parent_offset)
+ {
+ output_list->reserve(parent_list.size() - parent_offset);
+ std::copy(parent_list.begin() + parent_offset, parent_list.end(), std::back_inserter(*output_list));
+ }
} else {
- output_list->clear();
output_list->reserve(std::max((int)parent_list.size() - (int)parent_offset, (int)overlay_list->size()));
unsigned overlay_offset = 0;
while (parent_offset < parent_list.size() || overlay_offset < overlay_list->size()) {