From d9c4cd8aaa4f59fe17264cc5efcb0204f05683d3 Mon Sep 17 00:00:00 2001 From: "Emden R. Gansner" Date: Tue, 18 Feb 2014 11:54:04 -0500 Subject: [PATCH] Fix bug 2422 (update visio plugin to textspan_t) --- plugin/visio/VisioRender.cpp | 4 ++-- plugin/visio/VisioText.cpp | 14 +++++++------- plugin/visio/gvrender_visio_vdx.cpp | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/plugin/visio/VisioRender.cpp b/plugin/visio/VisioRender.cpp index bc70bfad4..4f8df6974 100644 --- a/plugin/visio/VisioRender.cpp +++ b/plugin/visio/VisioRender.cpp @@ -233,9 +233,9 @@ namespace Visio AddGraphic(job, Graphic::CreatePolyline(job, A, n)); } - void Render::AddText(GVJ_t* job, pointf p, textpara_t *para) + void Render::AddText(GVJ_t* job, pointf p, textspan_t *span) { - AddText(job, Text::CreateText(job, p, para)); + AddText(job, Text::CreateText(job, p, span)); } void Render::AddAnchor(GVJ_t *job, char *url, char *tooltip, char *target, char *id) diff --git a/plugin/visio/VisioText.cpp b/plugin/visio/VisioText.cpp index 54731235c..fad75fc21 100644 --- a/plugin/visio/VisioText.cpp +++ b/plugin/visio/VisioText.cpp @@ -77,16 +77,16 @@ namespace Visio gvprintf(job, "%s\n", index, index, _text ? xml_string(_text) : ""); /* para mark + char mark + actual text */ } - Text* Text::CreateText(GVJ_t* job, pointf p, textpara_t* para) + Text* Text::CreateText(GVJ_t* job, pointf p, textspan_t* span) { Para::HorzAlign horzAlign; /* compute text bounding box and VDX horizontal align */ boxf bounds; - bounds.LL.y = p.y + para->yoffset_centerline; - bounds.UR.y = p.y + para->yoffset_centerline + para->height; - double width = para->width; - switch (para->just) + bounds.LL.y = p.y + span->yoffset_centerline; + bounds.UR.y = p.y + span->yoffset_centerline + span->size.y; + double width = span->size.x; + switch (span->just) { case 'r': horzAlign = Para::horzRight; @@ -110,13 +110,13 @@ namespace Visio new Para( horzAlign), new Char( - para->fontsize, + span->font->size, job->obj->pencolor.u.rgba[0], job->obj->pencolor.u.rgba[1], job->obj->pencolor.u.rgba[2]), new Run( bounds, - para->str)); + span->str)); } Text::Text(Para* para, Char* chars, Run* run): diff --git a/plugin/visio/gvrender_visio_vdx.cpp b/plugin/visio/gvrender_visio_vdx.cpp index 504973468..665a4ec6c 100644 --- a/plugin/visio/gvrender_visio_vdx.cpp +++ b/plugin/visio/gvrender_visio_vdx.cpp @@ -101,11 +101,11 @@ static void vdxgen_begin_anchor(GVJ_t *job, char *url, char *tooltip, char *targ context->AddAnchor(job, url, tooltip, target, id); } -static void vdxgen_textpara(GVJ_t * job, pointf p, textpara_t * para) +static void vdxgen_textspan(GVJ_t * job, pointf p, textspan_t * span) { Visio::Render* context = (Visio::Render*)job->context; if (context) - context->AddText(job, p, para); + context->AddText(job, p, span); } static void vdxgen_ellipse(GVJ_t * job, pointf * A, int filled) @@ -159,7 +159,7 @@ gvrender_engine_t vdxgen_engine = { 0, /* vdxgen_end_anchor */ 0, /* vdxgen_begin_label */ 0, /* vdxgen_end_label */ - vdxgen_textpara, + vdxgen_textspan, 0, /* vdxgen_resolve_color */ vdxgen_ellipse, vdxgen_polygon, -- 2.40.0