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