summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWinfried Donkers <osc@dci-electronics.nl>2012-02-17 18:02:55 +0100
committerMichael Meeks <michael.meeks@suse.com>2012-02-20 17:16:35 +0000
commita99083d233d0d5c5a09941ec2ee7164bc63c61db (patch)
tree527cbd2164e46580865051756f2180122d7ca975
parent3a6c12b32f9ca4ce060d1fed55a4bf3fbf5a4fbf (diff)
fdo#44516 final fix for labels with gaps larger than page margin
-rw-r--r--sw/source/ui/app/applab.cxx23
1 files changed, 9 insertions, 14 deletions
diff --git a/sw/source/ui/app/applab.cxx b/sw/source/ui/app/applab.cxx
index 3ccbf132f08f..4159f1835bda 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;