Kaydet (Commit) 7fb6496e authored tarafından Tsutomu Uchino's avatar Tsutomu Uchino

#i53718# add support of paper size for label document

üst 23e16b91
......@@ -40,10 +40,10 @@
</prop>
<prop oor:name="Measure" oor:type="xs:string">
<!--Label: Contains the measurement data of the label contatenated by a colon (;) in the following order:
'C' or 'S';Horizontal Distance;Vertical Distance;Width;Height;Left margin;Upper margin;Columns;Rows" while 'C' marks a continuous label and 'S' marks a sheet
'C' or 'S';Horizontal Distance;Vertical Distance;Width;Height;Left margin;Upper margin;Columns;Rows;Paper Width;Paper Height" while 'C' marks a continuous label and 'S' marks a sheet
-->
<info>
<desc>Contains the measurement data of the label concatenated by a colon (;) in the following order: 'C' or 'S';Horizontal Distance;Vertical Distance;Width;Height;Left margin;Upper margin;Columns;Rows" while &apos;C&apos; marks a continuous label and &apos;S&apos; marks a sheet.</desc>
<desc>Contains the measurement data of the label concatenated by a colon (;) in the following order: 'C' or 'S';Horizontal Distance;Vertical Distance;Width;Height;Left margin;Upper margin;Columns;Rows;Paper Width;Paper Height" while &apos;C&apos; marks a continuous label and &apos;S&apos; marks a sheet.</desc>
</info>
</prop>
</group>
......
......@@ -5026,6 +5026,18 @@
</info>
<value>0</value>
</prop>
<prop oor:name="PaperWidth" oor:type="xs:int">
<info>
<desc>Specifies the width of the paper [UNIT=1/100 mm].</desc>
</info>
<value>10000</value>
</prop>
<prop oor:name="PaperHeight" oor:type="xs:int">
<info>
<desc>Specifies the height of the paper [UNIT=1/100 mm].</desc>
</info>
<value>10000</value>
</prop>
</group>
<group oor:name="Option">
<info>
......
......@@ -97,7 +97,8 @@ const SwFrmFmt *lcl_InsertBCText( SwWrtShell& rSh, const SwLabItem& rItem,
sal_uInt16 nCol, sal_uInt16 nRow, sal_Bool bPage)
{
SfxItemSet aSet(rSh.GetAttrPool(), RES_ANCHOR, RES_ANCHOR,
RES_VERT_ORIENT, RES_VERT_ORIENT, RES_HORI_ORIENT, RES_HORI_ORIENT, 0 );
RES_VERT_ORIENT, RES_VERT_ORIENT, RES_HORI_ORIENT, RES_HORI_ORIENT,
RES_LR_SPACE, RES_LR_SPACE, 0 );
sal_uInt16 nPhyPageNum, nVirtPageNum;
rSh.GetPageNum( nPhyPageNum, nVirtPageNum );
......@@ -109,6 +110,10 @@ const SwFrmFmt *lcl_InsertBCText( SwWrtShell& rSh, const SwLabItem& rItem,
aSet.Put(SwFmtVertOrient(rItem.lUpper + nRow * rItem.lVDist,
text::VertOrientation::NONE, text::RelOrientation::PAGE_FRAME ));
}
if ( nCol == rItem.nCols -1 )
{
aSet.Put( SvxLRSpaceItem( 0, 0, 0, 0, RES_LR_SPACE ) );
}
const SwFrmFmt *pFmt = rSh.NewFlyFrm(aSet, sal_True, &rFmt ); // Fly einfuegen
ASSERT( pFmt, "Fly not inserted" );
......@@ -137,7 +142,8 @@ const SwFrmFmt *lcl_InsertLabText( SwWrtShell& rSh, const SwLabItem& rItem,
sal_uInt16 nCol, sal_uInt16 nRow, sal_Bool bLast, sal_Bool bPage)
{
SfxItemSet aSet(rSh.GetAttrPool(), RES_ANCHOR, RES_ANCHOR,
RES_VERT_ORIENT, RES_VERT_ORIENT, RES_HORI_ORIENT, RES_HORI_ORIENT, 0 );
RES_VERT_ORIENT, RES_VERT_ORIENT, RES_HORI_ORIENT, RES_HORI_ORIENT,
RES_LR_SPACE, RES_LR_SPACE, 0 );
sal_uInt16 nPhyPageNum, nVirtPageNum;
rSh.GetPageNum( nPhyPageNum, nVirtPageNum );
......@@ -149,6 +155,10 @@ const SwFrmFmt *lcl_InsertLabText( SwWrtShell& rSh, const SwLabItem& rItem,
aSet.Put(SwFmtVertOrient(rItem.lUpper + nRow * rItem.lVDist,
text::VertOrientation::NONE, text::RelOrientation::PAGE_FRAME ));
}
if ( nCol == rItem.nCols -1 )
{
aSet.Put( SvxLRSpaceItem( 0, 0, 0, 0, RES_LR_SPACE ) );
}
const SwFrmFmt *pFmt = rSh.NewFlyFrm(aSet, sal_True, &rFmt ); // Fly einfuegen
ASSERT( pFmt, "Fly not inserted" );
......@@ -272,8 +282,8 @@ static sal_uInt16 nBCTitleNo = 0;
// Einstellen der Seitengroesse
rFmt.SetFmtAttr(SwFmtFrmSize(ATT_FIX_SIZE,
rItem.lLeft + rItem.nCols * rItem.lHDist + MINLAY,
rItem.lUpper + rItem.nRows * rItem.lVDist + MINLAY));
rItem.lPaperWidth == 0 ? rItem.lLeft + rItem.nCols * rItem.lHDist + MINLAY : rItem.lPaperWidth,
rItem.bCont || rItem.lPaperHeight == 0 ? rItem.lUpper + rItem.nRows * rItem.lVDist + MINLAY : rItem.lPaperHeight));
// Numerierungsart
SvxNumberType aType;
......
......@@ -71,6 +71,8 @@ void SwLabRec::SetFromItem( const SwLabItem& rItem )
lUpper = rItem.lUpper;
nCols = rItem.nCols;
nRows = rItem.nRows;
lPaperWidth = rItem.lPaperWidth;
lPaperHeight = rItem.lPaperHeight;
bCont = rItem.bCont;
}
......@@ -84,6 +86,8 @@ void SwLabRec::FillItem( SwLabItem& rItem ) const
rItem.lUpper = lUpper;
rItem.nCols = nCols;
rItem.nRows = nRows;
rItem.lPaperWidth = lPaperWidth;
rItem.lPaperHeight = lPaperHeight;
}
// --------------------------------------------------------------------------
......
......@@ -111,6 +111,8 @@ SwLabRec* lcl_CreateSwLabRec(Sequence<Any>& rValues, const OUString& rManufactur
case 6 : pNewRec->lUpper = MM100_TO_TWIP(nVal);break;
case 7 : pNewRec->nCols = nVal; break;
case 8 : pNewRec->nRows = nVal; break;
case 9 : pNewRec->lPaperWidth = MM100_TO_TWIP(nVal);break;
case 10: pNewRec->lPaperHeight = MM100_TO_TWIP(nVal);break;
}
}
}
......@@ -146,7 +148,9 @@ Sequence<PropertyValue> lcl_CreateProperties(
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 += OUString::valueOf(rRec.nRows );sTmp += sColon;
sTmp += OUString::valueOf(TWIP_TO_MM100(rRec.lPaperWidth));sTmp += sColon;
sTmp += OUString::valueOf(TWIP_TO_MM100(rRec.lPaperHeight));
pValues[nProp].Value <<= sTmp;
}
break;
......
......@@ -329,6 +329,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 )),
aPaperWidthText (this, SW_RES(TXT_PAPER_WIDTH)),
aPaperWidthField (this, SW_RES(FLD_PAPER_WIDTH)),
aPaperHeightText (this, SW_RES(TXT_PAPER_HEIGHT)),
aPaperHeightField(this, SW_RES(FLD_PAPER_HEIGHT)),
aSavePB (this, SW_RES(PB_SAVE )),
bModified(sal_False),
aItem ((const SwLabItem&) rSet.Get(FN_LABEL))
......@@ -344,6 +348,8 @@ SwLabFmtPage::SwLabFmtPage(Window* pParent, const SfxItemSet& rSet) :
SetMetric(aHeightField, aMetric);
SetMetric(aLeftField , aMetric);
SetMetric(aUpperField , aMetric);
SetMetric(aPaperWidthField, aMetric);
SetMetric(aPaperHeightField, aMetric);
// Handler installieren
Link aLk = LINK(this, SwLabFmtPage, ModifyHdl);
......@@ -355,6 +361,8 @@ SwLabFmtPage::SwLabFmtPage(Window* pParent, const SfxItemSet& rSet) :
aUpperField .SetModifyHdl( aLk );
aColsField .SetModifyHdl( aLk );
aRowsField .SetModifyHdl( aLk );
aPaperWidthField .SetModifyHdl( aLk );
aPaperHeightField.SetModifyHdl( aLk );
aLk = LINK(this, SwLabFmtPage, LoseFocusHdl);
aHDistField .SetLoseFocusHdl( aLk );
......@@ -533,6 +541,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.lPaperWidth = rRec.lPaperWidth = static_cast< long >(GETFLDVAL(aPaperWidthField));
rItem.lPaperHeight = rRec.lPaperHeight = static_cast< long >(GETFLDVAL(aPaperHeightField));
}
}
......@@ -567,6 +577,8 @@ void SwLabFmtPage::Reset(const SfxItemSet& )
SETFLDVAL(aHeightField, aItem.lHeight);
SETFLDVAL(aLeftField , aItem.lLeft );
SETFLDVAL(aUpperField , aItem.lUpper );
SETFLDVAL(aPaperWidthField , aItem.lPaperWidth );
SETFLDVAL(aPaperHeightField, aItem.lPaperHeight);
aColsField.SetMax(aItem.nCols);
aRowsField.SetMax(aItem.nRows);
......@@ -592,6 +604,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.lPaperWidth = static_cast< long >(GETFLDVAL(aPaperWidthField ));
aRec.lPaperHeight = static_cast< long >(GETFLDVAL(aPaperHeightField));
aRec.bCont = aItem.bCont;
SwSaveLabelDlg* pSaveDlg = new SwSaveLabelDlg(this, aRec);
pSaveDlg->SetLabel(aItem.aLstMake, aItem.aLstType);
......@@ -702,6 +716,8 @@ sal_Bool SwSaveLabelDlg::GetLabel(SwLabItem& rItem)
rItem.lUpper = rLabRec.lUpper;
rItem.nCols = rLabRec.nCols;
rItem.nRows = rLabRec.nRows;
rItem.lPaperWidth = rLabRec.lPaperWidth;
rItem.lPaperHeight = rLabRec.lPaperHeight;
}
return bSuccess;
}
......
......@@ -51,6 +51,10 @@
#define PB_SAVE 19
#define FI_MAKE 20
#define FI_TYPE 21
#define TXT_PAPER_WIDTH 22
#define FLD_PAPER_WIDTH 23
#define TXT_PAPER_HEIGHT 24
#define FLD_PAPER_HEIGHT 25
#define FL_OPTIONS 1
#define FT_MAKE 2
......
......@@ -100,6 +100,10 @@ class SwLabFmtPage : public SfxTabPage
NumericField aColsField;
FixedText aRowsText;
NumericField aRowsField;
FixedText aPaperWidthText;
MetricField aPaperWidthField;
FixedText aPaperHeightText;
MetricField aPaperHeightField;
PushButton aSavePB;
Timer aPreviewTimer;
......
......@@ -71,7 +71,7 @@ TabPage TP_LAB_FMT
};
FixedText TXT_VDIST
{
Pos = MAP_APPFONT ( 6 , 35 ) ;
Pos = MAP_APPFONT ( 6 , 33 ) ;
Size = MAP_APPFONT ( 50 , 8 ) ;
Text [ en-US ] = "~Vertical pitch" ;
Left = TRUE ;
......@@ -80,7 +80,7 @@ TabPage TP_LAB_FMT
{
HelpID = "sw:MetricField:TP_LAB_FMT:FLD_VDIST";
Border = TRUE ;
Pos = MAP_APPFONT ( 60 , 33 ) ;
Pos = MAP_APPFONT ( 60 , 31 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
......@@ -92,7 +92,7 @@ TabPage TP_LAB_FMT
};
FixedText TXT_WIDTH
{
Pos = MAP_APPFONT ( 6 , 51 ) ;
Pos = MAP_APPFONT ( 6 , 47 ) ;
Size = MAP_APPFONT ( 50 , 8 ) ;
Text [ en-US ] = "~Width" ;
Left = TRUE ;
......@@ -101,7 +101,7 @@ TabPage TP_LAB_FMT
{
HelpID = "sw:MetricField:TP_LAB_FMT:FLD_WIDTH";
Border = TRUE ;
Pos = MAP_APPFONT ( 60 , 49 ) ;
Pos = MAP_APPFONT ( 60 , 45 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
......@@ -113,7 +113,7 @@ TabPage TP_LAB_FMT
};
FixedText TXT_HEIGHT
{
Pos = MAP_APPFONT ( 6 , 67 ) ;
Pos = MAP_APPFONT ( 6 , 61 ) ;
Size = MAP_APPFONT ( 50 , 8 ) ;
Text [ en-US ] = "~Height" ;
Left = TRUE ;
......@@ -122,7 +122,7 @@ TabPage TP_LAB_FMT
{
HelpID = "sw:MetricField:TP_LAB_FMT:FLD_HEIGHT";
Border = TRUE ;
Pos = MAP_APPFONT ( 60 , 65 ) ;
Pos = MAP_APPFONT ( 60 , 59 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
......@@ -134,7 +134,7 @@ TabPage TP_LAB_FMT
};
FixedText TXT_LEFT
{
Pos = MAP_APPFONT ( 6 , 83 ) ;
Pos = MAP_APPFONT ( 6 , 75 ) ;
Size = MAP_APPFONT ( 50 , 8 ) ;
Text [ en-US ] = "~Left margin" ;
Left = TRUE ;
......@@ -143,7 +143,7 @@ TabPage TP_LAB_FMT
{
HelpID = "sw:MetricField:TP_LAB_FMT:FLD_LEFT";
Border = TRUE ;
Pos = MAP_APPFONT ( 60 , 81 ) ;
Pos = MAP_APPFONT ( 60 , 73 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
......@@ -157,7 +157,7 @@ TabPage TP_LAB_FMT
};
FixedText TXT_UPPER
{
Pos = MAP_APPFONT ( 6 , 99 ) ;
Pos = MAP_APPFONT ( 6 , 89 ) ;
Size = MAP_APPFONT ( 50 , 8 ) ;
Text [ en-US ] = "~Top margin" ;
Left = TRUE ;
......@@ -166,7 +166,7 @@ TabPage TP_LAB_FMT
{
HelpID = "sw:MetricField:TP_LAB_FMT:FLD_UPPER";
Border = TRUE ;
Pos = MAP_APPFONT ( 60 , 97 ) ;
Pos = MAP_APPFONT ( 60 , 87 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
......@@ -180,7 +180,7 @@ TabPage TP_LAB_FMT
};
FixedText TXT_COLUMNS
{
Pos = MAP_APPFONT ( 6 , 115 ) ;
Pos = MAP_APPFONT ( 6 , 103 ) ;
Size = MAP_APPFONT ( 50 , 8 ) ;
Text [ en-US ] = "~Columns" ;
Left = TRUE ;
......@@ -189,7 +189,7 @@ TabPage TP_LAB_FMT
{
HelpID = "sw:NumericField:TP_LAB_FMT:FLD_COLUMNS";
Border = TRUE ;
Pos = MAP_APPFONT ( 60 , 113 ) ;
Pos = MAP_APPFONT ( 60 , 101 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
......@@ -200,7 +200,7 @@ TabPage TP_LAB_FMT
};
FixedText TXT_ROWS
{
Pos = MAP_APPFONT ( 6 , 131 ) ;
Pos = MAP_APPFONT ( 6 , 117 ) ;
Size = MAP_APPFONT ( 50 , 8 ) ;
Text [ en-US ] = "R~ows" ;
Left = TRUE ;
......@@ -209,7 +209,7 @@ TabPage TP_LAB_FMT
{
HelpID = "sw:NumericField:TP_LAB_FMT:FLD_ROWS";
Border = TRUE ;
Pos = MAP_APPFONT ( 60 , 129 ) ;
Pos = MAP_APPFONT ( 60 , 115 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
......@@ -218,10 +218,52 @@ TabPage TP_LAB_FMT
Minimum = 1 ;
First = 1 ;
};
FixedText TXT_PAPER_WIDTH
{
Pos = MAP_APPFONT ( 6 , 131 ) ;
Size = MAP_APPFONT ( 50 , 8 ) ;
Text [ en-US ] = "~Paper Width" ;
Left = TRUE ;
};
MetricField FLD_PAPER_WIDTH
{
HelpID = "sw:MetricField:TP_LAB_FMT:FLD_PAPER_WIDTH";
Border = TRUE ;
Pos = MAP_APPFONT ( 60 , 129 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
Spin = TRUE ;
DecimalDigits = 2 ;
Unit = FUNIT_CM ;
Repeat = TRUE ;
SpinSize = 10 ;
};
FixedText TXT_PAPER_HEIGHT
{
Pos = MAP_APPFONT ( 6 , 145 ) ;
Size = MAP_APPFONT ( 50 , 8 ) ;
Text [ en-US ] = "Pape~r Height" ;
Left = TRUE ;
};
MetricField FLD_PAPER_HEIGHT
{
HelpID = "sw:MetricField:TP_LAB_FMT:FLD_PAPER_HEIGHT";
Border = TRUE ;
Pos = MAP_APPFONT ( 60 , 143 ) ;
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 , 164 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Save...";
};
......
This diff is collapsed.
......@@ -101,6 +101,8 @@ public:
long lUpper;
sal_Int32 nCols;
sal_Int32 nRows;
long lPaperWidth;
long lPaperHeight;
sal_Bool bCont;
};
......
......@@ -63,6 +63,8 @@ public:
sal_Int32 nRows; // Anzahl Zeilen (Benutzer)
sal_Int32 nCol; // Spalte fuer Einzeldruck
sal_Int32 nRow; // Zeile fuer Einzeldruck
sal_Int32 lPaperWidth; // Paper Width (user)
sal_Int32 lPaperHeight; // Paper Height (user)
sal_Bool bAddr;// Adresse als Aufschrift?
sal_Bool bCont;// Endlospapier?
sal_Bool bPage;// Ganze Seite oder einzelnes Etikett?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment