[Libreoffice-commits] .: Branch 'libreoffice-3-4-5' - sw/source

Petr Mladek pmladek at kemper.freedesktop.org
Tue Jan 3 01:12:50 PST 2012


 sw/source/ui/app/applab.cxx |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 7f978af6476d73246d7cf6c29b48e88a7465f44e
Author: Winfried Donkers <W.Donkers at dci-electronics.nl>
Date:   Fri Dec 9 17:44:20 2011 +0100

    fdo#36874: Label PRINTING misplaced on paper sheet
    
    Signed-off-by: Petr Mladek <pmladek at suse.cz>
    Signed-off-by: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
    Signed-off-by: Lubos Lunak <l.lunak at suse.cz>

diff --git a/sw/source/ui/app/applab.cxx b/sw/source/ui/app/applab.cxx
index 00809fe..f1f8536 100644
--- a/sw/source/ui/app/applab.cxx
+++ b/sw/source/ui/app/applab.cxx
@@ -266,10 +266,14 @@ void SwModule::InsertLab(SfxRequest& rReq, sal_Bool bLabel)
 
             aDesc.SetUseOn(nsUseOnPage::PD_ALL);				// Site numbering
 
+            // fix (fdo36874) revised page size calculation
             // Set page size
-            rFmt.SetFmtAttr(SwFmtFrmSize(ATT_FIX_SIZE,
-                                        rItem.lLeft  + rItem.nCols * rItem.lHDist + MINLAY,
-                                        rItem.lUpper + rItem.nRows * rItem.lVDist + MINLAY));
+            long lPgWidth, lPgHeight;
+            lPgWidth = (((rItem.lLeft  + (rItem.nCols - 1) * rItem.lHDist + rItem.lWidth + rItem.lLeft) > MINLAY) ?
+                (rItem.lLeft  + (rItem.nCols - 1) * rItem.lHDist + rItem.lWidth + rItem.lLeft) : MINLAY);
+            lPgHeight = (((rItem.lUpper + (rItem.nRows - 1) * rItem.lVDist + rItem.lHeight + rItem.lUpper) > MINLAY) ?
+                (rItem.lUpper + (rItem.nRows - 1) * rItem.lVDist + rItem.lHeight + rItem.lUpper) : MINLAY);
+            rFmt.SetFmtAttr( SwFmtFrmSize( ATT_FIX_SIZE, lPgWidth, lPgHeight ));
 
             // Numbering type
             SvxNumberType aType;


More information about the Libreoffice-commits mailing list