Bugzilla – Attachment 97059 Details for
Bug 23488
Line wrapping doesn't always respect word order in Patron card creator
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23488: Line wrapping doesn't always respect word order in Patron card creator
Bug-23488-Line-wrapping-doesnt-always-respect-word.patch (text/plain), 1.95 KB, created by
William Frazilien
on 2020-01-08 21:52:14 UTC
(
hide
)
Description:
Bug 23488: Line wrapping doesn't always respect word order in Patron card creator
Filename:
MIME Type:
Creator:
William Frazilien
Created:
2020-01-08 21:52:14 UTC
Size:
1.95 KB
patch
obsolete
>From bb133a94bc00f92f02c80d10e1b06e02052992ef Mon Sep 17 00:00:00 2001 >From: Maryse Simard <maryse.simard@inlibro.com> >Date: Wed, 21 Aug 2019 17:20:16 -0400 >Subject: [PATCH] Bug 23488: Line wrapping doesn't always respect word order in > Patron card creator > >When wrapping long lines of text, the line is divided by removing each >word from the end of the line and putting it in a new one until the line >is the right width. When the word to be removed appears multiple time >in the line, it is not the last occurrence that is removed. > >This patch changes the regular expression used to remove the part of >the text that is wrapped to a new line, making sure it removes it at >the end of the text. > >Signed-off-by: Gabriel DeCarufel <gabriel@inlibro.com> >Signed-off-by: William Frazilien <william.frazilien@inlibro.com> >--- > C4/Patroncards/Patroncard.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/C4/Patroncards/Patroncard.pm b/C4/Patroncards/Patroncard.pm >index 661a9e8ac5..963aac8acf 100644 >--- a/C4/Patroncards/Patroncard.pm >+++ b/C4/Patroncards/Patroncard.pm >@@ -261,7 +261,7 @@ sub draw_text { > warn sprintf('Line wrap failed. DEBUG INFO: Data: \'%s\'\n Method: C4::Patroncards->draw_text Additional Information: Line wrap regexp failed. (Please file in this information in a bug report at http://bugs.koha-community.org', $line) and last WRAP_LINES if !$1; > $trim = $1 . $trim; > #Sanitize the input into this regular expression so regex metacharacters are escaped as literal values (https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22429) >- $line =~ s/\Q$1\E//; >+ $line =~ s/\Q$1\E$//; > $string_width = C4::Creators::PDF->StrWidth($line, $text_attribs->{'font'}, $text_attribs->{'font_size'}); > # $font_units_width = $m->string_width($line); > # $string_width = ($font_units_width * $text_attribs->{'font_size'}) / $units_per_em; >-- >2.17.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23488
:
92411
|
97030
|
97059
|
99115
|
99835