diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2023-03-02 11:23:16 +0000 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2023-03-02 12:40:05 +0000 |
commit | d72c2ceb3f3362fe05c5ca6e4b1f01d285cbf104 (patch) | |
tree | 2cd1695f9234a8bbe44d1820d83cbd1282be566f /devices | |
parent | 34267e03378f33fec8cbe4acb0e6517928e37090 (diff) | |
download | ghostpdl-d72c2ceb3f3362fe05c5ca6e4b1f01d285cbf104.tar.gz |
Coverity 380514/380530: Hoist initialisation out of loop.
The pgs doesn't change, and we only initialise once, so this
does the same thing, and is clearer.
Diffstat (limited to 'devices')
-rw-r--r-- | devices/vector/gdevdocxw.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/devices/vector/gdevdocxw.c b/devices/vector/gdevdocxw.c index a92927a5e..f16860a2d 100644 --- a/devices/vector/gdevdocxw.c +++ b/devices/vector/gdevdocxw.c @@ -991,6 +991,13 @@ docxwrite_process_plain_text(gx_device_docxwrite_t *tdev, gs_text_enum_t *pte) gs_point wanted; /* user space */ gs_matrix combined; + combined.xx = penum->pgs->ctm.xx; + combined.xy = penum->pgs->ctm.xy; + combined.yx = penum->pgs->ctm.yx; + combined.yy = penum->pgs->ctm.yy; + combined.tx = penum->pgs->ctm.tx; + combined.ty = penum->pgs->ctm.ty; + for (i=pte->index;i<pte->text.size;i++) { const char* prevFontName; float glyph_width; @@ -1031,13 +1038,6 @@ docxwrite_process_plain_text(gx_device_docxwrite_t *tdev, gs_text_enum_t *pte) if (!prevFontName && penum->text_state->FontName) { gs_rect *bbox = &((gs_font_base *)pte->orig_font)->FontBBox; - combined.xx = penum->pgs->ctm.xx; - combined.xy = penum->pgs->ctm.xy; - combined.yx = penum->pgs->ctm.yx; - combined.yy = penum->pgs->ctm.yy; - combined.tx = penum->pgs->ctm.tx; - combined.ty = penum->pgs->ctm.ty; - if (extract_span_begin( tdev->extract, penum->text_state->FontName, |