update credits
[LibreOffice.git] / cui / source / tabpages / labdlg.cxx
blob819dd2a2d1e8249cfc499572d7118cdebf122f32
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <comphelper/string.hxx>
21 #include <tools/shl.hxx>
22 #include <sfx2/app.hxx>
23 #include <sfx2/module.hxx>
24 #include <swpossizetabpage.hxx>
25 #include <svx/dialogs.hrc>
27 #include <svx/svdattrx.hxx>
28 #include <cuires.hrc>
29 #include <dialmgr.hxx>
30 #include "svx/dlgutil.hxx"
31 #include "transfrm.hxx"
33 #include "labdlg.hrc"
34 #include "labdlg.hxx"
36 // define ----------------------------------------------------------------
38 #define AZ_OPTIMAL 0
39 #define AZ_VON_OBEN 1
40 #define AZ_VON_LINKS 2
41 #define AZ_HORIZONTAL 3
42 #define AZ_VERTIKAL 4
44 #define AT_OBEN 0
45 #define AT_MITTE 1
46 #define AT_UNTEN 2
48 #define WK_OPTIMAL 0
49 #define WK_30 1
50 #define WK_45 2
51 #define WK_60 3
52 #define WK_90 4
54 // static ----------------------------------------------------------------
56 static sal_uInt16 pCaptionRanges[] =
58 SDRATTR_CAPTIONTYPE,
59 SDRATTR_CAPTIONFIXEDANGLE,
60 SDRATTR_CAPTIONANGLE,
61 SDRATTR_CAPTIONGAP,
62 SDRATTR_CAPTIONESCDIR,
63 SDRATTR_CAPTIONESCISREL,
64 SDRATTR_CAPTIONESCREL,
65 SDRATTR_CAPTIONESCABS,
66 SDRATTR_CAPTIONLINELEN,
67 SDRATTR_CAPTIONFITLINELEN,
71 // -----------------------------------------------------------------------
73 SvxCaptionTabPage::SvxCaptionTabPage(Window* pParent, const SfxItemSet& rInAttrs)
74 : SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_CAPTION ), rInAttrs ),
76 aCT_CAPTTYPE( this, CUI_RES( CT_CAPTTYPE ) ),
77 aFT_ABSTAND( this, CUI_RES( FT_ABSTAND ) ),
78 aMF_ABSTAND( this, CUI_RES( MF_ABSTAND ) ),
79 aFT_WINKEL( this, CUI_RES( FT_WINKEL ) ),
80 aLB_WINKEL( this, CUI_RES( LB_WINKEL ) ),
81 aFT_ANSATZ( this, CUI_RES( FT_ANSATZ ) ),
82 aLB_ANSATZ( this, CUI_RES( LB_ANSATZ ) ),
83 aFT_UM( this, CUI_RES( FT_UM ) ),
84 aMF_ANSATZ( this, CUI_RES( MF_ANSATZ ) ),
85 aFT_ANSATZ_REL( this, CUI_RES( FT_ANSATZ_REL ) ),
86 aLB_ANSATZ_REL( this, CUI_RES( LB_ANSATZ_REL ) ),
87 aFT_LAENGE( this, CUI_RES( FT_LAENGE ) ),
88 aMF_LAENGE( this, CUI_RES( MF_LAENGE ) ),
89 aCB_LAENGE( this, CUI_RES( CB_LAENGE ) ),
91 aStrHorzList( CUI_RES(STR_HORZ_LIST) ),
92 aStrVertList( CUI_RES(STR_VERT_LIST) ),
94 rOutAttrs ( rInAttrs )
96 //------------NYI-------------------------------------------
97 aFT_WINKEL.Hide();
98 aLB_WINKEL.Hide();
100 //------------correct positions-------------------------
101 aFT_ANSATZ_REL.SetPosPixel( aFT_UM.GetPosPixel() );
102 aLB_ANSATZ_REL.SetPosPixel(
103 Point(
104 aFT_ANSATZ_REL.GetPosPixel().X()+aFT_ANSATZ_REL.GetSizePixel().Width()+6,
105 aLB_ANSATZ.GetPosPixel().Y() )
108 aMF_ANSATZ.SetPosPixel(
109 Point(
110 aFT_UM.GetPosPixel().X()+aFT_UM.GetSizePixel().Width()+6,
111 aLB_ANSATZ.GetPosPixel().Y() )
114 sal_uInt16 nBitmap;
115 for( nBitmap = 0; nBitmap < CAPTYPE_BITMAPS_COUNT; nBitmap++ )
116 mpBmpCapTypes[nBitmap] = new Image(Bitmap(CUI_RES(BMP_CAPTTYPE_1 + nBitmap)), COL_LIGHTMAGENTA );
118 //------------install ValueSet--------------------------
119 aCT_CAPTTYPE.SetStyle( aCT_CAPTTYPE.GetStyle() | WB_ITEMBORDER | WB_DOUBLEBORDER | WB_NAMEFIELD );
120 aCT_CAPTTYPE.SetColCount(5);//XXX
121 aCT_CAPTTYPE.SetLineCount(1);
122 aCT_CAPTTYPE.SetSelectHdl(LINK( this, SvxCaptionTabPage, SelectCaptTypeHdl_Impl));
124 Image aImage;
125 aCT_CAPTTYPE.InsertItem(BMP_CAPTTYPE_1, aImage, String(CUI_RES(STR_CAPTTYPE_1)));
126 aCT_CAPTTYPE.InsertItem(BMP_CAPTTYPE_2, aImage, String(CUI_RES(STR_CAPTTYPE_2)));
127 aCT_CAPTTYPE.InsertItem(BMP_CAPTTYPE_3, aImage, String(CUI_RES(STR_CAPTTYPE_3)));
129 FillValueSet();
131 aLB_ANSATZ.SetSelectHdl(LINK(this,SvxCaptionTabPage,AnsatzSelectHdl_Impl));
132 aLB_ANSATZ_REL.SetSelectHdl(LINK(this,SvxCaptionTabPage,AnsatzRelSelectHdl_Impl));
133 aCB_LAENGE.SetClickHdl(LINK(this,SvxCaptionTabPage,LineOptHdl_Impl));
135 FreeResource();
138 // -----------------------------------------------------------------------
140 SvxCaptionTabPage::~SvxCaptionTabPage()
142 sal_uInt16 nBitmap;
143 for( nBitmap = 0; nBitmap < CAPTYPE_BITMAPS_COUNT; nBitmap++ )
144 delete mpBmpCapTypes[nBitmap];
147 // -----------------------------------------------------------------------
149 void SvxCaptionTabPage::Construct()
151 // set rectangle and working area
152 DBG_ASSERT( pView, "Keine gueltige View Uebergeben!" );
155 // -----------------------------------------------------------------------
157 sal_Bool SvxCaptionTabPage::FillItemSet( SfxItemSet& _rOutAttrs)
159 SfxItemPool* pPool = _rOutAttrs.GetPool();
160 DBG_ASSERT( pPool, "Wo ist der Pool" );
162 SfxMapUnit eUnit;
164 nCaptionType = aCT_CAPTTYPE.GetSelectItemId()-1;
166 _rOutAttrs.Put( SdrCaptionTypeItem( (SdrCaptionType) nCaptionType ) );
168 if( aMF_ABSTAND.IsValueModified() )
170 eUnit = pPool->GetMetric( GetWhich( SDRATTR_CAPTIONGAP ) );
171 _rOutAttrs.Put( SdrCaptionGapItem( GetCoreValue(aMF_ABSTAND, eUnit ) ) );
174 // special treatment!!! XXX
175 if( nCaptionType==SDRCAPT_TYPE1 )
177 switch( nEscDir )
179 case SDRCAPT_ESCHORIZONTAL: nEscDir=SDRCAPT_ESCVERTICAL;break;
180 case SDRCAPT_ESCVERTICAL: nEscDir=SDRCAPT_ESCHORIZONTAL;break;
184 _rOutAttrs.Put( SdrCaptionEscDirItem( (SdrCaptionEscDir)nEscDir ) );
186 bEscRel = aLB_ANSATZ_REL.IsVisible();
187 _rOutAttrs.Put( SdrCaptionEscIsRelItem( bEscRel ) );
189 if( bEscRel )
191 long nVal = 0;
193 switch( aLB_ANSATZ_REL.GetSelectEntryPos() )
195 case AT_OBEN: nVal=0;break;
196 case AT_MITTE: nVal=5000;break;
197 case AT_UNTEN: nVal=10000;break;
199 _rOutAttrs.Put( SdrCaptionEscRelItem( nVal ) );
201 else
203 if( aMF_ANSATZ.IsValueModified() )
205 eUnit = pPool->GetMetric( GetWhich( SDRATTR_CAPTIONESCABS ) );
206 _rOutAttrs.Put( SdrCaptionEscAbsItem( GetCoreValue(aMF_ANSATZ, eUnit ) ) );
210 bFitLineLen = aCB_LAENGE.IsChecked();
211 _rOutAttrs.Put( SdrCaptionFitLineLenItem( bFitLineLen ) );
213 if( ! bFitLineLen )
215 if( aMF_LAENGE.IsValueModified() )
217 eUnit = pPool->GetMetric( GetWhich( SDRATTR_CAPTIONLINELEN ) );
218 _rOutAttrs.Put( SdrCaptionLineLenItem( GetCoreValue(aMF_LAENGE, eUnit ) ) );
222 //NYI-------------the angles have to be added here!!! XXX----------------------
224 return( sal_True );
227 // -----------------------------------------------------------------------
229 void SvxCaptionTabPage::Reset( const SfxItemSet& )
232 //------------set metric-----------------------------
234 FieldUnit eFUnit = GetModuleFieldUnit( rOutAttrs );
236 switch ( eFUnit )
238 case FUNIT_CM:
239 case FUNIT_M:
240 case FUNIT_KM:
241 eFUnit = FUNIT_MM;
242 break;
243 default: ;//prevent warning
245 SetFieldUnit( aMF_ABSTAND, eFUnit );
246 SetFieldUnit( aMF_ANSATZ, eFUnit );
247 SetFieldUnit( aMF_LAENGE, eFUnit );
249 SfxItemPool* pPool = rOutAttrs.GetPool();
250 DBG_ASSERT( pPool, "Wo ist der Pool" );
252 sal_uInt16 nWhich;
253 SfxMapUnit eUnit;
255 //------- angle ----------
256 nWhich = GetWhich( SDRATTR_CAPTIONANGLE );
257 nFixedAngle = ( ( const SdrCaptionAngleItem& ) rOutAttrs.Get( nWhich ) ).GetValue();
259 nWhich = GetWhich( SDRATTR_CAPTIONESCABS );
260 eUnit = pPool->GetMetric( nWhich );
261 nEscAbs = ( ( const SdrCaptionEscAbsItem& ) rOutAttrs.Get( nWhich ) ).GetValue();
262 SetMetricValue( aMF_ANSATZ, nEscAbs, eUnit );
263 nEscAbs = static_cast<long>(aMF_ANSATZ.GetValue());
265 nWhich = GetWhich( SDRATTR_CAPTIONESCREL );
266 nEscRel = (long)( ( const SdrCaptionEscRelItem& ) rOutAttrs.Get( nWhich ) ).GetValue();
268 //------- line length ----------
269 nWhich = GetWhich( SDRATTR_CAPTIONLINELEN );
270 eUnit = pPool->GetMetric( nWhich );
271 nLineLen = ( ( const SdrCaptionLineLenItem& ) rOutAttrs.Get( nWhich ) ).GetValue();
272 SetMetricValue( aMF_LAENGE, nLineLen, eUnit );
273 nLineLen = static_cast<long>(aMF_LAENGE.GetValue());
275 //------- distance to box ----------
276 nWhich = GetWhich( SDRATTR_CAPTIONGAP );
277 eUnit = pPool->GetMetric( nWhich );
278 nGap = ( ( const SdrCaptionGapItem& ) rOutAttrs.Get( nWhich ) ).GetValue();
279 SetMetricValue( aMF_ABSTAND, nGap, eUnit );
280 nGap = static_cast<long>(aMF_ABSTAND.GetValue());
282 nCaptionType = (short)( ( const SdrCaptionTypeItem& ) rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONTYPE ) ) ).GetValue();
283 bFixedAngle = ( ( const SfxBoolItem& ) rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONFIXEDANGLE ) ) ).GetValue();
284 bFitLineLen = ( ( const SfxBoolItem& ) rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONFITLINELEN ) ) ).GetValue();
285 nEscDir = (short)( ( const SdrCaptionEscDirItem& ) rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCDIR ) ) ).GetValue();
286 bEscRel = ( ( const SfxBoolItem& ) rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCISREL ) ) ).GetValue();
288 // special treatment!!! XXX
289 if( nCaptionType==SDRCAPT_TYPE1 )
291 switch( nEscDir )
293 case SDRCAPT_ESCHORIZONTAL: nEscDir=SDRCAPT_ESCVERTICAL;break;
294 case SDRCAPT_ESCVERTICAL: nEscDir=SDRCAPT_ESCHORIZONTAL;break;
298 nAnsatzRelPos=AT_MITTE;
299 nAnsatzTypePos=AZ_OPTIMAL;
300 nWinkelTypePos=WK_OPTIMAL;
302 aMF_ABSTAND.SetValue( nGap );
304 if( nEscDir == SDRCAPT_ESCHORIZONTAL )
306 if( bEscRel )
308 if( nEscRel < 3333 )
309 nAnsatzRelPos = AT_OBEN;
310 if( nEscRel > 6666 )
311 nAnsatzRelPos = AT_UNTEN;
312 nAnsatzTypePos = AZ_HORIZONTAL;
314 else
316 nAnsatzTypePos = AZ_VON_OBEN;
317 aMF_ANSATZ.SetValue( nEscAbs );
320 else if( nEscDir == SDRCAPT_ESCVERTICAL )
322 if( bEscRel )
324 if( nEscRel < 3333 )
325 nAnsatzRelPos = AT_OBEN;
326 if( nEscRel > 6666 )
327 nAnsatzRelPos = AT_UNTEN;
328 nAnsatzTypePos = AZ_VERTIKAL;
330 else
332 nAnsatzTypePos = AZ_VON_LINKS;
333 aMF_ANSATZ.SetValue( nEscAbs );
336 else if( nEscDir == SDRCAPT_ESCBESTFIT )
338 nAnsatzTypePos = AZ_OPTIMAL;
341 if( bFixedAngle )
343 if( nFixedAngle <= 3000 )
344 nWinkelTypePos=WK_30;
345 else if( nFixedAngle <= 4500 )
346 nWinkelTypePos=WK_45;
347 else if( nFixedAngle <= 6000 )
348 nWinkelTypePos=WK_60;
349 else
350 nWinkelTypePos=WK_90;
353 aCB_LAENGE.Check( bFitLineLen );
354 aMF_LAENGE.SetValue( nLineLen );
356 aLB_ANSATZ.SelectEntryPos( nAnsatzTypePos );
357 aLB_WINKEL.SelectEntryPos( nWinkelTypePos );
359 SetupAnsatz_Impl( nAnsatzTypePos );
360 aCT_CAPTTYPE.SelectItem( nCaptionType+1 ); // Enum starts at 0!
361 SetupType_Impl( nCaptionType+1 );
364 // -----------------------------------------------------------------------
366 SfxTabPage* SvxCaptionTabPage::Create( Window* pWindow,
367 const SfxItemSet& rOutAttrs )
369 return( new SvxCaptionTabPage( pWindow, rOutAttrs ) );
372 //------------------------------------------------------------------------
374 sal_uInt16* SvxCaptionTabPage::GetRanges()
376 return( pCaptionRanges );
379 //------------------------------------------------------------------------
381 void SvxCaptionTabPage::SetupAnsatz_Impl( sal_uInt16 nType )
383 xub_StrLen nCnt=0, nIdx=0;
385 switch( nType )
387 case AZ_OPTIMAL:
388 // aMF_ANSATZ.Hide(); //XXX in case of OPTIMAL also absolute values are taken
389 // aFT_UM.Hide();
390 aMF_ANSATZ.Show();
391 aFT_UM.Show();
392 aFT_ANSATZ_REL.Hide();
393 aLB_ANSATZ_REL.Hide();
394 nEscDir = SDRCAPT_ESCBESTFIT;
395 break;
397 case AZ_VON_OBEN:
398 aMF_ANSATZ.Show();
399 aFT_UM.Show();
400 aFT_ANSATZ_REL.Hide();
401 aLB_ANSATZ_REL.Hide();
402 nEscDir = SDRCAPT_ESCHORIZONTAL;
403 break;
405 case AZ_VON_LINKS:
406 aMF_ANSATZ.Show();
407 aFT_UM.Show();
408 aFT_ANSATZ_REL.Hide();
409 aLB_ANSATZ_REL.Hide();
410 nEscDir = SDRCAPT_ESCVERTICAL;
411 break;
413 case AZ_HORIZONTAL:
414 aLB_ANSATZ_REL.Clear();
415 nCnt = comphelper::string::getTokenCount(aStrHorzList, ';');
416 for( nIdx=0 ; nIdx<nCnt ; nIdx++ )
417 aLB_ANSATZ_REL.InsertEntry( aStrHorzList.GetToken(nIdx) );
418 aLB_ANSATZ_REL.SelectEntryPos( nAnsatzRelPos );
420 aMF_ANSATZ.Hide();
421 aFT_UM.Hide();
422 aFT_ANSATZ_REL.Show();
423 aLB_ANSATZ_REL.Show();
424 nEscDir = SDRCAPT_ESCHORIZONTAL;
425 break;
427 case AZ_VERTIKAL:
428 aLB_ANSATZ_REL.Clear();
429 nCnt = comphelper::string::getTokenCount(aStrVertList, ';');
430 for( nIdx=0 ; nIdx<nCnt ; nIdx++ )
431 aLB_ANSATZ_REL.InsertEntry( aStrVertList.GetToken(nIdx) );
432 aLB_ANSATZ_REL.SelectEntryPos( nAnsatzRelPos );
434 aMF_ANSATZ.Hide();
435 aFT_UM.Hide();
436 aFT_ANSATZ_REL.Show();
437 aLB_ANSATZ_REL.Show();
438 nEscDir = SDRCAPT_ESCVERTICAL;
439 break;
443 //------------------------------------------------------------------------
445 IMPL_LINK_INLINE_START( SvxCaptionTabPage, AnsatzSelectHdl_Impl, ListBox *, pListBox )
447 if( pListBox == &aLB_ANSATZ )
449 SetupAnsatz_Impl( aLB_ANSATZ.GetSelectEntryPos() );
451 return 0;
453 IMPL_LINK_INLINE_END( SvxCaptionTabPage, AnsatzSelectHdl_Impl, ListBox *, pListBox )
455 //------------------------------------------------------------------------
457 IMPL_LINK_INLINE_START( SvxCaptionTabPage, AnsatzRelSelectHdl_Impl, ListBox *, pListBox )
459 if( pListBox == &aLB_ANSATZ_REL )
461 nAnsatzRelPos = aLB_ANSATZ_REL.GetSelectEntryPos();
463 return 0;
465 IMPL_LINK_INLINE_END( SvxCaptionTabPage, AnsatzRelSelectHdl_Impl, ListBox *, pListBox )
467 //------------------------------------------------------------------------
469 IMPL_LINK( SvxCaptionTabPage, LineOptHdl_Impl, Button *, pButton )
471 if( pButton == &aCB_LAENGE )
473 if( aCB_LAENGE.IsChecked() || ! aCB_LAENGE.IsEnabled() )
475 aFT_LAENGE.Disable();
476 aMF_LAENGE.Disable();
478 else
480 aFT_LAENGE.Enable();
481 aMF_LAENGE.Enable();
484 return 0;
487 //------------------------------------------------------------------------
489 IMPL_LINK_NOARG_INLINE_START(SvxCaptionTabPage, SelectCaptTypeHdl_Impl)
491 SetupType_Impl( aCT_CAPTTYPE.GetSelectItemId() );
492 return 0;
494 IMPL_LINK_NOARG_INLINE_END(SvxCaptionTabPage, SelectCaptTypeHdl_Impl)
496 //------------------------------------------------------------------------
498 void SvxCaptionTabPage::SetupType_Impl( sal_uInt16 nType )
500 switch( nType-1 )
502 case SDRCAPT_TYPE1:
503 aFT_WINKEL.Disable();
504 aLB_WINKEL.Disable();
505 aFT_LAENGE.Disable();
506 aCB_LAENGE.Disable();
507 LineOptHdl_Impl( &aCB_LAENGE );
508 break;
510 case SDRCAPT_TYPE2:
511 aFT_WINKEL.Enable();
512 aLB_WINKEL.Enable();
513 aFT_LAENGE.Disable();
514 aCB_LAENGE.Disable();
515 LineOptHdl_Impl( &aCB_LAENGE );
516 break;
518 case SDRCAPT_TYPE3:
519 aFT_WINKEL.Enable();
520 aLB_WINKEL.Enable();
521 aFT_LAENGE.Enable();
522 aCB_LAENGE.Enable();
523 LineOptHdl_Impl( &aCB_LAENGE );
524 break;
526 case SDRCAPT_TYPE4:
527 aFT_WINKEL.Enable();
528 aLB_WINKEL.Enable();
529 aFT_LAENGE.Enable();
530 aCB_LAENGE.Enable();
531 LineOptHdl_Impl( &aCB_LAENGE );
532 break;
536 // -----------------------------------------------------------------------
538 void SvxCaptionTabPage::DataChanged( const DataChangedEvent& rDCEvt )
540 SfxTabPage::DataChanged( rDCEvt );
542 if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) )
543 FillValueSet();
546 // -----------------------------------------------------------------------
548 void SvxCaptionTabPage::FillValueSet()
550 Image** ppBitmaps = mpBmpCapTypes;
551 aCT_CAPTTYPE.SetItemImage(BMP_CAPTTYPE_1, *(ppBitmaps[0]) );
552 aCT_CAPTTYPE.SetItemImage(BMP_CAPTTYPE_2, *(ppBitmaps[1]) );
553 aCT_CAPTTYPE.SetItemImage(BMP_CAPTTYPE_3, *(ppBitmaps[2]) );
556 //========================================================================
559 SvxCaptionTabDialog::SvxCaptionTabDialog(Window* pParent, const SdrView* pSdrView, sal_uInt16 nAnchorTypes)
560 : SfxTabDialog( pParent, CUI_RES( RID_SVXDLG_CAPTION ) ),
561 pView ( pSdrView ),
562 nAnchorCtrls(nAnchorTypes)
564 FreeResource();
566 DBG_ASSERT( pView, "Keine gueltige View Uebergeben!" );
568 //different positioning page in Writer
569 if(nAnchorCtrls & 0x00ff )
571 AddTabPage( RID_SVXPAGE_SWPOSSIZE, SvxSwPosSizeTabPage::Create,
572 SvxSwPosSizeTabPage::GetRanges );
573 RemoveTabPage( RID_SVXPAGE_POSITION_SIZE);
575 else
577 AddTabPage( RID_SVXPAGE_POSITION_SIZE, SvxPositionSizeTabPage::Create,
578 SvxPositionSizeTabPage::GetRanges );
579 RemoveTabPage( RID_SVXPAGE_SWPOSSIZE );
581 AddTabPage( RID_SVXPAGE_CAPTION, SvxCaptionTabPage::Create,
582 SvxCaptionTabPage::GetRanges );
585 // -----------------------------------------------------------------------
587 SvxCaptionTabDialog::~SvxCaptionTabDialog()
591 // -----------------------------------------------------------------------
593 void SvxCaptionTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
595 switch( nId )
597 case RID_SVXPAGE_POSITION_SIZE:
598 ( (SvxPositionSizeTabPage&) rPage ).SetView( pView );
599 ( (SvxPositionSizeTabPage&) rPage ).Construct();
600 if( nAnchorCtrls & SVX_OBJ_NORESIZE )
601 ( (SvxPositionSizeTabPage&) rPage ).DisableResize();
603 if( nAnchorCtrls & SVX_OBJ_NOPROTECT )
604 ( (SvxPositionSizeTabPage&) rPage ).DisableProtect();
605 break;
606 case RID_SVXPAGE_SWPOSSIZE :
608 SvxSwPosSizeTabPage& rSwPage = static_cast<SvxSwPosSizeTabPage&>(rPage);
609 rSwPage.EnableAnchorTypes(nAnchorCtrls);
610 rSwPage.SetValidateFramePosLink( aValidateLink );
612 break;
614 case RID_SVXPAGE_CAPTION:
615 ( (SvxCaptionTabPage&) rPage ).SetView( pView );
616 ( (SvxCaptionTabPage&) rPage ).Construct();
617 break;
621 void SvxCaptionTabDialog::SetValidateFramePosLink( const Link& rLink )
623 aValidateLink = rLink;
627 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */