Attached a first fix for the problems that showed after my first patch for 
fdo44516.
Labels documents are now created with proper gaps between the labels.
The fix is not yet complete, but covers approx. 95% percent of the labels.
My next fix will be for the remaining 5%. 
That is for labels where the H/V gap between labels is greater than the 
right/bottom
page margin. I hope to submit that soon...
Exuses for the inconvenience.

Winfried
From 52e8c195faa346ab99349bdf63a485c9a7130335 Mon Sep 17 00:00:00 2001
From: Winfried Donkers <o...@dci-electronics.nl>
Date: Thu, 16 Feb 2012 15:33:53 +0100
Subject: [PATCH] fix for patch that did not create gaps between labels in
 document

---
 sw/source/ui/app/applab.cxx |   26 ++------------------------
 1 files changed, 2 insertions(+), 24 deletions(-)

diff --git a/sw/source/ui/app/applab.cxx b/sw/source/ui/app/applab.cxx
index 3ccbf13..d8acd55 100644
--- a/sw/source/ui/app/applab.cxx
+++ b/sw/source/ui/app/applab.cxx
@@ -294,9 +294,6 @@ void SwModule::InsertLab(SfxRequest& rReq, sal_Bool bLabel)
 
             // Prepare border template
             SwFrmFmt* pFmt = pSh->GetFrmFmtFromPool( RES_POOLFRM_LABEL );
-            SwFrmFmt* pFmtEORow = pSh->GetFrmFmtFromPool( RES_POOLFRM_LABEL );  //new SwFrmFmt (*pFmt);
-            SwFrmFmt* pFmtEOCol = pSh->GetFrmFmtFromPool( RES_POOLFRM_LABEL );  //new SwFrmFmt (*pFmt);
-            SwFrmFmt* pFmtEOColEORow = pSh->GetFrmFmtFromPool( RES_POOLFRM_LABEL );  //new SwFrmFmt (*pFmt);
 
             sal_Int32 iResultWidth = rItem.lLeft + (rItem.nCols - 1) * rItem.lHDist + rItem.lWidth - rItem.lPWidth;
             sal_Int32 iResultHeight = rItem.lUpper + (rItem.nRows - 1) * rItem.lVDist + rItem.lHeight - rItem.lPHeight;
@@ -306,24 +303,13 @@ void SwModule::InsertLab(SfxRequest& rReq, sal_Bool bLabel)
 
             SvxULSpaceItem aFrmULSpace( 0, (sal_uInt16)(rItem.lVDist - rItem.lHeight),
                                         RES_UL_SPACE);
-            SvxULSpaceItem aFrmNoULSpace( 0, 0, RES_UL_SPACE);
 
             SvxLRSpaceItem aFrmLRSpace( 0, (sal_uInt16)(rItem.lHDist - rItem.lWidth),
                                         0, 0, RES_LR_SPACE);
-            SvxLRSpaceItem aFrmNoLRSpace( 0, 0, 0, 0, RES_LR_SPACE);
 
             pFmt->SetFmtAttr( aFrmSize );
             pFmt->SetFmtAttr(aFrmULSpace);
             pFmt->SetFmtAttr(aFrmLRSpace);
-            pFmtEORow->SetFmtAttr( aFrmSize );
-            pFmtEORow->SetFmtAttr(aFrmULSpace);
-            pFmtEORow->SetFmtAttr(aFrmNoLRSpace);
-            pFmtEOCol->SetFmtAttr( aFrmSize );
-            pFmtEOCol->SetFmtAttr(aFrmNoULSpace);
-            pFmtEOCol->SetFmtAttr(aFrmLRSpace);
-            pFmtEOColEORow->SetFmtAttr( aFrmSize );
-            pFmtEOColEORow->SetFmtAttr(aFrmNoULSpace);
-            pFmtEOColEORow->SetFmtAttr(aFrmNoLRSpace);
 
             const SwFrmFmt *pFirstFlyFmt = 0;
             if ( rItem.bPage )
@@ -331,26 +317,18 @@ void SwModule::InsertLab(SfxRequest& rReq, sal_Bool bLabel)
                 SwFmtVertOrient aFrmVertOrient( pFmt->GetVertOrient() );
                 aFrmVertOrient.SetVertOrient( text::VertOrientation::TOP );
                 pFmt->SetFmtAttr(aFrmVertOrient);
-                pFmtEORow->SetFmtAttr(aFrmVertOrient);
-                pFmtEOCol->SetFmtAttr(aFrmVertOrient);
-                pFmtEOColEORow->SetFmtAttr(aFrmVertOrient);
 
                 for ( sal_uInt16 i = 0; i < rItem.nRows; ++i )
                 {
                     for ( sal_uInt16 j = 0; j < rItem.nCols; ++j )
                     {
                         pSh->Push();
-                        SwFrmFmt* pFrmFmt;
-                        if ( j == rItem.nCols - 1 )
-                            pFrmFmt = ( i == rItem.nRows - 1 ? pFmtEOColEORow : pFmtEORow );
-                        else
-                            pFrmFmt = ( i == rItem.nRows - 1 ? pFmtEOCol : pFmt );
 
                         const SwFrmFmt *pTmp =
                                 bLabel ?
-                                lcl_InsertLabText( *pSh, rItem, *pFrmFmt, *pFldMgr, j, i,
+                                lcl_InsertLabText( *pSh, rItem, *pFmt, *pFldMgr, j, i,
                                     i == rItem.nRows - 1 && j == rItem.nCols - 1, sal_True ) :
-                                lcl_InsertBCText(*pSh, rItem, *pFrmFmt, j, i, sal_True);
+                                lcl_InsertBCText(*pSh, rItem, *pFmt, j, i, sal_True);
 
                         if (!(i|j))
                         {
-- 
1.7.7

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to