[okular] [Bug 479070] Okular hangs when editing Chinese characters in inline note annotation
Keyu Tao
bugzilla_noreply at kde.org
Fri Dec 29 12:30:29 GMT 2023
https://bugs.kde.org/show_bug.cgi?id=479070
--- Comment #24 from Keyu Tao <taoky1999 at gmail.com> ---
(In reply to Albert Astals Cid from comment #23)
> (In reply to Keyu Tao from comment #22)
> > (In reply to Albert Astals Cid from comment #21)
> >
> > > How much do you know about programming? If i tell you do add some printf in
> > > the poppler code is that something you can do?
> >
> > Yes, as I got this conclusion just by adding `std::cout` inside poppler code
> > :)
>
> Ok, can you please print
> rect->x2
> rect->x1
> width
> borderWidth
> textwidth
> da.getFontPtSize()
> before the call to
> const DrawMultiLineTextResult textCommands = drawMultiLineText(*contents,
> textwidth, form, *font, da.getFontName().getName(), da.getFontPtSize(),
> quadding, 0 /*borderWidth*/);
> in
> generateFreeTextAppearance()
>
>
> Also i'm guessing
>
> diff --git a/poppler/Annot.cc b/poppler/Annot.cc
> index b4c4a771..8a50225f 100644
> --- a/poppler/Annot.cc
> +++ b/poppler/Annot.cc
> @@ -3036,7 +3036,7 @@ public:
> *availableWidth -= blockWidth;
> }
>
> - while (newFontNeeded && (!availableWidth || *availableWidth > 0)) {
> + while (newFontNeeded && (!availableWidth || *availableWidth > 0||
> (isUnicode && i == 2) || (!isUnicode && i == 0))) {
> if (!form) {
> // There's no fonts to look for, so just skip the characters
> i += isUnicode ? 2 : 1;
>
>
> Will fix your problem too but i'd like to figure out how availableWidth gets
> to be negative
Var outputs:
===
rect->x2: 25.7253
rect->x1: 23.9537
width: 1.77165
borderWidth: 1
textWidth: -2.22835
da.getFontPtSize(): 10
===
And this patch is working: I could not reproduce the hang with the patched
while loop.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Okular-devel
mailing list