Attached the final fix for the problems that showed after my first patch for fdo44516.
Fix 2/3 that I submitted on februari 16 need not be pushed; changes in that fix are
overwritten by the final fix.
Winfried
From cec5b45badbc8755d091fbc3b7574cd60d7b504b Mon Sep 17 00:00:00 2001
From: Winfried Donkers <osc@dci-electronics.nl>
Date: Fri, 17 Feb 2012 18:02:55 +0100
Subject: [PATCH] fdo#44516 final fix for labels with gaps larger than page
margin
---
sw/source/ui/app/applab.cxx | 23 +++++++++--------------
1 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/sw/source/ui/app/applab.cxx b/sw/source/ui/app/applab.cxx
index 3ccbf13..4159f183 100644
--- a/sw/source/ui/app/applab.cxx
+++ b/sw/source/ui/app/applab.cxx
@@ -164,7 +164,6 @@ const SwFrmFmt *lcl_InsertLabText( SwWrtShell& rSh, const SwLabItem& rItem,
return pFmt;
}
-
void SwModule::InsertLab(SfxRequest& rReq, sal_Bool bLabel)
{
static sal_uInt16 nLabelTitleNo = 0;
@@ -294,34 +293,31 @@ 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;
sal_Int32 iWidth = (iResultWidth > 0 ? rItem.lWidth - (iResultWidth / rItem.nCols) - 1
: rItem.lWidth);
sal_Int32 iHeight = (iResultHeight > 0 ? rItem.lHeight - (iResultHeight / rItem.nRows)
- 1 : rItem.lHeight);
SwFmtFrmSize aFrmSize( ATT_FIX_SIZE, iWidth, iHeight );
+ pFmt->SetFmtAttr( aFrmSize );
+
+ SwFrmFmt* pFmtEORow = new SwFrmFmt (*pFmt);
+ SwFrmFmt* pFmtEOCol = new SwFrmFmt (*pFmt);
+ SwFrmFmt* pFmtEOColEORow = new SwFrmFmt (*pFmt);
SvxULSpaceItem aFrmULSpace( 0, (sal_uInt16)(rItem.lVDist - rItem.lHeight),
- RES_UL_SPACE);
- SvxULSpaceItem aFrmNoULSpace( 0, 0, RES_UL_SPACE);
+ 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);
+ 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);
@@ -351,7 +347,6 @@ void SwModule::InsertLab(SfxRequest& rReq, sal_Bool bLabel)
lcl_InsertLabText( *pSh, rItem, *pFrmFmt, *pFldMgr, j, i,
i == rItem.nRows - 1 && j == rItem.nCols - 1, sal_True ) :
lcl_InsertBCText(*pSh, rItem, *pFrmFmt, j, i, sal_True);
-
if (!(i|j))
{
pFirstFlyFmt = pTmp;
--
1.7.7
Context
- [PATCH]fdo44516 improved label and business card document creation (final) · Winfried Donkers
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.