]> granicus.if.org Git - graphviz/commitdiff
Fix bug 2422 (update visio plugin to textspan_t)
authorEmden R. Gansner <erg@alum.mit.edu>
Tue, 18 Feb 2014 16:54:04 +0000 (11:54 -0500)
committerEmden R. Gansner <erg@alum.mit.edu>
Tue, 18 Feb 2014 16:54:04 +0000 (11:54 -0500)
plugin/visio/VisioRender.cpp
plugin/visio/VisioText.cpp
plugin/visio/gvrender_visio_vdx.cpp

index bc70bfad46d185a106e6094bef853a008bb30fb5..4f8df6974d172379d8c1854170452b5b1ae3d520 100644 (file)
@@ -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)
index 54731235ca8afc640d5fc51b8b0024e2648cf90a..fad75fc2185f0e706cf66bfa65387450fc02cd10 100644 (file)
@@ -77,16 +77,16 @@ namespace Visio
                gvprintf(job, "<pp IX='%d'/><cp IX='%d'/>%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):
index 504973468e8757bc3265ef7aa9e01e2a4a600410..665a4ec6ca6549f173862cc4260f5960943783f8 100644 (file)
@@ -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,