summaryrefslogtreecommitdiff
path: root/source/fitz/stext-device.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2017-11-07 11:51:40 +0100
committerTor Andersson <tor.andersson@artifex.com>2017-11-08 17:57:09 +0100
commita0f531e2492bd6d19edab9ca2e9f19f2284b0796 (patch)
tree0f8fcd1ab547df519dff0302fe88fe90214a9bbb /source/fitz/stext-device.c
parent44397fc9cbc795ec5acabcc4da1b08608431313b (diff)
downloadmupdf-a0f531e2492bd6d19edab9ca2e9f19f2284b0796.tar.xz
Select and copy structured text by lines.
Diffstat (limited to 'source/fitz/stext-device.c')
-rw-r--r--source/fitz/stext-device.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/source/fitz/stext-device.c b/source/fitz/stext-device.c
index cae3c583..cd657acc 100644
--- a/source/fitz/stext-device.c
+++ b/source/fitz/stext-device.c
@@ -643,14 +643,13 @@ fz_stext_close_device(fz_context *ctx, fz_device *dev)
for (block = page->first_block; block; block = block->next)
{
- if (block->type == FZ_STEXT_BLOCK_TEXT)
+ if (block->type != FZ_STEXT_BLOCK_TEXT)
+ continue;
+ for (line = block->u.t.first_line; line; line = line->next)
{
- for (line = block->u.t.first_line; line; line = line->next)
- {
- for (ch = line->first_char; ch; ch = ch->next)
- fz_union_rect(&line->bbox, &ch->bbox);
- fz_union_rect(&block->bbox, &line->bbox);
- }
+ for (ch = line->first_char; ch; ch = ch->next)
+ fz_union_rect(&line->bbox, &ch->bbox);
+ fz_union_rect(&block->bbox, &line->bbox);
}
}