Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Winfried Donkers píše v Po 19. 12. 2011 v 09:12 +0100:
Is it an option to push it to 3.4.5 as well?

This probably is still not the correct way to propose this patch for
 3.4.5 but hopefully good enough to be reviewed and processed. I'm not
 fast in learning, but eventually I may get there ;)

You asked for review the right way. :-)

We need to be very careful when pushing changes into 3-4-5. There is not
much time for testing.

Your code looks definitely better than the original one. Well, I am
still not sure about the calculation. It makes perfect sense when I
imagine the paper with blank labels. On the other hand, 
please look at http://download.go-oo.org/tmp/labels.png. The LO GUI
shows the page width as:

    left-margin + 3 * horizontal-pitch

=> the corresponding calculation should be:

        rItem.lLeft + rItem.nCols * rItem.lHDist

=> The code might be:

        long lPgWidth, lPgHeight;
        lPgWidth = rItem.lLeft + rItem.nCols * rItem.lHDist;
        lPgHeight = rItem.lUpper + rItem.nRows * rItem.lVDist;
        // check mimimal size
        if ( lPgWidth < MINLAY )
                lPgWidth = MINLAY;
        if ( lPgHeight < MINLAY )
                lPgHeight = MINLAY;
        rFmt.SetFmtAttr( SwFmtFrmSize( ATT_FIX_SIZE, lPgWidth, lPgHeight ));

As I said, your code makes perfect sense in the real printing. It might
be that just the LO GUI uses wrong visualization.

Have you tested your code with real label printing?
Is just the visualization wrong in LO?

Thanks a lot for the fix.


Best Regards,
Petr


PS: Just a nitpicking. I did not use the ?: operator in my example. I
think that it was not ideal in this case because you cut&pasted the long
calculation, so it was hard to read and prone to a typo ;-)

Attachment: labels.png
Description: PNG image


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.