15b190011SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
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
105b190011SAndrew Rist *
115b190011SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
125b190011SAndrew Rist *
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.
195b190011SAndrew Rist *
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 |*
58cdf0e10cSrcweir |* Dialog zum Kopieren von Objekten
59cdf0e10cSrcweir |*
60cdf0e10cSrcweir \************************************************************************/
61cdf0e10cSrcweir
CopyDlg(::Window * pWindow,const SfxItemSet & rInAttrs,XColorListSharedPtr aColTab,::sd::View * pInView)62cdf0e10cSrcweir CopyDlg::CopyDlg(
63cdf0e10cSrcweir ::Window* pWindow,
64cdf0e10cSrcweir const SfxItemSet& rInAttrs,
65*c7be74b1SArmin Le Grand XColorListSharedPtr aColTab,
66cdf0e10cSrcweir ::sd::View* pInView )
67cdf0e10cSrcweir : SfxModalDialog ( pWindow, SdResId( DLG_COPY ) ),
68cdf0e10cSrcweir maFtCopies ( this, SdResId( FT_COPIES ) ),
69cdf0e10cSrcweir maNumFldCopies ( this, SdResId( NUM_FLD_COPIES ) ),
70cdf0e10cSrcweir maBtnSetViewData ( this, SdResId( BTN_SET_VIEWDATA ) ),
71cdf0e10cSrcweir maGrpMovement ( this, SdResId( GRP_MOVEMENT ) ),
72cdf0e10cSrcweir maFtMoveX ( this, SdResId( FT_MOVE_X ) ),
73cdf0e10cSrcweir maMtrFldMoveX ( this, SdResId( MTR_FLD_MOVE_X ) ),
74cdf0e10cSrcweir maFtMoveY ( this, SdResId( FT_MOVE_Y ) ),
75cdf0e10cSrcweir maMtrFldMoveY ( this, SdResId( MTR_FLD_MOVE_Y ) ),
76cdf0e10cSrcweir maFtAngle ( this, SdResId( FT_ANGLE ) ),
77cdf0e10cSrcweir maMtrFldAngle ( this, SdResId( MTR_FLD_ANGLE ) ),
78cdf0e10cSrcweir maGrpEnlargement ( this, SdResId( GRP_ENLARGEMENT ) ),
79cdf0e10cSrcweir maFtWidth ( this, SdResId( FT_WIDTH ) ),
80cdf0e10cSrcweir maMtrFldWidth ( this, SdResId( MTR_FLD_WIDTH ) ),
81cdf0e10cSrcweir maFtHeight ( this, SdResId( FT_HEIGHT ) ),
82cdf0e10cSrcweir maMtrFldHeight ( this, SdResId( MTR_FLD_HEIGHT ) ),
83cdf0e10cSrcweir maGrpColor ( this, SdResId( GRP_COLOR ) ),
84cdf0e10cSrcweir maFtStartColor ( this, SdResId( FT_START_COLOR ) ),
85cdf0e10cSrcweir maLbStartColor ( this, SdResId( LB_START_COLOR ) ),
86cdf0e10cSrcweir maFtEndColor ( this, SdResId( FT_END_COLOR ) ),
87cdf0e10cSrcweir maLbEndColor ( this, SdResId( LB_END_COLOR ) ),
88cdf0e10cSrcweir maBtnOK ( this, SdResId( BTN_OK ) ),
89cdf0e10cSrcweir maBtnCancel ( this, SdResId( BTN_CANCEL ) ),
90cdf0e10cSrcweir maBtnHelp ( this, SdResId( BTN_HELP ) ),
91cdf0e10cSrcweir maBtnSetDefault ( this, SdResId( BTN_SET_DEFAULT ) ),
92cdf0e10cSrcweir mrOutAttrs ( rInAttrs ),
93*c7be74b1SArmin Le Grand maColorTab ( aColTab ),
94cdf0e10cSrcweir maUIScale(pInView->GetDoc()->GetUIScale()),
95cdf0e10cSrcweir mpView ( pInView )
96cdf0e10cSrcweir {
97cdf0e10cSrcweir FreeResource();
98cdf0e10cSrcweir
99cdf0e10cSrcweir // Set up the view data button (image and accessible name).
100cdf0e10cSrcweir maBtnSetViewData.SetModeImage( Image( SdResId( IMG_PIPETTE_H ) ), BMP_COLOR_HIGHCONTRAST );
101cdf0e10cSrcweir maBtnSetViewData.SetAccessibleName (maBtnSetViewData.GetQuickHelpText());
102cdf0e10cSrcweir
103cdf0e10cSrcweir // Farbtabellen
104*c7be74b1SArmin Le Grand DBG_ASSERT( maColorTab.get(), "Keine gueltige ColorTable uebergeben!" );
105*c7be74b1SArmin Le Grand maLbStartColor.Fill( maColorTab );
106cdf0e10cSrcweir maLbEndColor.CopyEntries( maLbStartColor );
107cdf0e10cSrcweir
108cdf0e10cSrcweir maLbStartColor.SetSelectHdl( LINK( this, CopyDlg, SelectColorHdl ) );
109cdf0e10cSrcweir maBtnSetViewData.SetClickHdl( LINK( this, CopyDlg, SetViewData ) );
110cdf0e10cSrcweir maBtnSetDefault.SetClickHdl( LINK( this, CopyDlg, SetDefault ) );
111cdf0e10cSrcweir
112cdf0e10cSrcweir
113cdf0e10cSrcweir FieldUnit eFUnit( SfxModule::GetCurrentFieldUnit() );
114cdf0e10cSrcweir
115cdf0e10cSrcweir SetFieldUnit( maMtrFldMoveX, eFUnit, sal_True );
116cdf0e10cSrcweir SetFieldUnit( maMtrFldMoveY, eFUnit, sal_True );
117cdf0e10cSrcweir SetFieldUnit( maMtrFldWidth, eFUnit, sal_True );
118cdf0e10cSrcweir SetFieldUnit( maMtrFldHeight, eFUnit, sal_True );
119cdf0e10cSrcweir
120cdf0e10cSrcweir Reset(0L);
121cdf0e10cSrcweir }
122cdf0e10cSrcweir
123cdf0e10cSrcweir /*************************************************************************
124cdf0e10cSrcweir |*
125cdf0e10cSrcweir |* Dtor
126cdf0e10cSrcweir |*
127cdf0e10cSrcweir \************************************************************************/
128cdf0e10cSrcweir
~CopyDlg()129cdf0e10cSrcweir CopyDlg::~CopyDlg()
130cdf0e10cSrcweir {
131cdf0e10cSrcweir String& rStr = GetExtraData();
132cdf0e10cSrcweir
133cdf0e10cSrcweir rStr = UniString::CreateFromInt64( maNumFldCopies.GetValue() );
134cdf0e10cSrcweir rStr.Append( TOKEN );
135cdf0e10cSrcweir
136cdf0e10cSrcweir rStr += UniString::CreateFromInt64( maMtrFldMoveX.GetValue() );
137cdf0e10cSrcweir rStr.Append( TOKEN );
138cdf0e10cSrcweir
139cdf0e10cSrcweir rStr += UniString::CreateFromInt64( maMtrFldMoveY.GetValue() );
140cdf0e10cSrcweir rStr.Append( TOKEN );
141cdf0e10cSrcweir
142cdf0e10cSrcweir rStr += UniString::CreateFromInt64( maMtrFldAngle.GetValue() );
143cdf0e10cSrcweir rStr.Append( TOKEN );
144cdf0e10cSrcweir
145cdf0e10cSrcweir rStr += UniString::CreateFromInt64( maMtrFldWidth.GetValue() );
146cdf0e10cSrcweir rStr.Append( TOKEN );
147cdf0e10cSrcweir
148cdf0e10cSrcweir rStr += UniString::CreateFromInt64( maMtrFldHeight.GetValue() );
149cdf0e10cSrcweir rStr.Append( TOKEN );
150cdf0e10cSrcweir
151cdf0e10cSrcweir rStr += UniString::CreateFromInt32( (long)maLbStartColor.GetSelectEntryColor().GetColor() );
152cdf0e10cSrcweir rStr.Append( TOKEN );
153cdf0e10cSrcweir
154cdf0e10cSrcweir rStr += UniString::CreateFromInt32( (long)maLbEndColor.GetSelectEntryColor().GetColor() );
155cdf0e10cSrcweir }
156cdf0e10cSrcweir
157cdf0e10cSrcweir /*************************************************************************
158cdf0e10cSrcweir |*
159cdf0e10cSrcweir |* Liest uebergebenen Item-Set oder wertet den INI-String aus
160cdf0e10cSrcweir |*
161cdf0e10cSrcweir \************************************************************************/
162cdf0e10cSrcweir
IMPL_LINK(CopyDlg,Reset,void *,EMPTYARG)163cdf0e10cSrcweir IMPL_LINK( CopyDlg, Reset, void*, EMPTYARG )
164cdf0e10cSrcweir {
165cdf0e10cSrcweir const SfxPoolItem* pPoolItem = NULL;
166cdf0e10cSrcweir String aStr( GetExtraData() );
167cdf0e10cSrcweir
168cdf0e10cSrcweir if( aStr.GetTokenCount( TOKEN ) < 8 )
169cdf0e10cSrcweir {
170cdf0e10cSrcweir if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_NUMBER, sal_True, &pPoolItem ) )
171cdf0e10cSrcweir maNumFldCopies.SetValue( ( ( const SfxUInt16Item* ) pPoolItem )->GetValue() );
172cdf0e10cSrcweir else
173cdf0e10cSrcweir maNumFldCopies.SetValue( 1L );
174cdf0e10cSrcweir
175cdf0e10cSrcweir long nMoveX = 500L;
176cdf0e10cSrcweir if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_MOVE_X, sal_True, &pPoolItem ) )
177cdf0e10cSrcweir nMoveX = ( ( ( const SfxInt32Item* ) pPoolItem )->GetValue() );
178cdf0e10cSrcweir SetMetricValue( maMtrFldMoveX, Fraction(nMoveX) / maUIScale, SFX_MAPUNIT_100TH_MM);
179cdf0e10cSrcweir
180cdf0e10cSrcweir long nMoveY = 500L;
181cdf0e10cSrcweir if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_MOVE_Y, sal_True, &pPoolItem ) )
182cdf0e10cSrcweir nMoveY = ( ( ( const SfxInt32Item* ) pPoolItem )->GetValue() );
183cdf0e10cSrcweir SetMetricValue( maMtrFldMoveY, Fraction(nMoveY) / maUIScale, SFX_MAPUNIT_100TH_MM);
184cdf0e10cSrcweir
185cdf0e10cSrcweir if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_ANGLE, sal_True, &pPoolItem ) )
186cdf0e10cSrcweir maMtrFldAngle.SetValue( ( ( const SfxInt32Item* ) pPoolItem )->GetValue() );
187cdf0e10cSrcweir else
188cdf0e10cSrcweir maMtrFldAngle.SetValue( 0L );
189cdf0e10cSrcweir
190cdf0e10cSrcweir long nWidth = 0L;
191cdf0e10cSrcweir if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_WIDTH, sal_True, &pPoolItem ) )
192cdf0e10cSrcweir nWidth = ( ( ( const SfxInt32Item* ) pPoolItem )->GetValue() );
193cdf0e10cSrcweir SetMetricValue( maMtrFldWidth, Fraction(nWidth) / maUIScale, SFX_MAPUNIT_100TH_MM);
194cdf0e10cSrcweir
195cdf0e10cSrcweir long nHeight = 0L;
196cdf0e10cSrcweir if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_HEIGHT, sal_True, &pPoolItem ) )
197cdf0e10cSrcweir nHeight = ( ( ( const SfxInt32Item* ) pPoolItem )->GetValue() );
198cdf0e10cSrcweir SetMetricValue( maMtrFldHeight, Fraction(nHeight) / maUIScale, SFX_MAPUNIT_100TH_MM);
199cdf0e10cSrcweir
200cdf0e10cSrcweir if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_START_COLOR, sal_True, &pPoolItem ) )
201cdf0e10cSrcweir {
202cdf0e10cSrcweir Color aColor = ( ( const XColorItem* ) pPoolItem )->GetColorValue();
203cdf0e10cSrcweir maLbStartColor.SelectEntry( aColor );
204cdf0e10cSrcweir maLbEndColor.SelectEntry( aColor );
205cdf0e10cSrcweir }
206cdf0e10cSrcweir else
207cdf0e10cSrcweir {
208cdf0e10cSrcweir maLbStartColor.SetNoSelection();
209cdf0e10cSrcweir maLbEndColor.SetNoSelection();
210cdf0e10cSrcweir maLbEndColor.Disable();
211cdf0e10cSrcweir maFtEndColor.Disable();
212cdf0e10cSrcweir }
213cdf0e10cSrcweir }
214cdf0e10cSrcweir else
215cdf0e10cSrcweir {
216cdf0e10cSrcweir long nTmp;
217cdf0e10cSrcweir nTmp = (long)aStr.GetToken( 0, TOKEN ).ToInt32();
218cdf0e10cSrcweir maNumFldCopies.SetValue( nTmp );
219cdf0e10cSrcweir
220cdf0e10cSrcweir nTmp = (long)aStr.GetToken( 1, TOKEN ).ToInt32();
221cdf0e10cSrcweir maMtrFldMoveX.SetValue( nTmp );
222cdf0e10cSrcweir
223cdf0e10cSrcweir nTmp = (long)aStr.GetToken( 2, TOKEN ).ToInt32();
224cdf0e10cSrcweir maMtrFldMoveY.SetValue( nTmp );
225cdf0e10cSrcweir
226cdf0e10cSrcweir nTmp = (long)aStr.GetToken( 3, TOKEN ).ToInt32();
227cdf0e10cSrcweir maMtrFldAngle.SetValue( nTmp );
228cdf0e10cSrcweir
229cdf0e10cSrcweir nTmp = (long)aStr.GetToken( 4, TOKEN ).ToInt32();
230cdf0e10cSrcweir maMtrFldWidth.SetValue( nTmp );
231cdf0e10cSrcweir
232cdf0e10cSrcweir nTmp = (long)aStr.GetToken( 5, TOKEN ).ToInt32();
233cdf0e10cSrcweir maMtrFldHeight.SetValue( nTmp );
234cdf0e10cSrcweir
235cdf0e10cSrcweir nTmp = (long)aStr.GetToken( 6, TOKEN ).ToInt32();
236cdf0e10cSrcweir maLbStartColor.SelectEntry( Color( nTmp ) );
237cdf0e10cSrcweir
238cdf0e10cSrcweir nTmp = (long)aStr.GetToken( 7, TOKEN ).ToInt32();
239cdf0e10cSrcweir maLbEndColor.SelectEntry( Color( nTmp ) );
240cdf0e10cSrcweir }
241cdf0e10cSrcweir
242cdf0e10cSrcweir return 0;
243cdf0e10cSrcweir }
244cdf0e10cSrcweir
245cdf0e10cSrcweir /*************************************************************************
246cdf0e10cSrcweir |*
247cdf0e10cSrcweir |* Fuellt uebergebenen Item-Set mit Dialogbox-Attributen
248cdf0e10cSrcweir |*
249cdf0e10cSrcweir \************************************************************************/
250cdf0e10cSrcweir
GetAttr(SfxItemSet & rOutAttrs)251cdf0e10cSrcweir void CopyDlg::GetAttr( SfxItemSet& rOutAttrs )
252cdf0e10cSrcweir {
253cdf0e10cSrcweir long nMoveX = Fraction( GetCoreValue( maMtrFldMoveX, SFX_MAPUNIT_100TH_MM) ) * maUIScale;
254cdf0e10cSrcweir long nMoveY = Fraction( GetCoreValue( maMtrFldMoveY, SFX_MAPUNIT_100TH_MM) ) * maUIScale;
255cdf0e10cSrcweir long nHeight = Fraction( GetCoreValue( maMtrFldHeight, SFX_MAPUNIT_100TH_MM) ) * maUIScale;
256cdf0e10cSrcweir long nWidth = Fraction( GetCoreValue( maMtrFldWidth, SFX_MAPUNIT_100TH_MM) ) * maUIScale;
257cdf0e10cSrcweir
258cdf0e10cSrcweir rOutAttrs.Put( SfxUInt16Item( ATTR_COPY_NUMBER, (sal_uInt16) maNumFldCopies.GetValue() ) );
259cdf0e10cSrcweir rOutAttrs.Put( SfxInt32Item( ATTR_COPY_MOVE_X, nMoveX ) );
260cdf0e10cSrcweir rOutAttrs.Put( SfxInt32Item( ATTR_COPY_MOVE_Y, nMoveY ) );
261cdf0e10cSrcweir rOutAttrs.Put( SfxInt32Item( ATTR_COPY_ANGLE, static_cast<sal_Int32>(maMtrFldAngle.GetValue()) ) );
262cdf0e10cSrcweir rOutAttrs.Put( SfxInt32Item( ATTR_COPY_WIDTH, nWidth ) );
263cdf0e10cSrcweir rOutAttrs.Put( SfxInt32Item( ATTR_COPY_HEIGHT, nHeight ) );
264cdf0e10cSrcweir
265cdf0e10cSrcweir if( maLbStartColor.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND )
266cdf0e10cSrcweir {
267cdf0e10cSrcweir XColorItem aXColorItem( ATTR_COPY_START_COLOR, maLbStartColor.GetSelectEntry(),
268cdf0e10cSrcweir maLbStartColor.GetSelectEntryColor() );
269cdf0e10cSrcweir rOutAttrs.Put( aXColorItem );
270cdf0e10cSrcweir }
271cdf0e10cSrcweir if( maLbEndColor.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND )
272cdf0e10cSrcweir {
273cdf0e10cSrcweir XColorItem aXColorItem( ATTR_COPY_END_COLOR, maLbEndColor.GetSelectEntry(),
274cdf0e10cSrcweir maLbEndColor.GetSelectEntryColor() );
275cdf0e10cSrcweir rOutAttrs.Put( aXColorItem );
276cdf0e10cSrcweir }
277cdf0e10cSrcweir }
278cdf0e10cSrcweir
279cdf0e10cSrcweir /*************************************************************************
280cdf0e10cSrcweir |*
281cdf0e10cSrcweir |* Enabled und selektiert Endfarben-LB
282cdf0e10cSrcweir |*
283cdf0e10cSrcweir \************************************************************************/
284cdf0e10cSrcweir
IMPL_LINK(CopyDlg,SelectColorHdl,void *,EMPTYARG)285cdf0e10cSrcweir IMPL_LINK( CopyDlg, SelectColorHdl, void *, EMPTYARG )
286cdf0e10cSrcweir {
287cdf0e10cSrcweir sal_uInt16 nPos = maLbStartColor.GetSelectEntryPos();
288cdf0e10cSrcweir
289cdf0e10cSrcweir if( nPos != LISTBOX_ENTRY_NOTFOUND &&
290cdf0e10cSrcweir !maLbEndColor.IsEnabled() )
291cdf0e10cSrcweir {
292cdf0e10cSrcweir maLbEndColor.SelectEntryPos( nPos );
293cdf0e10cSrcweir maLbEndColor.Enable();
294cdf0e10cSrcweir maFtEndColor.Enable();
295cdf0e10cSrcweir }
296cdf0e10cSrcweir return 0;
297cdf0e10cSrcweir }
298cdf0e10cSrcweir
299cdf0e10cSrcweir /*************************************************************************
300cdf0e10cSrcweir |* Setzt Werte der Selektion
301cdf0e10cSrcweir \************************************************************************/
302cdf0e10cSrcweir
IMPL_LINK(CopyDlg,SetViewData,void *,EMPTYARG)303cdf0e10cSrcweir IMPL_LINK( CopyDlg, SetViewData, void*, EMPTYARG )
304cdf0e10cSrcweir {
305cdf0e10cSrcweir Rectangle aRect = mpView->GetAllMarkedRect();
306cdf0e10cSrcweir
307cdf0e10cSrcweir SetMetricValue( maMtrFldMoveX, Fraction( aRect.GetWidth() ) /
308cdf0e10cSrcweir maUIScale, SFX_MAPUNIT_100TH_MM);
309cdf0e10cSrcweir SetMetricValue( maMtrFldMoveY, Fraction( aRect.GetHeight() ) /
310cdf0e10cSrcweir maUIScale, SFX_MAPUNIT_100TH_MM);
311cdf0e10cSrcweir
312cdf0e10cSrcweir // Farb-Attribut setzen
313cdf0e10cSrcweir const SfxPoolItem* pPoolItem = NULL;
314cdf0e10cSrcweir if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_START_COLOR, sal_True, &pPoolItem ) )
315cdf0e10cSrcweir {
316cdf0e10cSrcweir Color aColor = ( ( const XColorItem* ) pPoolItem )->GetColorValue();
317cdf0e10cSrcweir maLbStartColor.SelectEntry( aColor );
318cdf0e10cSrcweir }
319cdf0e10cSrcweir
320cdf0e10cSrcweir return 0;
321cdf0e10cSrcweir }
322cdf0e10cSrcweir
323cdf0e10cSrcweir /*************************************************************************
324cdf0e10cSrcweir |* Setzt Werte auf Standard
325cdf0e10cSrcweir \************************************************************************/
326cdf0e10cSrcweir
IMPL_LINK(CopyDlg,SetDefault,void *,EMPTYARG)327cdf0e10cSrcweir IMPL_LINK( CopyDlg, SetDefault, void*, EMPTYARG )
328cdf0e10cSrcweir {
329cdf0e10cSrcweir maNumFldCopies.SetValue( 1L );
330cdf0e10cSrcweir
331cdf0e10cSrcweir long nValue = 500L;
332cdf0e10cSrcweir SetMetricValue( maMtrFldMoveX, Fraction(nValue) / maUIScale, SFX_MAPUNIT_100TH_MM);
333cdf0e10cSrcweir SetMetricValue( maMtrFldMoveY, Fraction(nValue) / maUIScale, SFX_MAPUNIT_100TH_MM);
334cdf0e10cSrcweir
335cdf0e10cSrcweir nValue = 0L;
336cdf0e10cSrcweir maMtrFldAngle.SetValue( nValue );
337cdf0e10cSrcweir SetMetricValue( maMtrFldWidth, Fraction(nValue) / maUIScale, SFX_MAPUNIT_100TH_MM);
338cdf0e10cSrcweir SetMetricValue( maMtrFldHeight, Fraction(nValue) / maUIScale, SFX_MAPUNIT_100TH_MM);
339cdf0e10cSrcweir
340cdf0e10cSrcweir // Farb-Attribut setzen
341cdf0e10cSrcweir const SfxPoolItem* pPoolItem = NULL;
342cdf0e10cSrcweir if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_START_COLOR, sal_True, &pPoolItem ) )
343cdf0e10cSrcweir {
344cdf0e10cSrcweir Color aColor = ( ( const XColorItem* ) pPoolItem )->GetColorValue();
345cdf0e10cSrcweir maLbStartColor.SelectEntry( aColor );
346cdf0e10cSrcweir maLbEndColor.SelectEntry( aColor );
347cdf0e10cSrcweir }
348cdf0e10cSrcweir
349cdf0e10cSrcweir return 0;
350cdf0e10cSrcweir }
351cdf0e10cSrcweir
352cdf0e10cSrcweir
353cdf0e10cSrcweir } // end of namespace sd
354