diff options
author | Winfried Donkers <osc@dci-electronics.nl> | 2012-02-08 19:16:52 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2012-02-13 22:30:55 +0100 |
commit | 80a72c4cc7edc6b4c0b88d841500617cd733cbf7 (patch) | |
tree | 6436cc464578ddcb884b2bc7cc37973570af6463 /sw/source/ui | |
parent | 765c6d9916b1959ff92811e80bf0fc4870e7ab29 (diff) |
fdo#44516: Improved label/BC wizard - set paper size
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/app/applab.cxx | 86 | ||||
-rw-r--r-- | sw/source/ui/envelp/label1.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/envelp/labelcfg.cxx | 49 | ||||
-rw-r--r-- | sw/source/ui/envelp/labfmt.cxx | 67 | ||||
-rw-r--r-- | sw/source/ui/envelp/labfmt.hrc | 34 | ||||
-rw-r--r-- | sw/source/ui/envelp/labfmt.hxx | 9 | ||||
-rw-r--r-- | sw/source/ui/envelp/labfmt.src | 84 | ||||
-rw-r--r-- | sw/source/ui/envelp/labimg.cxx | 218 | ||||
-rw-r--r-- | sw/source/ui/envelp/labimp.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/inc/labimg.hxx | 2 |
10 files changed, 353 insertions, 202 deletions
diff --git a/sw/source/ui/app/applab.cxx b/sw/source/ui/app/applab.cxx index e913db72f742..3ccbf132f08f 100644 --- a/sw/source/ui/app/applab.cxx +++ b/sw/source/ui/app/applab.cxx @@ -250,8 +250,8 @@ void SwModule::InsertLab(SfxRequest& rReq, sal_Bool bLabel) SvxULSpaceItem aULMargin( RES_UL_SPACE ); aLRMargin.SetLeft ((sal_uInt16) rItem.lLeft ); aULMargin.SetUpper((sal_uInt16) rItem.lUpper); - aLRMargin.SetRight(MINLAY/2); - aULMargin.SetLower(MINLAY/2); + aLRMargin.SetRight( 0 ); + aULMargin.SetLower( 0 ); rFmt.SetFmtAttr(aLRMargin); rFmt.SetFmtAttr(aULMargin); @@ -264,15 +264,11 @@ void SwModule::InsertLab(SfxRequest& rReq, sal_Bool bLabel) aDesc.SetUseOn(nsUseOnPage::PD_ALL); // Site numbering - // fix (fdo36874) revised page size calculation // Set page size - 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); + long lPgWidth, lPgHeight; + lPgWidth = (rItem.lPWidth > MINLAY ? rItem.lPWidth : MINLAY); + lPgHeight = (rItem.lPHeight > MINLAY ? rItem.lPHeight : MINLAY); rFmt.SetFmtAttr( SwFmtFrmSize( ATT_FIX_SIZE, lPgWidth, lPgHeight )); - // Numbering type SvxNumberType aType; aType.SetNumberingType(SVX_NUM_NUMBER_NONE); @@ -287,10 +283,8 @@ void SwModule::InsertLab(SfxRequest& rReq, sal_Bool bLabel) aItem.SetValue((sal_Int8)pPrt->GetPaperBin()); rFmt.SetFmtAttr(aItem); - // Determine orientation by calculating the width and height of the resulting page - const int nResultWidth = rItem.lHDist * (rItem.nCols - 1) + rItem.lWidth + rItem.lLeft; - const int nResultHeight = rItem.lVDist * (rItem.nRows - 1) + rItem.lHeight + rItem.lUpper; - aDesc.SetLandscape(nResultWidth > nResultHeight); + // Determine orientation of the resulting page + aDesc.SetLandscape(rItem.lPWidth > rItem.lPHeight); pSh->ChgPageDesc( 0, aDesc ); @@ -298,37 +292,38 @@ void SwModule::InsertLab(SfxRequest& rReq, sal_Bool bLabel) SwFldMgr* pFldMgr = new SwFldMgr; pFldMgr->SetEvalExpFlds(sal_False); - //fix(24446): To avoid that labels end up in unprintable area, we set - //borders accordingly. To keep the handling as good as possible, we - //don't set any border as hard attribute at the current paragraph template - //(so that formating works, because of character-bound borders). Then - //we set the default paragraph template using the unprintable area. - const long nMin = pPrt->GetPageOffset().X() - rItem.lLeft; - if ( nMin > 0 ) - { - SvxLRSpaceItem aLR( RES_LR_SPACE ); - pSh->SetAttr( aLR ); - SwFmt *pStandard = pSh->GetTxtCollFromPool( RES_POOLCOLL_STANDARD ); - aLR.SetLeft ( sal_uInt16(nMin) ); - aLR.SetRight( sal_uInt16(nMin) ); - pStandard->SetFmtAttr( aLR ); - } - // Prepare border template SwFrmFmt* pFmt = pSh->GetFrmFmtFromPool( RES_POOLFRM_LABEL ); - SwFmtFrmSize aFrmSize( ATT_FIX_SIZE, - rItem.lHDist - (rItem.lHDist-rItem.lWidth), - rItem.lVDist - (rItem.lVDist-rItem.lHeight)); - pFmt->SetFmtAttr(aFrmSize); + 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); - SvxLRSpaceItem aFrmLRSpace( 0, (sal_uInt16)(rItem.lHDist - rItem.lWidth), - 0, 0, - RES_LR_SPACE); - pFmt->SetFmtAttr(aFrmLRSpace); + 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 ); 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 ) @@ -336,18 +331,27 @@ 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, *pFmt, *pFldMgr, j, i, - i == rItem.nRows - 1 && j == rItem.nCols - 1, - sal_True ) : - lcl_InsertBCText(*pSh, rItem, *pFmt, j, i, sal_True); + 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; diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx index e4c3210b9898..0867c37a9d09 100644 --- a/sw/source/ui/envelp/label1.cxx +++ b/sw/source/ui/envelp/label1.cxx @@ -64,6 +64,8 @@ void SwLabRec::SetFromItem( const SwLabItem& rItem ) lUpper = rItem.lUpper; nCols = rItem.nCols; nRows = rItem.nRows; + lPWidth = rItem.lPWidth; + lPHeight = rItem.lPHeight; bCont = rItem.bCont; } @@ -76,6 +78,8 @@ void SwLabRec::FillItem( SwLabItem& rItem ) const rItem.lLeft = lLeft; rItem.lUpper = lUpper; rItem.nCols = nCols; + rItem.lPWidth = lPWidth; + rItem.lPHeight = lPHeight; rItem.nRows = nRows; } diff --git a/sw/source/ui/envelp/labelcfg.cxx b/sw/source/ui/envelp/labelcfg.cxx index b6748953a6de..04a8695e0782 100644 --- a/sw/source/ui/envelp/labelcfg.cxx +++ b/sw/source/ui/envelp/labelcfg.cxx @@ -77,6 +77,8 @@ SwLabRec* lcl_CreateSwLabRec(Sequence<Any>& rValues, const OUString& rManufactur const Any* pValues = rValues.getConstArray(); OUString sTmp; pNewRec->aMake = rManufacturer; + pNewRec->lPWidth = 0; + pNewRec->lPHeight = 0; for(sal_Int32 nProp = 0; nProp < rValues.getLength(); nProp++) { if(pValues[nProp].hasValue()) @@ -97,15 +99,17 @@ SwLabRec* lcl_CreateSwLabRec(Sequence<Any>& rValues, const OUString& rManufactur int nVal = sToken.ToInt32(); switch(i) { - case 0 : pNewRec->bCont = sToken.GetChar(0) == 'C'; break; - case 1 : pNewRec->lHDist = MM100_TO_TWIP(nVal);break; - case 2 : pNewRec->lVDist = MM100_TO_TWIP(nVal);break; - case 3 : pNewRec->lWidth = MM100_TO_TWIP(nVal);break; - case 4 : pNewRec->lHeight = MM100_TO_TWIP(nVal); break; - case 5 : pNewRec->lLeft = MM100_TO_TWIP(nVal);break; - case 6 : pNewRec->lUpper = MM100_TO_TWIP(nVal);break; - case 7 : pNewRec->nCols = nVal; break; - case 8 : pNewRec->nRows = nVal; break; + case 0 : pNewRec->bCont = sToken.GetChar(0) == 'C'; break; + case 1 : pNewRec->lHDist = MM100_TO_TWIP(nVal); break; + case 2 : pNewRec->lVDist = MM100_TO_TWIP(nVal); break; + case 3 : pNewRec->lWidth = MM100_TO_TWIP(nVal); break; + case 4 : pNewRec->lHeight = MM100_TO_TWIP(nVal); break; + case 5 : pNewRec->lLeft = MM100_TO_TWIP(nVal); break; + case 6 : pNewRec->lUpper = MM100_TO_TWIP(nVal); break; + case 7 : pNewRec->nCols = nVal; break; + case 8 : pNewRec->nRows = nVal; break; + case 9 : pNewRec->lPWidth = MM100_TO_TWIP(nVal); break; + case 10 : pNewRec->lPHeight = MM100_TO_TWIP(nVal); break; } } } @@ -113,6 +117,13 @@ SwLabRec* lcl_CreateSwLabRec(Sequence<Any>& rValues, const OUString& rManufactur } } } + // lines added for compatibility with custom label defintions saved before patch 44516 + if (pNewRec->lPWidth == 0 || pNewRec->lPHeight == 0) + { + // old style definition (no paper dimensions), calculate probable values + pNewRec->lPWidth = 2 * pNewRec->lLeft + (pNewRec->nCols - 1) * pNewRec->lHDist + pNewRec->lWidth; + pNewRec->lPHeight = ( pNewRec->bCont ? pNewRec->nRows * pNewRec->lVDist : 2 * pNewRec->lUpper + (pNewRec->nRows - 1) * pNewRec->lVDist + pNewRec->lHeight ); + } return pNewRec; } @@ -133,15 +144,17 @@ Sequence<PropertyValue> lcl_CreateProperties( case 1: { OUString sTmp; - sTmp += C2U( rRec.bCont ? "C" : "S"); sTmp += sColon; - sTmp += OUString::valueOf(TWIP_TO_MM100(rRec.lHDist) ); sTmp += sColon; - sTmp += OUString::valueOf(TWIP_TO_MM100(rRec.lVDist)); sTmp += sColon; - sTmp += OUString::valueOf(TWIP_TO_MM100(rRec.lWidth) ); sTmp += sColon; - sTmp += OUString::valueOf(TWIP_TO_MM100(rRec.lHeight) ); sTmp += sColon; - sTmp += OUString::valueOf(TWIP_TO_MM100(rRec.lLeft) ); sTmp += sColon; - sTmp += OUString::valueOf(TWIP_TO_MM100(rRec.lUpper) ); sTmp += sColon; - sTmp += OUString::valueOf(rRec.nCols );sTmp += sColon; - sTmp += OUString::valueOf(rRec.nRows ); + sTmp += C2U( rRec.bCont ? "C" : "S"); sTmp += sColon; + sTmp += OUString::valueOf(TWIP_TO_MM100(rRec.lHDist) ); sTmp += sColon; + sTmp += OUString::valueOf(TWIP_TO_MM100(rRec.lVDist)); sTmp += sColon; + sTmp += OUString::valueOf(TWIP_TO_MM100(rRec.lWidth) ); sTmp += sColon; + sTmp += OUString::valueOf(TWIP_TO_MM100(rRec.lHeight) ); sTmp += sColon; + sTmp += OUString::valueOf(TWIP_TO_MM100(rRec.lLeft) ); sTmp += sColon; + sTmp += OUString::valueOf(TWIP_TO_MM100(rRec.lUpper) ); sTmp += sColon; + sTmp += OUString::valueOf(rRec.nCols ); sTmp += sColon; + sTmp += OUString::valueOf(rRec.nRows ); sTmp += sColon; + sTmp += OUString::valueOf(TWIP_TO_MM100(rRec.lPWidth) ); sTmp += sColon; + sTmp += OUString::valueOf(TWIP_TO_MM100(rRec.lPHeight) ); pValues[nProp].Value <<= sTmp; } break; diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx index 2aa1e3b505ca..6ec2a79484bc 100644 --- a/sw/source/ui/envelp/labfmt.cxx +++ b/sw/source/ui/envelp/labfmt.cxx @@ -67,7 +67,9 @@ SwLabPreview::SwLabPreview( const SwLabFmtPage* pParent, const ResId& rResID ) : aLeftStr (SW_RES(STR_LEFT )), aUpperStr (SW_RES(STR_UPPER )), aColsStr (SW_RES(STR_COLS )), - aRowsStr (SW_RES(STR_ROWS )) + aRowsStr (SW_RES(STR_ROWS )), + aPWidthStr (SW_RES(STR_PWIDTH )), + aPHeightStr(SW_RES(STR_PHEIGHT)) { SetMapMode(MAP_PIXEL); @@ -92,7 +94,8 @@ SwLabPreview::SwLabPreview( const SwLabFmtPage* pParent, const ResId& rResID ) : lLeftWidth = GetTextWidth(aLeftStr ); lUpperWidth = GetTextWidth(aUpperStr ); lColsWidth = GetTextWidth(aColsStr ); - + lPWidthWidth = GetTextWidth(aPWidthStr); + lPHeightWidth = GetTextWidth(aPHeightStr); lXHeight = GetTextHeight(); lXWidth = GetTextWidth('X'); @@ -170,7 +173,7 @@ void SwLabPreview::Paint(const Rectangle &) // Labels SetClipRegion (Rectangle(Point(lX0, lY0), Size(lOutlineW, lOutlineH))); - SetFillColor(rWinColor); + SetFillColor( Color( 0xE0, 0xE0, 0xFF ) ); for (sal_uInt16 nRow = 0; nRow < Min((sal_uInt16) 2, (sal_uInt16) aItem.nRows); nRow++) for (sal_uInt16 nCol = 0; nCol < Min((sal_uInt16) 2, (sal_uInt16) aItem.nCols); nCol++) DrawRect(Rectangle( @@ -321,6 +324,10 @@ SwLabFmtPage::SwLabFmtPage(Window* pParent, const SfxItemSet& rSet) : aColsField (this, SW_RES(FLD_COLUMNS)), aRowsText (this, SW_RES(TXT_ROWS )), aRowsField (this, SW_RES(FLD_ROWS )), + aPWidthText (this, SW_RES(TXT_PWIDTH )), + aPWidthField (this, SW_RES(FLD_PWIDTH )), + aPHeightText (this, SW_RES(TXT_PHEIGHT )), + aPHeightField (this, SW_RES(FLD_PHEIGHT )), aSavePB (this, SW_RES(PB_SAVE )), bModified(sal_False), aItem ((const SwLabItem&) rSet.Get(FN_LABEL)) @@ -336,6 +343,8 @@ SwLabFmtPage::SwLabFmtPage(Window* pParent, const SfxItemSet& rSet) : SetMetric(aHeightField, aMetric); SetMetric(aLeftField , aMetric); SetMetric(aUpperField , aMetric); + SetMetric(aPWidthField , aMetric); + SetMetric(aPHeightField, aMetric); // Install handlers Link aLk = LINK(this, SwLabFmtPage, ModifyHdl); @@ -347,6 +356,8 @@ SwLabFmtPage::SwLabFmtPage(Window* pParent, const SfxItemSet& rSet) : aUpperField .SetModifyHdl( aLk ); aColsField .SetModifyHdl( aLk ); aRowsField .SetModifyHdl( aLk ); + aPWidthField .SetModifyHdl( aLk ); + aPHeightField.SetModifyHdl( aLk ); aLk = LINK(this, SwLabFmtPage, LoseFocusHdl); aHDistField .SetLoseFocusHdl( aLk ); @@ -357,6 +368,8 @@ SwLabFmtPage::SwLabFmtPage(Window* pParent, const SfxItemSet& rSet) : aUpperField .SetLoseFocusHdl( aLk ); aColsField .SetLoseFocusHdl( aLk ); aRowsField .SetLoseFocusHdl( aLk ); + aPWidthField .SetLoseFocusHdl( aLk ); + aPHeightField.SetLoseFocusHdl( aLk ); aSavePB.SetClickHdl( LINK (this, SwLabFmtPage, SaveHdl)); // Set timer @@ -401,21 +414,26 @@ IMPL_LINK_INLINE_END( SwLabFmtPage, LoseFocusHdl, Control *, pControl ) void SwLabFmtPage::ChangeMinMax() { long lMax = 31748; // 56 cm + long nMinSize = 10; // 0,1cm // Min and Max - long lLeft = static_cast< long >(GETFLDVAL(aLeftField )), - lUpper = static_cast< long >(GETFLDVAL(aUpperField)), - lHDist = static_cast< long >(GETFLDVAL(aHDistField)), - lVDist = static_cast< long >(GETFLDVAL(aVDistField)); - - long nMinSize = 10; // 0,1cm + int nCols = aColsField.GetValue(), + nRows = aRowsField.GetValue(); + long lLeft = static_cast< long >(GETFLDVAL(aLeftField )), + lUpper = static_cast< long >(GETFLDVAL(aUpperField)), + lHDist = static_cast< long >(GETFLDVAL(aHDistField)), + lVDist = static_cast< long >(GETFLDVAL(aVDistField)), + lWidth = static_cast< long >(GETFLDVAL(aWidthField)), + lHeight = static_cast< long >(GETFLDVAL(aHeightField)), + lMinPWidth = lLeft + (nCols - 1) * lHDist + lWidth, + lMinPHeight = lUpper + (nRows - 1) * lVDist + lHeight; aHDistField .SetMin(nMinSize, FUNIT_CM); aVDistField .SetMin(nMinSize, FUNIT_CM); - aHDistField .SetMax((long) 100 * ((lMax - lLeft ) / Max(1L, (long) aColsField.GetValue())), FUNIT_TWIP); - aVDistField .SetMax((long) 100 * ((lMax - lUpper) / Max(1L, (long) aRowsField.GetValue())), FUNIT_TWIP); + aHDistField .SetMax((long) 100 * ((lMax - lLeft ) / Max(1L, (long) nCols)), FUNIT_TWIP); + aVDistField .SetMax((long) 100 * ((lMax - lUpper) / Max(1L, (long) nRows)), FUNIT_TWIP); aWidthField .SetMin(nMinSize, FUNIT_CM); aHeightField.SetMin(nMinSize, FUNIT_CM); @@ -423,12 +441,19 @@ void SwLabFmtPage::ChangeMinMax() aWidthField .SetMax((long) 100 * (lHDist), FUNIT_TWIP); aHeightField.SetMax((long) 100 * (lVDist), FUNIT_TWIP); - aLeftField .SetMax((long) 100 * (lMax - (long) aColsField.GetValue() * GETFLDVAL(aHDistField)), FUNIT_TWIP); - aUpperField .SetMax((long) 100 * (lMax - (long) aRowsField.GetValue() * GETFLDVAL(aVDistField)), FUNIT_TWIP); + aLeftField .SetMax((long) 100 * (lMax - nCols * lHDist), FUNIT_TWIP); + aUpperField .SetMax((long) 100 * (lMax - nRows * lVDist), FUNIT_TWIP); + + aColsField .SetMin( 1 ); + aRowsField .SetMin( 1 ); aColsField .SetMax((lMax - lLeft ) / Max(1L, lHDist)); aRowsField .SetMax((lMax - lUpper) / Max(1L, lVDist)); + aPWidthField .SetMin( (long) 100 * lMinPWidth, FUNIT_TWIP ); + aPHeightField.SetMin( (long) 100 * lMinPHeight, FUNIT_TWIP ); + aPWidthField .SetMax( (long) 100 * lMax, FUNIT_TWIP); + aPHeightField.SetMax( (long) 100 * lMax, FUNIT_TWIP); // First and Last aHDistField .SetFirst(aHDistField .GetMin()); @@ -448,7 +473,11 @@ void SwLabFmtPage::ChangeMinMax() aColsField .SetLast (aColsField .GetMax()); aRowsField .SetLast (aRowsField .GetMax()); + aPWidthField .SetFirst(aPWidthField .GetMin()); + aPHeightField.SetFirst(aPHeightField.GetMin()); + aPWidthField .SetLast (aPWidthField .GetMax()); + aPHeightField.SetLast (aPHeightField.GetMax()); aHDistField .Reformat(); aVDistField .Reformat(); aWidthField .Reformat(); @@ -457,6 +486,8 @@ void SwLabFmtPage::ChangeMinMax() aUpperField .Reformat(); aColsField .Reformat(); aRowsField .Reformat(); + aPWidthField .Reformat(); + aPHeightField.Reformat(); } SfxTabPage* SwLabFmtPage::Create(Window* pParent, const SfxItemSet& rSet) @@ -493,6 +524,8 @@ void SwLabFmtPage::FillItem(SwLabItem& rItem) rItem.lUpper = rRec.lUpper = static_cast< long >(GETFLDVAL(aUpperField )); rItem.nCols = rRec.nCols = (sal_uInt16) aColsField.GetValue(); rItem.nRows = rRec.nRows = (sal_uInt16) aRowsField.GetValue(); + rItem.lPWidth = rRec.lPWidth = static_cast< long >(GETFLDVAL(aPWidthField )); + rItem.lPHeight = rRec.lPHeight = static_cast< long >(GETFLDVAL(aPHeightField)); } } @@ -515,6 +548,8 @@ void SwLabFmtPage::Reset(const SfxItemSet& ) aHeightField.SetMax(100 * aItem.lHeight, FUNIT_TWIP); aLeftField .SetMax(100 * aItem.lLeft , FUNIT_TWIP); aUpperField .SetMax(100 * aItem.lUpper , FUNIT_TWIP); + aPWidthField .SetMax(100 * aItem.lPWidth , FUNIT_TWIP); + aPHeightField.SetMax(100 * aItem.lPHeight, FUNIT_TWIP); SETFLDVAL(aHDistField , aItem.lHDist ); SETFLDVAL(aVDistField , aItem.lVDist ); @@ -522,6 +557,8 @@ void SwLabFmtPage::Reset(const SfxItemSet& ) SETFLDVAL(aHeightField, aItem.lHeight); SETFLDVAL(aLeftField , aItem.lLeft ); SETFLDVAL(aUpperField , aItem.lUpper ); + SETFLDVAL(aPWidthField , aItem.lPWidth ); + SETFLDVAL(aPHeightField, aItem.lPHeight); aColsField.SetMax(aItem.nCols); aRowsField.SetMax(aItem.nRows); @@ -544,6 +581,8 @@ IMPL_LINK( SwLabFmtPage, SaveHdl, PushButton *, EMPTYARG ) aRec.lUpper = static_cast< long >(GETFLDVAL(aUpperField )); aRec.nCols = (sal_uInt16) aColsField.GetValue(); aRec.nRows = (sal_uInt16) aRowsField.GetValue(); + aRec.lPWidth = static_cast< long >(GETFLDVAL(aPWidthField )); + aRec.lPHeight = static_cast< long >(GETFLDVAL(aPHeightField)); aRec.bCont = aItem.bCont; SwSaveLabelDlg* pSaveDlg = new SwSaveLabelDlg(this, aRec); pSaveDlg->SetLabel(aItem.aLstMake, aItem.aLstType); @@ -644,6 +683,8 @@ sal_Bool SwSaveLabelDlg::GetLabel(SwLabItem& rItem) rItem.lUpper = rLabRec.lUpper; rItem.nCols = rLabRec.nCols; rItem.nRows = rLabRec.nRows; + rItem.lPWidth = rLabRec.lPWidth; + rItem.lPHeight = rLabRec.lPHeight; } return bSuccess; } diff --git a/sw/source/ui/envelp/labfmt.hrc b/sw/source/ui/envelp/labfmt.hrc index 6033e7e96f7e..70cc5824b5f1 100644 --- a/sw/source/ui/envelp/labfmt.hrc +++ b/sw/source/ui/envelp/labfmt.hrc @@ -49,12 +49,16 @@ #define FLD_COLUMNS 15 #define TXT_ROWS 16 #define FLD_ROWS 17 -#define FL_NONAME 18 -#define PB_SAVE 19 -#define FI_MAKE 20 -#define FI_TYPE 21 +#define TXT_PWIDTH 18 +#define FLD_PWIDTH 19 +#define TXT_PHEIGHT 20 +#define FLD_PHEIGHT 21 +#define FL_NONAME 22 +#define PB_SAVE 23 +#define FI_MAKE 24 +#define FI_TYPE 25 -#define FL_OPTIONS 1 +#define FL_OPTIONS 1 #define FT_MAKE 2 #define CB_MAKE 3 #define FT_TYPE 4 @@ -66,18 +70,20 @@ // global resources ******************************************************** -#define STR_HDIST (RC_LABFMT_BEGIN + 1) -#define STR_VDIST (RC_LABFMT_BEGIN + 2) -#define STR_WIDTH (RC_LABFMT_BEGIN + 3) -#define STR_HEIGHT (RC_LABFMT_BEGIN + 4) -#define STR_LEFT (RC_LABFMT_BEGIN + 5) -#define STR_UPPER (RC_LABFMT_BEGIN + 6) -#define STR_COLS (RC_LABFMT_BEGIN + 7) -#define STR_ROWS (RC_LABFMT_BEGIN + 8) +#define STR_HDIST (RC_LABFMT_BEGIN + 1) +#define STR_VDIST (RC_LABFMT_BEGIN + 2) +#define STR_WIDTH (RC_LABFMT_BEGIN + 3) +#define STR_HEIGHT (RC_LABFMT_BEGIN + 4) +#define STR_LEFT (RC_LABFMT_BEGIN + 5) +#define STR_UPPER (RC_LABFMT_BEGIN + 6) +#define STR_COLS (RC_LABFMT_BEGIN + 7) +#define STR_ROWS (RC_LABFMT_BEGIN + 8) +#define STR_PWIDTH (RC_LABFMT_BEGIN + 9) +#define STR_PHEIGHT (RC_LABFMT_BEGIN + 10) // overflow check ******************************************************** -#define LABFMT_ACT_END STR_ROWS +#define LABFMT_ACT_END STR_PHEIGHT #if LABFMT_ACT_END > RC_LABFMT_END #error Resource-Ueberlauf in #file, #line diff --git a/sw/source/ui/envelp/labfmt.hxx b/sw/source/ui/envelp/labfmt.hxx index 6019081157d1..547d83753a54 100644 --- a/sw/source/ui/envelp/labfmt.hxx +++ b/sw/source/ui/envelp/labfmt.hxx @@ -52,6 +52,8 @@ class SwLabPreview : public Window String aUpperStr; String aColsStr; String aRowsStr; + String aPWidthStr; + String aPHeightStr; long lHDistWidth; long lVDistWidth; @@ -59,6 +61,9 @@ class SwLabPreview : public Window long lLeftWidth; long lUpperWidth; long lColsWidth; + long PRowsWidth; + long lPWidthWidth; + long lPHeightWidth; long lXWidth; long lXHeight; @@ -105,6 +110,10 @@ class SwLabFmtPage : public SfxTabPage NumericField aColsField; FixedText aRowsText; NumericField aRowsField; + FixedText aPWidthText; + MetricField aPWidthField; + FixedText aPHeightText; + MetricField aPHeightField; PushButton aSavePB; Timer aPreviewTimer; diff --git a/sw/source/ui/envelp/labfmt.src b/sw/source/ui/envelp/labfmt.src index a7cbab1900c4..ba2578ea7f98 100644 --- a/sw/source/ui/envelp/labfmt.src +++ b/sw/source/ui/envelp/labfmt.src @@ -51,7 +51,7 @@ TabPage TP_LAB_FMT }; FixedText TXT_HDIST { - Pos = MAP_APPFONT ( 6 , 19 ) ; + Pos = MAP_APPFONT ( 6 , 6 ) ; Size = MAP_APPFONT ( 50 , 8 ) ; Text [ en-US ] = "Hori~zontal pitch" ; Group = TRUE ; @@ -61,7 +61,7 @@ TabPage TP_LAB_FMT { HelpID = "sw:MetricField:TP_LAB_FMT:FLD_HDIST"; Border = TRUE ; - Pos = MAP_APPFONT ( 60 , 17 ) ; + Pos = MAP_APPFONT ( 60 , 4 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; TabStop = TRUE ; Left = TRUE ; @@ -73,7 +73,7 @@ TabPage TP_LAB_FMT }; FixedText TXT_VDIST { - Pos = MAP_APPFONT ( 6 , 35 ) ; + Pos = MAP_APPFONT ( 6 , 22 ) ; Size = MAP_APPFONT ( 50 , 8 ) ; Text [ en-US ] = "~Vertical pitch" ; Left = TRUE ; @@ -82,7 +82,7 @@ TabPage TP_LAB_FMT { HelpID = "sw:MetricField:TP_LAB_FMT:FLD_VDIST"; Border = TRUE ; - Pos = MAP_APPFONT ( 60 , 33 ) ; + Pos = MAP_APPFONT ( 60 , 20 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; TabStop = TRUE ; Left = TRUE ; @@ -94,7 +94,7 @@ TabPage TP_LAB_FMT }; FixedText TXT_WIDTH { - Pos = MAP_APPFONT ( 6 , 51 ) ; + Pos = MAP_APPFONT ( 6 , 38 ) ; Size = MAP_APPFONT ( 50 , 8 ) ; Text [ en-US ] = "~Width" ; Left = TRUE ; @@ -103,7 +103,7 @@ TabPage TP_LAB_FMT { HelpID = "sw:MetricField:TP_LAB_FMT:FLD_WIDTH"; Border = TRUE ; - Pos = MAP_APPFONT ( 60 , 49 ) ; + Pos = MAP_APPFONT ( 60 , 36 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; TabStop = TRUE ; Left = TRUE ; @@ -115,7 +115,7 @@ TabPage TP_LAB_FMT }; FixedText TXT_HEIGHT { - Pos = MAP_APPFONT ( 6 , 67 ) ; + Pos = MAP_APPFONT ( 6 , 54 ) ; Size = MAP_APPFONT ( 50 , 8 ) ; Text [ en-US ] = "~Height" ; Left = TRUE ; @@ -124,7 +124,7 @@ TabPage TP_LAB_FMT { HelpID = "sw:MetricField:TP_LAB_FMT:FLD_HEIGHT"; Border = TRUE ; - Pos = MAP_APPFONT ( 60 , 65 ) ; + Pos = MAP_APPFONT ( 60 , 52 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; TabStop = TRUE ; Left = TRUE ; @@ -136,7 +136,7 @@ TabPage TP_LAB_FMT }; FixedText TXT_LEFT { - Pos = MAP_APPFONT ( 6 , 83 ) ; + Pos = MAP_APPFONT ( 6 , 70 ) ; Size = MAP_APPFONT ( 50 , 8 ) ; Text [ en-US ] = "~Left margin" ; Left = TRUE ; @@ -145,7 +145,7 @@ TabPage TP_LAB_FMT { HelpID = "sw:MetricField:TP_LAB_FMT:FLD_LEFT"; Border = TRUE ; - Pos = MAP_APPFONT ( 60 , 81 ) ; + Pos = MAP_APPFONT ( 60 , 68 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; TabStop = TRUE ; Left = TRUE ; @@ -159,7 +159,7 @@ TabPage TP_LAB_FMT }; FixedText TXT_UPPER { - Pos = MAP_APPFONT ( 6 , 99 ) ; + Pos = MAP_APPFONT ( 6 , 86 ) ; Size = MAP_APPFONT ( 50 , 8 ) ; Text [ en-US ] = "~Top margin" ; Left = TRUE ; @@ -168,7 +168,7 @@ TabPage TP_LAB_FMT { HelpID = "sw:MetricField:TP_LAB_FMT:FLD_UPPER"; Border = TRUE ; - Pos = MAP_APPFONT ( 60 , 97 ) ; + Pos = MAP_APPFONT ( 60 , 84 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; TabStop = TRUE ; Left = TRUE ; @@ -182,7 +182,7 @@ TabPage TP_LAB_FMT }; FixedText TXT_COLUMNS { - Pos = MAP_APPFONT ( 6 , 115 ) ; + Pos = MAP_APPFONT ( 6 , 102 ) ; Size = MAP_APPFONT ( 50 , 8 ) ; Text [ en-US ] = "~Columns" ; Left = TRUE ; @@ -191,7 +191,7 @@ TabPage TP_LAB_FMT { HelpID = "sw:NumericField:TP_LAB_FMT:FLD_COLUMNS"; Border = TRUE ; - Pos = MAP_APPFONT ( 60 , 113 ) ; + Pos = MAP_APPFONT ( 60 , 100 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; TabStop = TRUE ; Left = TRUE ; @@ -202,7 +202,7 @@ TabPage TP_LAB_FMT }; FixedText TXT_ROWS { - Pos = MAP_APPFONT ( 6 , 131 ) ; + Pos = MAP_APPFONT ( 6 , 118 ) ; Size = MAP_APPFONT ( 50 , 8 ) ; Text [ en-US ] = "R~ows" ; Left = TRUE ; @@ -211,7 +211,7 @@ TabPage TP_LAB_FMT { HelpID = "sw:NumericField:TP_LAB_FMT:FLD_ROWS"; Border = TRUE ; - Pos = MAP_APPFONT ( 60 , 129 ) ; + Pos = MAP_APPFONT ( 60 , 116 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; TabStop = TRUE ; Left = TRUE ; @@ -220,10 +220,52 @@ TabPage TP_LAB_FMT Minimum = 1 ; First = 1 ; }; + FixedText TXT_PWIDTH + { + Pos = MAP_APPFONT ( 6 , 134 ) ; + Size = MAP_APPFONT ( 50 , 8 ) ; + Text [ en-US ] = "P~age Width" ; + Left = TRUE ; + }; + MetricField FLD_PWIDTH + { + HelpID = "sw:MetricField:TP_LAB_FMT:FLD_PWIDTH"; + Border = TRUE ; + Pos = MAP_APPFONT ( 60 , 132 ) ; + Size = MAP_APPFONT ( 40 , 12 ) ; + TabStop = TRUE ; + Left = TRUE ; + Spin = TRUE ; + DecimalDigits = 2 ; + Unit = FUNIT_CM ; + Repeat = TRUE ; + SpinSize = 10 ; + }; + FixedText TXT_PHEIGHT + { + Pos = MAP_APPFONT ( 6 , 150 ) ; + Size = MAP_APPFONT ( 50 , 8 ) ; + Text [ en-US ] = "Pa~ge Height" ; + Left = TRUE ; + }; + MetricField FLD_PHEIGHT + { + HelpID = "sw:MetricField:TP_LAB_FMT:FLD_PHEIGHT"; + Border = TRUE ; + Pos = MAP_APPFONT ( 60 , 148 ) ; + Size = MAP_APPFONT ( 40 , 12 ) ; + TabStop = TRUE ; + Left = TRUE ; + Spin = TRUE ; + DecimalDigits = 2 ; + Unit = FUNIT_CM ; + Repeat = TRUE ; + SpinSize = 10 ; + }; PushButton PB_SAVE { HelpID = "sw:PushButton:TP_LAB_FMT:PB_SAVE"; - Pos = MAP_APPFONT ( 50 , 148 ) ; + Pos = MAP_APPFONT ( 50 , 167 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Save..."; }; @@ -261,6 +303,14 @@ String STR_ROWS { Text [ en-US ] = "Rows" ; }; +String STR_PWIDTH +{ + Text [ en-US ] = "Page Width" ; +}; +String STR_PHEIGHT +{ + Text [ en-US ] = "Page Height" ; +}; ModalDialog DLG_SAVE_LABEL { HelpID = HID_SAVE_LABEL_DLG ; diff --git a/sw/source/ui/envelp/labimg.cxx b/sw/source/ui/envelp/labimg.cxx index 64d6f8c6adb4..e6c1d65bdf91 100644 --- a/sw/source/ui/envelp/labimg.cxx +++ b/sw/source/ui/envelp/labimg.cxx @@ -55,12 +55,16 @@ SwLabItem::SwLabItem() : nCol (1), nRow (1) { - bAddr = bCont = bSynchron = sal_False; - bPage = sal_True; - lHDist = - lVDist = - lWidth = - lHeight = 5669; // 10 cm + bAddr = + bCont = + bSynchron = sal_False; + bPage = sal_True; + lHDist = + lVDist = + lWidth = + lHeight = + lPWidth = + lPHeight = 5669; // 10 cm } SwLabItem::SwLabItem(const SwLabItem& rItem) : @@ -92,6 +96,8 @@ SwLabItem& SwLabItem::operator =(const SwLabItem& rItem) lUpper = rItem.lUpper; nCols = rItem.nCols; nRows = rItem.nRows; + lPWidth = rItem.lPWidth; + lPHeight = rItem.lPHeight; aPrivFirstName = rItem.aPrivFirstName; aPrivName = rItem.aPrivName; aPrivShortCut = rItem.aPrivShortCut; @@ -148,6 +154,8 @@ int SwLabItem::operator ==(const SfxPoolItem& rItem) const lUpper == rLab.lUpper && nCols == rLab.nCols && nRows == rLab.nRows && + lPWidth == rLab.lPWidth && + lPHeight == rLab.lPHeight&& aWriting == rLab.aWriting&& aMake == rLab.aMake && aType == rLab.aType && @@ -210,13 +218,15 @@ Sequence<rtl::OUString> SwLabCfgItem::GetPropertyNames() "Format/Height", // 8 "Format/LeftMargin", // 9 "Format/TopMargin", //10 - "Option/Synchronize", //11 - "Option/Page", //12 - "Option/Column", //13 - "Option/Row", //14 - "Inscription/UseAddress", //15 - "Inscription/Address", //16 - "Inscription/Database" //17 + "Format/PageWidth", //11 + "Format/PageHeight", //12 + "Option/Synchronize", //13 + "Option/Page", //14 + "Option/Column", //15 + "Option/Row", //16 + "Inscription/UseAddress", //17 + "Inscription/Address", //18 + "Inscription/Database" //19 }; static const char* aBusinessPropNames[] = { @@ -256,7 +266,7 @@ Sequence<rtl::OUString> SwLabCfgItem::GetPropertyNames() "AutoText/Block" // 33 }; const int nBusinessCount = bIsLabel ? 0 : 34; - const int nLabelCount = bIsLabel ? 18 : 15; + const int nLabelCount = bIsLabel ? 20 : 17; Sequence<OUString> aNames(nBusinessCount + nLabelCount); OUString* pNames = aNames.getArray(); int nIndex = 0; @@ -285,9 +295,9 @@ SwLabCfgItem::SwLabCfgItem(sal_Bool bLabel) : if(pValues[nProp].hasValue()) { //to have a contiuous switch an offset is added - if(nProp == 15 && !bIsLabel) + if(nProp == 17 && !bIsLabel) nProperty += 3; - if(nProperty >= 18) + if(nProperty >= 20) bNoConfigValues = sal_False; switch(nProperty) { @@ -320,47 +330,55 @@ SwLabCfgItem::SwLabCfgItem(sal_Bool bLabel) : pValues[nProp] >>= aItem.lUpper; aItem.lUpper = MM100_TO_TWIP(aItem.lUpper); break;// "Format/TopMargin", - case 11: aItem.bSynchron = *(sal_Bool*)pValues[nProp].getValue(); break;// "Option/Synchronize", - case 12: aItem.bPage = *(sal_Bool*)pValues[nProp].getValue(); break;// "Option/Page", - case 13: pValues[nProp] >>= aItem.nCol; break;// "Option/Column", - case 14: pValues[nProp] >>= aItem.nRow; break;// "Option/Row" - case 15: aItem.bAddr = *(sal_Bool*)pValues[nProp].getValue(); break;// "Inscription/UseAddress", - case 16: pValues[nProp] >>= aItem.aWriting; break;// "Inscription/Address", - case 17: pValues[nProp] >>= aItem.sDBName; break;// "Inscription/Database" - case 18: pValues[nProp] >>= aItem.aPrivFirstName; break;// "PrivateAddress/FirstName", - case 19: pValues[nProp] >>= aItem.aPrivName; break;// "PrivateAddress/Name", - case 20: pValues[nProp] >>= aItem.aPrivShortCut; break;// "PrivateAddress/ShortCut", - case 21: pValues[nProp] >>= aItem.aPrivFirstName2; break;// "PrivateAddress/SecondFirstName", - case 22: pValues[nProp] >>= aItem.aPrivName2; break;// "PrivateAddress/SecondName", - case 23: pValues[nProp] >>= aItem.aPrivShortCut2; break;// "PrivateAddress/SecondShortCut", - case 24: pValues[nProp] >>= aItem.aPrivStreet; break;// "PrivateAddress/Street", - case 25: pValues[nProp] >>= aItem.aPrivZip; break;// "PrivateAddress/Zip", - case 26: pValues[nProp] >>= aItem.aPrivCity; break;// "PrivateAddress/City", - case 27: pValues[nProp] >>= aItem.aPrivCountry; break;// "PrivateAddress/Country", - case 28: pValues[nProp] >>= aItem.aPrivState; break;// "PrivateAddress/State", - case 29: pValues[nProp] >>= aItem.aPrivTitle; break;// "PrivateAddress/Title", - case 30: pValues[nProp] >>= aItem.aPrivProfession; break;// "PrivateAddress/Profession", - case 31: pValues[nProp] >>= aItem.aPrivPhone; break;// "PrivateAddress/Phone", - case 32: pValues[nProp] >>= aItem.aPrivMobile; break;// "PrivateAddress/Mobile", - case 33: pValues[nProp] >>= aItem.aPrivFax; break;// "PrivateAddress/Fax", - case 34: pValues[nProp] >>= aItem.aPrivWWW; break;// "PrivateAddress/WebAddress", - case 35: pValues[nProp] >>= aItem.aPrivMail; break;// "PrivateAddress/Email", - case 36: pValues[nProp] >>= aItem.aCompCompany; break;// "BusinessAddress/Company", - case 37: pValues[nProp] >>= aItem.aCompCompanyExt; break;// "BusinessAddress/CompanyExt", - case 38: pValues[nProp] >>= aItem.aCompSlogan; break;// "BusinessAddress/Slogan", - case 39: pValues[nProp] >>= aItem.aCompStreet; break;// "BusinessAddress/Street", - case 40: pValues[nProp] >>= aItem.aCompZip; break;// "BusinessAddress/Zip", - case 41: pValues[nProp] >>= aItem.aCompCity; break;// "BusinessAddress/City", - case 42: pValues[nProp] >>= aItem.aCompCountry; break;// "BusinessAddress/Country", - case 43: pValues[nProp] >>= aItem.aCompState; break;// "BusinessAddress/State", - case 44: pValues[nProp] >>= aItem.aCompPosition; break;// "BusinessAddress/Position", - case 45: pValues[nProp] >>= aItem.aCompPhone; break;// "BusinessAddress/Phone", - case 46: pValues[nProp] >>= aItem.aCompMobile; break;// "BusinessAddress/Mobile", - case 47: pValues[nProp] >>= aItem.aCompFax; break;// "BusinessAddress/Fax", - case 48: pValues[nProp] >>= aItem.aCompWWW; break;// "BusinessAddress/WebAddress", - case 49: pValues[nProp] >>= aItem.aCompMail; break;// "BusinessAddress/Email", - case 50: pValues[nProp] >>= aItem.sGlossaryGroup; break;// "AutoText/Group" - case 51: pValues[nProp] >>= aItem.sGlossaryBlockName; break;// "AutoText/Block" + case 11: + pValues[nProp] >>= aItem.lPWidth; + aItem.lPWidth = MM100_TO_TWIP(aItem.lPWidth); + break;// "Format/PageWidth", + case 12: + pValues[nProp] >>= aItem.lPHeight; + aItem.lPHeight = MM100_TO_TWIP(aItem.lPHeight); + break;// "Format/PageHeight", + case 13: aItem.bSynchron = *(sal_Bool*)pValues[nProp].getValue(); break;// "Option/Synchronize", + case 14: aItem.bPage = *(sal_Bool*)pValues[nProp].getValue(); break;// "Option/Page", + case 15: pValues[nProp] >>= aItem.nCol; break;// "Option/Column", + case 16: pValues[nProp] >>= aItem.nRow; break;// "Option/Row" + case 17: aItem.bAddr = *(sal_Bool*)pValues[nProp].getValue(); break;// "Inscription/UseAddress", + case 18: pValues[nProp] >>= aItem.aWriting; break;// "Inscription/Address", + case 19: pValues[nProp] >>= aItem.sDBName; break;// "Inscription/Database" + case 20: pValues[nProp] >>= aItem.aPrivFirstName; break;// "PrivateAddress/FirstName", + case 21: pValues[nProp] >>= aItem.aPrivName; break;// "PrivateAddress/Name", + case 22: pValues[nProp] >>= aItem.aPrivShortCut; break;// "PrivateAddress/ShortCut", + case 23: pValues[nProp] >>= aItem.aPrivFirstName2; break;// "PrivateAddress/SecondFirstName", + case 24: pValues[nProp] >>= aItem.aPrivName2; break;// "PrivateAddress/SecondName", + case 25: pValues[nProp] >>= aItem.aPrivShortCut2; break;// "PrivateAddress/SecondShortCut", + case 26: pValues[nProp] >>= aItem.aPrivStreet; break;// "PrivateAddress/Street", + case 27: pValues[nProp] >>= aItem.aPrivZip; break;// "PrivateAddress/Zip", + case 28: pValues[nProp] >>= aItem.aPrivCity; break;// "PrivateAddress/City", + case 29: pValues[nProp] >>= aItem.aPrivCountry; break;// "PrivateAddress/Country", + case 30: pValues[nProp] >>= aItem.aPrivState; break;// "PrivateAddress/State", + case 31: pValues[nProp] >>= aItem.aPrivTitle; break;// "PrivateAddress/Title", + case 32: pValues[nProp] >>= aItem.aPrivProfession; break;// "PrivateAddress/Profession", + case 33: pValues[nProp] >>= aItem.aPrivPhone; break;// "PrivateAddress/Phone", + case 34: pValues[nProp] >>= aItem.aPrivMobile; break;// "PrivateAddress/Mobile", + case 35: pValues[nProp] >>= aItem.aPrivFax; break;// "PrivateAddress/Fax", + case 36: pValues[nProp] >>= aItem.aPrivWWW; break;// "PrivateAddress/WebAddress", + case 37: pValues[nProp] >>= aItem.aPrivMail; break;// "PrivateAddress/Email", + case 38: pValues[nProp] >>= aItem.aCompCompany; break;// "BusinessAddress/Company", + case 39: pValues[nProp] >>= aItem.aCompCompanyExt; break;// "BusinessAddress/CompanyExt", + case 40: pValues[nProp] >>= aItem.aCompSlogan; break;// "BusinessAddress/Slogan", + case 41: pValues[nProp] >>= aItem.aCompStreet; break;// "BusinessAddress/Street", + case 42: pValues[nProp] >>= aItem.aCompZip; break;// "BusinessAddress/Zip", + case 43: pValues[nProp] >>= aItem.aCompCity; break;// "BusinessAddress/City", + case 44: pValues[nProp] >>= aItem.aCompCountry; break;// "BusinessAddress/Country", + case 45: pValues[nProp] >>= aItem.aCompState; break;// "BusinessAddress/State", + case 46: pValues[nProp] >>= aItem.aCompPosition; break;// "BusinessAddress/Position", + case 47: pValues[nProp] >>= aItem.aCompPhone; break;// "BusinessAddress/Phone", + case 48: pValues[nProp] >>= aItem.aCompMobile; break;// "BusinessAddress/Mobile", + case 49: pValues[nProp] >>= aItem.aCompFax; break;// "BusinessAddress/Fax", + case 50: pValues[nProp] >>= aItem.aCompWWW; break;// "BusinessAddress/WebAddress", + case 51: pValues[nProp] >>= aItem.aCompMail; break;// "BusinessAddress/Email", + case 52: pValues[nProp] >>= aItem.sGlossaryGroup; break;// "AutoText/Group" + case 53: pValues[nProp] >>= aItem.sGlossaryBlockName; break;// "AutoText/Block" } } } @@ -402,7 +420,7 @@ void SwLabCfgItem::Commit() for(int nProp = 0, nProperty = 0; nProp < aNames.getLength(); nProp++, nProperty++) { //to have a contiuous switch an offset is added - if(nProp == 15 && !bIsLabel) + if(nProp == 17 && !bIsLabel) nProperty += 3; switch(nProperty) { @@ -417,47 +435,49 @@ void SwLabCfgItem::Commit() case 8: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lHeight)); break;// "Format/Height", case 9: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lLeft)); break;// "Format/LeftMargin", case 10: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lUpper)); break;// "Format/TopMargin", - case 11: pValues[nProp].setValue(&aItem.bSynchron, rType); break;// "Option/Synchronize", - case 12: pValues[nProp].setValue(&aItem.bPage, rType); break;// "Option/Page", - case 13: pValues[nProp] <<= aItem.nCol; break;// "Option/Column", - case 14: pValues[nProp] <<= aItem.nRow; break;// "Option/Row" - case 15: pValues[nProp].setValue(&aItem.bAddr, rType); break;// "Inscription/UseAddress", - case 16: pValues[nProp] <<= aItem.aWriting; break;// "Inscription/Address", - case 17: pValues[nProp] <<= aItem.sDBName; break;// "Inscription/Database" - case 18: pValues[nProp] <<= aItem.aPrivFirstName; break;// "PrivateAddress/FirstName", - case 19: pValues[nProp] <<= aItem.aPrivName; break;// "PrivateAddress/Name", - case 20: pValues[nProp] <<= aItem.aPrivShortCut; break;// "PrivateAddress/ShortCut", - case 21: pValues[nProp] <<= aItem.aPrivFirstName2; break;// "PrivateAddress/SecondFirstName", - case 22: pValues[nProp] <<= aItem.aPrivName2; break;// "PrivateAddress/SecondName", - case 23: pValues[nProp] <<= aItem.aPrivShortCut2; break;// "PrivateAddress/SecondShortCut", - case 24: pValues[nProp] <<= aItem.aPrivStreet; break;// "PrivateAddress/Street", - case 25: pValues[nProp] <<= aItem.aPrivZip; break;// "PrivateAddress/Zip", - case 26: pValues[nProp] <<= aItem.aPrivCity; break;// "PrivateAddress/City", - case 27: pValues[nProp] <<= aItem.aPrivCountry; break;// "PrivateAddress/Country", - case 28: pValues[nProp] <<= aItem.aPrivState; break;// "PrivateAddress/State", - case 29: pValues[nProp] <<= aItem.aPrivTitle; break;// "PrivateAddress/Title", - case 30: pValues[nProp] <<= aItem.aPrivProfession; break;// "PrivateAddress/Profession", - case 31: pValues[nProp] <<= aItem.aPrivPhone; break;// "PrivateAddress/Phone", - case 32: pValues[nProp] <<= aItem.aPrivMobile; break;// "PrivateAddress/Mobile", - case 33: pValues[nProp] <<= aItem.aPrivFax; break;// "PrivateAddress/Fax", - case 34: pValues[nProp] <<= aItem.aPrivWWW; break;// "PrivateAddress/WebAddress", - case 35: pValues[nProp] <<= aItem.aPrivMail; break;// "PrivateAddress/Email", - case 36: pValues[nProp] <<= aItem.aCompCompany; break;// "BusinessAddress/Company", - case 37: pValues[nProp] <<= aItem.aCompCompanyExt; break;// "BusinessAddress/CompanyExt", - case 38: pValues[nProp] <<= aItem.aCompSlogan; break;// "BusinessAddress/Slogan", - case 39: pValues[nProp] <<= aItem.aCompStreet; break;// "BusinessAddress/Street", - case 40: pValues[nProp] <<= aItem.aCompZip; break;// "BusinessAddress/Zip", - case 41: pValues[nProp] <<= aItem.aCompCity; break;// "BusinessAddress/City", - case 42: pValues[nProp] <<= aItem.aCompCountry; break;// "BusinessAddress/Country", - case 43: pValues[nProp] <<= aItem.aCompState; break;// "BusinessAddress/State", - case 44: pValues[nProp] <<= aItem.aCompPosition; break;// "BusinessAddress/Position", - case 45: pValues[nProp] <<= aItem.aCompPhone; break;// "BusinessAddress/Phone", - case 46: pValues[nProp] <<= aItem.aCompMobile; break;// "BusinessAddress/Mobile", - case 47: pValues[nProp] <<= aItem.aCompFax; break;// "BusinessAddress/Fax", - case 48: pValues[nProp] <<= aItem.aCompWWW; break;// "BusinessAddress/WebAddress", - case 49: pValues[nProp] <<= aItem.aCompMail; break;// "BusinessAddress/Email", - case 50: pValues[nProp] <<= aItem.sGlossaryGroup; break;// "AutoText/Group" - case 51: pValues[nProp] <<= aItem.sGlossaryBlockName; break;// "AutoText/Block" + case 11: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lPWidth)); break;// "Format/Page Width", + case 12: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lPHeight)); break;// "Format/PageHeight", + case 13: pValues[nProp].setValue(&aItem.bSynchron, rType); break;// "Option/Synchronize", + case 14: pValues[nProp].setValue(&aItem.bPage, rType); break;// "Option/Page", + case 15: pValues[nProp] <<= aItem.nCol; break;// "Option/Column", + case 16: pValues[nProp] <<= aItem.nRow; break;// "Option/Row" + case 17: pValues[nProp].setValue(&aItem.bAddr, rType); break;// "Inscription/UseAddress", + case 18: pValues[nProp] <<= aItem.aWriting; break;// "Inscription/Address", + case 19: pValues[nProp] <<= aItem.sDBName; break;// "Inscription/Database" + case 20: pValues[nProp] <<= aItem.aPrivFirstName; break;// "PrivateAddress/FirstName", + case 21: pValues[nProp] <<= aItem.aPrivName; break;// "PrivateAddress/Name", + case 22: pValues[nProp] <<= aItem.aPrivShortCut; break;// "PrivateAddress/ShortCut", + case 23: pValues[nProp] <<= aItem.aPrivFirstName2; break;// "PrivateAddress/SecondFirstName", + case 24: pValues[nProp] <<= aItem.aPrivName2; break;// "PrivateAddress/SecondName", + case 25: pValues[nProp] <<= aItem.aPrivShortCut2; break;// "PrivateAddress/SecondShortCut", + case 26: pValues[nProp] <<= aItem.aPrivStreet; break;// "PrivateAddress/Street", + case 27: pValues[nProp] <<= aItem.aPrivZip; break;// "PrivateAddress/Zip", + case 28: pValues[nProp] <<= aItem.aPrivCity; break;// "PrivateAddress/City", + case 29: pValues[nProp] <<= aItem.aPrivCountry; break;// "PrivateAddress/Country", + case 30: pValues[nProp] <<= aItem.aPrivState; break;// "PrivateAddress/State", + case 31: pValues[nProp] <<= aItem.aPrivTitle; break;// "PrivateAddress/Title", + case 32: pValues[nProp] <<= aItem.aPrivProfession; break;// "PrivateAddress/Profession", + case 33: pValues[nProp] <<= aItem.aPrivPhone; break;// "PrivateAddress/Phone", + case 34: pValues[nProp] <<= aItem.aPrivMobile; break;// "PrivateAddress/Mobile", + case 35: pValues[nProp] <<= aItem.aPrivFax; break;// "PrivateAddress/Fax", + case 36: pValues[nProp] <<= aItem.aPrivWWW; break;// "PrivateAddress/WebAddress", + case 37: pValues[nProp] <<= aItem.aPrivMail; break;// "PrivateAddress/Email", + case 38: pValues[nProp] <<= aItem.aCompCompany; break;// "BusinessAddress/Company", + case 39: pValues[nProp] <<= aItem.aCompCompanyExt; break;// "BusinessAddress/CompanyExt", + case 40: pValues[nProp] <<= aItem.aCompSlogan; break;// "BusinessAddress/Slogan", + case 41: pValues[nProp] <<= aItem.aCompStreet; break;// "BusinessAddress/Street", + case 42: pValues[nProp] <<= aItem.aCompZip; break;// "BusinessAddress/Zip", + case 43: pValues[nProp] <<= aItem.aCompCity; break;// "BusinessAddress/City", + case 44: pValues[nProp] <<= aItem.aCompCountry; break;// "BusinessAddress/Country", + case 45: pValues[nProp] <<= aItem.aCompState; break;// "BusinessAddress/State", + case 46: pValues[nProp] <<= aItem.aCompPosition; break;// "BusinessAddress/Position", + case 47: pValues[nProp] <<= aItem.aCompPhone; break;// "BusinessAddress/Phone", + case 48: pValues[nProp] <<= aItem.aCompMobile; break;// "BusinessAddress/Mobile", + case 49: pValues[nProp] <<= aItem.aCompFax; break;// "BusinessAddress/Fax", + case 50: pValues[nProp] <<= aItem.aCompWWW; break;// "BusinessAddress/WebAddress", + case 51: pValues[nProp] <<= aItem.aCompMail; break;// "BusinessAddress/Email", + case 52: pValues[nProp] <<= aItem.sGlossaryGroup; break;// "AutoText/Group" + case 53: pValues[nProp] <<= aItem.sGlossaryBlockName; break;// "AutoText/Block" } } PutProperties(aNames, aValues); diff --git a/sw/source/ui/envelp/labimp.hxx b/sw/source/ui/envelp/labimp.hxx index 79dbce3e089c..a20415ec6c0a 100644 --- a/sw/source/ui/envelp/labimp.hxx +++ b/sw/source/ui/envelp/labimp.hxx @@ -105,6 +105,8 @@ public: long lHeight; long lLeft; long lUpper; + long lPWidth; + long lPHeight; sal_Int32 nCols; sal_Int32 nRows; sal_Bool bCont; diff --git a/sw/source/ui/inc/labimg.hxx b/sw/source/ui/inc/labimg.hxx index 45da9ad3e8e5..9e9299c59fee 100644 --- a/sw/source/ui/inc/labimg.hxx +++ b/sw/source/ui/inc/labimg.hxx @@ -68,6 +68,8 @@ public: sal_Int32 nRows; // number of rows (user) sal_Int32 nCol; // column for single print sal_Int32 nRow; // row for single print + sal_Int32 lPHeight; // paper height + sal_Int32 lPWidth; // paper width sal_Bool bAddr;// address as label? sal_Bool bCont;// continuous paper? sal_Bool bPage;// whole page or single labels? |