xref: /aoo41x/main/sd/source/ui/dlg/copydlg.cxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_sd.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #ifdef SD_DLLIMPLEMENTATION
32*cdf0e10cSrcweir #undef SD_DLLIMPLEMENTATION
33*cdf0e10cSrcweir #endif
34*cdf0e10cSrcweir 
35*cdf0e10cSrcweir #include "copydlg.hxx"
36*cdf0e10cSrcweir #include <svx/dlgutil.hxx>
37*cdf0e10cSrcweir #include <sfx2/module.hxx>
38*cdf0e10cSrcweir #include <svx/xcolit.hxx>
39*cdf0e10cSrcweir #include <svx/xflclit.hxx>
40*cdf0e10cSrcweir #include <svx/xdef.hxx>
41*cdf0e10cSrcweir #include <svx/xfillit0.hxx>
42*cdf0e10cSrcweir #include <svx/xenum.hxx>
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir #include <sfx2/app.hxx>
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir 
47*cdf0e10cSrcweir 
48*cdf0e10cSrcweir #include "sdattr.hxx"
49*cdf0e10cSrcweir 
50*cdf0e10cSrcweir #include "copydlg.hrc"
51*cdf0e10cSrcweir #include "View.hxx"
52*cdf0e10cSrcweir #include "sdresid.hxx"
53*cdf0e10cSrcweir #include "drawdoc.hxx"
54*cdf0e10cSrcweir #include "res_bmp.hrc"
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir namespace sd {
57*cdf0e10cSrcweir 
58*cdf0e10cSrcweir #define TOKEN (sal_Unicode(';'))
59*cdf0e10cSrcweir 
60*cdf0e10cSrcweir /*************************************************************************
61*cdf0e10cSrcweir |*
62*cdf0e10cSrcweir |* Dialog zum Kopieren von Objekten
63*cdf0e10cSrcweir |*
64*cdf0e10cSrcweir \************************************************************************/
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir CopyDlg::CopyDlg(
67*cdf0e10cSrcweir     ::Window* pWindow,
68*cdf0e10cSrcweir     const SfxItemSet& rInAttrs,
69*cdf0e10cSrcweir     XColorTable* pColTab,
70*cdf0e10cSrcweir     ::sd::View* pInView )
71*cdf0e10cSrcweir     : SfxModalDialog     ( pWindow, SdResId( DLG_COPY ) ),
72*cdf0e10cSrcweir       maFtCopies           ( this, SdResId( FT_COPIES ) ),
73*cdf0e10cSrcweir       maNumFldCopies       ( this, SdResId( NUM_FLD_COPIES ) ),
74*cdf0e10cSrcweir       maBtnSetViewData     ( this, SdResId( BTN_SET_VIEWDATA ) ),
75*cdf0e10cSrcweir       maGrpMovement        ( this, SdResId( GRP_MOVEMENT ) ),
76*cdf0e10cSrcweir       maFtMoveX            ( this, SdResId( FT_MOVE_X ) ),
77*cdf0e10cSrcweir       maMtrFldMoveX        ( this, SdResId( MTR_FLD_MOVE_X ) ),
78*cdf0e10cSrcweir       maFtMoveY            ( this, SdResId( FT_MOVE_Y ) ),
79*cdf0e10cSrcweir       maMtrFldMoveY        ( this, SdResId( MTR_FLD_MOVE_Y ) ),
80*cdf0e10cSrcweir       maFtAngle            ( this, SdResId( FT_ANGLE ) ),
81*cdf0e10cSrcweir       maMtrFldAngle        ( this, SdResId( MTR_FLD_ANGLE ) ),
82*cdf0e10cSrcweir       maGrpEnlargement     ( this, SdResId( GRP_ENLARGEMENT ) ),
83*cdf0e10cSrcweir       maFtWidth            ( this, SdResId( FT_WIDTH ) ),
84*cdf0e10cSrcweir       maMtrFldWidth        ( this, SdResId( MTR_FLD_WIDTH ) ),
85*cdf0e10cSrcweir       maFtHeight           ( this, SdResId( FT_HEIGHT ) ),
86*cdf0e10cSrcweir       maMtrFldHeight       ( this, SdResId( MTR_FLD_HEIGHT ) ),
87*cdf0e10cSrcweir       maGrpColor           ( this, SdResId( GRP_COLOR ) ),
88*cdf0e10cSrcweir       maFtStartColor       ( this, SdResId( FT_START_COLOR ) ),
89*cdf0e10cSrcweir       maLbStartColor       ( this, SdResId( LB_START_COLOR ) ),
90*cdf0e10cSrcweir       maFtEndColor         ( this, SdResId( FT_END_COLOR ) ),
91*cdf0e10cSrcweir       maLbEndColor         ( this, SdResId( LB_END_COLOR ) ),
92*cdf0e10cSrcweir       maBtnOK              ( this, SdResId( BTN_OK ) ),
93*cdf0e10cSrcweir       maBtnCancel          ( this, SdResId( BTN_CANCEL ) ),
94*cdf0e10cSrcweir       maBtnHelp            ( this, SdResId( BTN_HELP ) ),
95*cdf0e10cSrcweir       maBtnSetDefault      ( this, SdResId( BTN_SET_DEFAULT ) ),
96*cdf0e10cSrcweir       mrOutAttrs			( rInAttrs ),
97*cdf0e10cSrcweir       mpColorTab			( pColTab ),
98*cdf0e10cSrcweir 	  maUIScale(pInView->GetDoc()->GetUIScale()),
99*cdf0e10cSrcweir       mpView				( pInView )
100*cdf0e10cSrcweir {
101*cdf0e10cSrcweir 	FreeResource();
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir     // Set up the view data button (image and accessible name).
104*cdf0e10cSrcweir 	maBtnSetViewData.SetModeImage( Image( SdResId( IMG_PIPETTE_H ) ), BMP_COLOR_HIGHCONTRAST );
105*cdf0e10cSrcweir     maBtnSetViewData.SetAccessibleName (maBtnSetViewData.GetQuickHelpText());
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir 	// Farbtabellen
108*cdf0e10cSrcweir 	DBG_ASSERT( mpColorTab, "Keine gueltige ColorTable uebergeben!" );
109*cdf0e10cSrcweir 	maLbStartColor.Fill( mpColorTab );
110*cdf0e10cSrcweir 	maLbEndColor.CopyEntries( maLbStartColor );
111*cdf0e10cSrcweir 
112*cdf0e10cSrcweir 	maLbStartColor.SetSelectHdl( LINK( this, CopyDlg, SelectColorHdl ) );
113*cdf0e10cSrcweir 	maBtnSetViewData.SetClickHdl( LINK( this, CopyDlg, SetViewData ) );
114*cdf0e10cSrcweir 	maBtnSetDefault.SetClickHdl( LINK( this, CopyDlg, SetDefault ) );
115*cdf0e10cSrcweir 
116*cdf0e10cSrcweir 
117*cdf0e10cSrcweir 	FieldUnit eFUnit( SfxModule::GetCurrentFieldUnit() );
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir 	SetFieldUnit( maMtrFldMoveX, eFUnit, sal_True );
120*cdf0e10cSrcweir 	SetFieldUnit( maMtrFldMoveY, eFUnit, sal_True );
121*cdf0e10cSrcweir 	SetFieldUnit( maMtrFldWidth, eFUnit, sal_True );
122*cdf0e10cSrcweir 	SetFieldUnit( maMtrFldHeight, eFUnit, sal_True );
123*cdf0e10cSrcweir 
124*cdf0e10cSrcweir 	Reset(0L);
125*cdf0e10cSrcweir }
126*cdf0e10cSrcweir 
127*cdf0e10cSrcweir /*************************************************************************
128*cdf0e10cSrcweir |*
129*cdf0e10cSrcweir |* Dtor
130*cdf0e10cSrcweir |*
131*cdf0e10cSrcweir \************************************************************************/
132*cdf0e10cSrcweir 
133*cdf0e10cSrcweir CopyDlg::~CopyDlg()
134*cdf0e10cSrcweir {
135*cdf0e10cSrcweir 	String& rStr = GetExtraData();
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir 	rStr = UniString::CreateFromInt64( maNumFldCopies.GetValue() );
138*cdf0e10cSrcweir 	rStr.Append( TOKEN );
139*cdf0e10cSrcweir 
140*cdf0e10cSrcweir 	rStr += UniString::CreateFromInt64( maMtrFldMoveX.GetValue() );
141*cdf0e10cSrcweir 	rStr.Append( TOKEN );
142*cdf0e10cSrcweir 
143*cdf0e10cSrcweir 	rStr += UniString::CreateFromInt64( maMtrFldMoveY.GetValue() );
144*cdf0e10cSrcweir 	rStr.Append( TOKEN );
145*cdf0e10cSrcweir 
146*cdf0e10cSrcweir 	rStr += UniString::CreateFromInt64( maMtrFldAngle.GetValue() );
147*cdf0e10cSrcweir 	rStr.Append( TOKEN );
148*cdf0e10cSrcweir 
149*cdf0e10cSrcweir 	rStr += UniString::CreateFromInt64( maMtrFldWidth.GetValue() );
150*cdf0e10cSrcweir 	rStr.Append( TOKEN );
151*cdf0e10cSrcweir 
152*cdf0e10cSrcweir 	rStr += UniString::CreateFromInt64( maMtrFldHeight.GetValue() );
153*cdf0e10cSrcweir 	rStr.Append( TOKEN );
154*cdf0e10cSrcweir 
155*cdf0e10cSrcweir 	rStr += UniString::CreateFromInt32( (long)maLbStartColor.GetSelectEntryColor().GetColor() );
156*cdf0e10cSrcweir 	rStr.Append( TOKEN );
157*cdf0e10cSrcweir 
158*cdf0e10cSrcweir 	rStr += UniString::CreateFromInt32( (long)maLbEndColor.GetSelectEntryColor().GetColor() );
159*cdf0e10cSrcweir }
160*cdf0e10cSrcweir 
161*cdf0e10cSrcweir /*************************************************************************
162*cdf0e10cSrcweir |*
163*cdf0e10cSrcweir |* Liest uebergebenen Item-Set oder wertet den INI-String aus
164*cdf0e10cSrcweir |*
165*cdf0e10cSrcweir \************************************************************************/
166*cdf0e10cSrcweir 
167*cdf0e10cSrcweir IMPL_LINK( CopyDlg, Reset, void*, EMPTYARG )
168*cdf0e10cSrcweir {
169*cdf0e10cSrcweir 	const SfxPoolItem* pPoolItem = NULL;
170*cdf0e10cSrcweir 	String aStr( GetExtraData() );
171*cdf0e10cSrcweir 
172*cdf0e10cSrcweir 	if( aStr.GetTokenCount( TOKEN ) < 8 )
173*cdf0e10cSrcweir 	{
174*cdf0e10cSrcweir 		if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_NUMBER, sal_True, &pPoolItem ) )
175*cdf0e10cSrcweir 			maNumFldCopies.SetValue( ( ( const SfxUInt16Item* ) pPoolItem )->GetValue() );
176*cdf0e10cSrcweir 		else
177*cdf0e10cSrcweir 			maNumFldCopies.SetValue( 1L );
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir 		long nMoveX = 500L;
180*cdf0e10cSrcweir 		if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_MOVE_X, sal_True, &pPoolItem ) )
181*cdf0e10cSrcweir 			nMoveX = ( ( ( const SfxInt32Item* ) pPoolItem )->GetValue() );
182*cdf0e10cSrcweir 		SetMetricValue( maMtrFldMoveX, Fraction(nMoveX) / maUIScale, SFX_MAPUNIT_100TH_MM);
183*cdf0e10cSrcweir 
184*cdf0e10cSrcweir 		long nMoveY = 500L;
185*cdf0e10cSrcweir 		if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_MOVE_Y, sal_True, &pPoolItem ) )
186*cdf0e10cSrcweir 			nMoveY = ( ( ( const SfxInt32Item* ) pPoolItem )->GetValue() );
187*cdf0e10cSrcweir 		SetMetricValue( maMtrFldMoveY, Fraction(nMoveY) / maUIScale, SFX_MAPUNIT_100TH_MM);
188*cdf0e10cSrcweir 
189*cdf0e10cSrcweir 		if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_ANGLE, sal_True, &pPoolItem ) )
190*cdf0e10cSrcweir 			maMtrFldAngle.SetValue( ( ( const SfxInt32Item* ) pPoolItem )->GetValue() );
191*cdf0e10cSrcweir 		else
192*cdf0e10cSrcweir 			maMtrFldAngle.SetValue( 0L );
193*cdf0e10cSrcweir 
194*cdf0e10cSrcweir 		long nWidth = 0L;
195*cdf0e10cSrcweir 		if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_WIDTH, sal_True, &pPoolItem ) )
196*cdf0e10cSrcweir 			nWidth = ( ( ( const SfxInt32Item* ) pPoolItem )->GetValue() );
197*cdf0e10cSrcweir 		SetMetricValue( maMtrFldWidth, Fraction(nWidth) / maUIScale, SFX_MAPUNIT_100TH_MM);
198*cdf0e10cSrcweir 
199*cdf0e10cSrcweir 		long nHeight = 0L;
200*cdf0e10cSrcweir 		if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_HEIGHT, sal_True, &pPoolItem ) )
201*cdf0e10cSrcweir 			nHeight = ( ( ( const SfxInt32Item* ) pPoolItem )->GetValue() );
202*cdf0e10cSrcweir 		SetMetricValue( maMtrFldHeight, Fraction(nHeight) / maUIScale, SFX_MAPUNIT_100TH_MM);
203*cdf0e10cSrcweir 
204*cdf0e10cSrcweir 		if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_START_COLOR, sal_True, &pPoolItem ) )
205*cdf0e10cSrcweir 		{
206*cdf0e10cSrcweir 			Color aColor = ( ( const XColorItem* ) pPoolItem )->GetColorValue();
207*cdf0e10cSrcweir 			maLbStartColor.SelectEntry( aColor );
208*cdf0e10cSrcweir 			maLbEndColor.SelectEntry( aColor );
209*cdf0e10cSrcweir 		}
210*cdf0e10cSrcweir 		else
211*cdf0e10cSrcweir 		{
212*cdf0e10cSrcweir 			maLbStartColor.SetNoSelection();
213*cdf0e10cSrcweir 			maLbEndColor.SetNoSelection();
214*cdf0e10cSrcweir 			maLbEndColor.Disable();
215*cdf0e10cSrcweir 			maFtEndColor.Disable();
216*cdf0e10cSrcweir 		}
217*cdf0e10cSrcweir 	}
218*cdf0e10cSrcweir 	else
219*cdf0e10cSrcweir 	{
220*cdf0e10cSrcweir 		long nTmp;
221*cdf0e10cSrcweir 		nTmp = (long)aStr.GetToken( 0, TOKEN ).ToInt32();
222*cdf0e10cSrcweir 		maNumFldCopies.SetValue( nTmp );
223*cdf0e10cSrcweir 
224*cdf0e10cSrcweir 		nTmp = (long)aStr.GetToken( 1, TOKEN ).ToInt32();
225*cdf0e10cSrcweir 		maMtrFldMoveX.SetValue( nTmp );
226*cdf0e10cSrcweir 
227*cdf0e10cSrcweir 		nTmp = (long)aStr.GetToken( 2, TOKEN ).ToInt32();
228*cdf0e10cSrcweir 		maMtrFldMoveY.SetValue( nTmp );
229*cdf0e10cSrcweir 
230*cdf0e10cSrcweir 		nTmp = (long)aStr.GetToken( 3, TOKEN ).ToInt32();
231*cdf0e10cSrcweir 		maMtrFldAngle.SetValue( nTmp );
232*cdf0e10cSrcweir 
233*cdf0e10cSrcweir 		nTmp = (long)aStr.GetToken( 4, TOKEN ).ToInt32();
234*cdf0e10cSrcweir 		maMtrFldWidth.SetValue( nTmp );
235*cdf0e10cSrcweir 
236*cdf0e10cSrcweir 		nTmp = (long)aStr.GetToken( 5, TOKEN ).ToInt32();
237*cdf0e10cSrcweir 		maMtrFldHeight.SetValue( nTmp );
238*cdf0e10cSrcweir 
239*cdf0e10cSrcweir 		nTmp = (long)aStr.GetToken( 6, TOKEN ).ToInt32();
240*cdf0e10cSrcweir 		maLbStartColor.SelectEntry( Color( nTmp ) );
241*cdf0e10cSrcweir 
242*cdf0e10cSrcweir 		nTmp = (long)aStr.GetToken( 7, TOKEN ).ToInt32();
243*cdf0e10cSrcweir 		maLbEndColor.SelectEntry( Color( nTmp ) );
244*cdf0e10cSrcweir 	}
245*cdf0e10cSrcweir 
246*cdf0e10cSrcweir 	return 0;
247*cdf0e10cSrcweir }
248*cdf0e10cSrcweir 
249*cdf0e10cSrcweir /*************************************************************************
250*cdf0e10cSrcweir |*
251*cdf0e10cSrcweir |* Fuellt uebergebenen Item-Set mit Dialogbox-Attributen
252*cdf0e10cSrcweir |*
253*cdf0e10cSrcweir \************************************************************************/
254*cdf0e10cSrcweir 
255*cdf0e10cSrcweir void CopyDlg::GetAttr( SfxItemSet& rOutAttrs )
256*cdf0e10cSrcweir {
257*cdf0e10cSrcweir 	long nMoveX = Fraction( GetCoreValue( maMtrFldMoveX, SFX_MAPUNIT_100TH_MM) ) * maUIScale;
258*cdf0e10cSrcweir 	long nMoveY = Fraction( GetCoreValue( maMtrFldMoveY, SFX_MAPUNIT_100TH_MM) ) * maUIScale;
259*cdf0e10cSrcweir 	long nHeight = Fraction( GetCoreValue( maMtrFldHeight, SFX_MAPUNIT_100TH_MM) ) * maUIScale;
260*cdf0e10cSrcweir 	long nWidth  = Fraction( GetCoreValue( maMtrFldWidth, SFX_MAPUNIT_100TH_MM) ) * maUIScale;
261*cdf0e10cSrcweir 
262*cdf0e10cSrcweir 	rOutAttrs.Put( SfxUInt16Item( ATTR_COPY_NUMBER, (sal_uInt16) maNumFldCopies.GetValue() ) );
263*cdf0e10cSrcweir 	rOutAttrs.Put( SfxInt32Item( ATTR_COPY_MOVE_X, nMoveX ) );
264*cdf0e10cSrcweir 	rOutAttrs.Put( SfxInt32Item( ATTR_COPY_MOVE_Y, nMoveY ) );
265*cdf0e10cSrcweir 	rOutAttrs.Put( SfxInt32Item( ATTR_COPY_ANGLE, static_cast<sal_Int32>(maMtrFldAngle.GetValue()) ) );
266*cdf0e10cSrcweir 	rOutAttrs.Put( SfxInt32Item( ATTR_COPY_WIDTH, nWidth ) );
267*cdf0e10cSrcweir 	rOutAttrs.Put( SfxInt32Item( ATTR_COPY_HEIGHT, nHeight ) );
268*cdf0e10cSrcweir 
269*cdf0e10cSrcweir 	if( maLbStartColor.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND )
270*cdf0e10cSrcweir 	{
271*cdf0e10cSrcweir 		XColorItem aXColorItem( ATTR_COPY_START_COLOR, maLbStartColor.GetSelectEntry(),
272*cdf0e10cSrcweir 									maLbStartColor.GetSelectEntryColor() );
273*cdf0e10cSrcweir 		rOutAttrs.Put( aXColorItem );
274*cdf0e10cSrcweir 	}
275*cdf0e10cSrcweir 	if( maLbEndColor.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND )
276*cdf0e10cSrcweir 	{
277*cdf0e10cSrcweir 		XColorItem aXColorItem( ATTR_COPY_END_COLOR, maLbEndColor.GetSelectEntry(),
278*cdf0e10cSrcweir 									maLbEndColor.GetSelectEntryColor() );
279*cdf0e10cSrcweir 		rOutAttrs.Put( aXColorItem );
280*cdf0e10cSrcweir 	}
281*cdf0e10cSrcweir }
282*cdf0e10cSrcweir 
283*cdf0e10cSrcweir /*************************************************************************
284*cdf0e10cSrcweir |*
285*cdf0e10cSrcweir |* Enabled und selektiert Endfarben-LB
286*cdf0e10cSrcweir |*
287*cdf0e10cSrcweir \************************************************************************/
288*cdf0e10cSrcweir 
289*cdf0e10cSrcweir IMPL_LINK( CopyDlg, SelectColorHdl, void *, EMPTYARG )
290*cdf0e10cSrcweir {
291*cdf0e10cSrcweir 	sal_uInt16 nPos = maLbStartColor.GetSelectEntryPos();
292*cdf0e10cSrcweir 
293*cdf0e10cSrcweir 	if( nPos != LISTBOX_ENTRY_NOTFOUND &&
294*cdf0e10cSrcweir 		!maLbEndColor.IsEnabled() )
295*cdf0e10cSrcweir 	{
296*cdf0e10cSrcweir 		maLbEndColor.SelectEntryPos( nPos );
297*cdf0e10cSrcweir 		maLbEndColor.Enable();
298*cdf0e10cSrcweir 		maFtEndColor.Enable();
299*cdf0e10cSrcweir 	}
300*cdf0e10cSrcweir 	return 0;
301*cdf0e10cSrcweir }
302*cdf0e10cSrcweir 
303*cdf0e10cSrcweir /*************************************************************************
304*cdf0e10cSrcweir |* Setzt Werte der Selektion
305*cdf0e10cSrcweir \************************************************************************/
306*cdf0e10cSrcweir 
307*cdf0e10cSrcweir IMPL_LINK( CopyDlg, SetViewData, void*, EMPTYARG )
308*cdf0e10cSrcweir {
309*cdf0e10cSrcweir 	Rectangle aRect = mpView->GetAllMarkedRect();
310*cdf0e10cSrcweir 
311*cdf0e10cSrcweir 	SetMetricValue( maMtrFldMoveX, Fraction( aRect.GetWidth() ) /
312*cdf0e10cSrcweir 									maUIScale, SFX_MAPUNIT_100TH_MM);
313*cdf0e10cSrcweir 	SetMetricValue( maMtrFldMoveY, Fraction( aRect.GetHeight() ) /
314*cdf0e10cSrcweir 									maUIScale, SFX_MAPUNIT_100TH_MM);
315*cdf0e10cSrcweir 
316*cdf0e10cSrcweir 	// Farb-Attribut setzen
317*cdf0e10cSrcweir 	const SfxPoolItem*	pPoolItem = NULL;
318*cdf0e10cSrcweir 	if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_START_COLOR, sal_True, &pPoolItem ) )
319*cdf0e10cSrcweir 	{
320*cdf0e10cSrcweir 		Color aColor = ( ( const XColorItem* ) pPoolItem )->GetColorValue();
321*cdf0e10cSrcweir 		maLbStartColor.SelectEntry( aColor );
322*cdf0e10cSrcweir 	}
323*cdf0e10cSrcweir 
324*cdf0e10cSrcweir 	return 0;
325*cdf0e10cSrcweir }
326*cdf0e10cSrcweir 
327*cdf0e10cSrcweir /*************************************************************************
328*cdf0e10cSrcweir |* Setzt Werte auf Standard
329*cdf0e10cSrcweir \************************************************************************/
330*cdf0e10cSrcweir 
331*cdf0e10cSrcweir IMPL_LINK( CopyDlg, SetDefault, void*, EMPTYARG )
332*cdf0e10cSrcweir {
333*cdf0e10cSrcweir 	maNumFldCopies.SetValue( 1L );
334*cdf0e10cSrcweir 
335*cdf0e10cSrcweir 	long nValue = 500L;
336*cdf0e10cSrcweir 	SetMetricValue( maMtrFldMoveX, Fraction(nValue) / maUIScale, SFX_MAPUNIT_100TH_MM);
337*cdf0e10cSrcweir 	SetMetricValue( maMtrFldMoveY, Fraction(nValue) / maUIScale, SFX_MAPUNIT_100TH_MM);
338*cdf0e10cSrcweir 
339*cdf0e10cSrcweir 	nValue = 0L;
340*cdf0e10cSrcweir 	maMtrFldAngle.SetValue( nValue );
341*cdf0e10cSrcweir 	SetMetricValue( maMtrFldWidth, Fraction(nValue) / maUIScale, SFX_MAPUNIT_100TH_MM);
342*cdf0e10cSrcweir 	SetMetricValue( maMtrFldHeight, Fraction(nValue) / maUIScale, SFX_MAPUNIT_100TH_MM);
343*cdf0e10cSrcweir 
344*cdf0e10cSrcweir 	// Farb-Attribut setzen
345*cdf0e10cSrcweir 	const SfxPoolItem*	pPoolItem = NULL;
346*cdf0e10cSrcweir 	if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_START_COLOR, sal_True, &pPoolItem ) )
347*cdf0e10cSrcweir 	{
348*cdf0e10cSrcweir 		Color aColor = ( ( const XColorItem* ) pPoolItem )->GetColorValue();
349*cdf0e10cSrcweir 		maLbStartColor.SelectEntry( aColor );
350*cdf0e10cSrcweir 		maLbEndColor.SelectEntry( aColor );
351*cdf0e10cSrcweir 	}
352*cdf0e10cSrcweir 
353*cdf0e10cSrcweir 	return 0;
354*cdf0e10cSrcweir }
355*cdf0e10cSrcweir 
356*cdf0e10cSrcweir 
357*cdf0e10cSrcweir } // end of namespace sd
358