Ivan Timofeev | 15 Jun 2012 14:24
Picon

[PATCH] fdo#32181: don't exceed margins on pdfexport

Hi,

MAB: https://bugs.freedesktop.org/show_bug.cgi?id=32181

I've created a (rather idiotic) patch, that fixes that bug, but I have 
no clue what is going on %-) so it can cause some awful side-effects.

There was
commit
http://cgit.freedesktop.org/libreoffice/core/commit/?id=6425c2884d6013a41adbd76728e15832af7a3220 

which did besides:

>  <at>  <at>  -496,7 +510,13  <at>  <at>  void SwTxtPainter::DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip,
>          if( pPor->IsArrowPortion() && GetInfo().OnWin() && !pArrow )
>              pArrow = (SwArrowPortion*)pPor;
>
> -        pPor = !bDrawInWindow && GetInfo().X() > nMaxRight ? 0 : pNext;
> +        pPor = bDrawInWindow || GetInfo().X() <= nMaxRight ||
> +               // --> FME 2004-06-24 #i16816# tagged pdf support
> +               ( GetInfo().GetVsh()->GetViewOptions()->IsPDFExport() &&
> +                 pNext && pNext->IsHolePortion() ) ?
> +               // <--
> +               pNext :
> +               0;
>      }

so on pdfexport we are taking next portion if it is a hole portion 
regardless of its position. What is this: "a hole portion"?
I am thinking: maybe the proper fix is to negate that condition:
(Continue reading)

Caolán McNamara | 18 Jun 2012 23:10
Picon
Favicon
Gravatar

Re: [PATCH] fdo#32181: don't exceed margins on pdfexport

On Fri, 2012-06-15 at 16:24 +0400, Ivan Timofeev wrote:

FWIW, I'm sure you know that #i16816# maps to (thesedays)
https://issues.apache.org/ooo/show_bug.cgi?id=16816 so that's the bug
apparently being addressed by the original commit. Though there's no
immediate explanation there for that specific hunk.

> so on pdfexport we are taking next portion if it is a hole portion 
> regardless of its position. What is this: "a hole portion"?

I haven't a clue, but I see that SwTxtPortion::FormatEOL is one of two
places that makes one, which makes me wonder if
https://bugs.freedesktop.org/show_bug.cgi?id=43737 is related.

> I am thinking: maybe the proper fix is to negate that condition:
> 
>    !pNext->IsHolePortion()
> 
> (it solves the problem as well)

Apparently a HolePortion is a basically a chunk of blank space required
to exist in some edge-cases. My guess is that the logic isn't reversed
in the original and if the choices are between fixing fdo#32181 and
retaining the fix for some obscure palmos pdf problem of #i16816# that
your first patch is the better choice. Just a guess.

Lack of visual layout regression tests is hurting us here :-( Custom
testing font + save to pdf + ye-old-imagemagick-subtract-images-trick is
probable way to go on that front for long term.

(Continue reading)

Ivan Timofeev | 22 Jun 2012 17:34
Picon

Re: [PATCH] fdo#32181: don't exceed margins on pdfexport

Hi Caolan,

first of all sorry for the poor patch, it was too hot that day...

On 19.06.2012 01:10, Caolán McNamara wrote:
> FWIW, I'm sure you know that #i16816# maps to (thesedays)
> https://issues.apache.org/ooo/show_bug.cgi?id=16816 so that's the bug
> apparently being addressed by the original commit.

Yes, #i16816# was about tagged pdf - a pdf in which the text can be 
reflowed (in Adobe Reader: View->Zoom->Reflow). I somehow thought the 
tagged pdf is some magical thing that can not be related... My bad.

We need a space in the EOL to prevent words sticking together on 
reflowing. But this space must not be underline, strike through, etc. I 
have not found yet the means of doing it, though.

Regards,
Ivan
_______________________________________________
LibreOffice mailing list
LibreOffice <at> lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Gmane