xref: /core/cui/source/tabpages/labdlg.cxx (revision ecf6f6f2)
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #include <swpossizetabpage.hxx>
21 #include <svtools/unitconv.hxx>
22 
23 #include <svx/svddef.hxx>
24 #include <svx/sxcecitm.hxx>
25 #include <svx/sxcgitm.hxx>
26 #include <svx/sxcllitm.hxx>
27 #include <svx/sxctitm.hxx>
28 
29 #include <svx/dlgutil.hxx>
30 #include <labdlg.hxx>
31 #include <transfrm.hxx>
32 #include <bitmaps.hlst>
33 
34 // define ----------------------------------------------------------------
35 
36 #define EXT_OPTIMAL     0
37 #define EXT_FROM_TOP    1
38 #define EXT_FROM_LEFT   2
39 #define EXT_HORIZONTAL  3
40 #define EXT_VERTICAL    4
41 
42 #define POS_TOP         0
43 #define POS_MIDDLE      1
44 #define POS_BOTTOM      2
45 
46 #define BMP_CAPTTYPE_1  1
47 #define BMP_CAPTTYPE_2  2
48 #define BMP_CAPTTYPE_3  3
49 
50 // static ----------------------------------------------------------------
51 
52 const WhichRangesContainer SvxCaptionTabPage::pCaptionRanges(
53     svl::Items<
54     SDRATTR_CAPTIONTYPE, SDRATTR_CAPTIONFIXEDANGLE,
55     SDRATTR_CAPTIONANGLE, SDRATTR_CAPTIONGAP,
56     SDRATTR_CAPTIONESCDIR, SDRATTR_CAPTIONESCISREL,
57     SDRATTR_CAPTIONESCREL, SDRATTR_CAPTIONESCABS,
58     SDRATTR_CAPTIONLINELEN, SDRATTR_CAPTIONFITLINELEN>);
59 
SvxCaptionTabPage(weld::Container * pPage,weld::DialogController * pController,const SfxItemSet & rInAttrs)60 SvxCaptionTabPage::SvxCaptionTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs)
61     : SfxTabPage(pPage, pController, u"cui/ui/calloutpage.ui"_ustr, u"CalloutPage"_ustr, &rInAttrs)
62     , nCaptionType(SdrCaptionType::Type1)
63     , nGap(0)
64     , nEscDir(SdrCaptionEscDir::Horizontal)
65     , bEscRel(false)
66     , nEscAbs(0)
67     , nEscRel(0)
68     , nLineLen(0)
69     , bFitLineLen(false)
70     , nPosition(0)
71     , nExtension(0)
72     , rOutAttrs(rInAttrs)
73     , pView(nullptr)
74     , m_xMF_SPACING(m_xBuilder->weld_metric_spin_button(u"spacing"_ustr, FieldUnit::MM))
75     , m_xLB_EXTENSION(m_xBuilder->weld_combo_box(u"extension"_ustr))
76     , m_xFT_BYFT(m_xBuilder->weld_label(u"byft"_ustr))
77     , m_xMF_BY(m_xBuilder->weld_metric_spin_button(u"by"_ustr, FieldUnit::MM))
78     , m_xFT_POSITIONFT(m_xBuilder->weld_label(u"positionft"_ustr))
79     , m_xLB_POSITION(m_xBuilder->weld_combo_box(u"position"_ustr))
80     , m_xLineTypes(m_xBuilder->weld_combo_box(u"linetypes"_ustr))
81     , m_xFT_LENGTHFT(m_xBuilder->weld_label(u"lengthft"_ustr))
82     , m_xMF_LENGTH(m_xBuilder->weld_metric_spin_button(u"length"_ustr, FieldUnit::MM))
83     , m_xCB_OPTIMAL(m_xBuilder->weld_check_button(u"optimal"_ustr))
84     , m_xCT_CAPTTYPE(new ValueSet(m_xBuilder->weld_scrolled_window(u"valuesetwin"_ustr, true)))
85     , m_xCT_CAPTTYPEWin(new weld::CustomWeld(*m_xBuilder, u"valueset"_ustr, *m_xCT_CAPTTYPE))
86 {
87     Size aSize(m_xCT_CAPTTYPE->GetDrawingArea()->get_ref_device().LogicToPixel(Size(187, 38), MapMode(MapUnit::MapAppFont)));
88     m_xCT_CAPTTYPEWin->set_size_request(aSize.Width(), aSize.Height());
89 
90     assert(m_xLB_POSITION->get_count() == 6);
91     for (int i = 0;  i < 3; ++i)
92         m_aStrHorzList.push_back(m_xLB_POSITION->get_text(i));
93     for (int i = 3;  i < 6; ++i)
94         m_aStrVertList.push_back(m_xLB_POSITION->get_text(i));
95     m_xLB_POSITION->clear();
96 
97     assert(m_xLineTypes->get_count() == 3);
98     std::vector<OUString> aLineTypes;
99     aLineTypes.reserve(3);
100     for (int i = 0; i < 3; ++i)
101         aLineTypes.push_back(m_xLineTypes->get_text(i));
102 
103     static_assert(CAPTYPE_BITMAPS_COUNT == 3, "unexpected");
104     m_aBmpCapTypes[0] = Image(StockImage::Yes, RID_SVXBMP_LEGTYP1);
105     m_aBmpCapTypes[1] = Image(StockImage::Yes, RID_SVXBMP_LEGTYP2);
106     m_aBmpCapTypes[2] = Image(StockImage::Yes, RID_SVXBMP_LEGTYP3);
107 
108     //------------install ValueSet--------------------------
109     m_xCT_CAPTTYPE->SetStyle( m_xCT_CAPTTYPE->GetStyle() | WB_ITEMBORDER | WB_DOUBLEBORDER | WB_NAMEFIELD );
110     m_xCT_CAPTTYPE->SetColCount(5);//XXX
111     m_xCT_CAPTTYPE->SetLineCount(1);
112     m_xCT_CAPTTYPE->SetSelectHdl(LINK( this, SvxCaptionTabPage, SelectCaptTypeHdl_Impl));
113 
114     Image aImage;
115     m_xCT_CAPTTYPE->InsertItem(BMP_CAPTTYPE_1, aImage, aLineTypes[0]);
116     m_xCT_CAPTTYPE->InsertItem(BMP_CAPTTYPE_2, aImage, aLineTypes[1]);
117     m_xCT_CAPTTYPE->InsertItem(BMP_CAPTTYPE_3, aImage, aLineTypes[2]);
118 
119     FillValueSet();
120 
121     m_xLB_EXTENSION->connect_changed(LINK(this, SvxCaptionTabPage, ExtensionSelectHdl_Impl));
122     m_xLB_POSITION->connect_changed(LINK(this, SvxCaptionTabPage, PositionSelectHdl_Impl));
123     m_xCB_OPTIMAL->connect_toggled(LINK(this, SvxCaptionTabPage, LineOptHdl_Impl));
124 }
125 
~SvxCaptionTabPage()126 SvxCaptionTabPage::~SvxCaptionTabPage()
127 {
128     m_xCT_CAPTTYPEWin.reset();
129     m_xCT_CAPTTYPE.reset();
130 }
131 
Construct()132 void SvxCaptionTabPage::Construct()
133 {
134     // set rectangle and working area
135     DBG_ASSERT( pView, "No valid View transferred!" );
136 }
137 
FillItemSet(SfxItemSet * _rOutAttrs)138 bool SvxCaptionTabPage::FillItemSet( SfxItemSet*  _rOutAttrs)
139 {
140     SfxItemPool* pPool = _rOutAttrs->GetPool();
141     assert(pPool && "Where is the pool?");
142 
143     MapUnit      eUnit;
144 
145     nCaptionType = static_cast<SdrCaptionType>(m_xCT_CAPTTYPE->GetSelectedItemId()-1);
146 
147     _rOutAttrs->Put( SdrCaptionTypeItem( nCaptionType ) );
148 
149     if (m_xMF_SPACING->get_value_changed_from_saved())
150     {
151         eUnit = pPool->GetMetric( GetWhich( SDRATTR_CAPTIONGAP ) );
152         _rOutAttrs->Put( SdrCaptionGapItem( GetCoreValue(*m_xMF_SPACING, eUnit ) ) );
153     }
154 
155     // special treatment!!! XXX
156     if( nCaptionType==SdrCaptionType::Type1 )
157     {
158         switch( nEscDir )
159         {
160             case SdrCaptionEscDir::Horizontal:     nEscDir=SdrCaptionEscDir::Vertical;break;
161             case SdrCaptionEscDir::Vertical:       nEscDir=SdrCaptionEscDir::Horizontal;break;
162             default: break;
163         }
164     }
165 
166     _rOutAttrs->Put( SdrCaptionEscDirItem( nEscDir ) );
167 
168     bEscRel = m_xLB_POSITION->get_visible();
169     _rOutAttrs->Put( SdrCaptionEscIsRelItem( bEscRel ) );
170 
171     if( bEscRel )
172     {
173         tools::Long    nVal = 0;
174 
175         switch (m_xLB_POSITION->get_active())
176         {
177             case POS_TOP:     nVal=0;break;
178             case POS_MIDDLE:  nVal=5000;break;
179             case POS_BOTTOM:  nVal=10000;break;
180         }
181         _rOutAttrs->Put( SdrCaptionEscRelItem( nVal ) );
182     }
183     else
184     {
185         if (m_xMF_BY->get_value_changed_from_saved())
186         {
187             eUnit = pPool->GetMetric( GetWhich( SDRATTR_CAPTIONESCABS ) );
188             _rOutAttrs->Put( SdrCaptionEscAbsItem( GetCoreValue(*m_xMF_BY, eUnit ) ) );
189         }
190     }
191 
192     bFitLineLen = m_xCB_OPTIMAL->get_active();
193     _rOutAttrs->Put( SdrCaptionFitLineLenItem( bFitLineLen ) );
194 
195     if( ! bFitLineLen )
196     {
197         if (m_xMF_LENGTH->get_value_changed_from_saved())
198         {
199             eUnit = pPool->GetMetric( GetWhich( SDRATTR_CAPTIONLINELEN ) );
200             _rOutAttrs->Put( SdrCaptionLineLenItem( GetCoreValue(*m_xMF_LENGTH, eUnit ) ) );
201         }
202     }
203 
204 //NYI-------------the angles have to be added here!!! XXX----------------------
205 
206     return true;
207 }
208 
Reset(const SfxItemSet *)209 void SvxCaptionTabPage::Reset( const SfxItemSet*  )
210 {
211 
212     //------------set metric-----------------------------
213 
214     FieldUnit eFUnit = GetModuleFieldUnit( rOutAttrs );
215 
216     switch ( eFUnit )
217     {
218         case FieldUnit::CM:
219         case FieldUnit::M:
220         case FieldUnit::KM:
221             eFUnit = FieldUnit::MM;
222             break;
223         default: ;//prevent warning
224     }
225     SetFieldUnit( *m_xMF_SPACING, eFUnit );
226     SetFieldUnit( *m_xMF_BY, eFUnit );
227     SetFieldUnit( *m_xMF_LENGTH, eFUnit );
228 
229     SfxItemPool*    pPool = rOutAttrs.GetPool();
230     assert(pPool && "Where is the pool?");
231 
232     sal_uInt16   nWhich;
233     MapUnit      eUnit;
234 
235     nWhich = GetWhich( SDRATTR_CAPTIONESCABS );
236     eUnit = pPool->GetMetric( nWhich );
237     nEscAbs = static_cast<const SdrCaptionEscAbsItem&>( rOutAttrs.Get( nWhich ) ).GetValue();
238     SetMetricValue( *m_xMF_BY, nEscAbs, eUnit );
239     nEscAbs = m_xMF_BY->get_value(FieldUnit::NONE);
240 
241     nWhich = GetWhich( SDRATTR_CAPTIONESCREL );
242     nEscRel = static_cast<tools::Long>(static_cast<const SdrCaptionEscRelItem&>( rOutAttrs.Get( nWhich ) ).GetValue());
243 
244     //------- line length ----------
245     nWhich = GetWhich( SDRATTR_CAPTIONLINELEN );
246     eUnit = pPool->GetMetric( nWhich );
247     nLineLen = static_cast<const SdrCaptionLineLenItem&>( rOutAttrs.Get( nWhich ) ).GetValue();
248     SetMetricValue( *m_xMF_LENGTH, nLineLen, eUnit );
249     nLineLen = m_xMF_LENGTH->get_value(FieldUnit::NONE);
250 
251     //------- distance to box ----------
252     nWhich = GetWhich( SDRATTR_CAPTIONGAP );
253     eUnit = pPool->GetMetric( nWhich );
254     nGap = static_cast<const SdrCaptionGapItem&>( rOutAttrs.Get( nWhich ) ).GetValue();
255     SetMetricValue( *m_xMF_SPACING, nGap, eUnit );
256     nGap = m_xMF_SPACING->get_value(FieldUnit::NONE);
257 
258     nCaptionType = rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONTYPE ) ).GetValue();
259     bFitLineLen = static_cast<const SfxBoolItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONFITLINELEN ) ) ).GetValue();
260     nEscDir = rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCDIR ) ).GetValue();
261     bEscRel = static_cast<const SfxBoolItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCISREL ) ) ).GetValue();
262 
263     // special treatment!!! XXX
264     if( nCaptionType==SdrCaptionType::Type1 )
265     {
266         switch( nEscDir )
267         {
268             case SdrCaptionEscDir::Horizontal:     nEscDir=SdrCaptionEscDir::Vertical;break;
269             case SdrCaptionEscDir::Vertical:       nEscDir=SdrCaptionEscDir::Horizontal;break;
270             default: break;
271         }
272     }
273 
274     nPosition = POS_MIDDLE;
275     nExtension = EXT_OPTIMAL;
276 
277     m_xMF_SPACING->set_value(nGap, FieldUnit::NONE);
278 
279     if( nEscDir == SdrCaptionEscDir::Horizontal )
280     {
281         if( bEscRel )
282         {
283             if( nEscRel < 3333 )
284                 nPosition = POS_TOP;
285             if( nEscRel > 6666 )
286                 nPosition = POS_BOTTOM;
287             nExtension = EXT_HORIZONTAL;
288         }
289         else
290         {
291             nExtension = EXT_FROM_TOP;
292             m_xMF_BY->set_value(nEscAbs, FieldUnit::NONE);
293         }
294     }
295     else if( nEscDir == SdrCaptionEscDir::Vertical )
296     {
297         if( bEscRel )
298         {
299             if( nEscRel < 3333 )
300                 nPosition = POS_TOP;
301             if( nEscRel > 6666 )
302                 nPosition = POS_BOTTOM;
303             nExtension = EXT_VERTICAL;
304         }
305         else
306         {
307             nExtension = EXT_FROM_LEFT;
308             m_xMF_BY->set_value(nEscAbs, FieldUnit::NONE);
309         }
310     }
311     else if( nEscDir == SdrCaptionEscDir::BestFit )
312     {
313         nExtension = EXT_OPTIMAL;
314     }
315 
316     m_xCB_OPTIMAL->set_active(bFitLineLen);
317     m_xMF_LENGTH->set_value(nLineLen, FieldUnit::NONE);
318 
319     m_xLB_EXTENSION->set_active(nExtension);
320 
321     SetupExtension_Impl( nExtension );
322     m_xCT_CAPTTYPE->SelectItem( static_cast<int>(nCaptionType)+1 ); // Enum starts at 0!
323     SetupType_Impl( nCaptionType );
324 }
325 
Create(weld::Container * pPage,weld::DialogController * pController,const SfxItemSet * rOutAttrs)326 std::unique_ptr<SfxTabPage> SvxCaptionTabPage::Create(weld::Container* pPage, weld::DialogController* pController,
327                                              const SfxItemSet* rOutAttrs)
328 {
329     return std::make_unique<SvxCaptionTabPage>(pPage, pController, *rOutAttrs);
330 }
331 
SetupExtension_Impl(sal_uInt16 nType)332 void SvxCaptionTabPage::SetupExtension_Impl( sal_uInt16 nType )
333 {
334     switch( nType )
335     {
336         case EXT_OPTIMAL:
337         m_xMF_BY->show();
338         m_xFT_BYFT->show();
339         m_xFT_POSITIONFT->hide();
340         m_xLB_POSITION->hide();
341         nEscDir = SdrCaptionEscDir::BestFit;
342         break;
343 
344         case EXT_FROM_TOP:
345         m_xMF_BY->show();
346         m_xFT_BYFT->show();
347         m_xFT_POSITIONFT->hide();
348         m_xLB_POSITION->hide();
349         nEscDir = SdrCaptionEscDir::Horizontal;
350         break;
351 
352         case EXT_FROM_LEFT:
353         m_xMF_BY->show();
354         m_xFT_BYFT->show();
355         m_xFT_POSITIONFT->hide();
356         m_xLB_POSITION->hide();
357         nEscDir = SdrCaptionEscDir::Vertical;
358         break;
359 
360         case EXT_HORIZONTAL:
361         m_xLB_POSITION->clear();
362         for (const OUString & i : m_aStrHorzList)
363             m_xLB_POSITION->append_text(i);
364         m_xLB_POSITION->set_active(nPosition);
365 
366         m_xMF_BY->hide();
367         m_xFT_BYFT->hide();
368         m_xFT_POSITIONFT->show();
369         m_xLB_POSITION->show();
370         nEscDir = SdrCaptionEscDir::Horizontal;
371         break;
372 
373         case EXT_VERTICAL:
374         m_xLB_POSITION->clear();
375         for (const OUString & i : m_aStrVertList)
376             m_xLB_POSITION->append_text(i);
377         m_xLB_POSITION->set_active(nPosition);
378 
379         m_xMF_BY->hide();
380         m_xFT_BYFT->hide();
381         m_xFT_POSITIONFT->show();
382         m_xLB_POSITION->show();
383         nEscDir = SdrCaptionEscDir::Vertical;
384         break;
385     }
386 }
387 
IMPL_LINK(SvxCaptionTabPage,ExtensionSelectHdl_Impl,weld::ComboBox &,rListBox,void)388 IMPL_LINK(SvxCaptionTabPage, ExtensionSelectHdl_Impl, weld::ComboBox&, rListBox, void)
389 {
390     if (&rListBox == m_xLB_EXTENSION.get())
391     {
392         SetupExtension_Impl(m_xLB_EXTENSION->get_active());
393     }
394 }
395 
IMPL_LINK(SvxCaptionTabPage,PositionSelectHdl_Impl,weld::ComboBox &,rListBox,void)396 IMPL_LINK(SvxCaptionTabPage, PositionSelectHdl_Impl, weld::ComboBox&, rListBox, void)
397 {
398     if (&rListBox == m_xLB_POSITION.get())
399     {
400         nPosition = m_xLB_POSITION->get_active();
401     }
402 }
403 
IMPL_LINK(SvxCaptionTabPage,LineOptHdl_Impl,weld::Toggleable &,rButton,void)404 IMPL_LINK( SvxCaptionTabPage, LineOptHdl_Impl, weld::Toggleable&, rButton, void )
405 {
406     if (&rButton != m_xCB_OPTIMAL.get())
407         return;
408 
409     if (m_xCB_OPTIMAL->get_active() || !m_xCB_OPTIMAL->get_sensitive())
410     {
411         m_xFT_LENGTHFT->set_sensitive(false);
412         m_xMF_LENGTH->set_sensitive(false);
413     }
414     else
415     {
416         m_xFT_LENGTHFT->set_sensitive(true);
417         m_xMF_LENGTH->set_sensitive(true);
418     }
419 }
420 
IMPL_LINK_NOARG(SvxCaptionTabPage,SelectCaptTypeHdl_Impl,ValueSet *,void)421 IMPL_LINK_NOARG(SvxCaptionTabPage, SelectCaptTypeHdl_Impl, ValueSet*, void)
422 {
423     SetupType_Impl( static_cast<SdrCaptionType>(m_xCT_CAPTTYPE->GetSelectedItemId()) );
424 }
425 
SetupType_Impl(SdrCaptionType nType)426 void SvxCaptionTabPage::SetupType_Impl( SdrCaptionType nType )
427 {
428     switch( nType )
429     {
430         case SdrCaptionType::Type1:
431         case SdrCaptionType::Type2:
432             m_xFT_LENGTHFT->set_sensitive(false);
433             m_xCB_OPTIMAL->set_sensitive(false);
434             LineOptHdl_Impl(*m_xCB_OPTIMAL);
435             break;
436         case SdrCaptionType::Type3:
437         case SdrCaptionType::Type4:
438             m_xFT_LENGTHFT->set_sensitive(true);
439             m_xCB_OPTIMAL->set_sensitive(true);
440             LineOptHdl_Impl(*m_xCB_OPTIMAL);
441             break;
442     }
443 }
444 
FillValueSet()445 void SvxCaptionTabPage::FillValueSet()
446 {
447     m_xCT_CAPTTYPE->SetItemImage(BMP_CAPTTYPE_1, m_aBmpCapTypes[0] );
448     m_xCT_CAPTTYPE->SetItemImage(BMP_CAPTTYPE_2, m_aBmpCapTypes[1] );
449     m_xCT_CAPTTYPE->SetItemImage(BMP_CAPTTYPE_3, m_aBmpCapTypes[2] );
450 }
451 
SvxCaptionTabDialog(weld::Window * pParent,const SdrView * pSdrView,SvxAnchorIds nAnchorTypes)452 SvxCaptionTabDialog::SvxCaptionTabDialog(weld::Window* pParent, const SdrView* pSdrView,
453     SvxAnchorIds nAnchorTypes)
454     : SfxTabDialogController(pParent, u"cui/ui/calloutdialog.ui"_ustr, u"CalloutDialog"_ustr)
455     , pView(pSdrView)
456     , nAnchorCtrls(nAnchorTypes)
457 {
458     assert(pView); // No valid View transferred!
459 
460     //different positioning page in Writer
461     if (nAnchorCtrls & (SvxAnchorIds::Paragraph | SvxAnchorIds::Character | SvxAnchorIds::Page | SvxAnchorIds::Fly))
462     {
463         AddTabPage(u"RID_SVXPAGE_SWPOSSIZE"_ustr, SvxSwPosSizeTabPage::Create,
464             SvxSwPosSizeTabPage::GetRanges );
465         RemoveTabPage(u"RID_SVXPAGE_POSITION_SIZE"_ustr);
466     }
467     else
468     {
469         AddTabPage(u"RID_SVXPAGE_POSITION_SIZE"_ustr, SvxPositionSizeTabPage::Create,
470             SvxPositionSizeTabPage::GetRanges );
471         RemoveTabPage(u"RID_SVXPAGE_SWPOSSIZE"_ustr);
472     }
473     AddTabPage(u"RID_SVXPAGE_CAPTION"_ustr, SvxCaptionTabPage::Create,
474         SvxCaptionTabPage::GetRanges );
475 }
476 
PageCreated(const OUString & rId,SfxTabPage & rPage)477 void SvxCaptionTabDialog::PageCreated(const OUString& rId, SfxTabPage &rPage)
478 {
479     if (rId == "RID_SVXPAGE_POSITION_SIZE")
480     {
481         static_cast<SvxPositionSizeTabPage&>( rPage ).SetView( pView );
482         static_cast<SvxPositionSizeTabPage&>( rPage ).Construct();
483         if( nAnchorCtrls & SvxAnchorIds::NoResize )
484             static_cast<SvxPositionSizeTabPage&>( rPage ).DisableResize();
485 
486         if( nAnchorCtrls & SvxAnchorIds::NoProtect )
487             static_cast<SvxPositionSizeTabPage&>( rPage ).DisableProtect();
488     }
489     else if (rId == "RID_SVXPAGE_SWPOSSIZE")
490     {
491         SvxSwPosSizeTabPage& rSwPage = static_cast<SvxSwPosSizeTabPage&>(rPage);
492         rSwPage.EnableAnchorTypes(nAnchorCtrls);
493         rSwPage.SetValidateFramePosLink( aValidateLink );
494     }
495     else if (rId == "RID_SVXPAGE_CAPTION")
496     {
497         static_cast<SvxCaptionTabPage&>( rPage ).SetView( pView );
498         static_cast<SvxCaptionTabPage&>( rPage ).Construct();
499     }
500 }
501 
SetValidateFramePosLink(const Link<SvxSwFrameValidation &,void> & rLink)502 void SvxCaptionTabDialog::SetValidateFramePosLink( const Link<SvxSwFrameValidation&,void>& rLink )
503 {
504     aValidateLink = rLink;
505 }
506 
507 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
508