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 <view.hxx>
21 #include <wrtsh.hxx>
22 #include <cption.hxx>
23 #include <fldmgr.hxx>
24 #include <expfld.hxx>
25 #include <numrule.hxx>
26 #include <poolfmt.hxx>
27 #include <docsh.hxx>
28 #include <calc.hxx>
29 #include <uitool.hxx>
30 #include <doc.hxx>
31 #include <modcfg.hxx>
32 #include <swmodule.hxx>
33 #include <com/sun/star/frame/XModel.hpp>
34 #include <com/sun/star/text/XTextGraphicObjectsSupplier.hpp>
35 #include <com/sun/star/text/XTextTablesSupplier.hpp>
36 #include <com/sun/star/text/XTextEmbeddedObjectsSupplier.hpp>
37 #include <com/sun/star/text/XTextFramesSupplier.hpp>
38 #include <comphelper/string.hxx>
39 #include <vcl/weld.hxx>
40 #include <strings.hrc>
41 #include <SwStyleNameMapper.hxx>
42 
43 using namespace ::com::sun::star;
44 
45 namespace {
46 
47 class SwSequenceOptionDialog : public weld::GenericDialogController
48 {
49     SwView&         m_rView;
50     OUString        m_aFieldTypeName;
51 
52     std::unique_ptr<weld::ComboBox> m_xLbLevel;
53     std::unique_ptr<weld::Entry> m_xEdDelim;
54 
55     std::unique_ptr<weld::ComboBox> m_xLbCharStyle;
56     std::unique_ptr<weld::CheckButton> m_xApplyBorderAndShadowCB;
57 
58     //#i61007# order of captions
59     std::unique_ptr<weld::ComboBox> m_xLbCaptionOrder;
60 
61 public:
62     SwSequenceOptionDialog(weld::Window *pParent, SwView &rV, const OUString& rSeqFieldType);
63     void Apply();
64 
IsApplyBorderAndShadow() const65     bool IsApplyBorderAndShadow() const { return m_xApplyBorderAndShadowCB->get_active(); }
SetApplyBorderAndShadow(bool bSet)66     void SetApplyBorderAndShadow( bool bSet )  { m_xApplyBorderAndShadowCB->set_active(bSet); }
67 
68     //#i61007# order of captions
IsOrderNumberingFirst() const69     bool IsOrderNumberingFirst() const { return m_xLbCaptionOrder->get_active() == 1; }
SetOrderNumberingFirst(bool bSet)70     void SetOrderNumberingFirst(bool bSet) { m_xLbCaptionOrder->set_active(bSet ? 1 : 0); }
71 
72     void      SetCharacterStyle(const OUString& rStyle);
73     OUString  GetCharacterStyle() const;
74 
run()75     virtual short run() override
76     {
77         int nRet = GenericDialogController::run();
78         if (nRet == RET_OK)
79             Apply();
80         return nRet;
81     }
82 };
83 
84 }
85 
86 OUString SwCaptionDialog::our_aSepTextSave(": "); // Caption separator text
87 
88 //Resolves: tdf#47427 disallow typing *or* pasting invalid content into the category box
filter(const OUString & rText)89 OUString TextFilterAutoConvert::filter(const OUString &rText)
90 {
91     if (!rText.isEmpty() && rText != m_sNone && !SwCalc::IsValidVarName(rText))
92         return m_sLastGoodText;
93     m_sLastGoodText = rText;
94     return rText;
95 }
96 
SwCaptionDialog(weld::Window * pParent,SwView & rV)97 SwCaptionDialog::SwCaptionDialog(weld::Window *pParent, SwView &rV)
98     : SfxDialogController(pParent, "modules/swriter/ui/insertcaption.ui", "InsertCaptionDialog")
99     , m_sNone(SwResId(SW_STR_NONE))
100     , m_aTextFilter(m_sNone)
101     , rView(rV)
102     , pMgr(new SwFieldMgr(rView.GetWrtShellPtr()))
103     , bCopyAttributes(false)
104     , bOrderNumberingFirst(SW_MOD()->GetModuleConfig()->IsCaptionOrderNumberingFirst())
105     , m_xTextEdit(m_xBuilder->weld_entry("caption_edit"))
106     , m_xCategoryBox(m_xBuilder->weld_combo_box("category"))
107     , m_xFormatText(m_xBuilder->weld_label("numbering_label"))
108     , m_xFormatBox(m_xBuilder->weld_combo_box("numbering"))
109     , m_xNumberingSeparatorFT(m_xBuilder->weld_label("num_separator"))
110     , m_xNumberingSeparatorED(m_xBuilder->weld_entry("num_separator_edit"))
111     , m_xSepText(m_xBuilder->weld_label("separator_label"))
112     , m_xSepEdit(m_xBuilder->weld_entry("separator_edit"))
113     , m_xPosText(m_xBuilder->weld_label("position_label"))
114     , m_xPosBox(m_xBuilder->weld_combo_box("position"))
115     , m_xOKButton(m_xBuilder->weld_button("ok"))
116     , m_xAutoCaptionButton(m_xBuilder->weld_button("auto"))
117     , m_xOptionButton(m_xBuilder->weld_button("options"))
118     , m_xPreview(new weld::CustomWeld(*m_xBuilder, "preview", m_aPreview))
119 {
120     //#i61007# order of captions
121     ApplyCaptionOrder();
122     SwWrtShell &rSh = rView.GetWrtShell();
123     uno::Reference< frame::XModel >  xModel = rView.GetDocShell()->GetBaseModel();
124 
125     SelectionType eType = rSh.GetSelectionType();
126     if ( eType & SelectionType::Ole )
127     {
128         eType = SelectionType::Graphic;
129         uno::Reference< text::XTextEmbeddedObjectsSupplier >  xObjs(xModel, uno::UNO_QUERY);
130         xNameAccess = xObjs->getEmbeddedObjects();
131     }
132 
133     m_xCategoryBox->connect_changed(LINK(this, SwCaptionDialog, ModifyComboHdl));
134     Link<weld::Entry&,void> aLk = LINK(this, SwCaptionDialog, ModifyEntryHdl);
135     m_xTextEdit->connect_changed(aLk);
136     m_xNumberingSeparatorED->connect_changed(aLk);
137     m_xSepEdit->connect_changed(aLk);
138 
139     m_xFormatBox->connect_changed(LINK(this, SwCaptionDialog, SelectListBoxHdl));
140     m_xOptionButton->connect_clicked(LINK(this, SwCaptionDialog, OptionHdl));
141     m_xAutoCaptionButton->connect_clicked(LINK(this, SwCaptionDialog, CaptionHdl));
142 
143     m_xCategoryBox->append_text(m_sNone);
144     size_t nCount = pMgr->GetFieldTypeCount();
145     for (size_t i = 0; i < nCount; ++i)
146     {
147         SwFieldType *pType = pMgr->GetFieldType( SwFieldIds::Unknown, i );
148         if( pType->Which() == SwFieldIds::SetExp &&
149             static_cast<SwSetExpFieldType *>( pType)->GetType() & nsSwGetSetExpType::GSE_SEQ )
150             m_xCategoryBox->append_text(pType->GetName());
151     }
152 
153     OUString sString;
154     sal_uInt16 nPoolId = 0;
155     if (eType & SelectionType::Graphic)
156     {
157         nPoolId = RES_POOLCOLL_LABEL_FIGURE;
158 
159         SwSetExpFieldType* pTypeIll= static_cast<SwSetExpFieldType*>(rSh.GetFieldType(SwFieldIds::SetExp, SwResId(STR_POOLCOLL_LABEL_ABB)));
160         if(rSh.IsUsed(*pTypeIll)) //default to illustration for legacy docs
161         {
162             nPoolId = RES_POOLCOLL_LABEL_ABB;
163 
164         }
165 
166         sString = rView.GetOldGrfCat();
167         bCopyAttributes = true;
168         //if not OLE
169         if(!xNameAccess.is())
170         {
171             uno::Reference< text::XTextGraphicObjectsSupplier >  xGraphics(xModel, uno::UNO_QUERY);
172             xNameAccess = xGraphics->getGraphicObjects();
173         }
174 
175     }
176     else if( eType & SelectionType::Table )
177     {
178         nPoolId = RES_POOLCOLL_LABEL_TABLE;
179         sString = rView.GetOldTabCat();
180         uno::Reference< text::XTextTablesSupplier >  xTables(xModel, uno::UNO_QUERY);
181         xNameAccess = xTables->getTextTables();
182     }
183     else if( eType & SelectionType::Frame )
184     {
185         nPoolId = RES_POOLCOLL_LABEL_FRAME;
186         sString = rView.GetOldFrameCat();
187         uno::Reference< text::XTextFramesSupplier >  xFrames(xModel, uno::UNO_QUERY);
188         xNameAccess = xFrames->getTextFrames();
189     }
190     else if( eType == SelectionType::Text )
191     {
192         nPoolId = RES_POOLCOLL_LABEL_FRAME;
193         sString = rView.GetOldFrameCat();
194     }
195     else if( eType & SelectionType::DrawObject )
196     {
197         nPoolId = RES_POOLCOLL_LABEL_DRAWING;
198         sString = rView.GetOldDrwCat();
199     }
200     if( nPoolId )
201     {
202         if (sString.isEmpty())
203             sString = SwStyleNameMapper::GetUIName(nPoolId, OUString());
204         auto nIndex = m_xCategoryBox->find_text(sString);
205         if (nIndex != -1)
206             m_xCategoryBox->set_active(nIndex);
207         else
208             m_xCategoryBox->set_entry_text(sString);
209     }
210 
211     // aFormatBox
212     sal_uInt16 nSelFormat = SVX_NUM_ARABIC;
213     nCount = pMgr->GetFieldTypeCount();
214     for ( size_t i = nCount; i; )
215     {
216         SwFieldType* pFieldType = pMgr->GetFieldType(SwFieldIds::Unknown, --i);
217         if (pFieldType->GetName() == m_xCategoryBox->get_active_text())
218         {
219             nSelFormat = o3tl::narrowing<sal_uInt16>(static_cast<SwSetExpFieldType*>(pFieldType)->GetSeqFormat());
220             break;
221         }
222     }
223 
224     sal_uInt16 nFormatCount = pMgr->GetFormatCount(SwFieldTypesEnum::Sequence, false);
225     for ( sal_uInt16 i = 0; i < nFormatCount; ++i )
226     {
227         const sal_uInt16 nFormatId = pMgr->GetFormatId(SwFieldTypesEnum::Sequence, i);
228         m_xFormatBox->append(OUString::number(nFormatId), pMgr->GetFormatStr(SwFieldTypesEnum::Sequence, i));
229         if (nFormatId == nSelFormat)
230             m_xFormatBox->set_active(i);
231     }
232 
233     // aPosBox
234     if (eType == SelectionType::Graphic
235         || eType == SelectionType::Table
236         || eType == (SelectionType::Table | SelectionType::NumberList)
237         || eType == (SelectionType::Table | SelectionType::Text)
238         || eType == (SelectionType::Table | SelectionType::NumberList | SelectionType::Text)
239         || eType == SelectionType::DrawObject
240         || eType == (SelectionType::DrawObject | SelectionType::Ornament))
241     {
242         m_xPosBox->append_text(SwResId(STR_CAPTION_ABOVE));
243         m_xPosBox->append_text(SwResId(STR_CAPTION_BELOW));
244     }
245     else if(eType == SelectionType::Frame
246             || eType == SelectionType::Text)
247     {
248         m_xPosBox->append_text(SwResId(STR_CAPTION_BEGINNING));
249         m_xPosBox->append_text(SwResId(STR_CAPTION_END));
250     }
251 
252     if (eType & SelectionType::Table)
253     {
254         m_xPosBox->set_active(0);
255     }
256     else
257     {
258         m_xPosBox->set_active(1);
259     }
260 
261     ModifyHdl();
262 
263     m_xSepEdit->set_text(our_aSepTextSave);
264     m_xTextEdit->grab_focus();
265     DrawSample();
266 }
267 
Apply()268 void SwCaptionDialog::Apply()
269 {
270     InsCaptionOpt aOpt;
271     aOpt.UseCaption() = true;
272     OUString aName(m_xCategoryBox->get_active_text());
273     if ( aName == m_sNone )
274     {
275         aOpt.SetCategory( OUString() );
276         aOpt.SetNumSeparator( OUString() );
277     }
278     else
279     {
280         aOpt.SetCategory(comphelper::string::strip(aName, ' '));
281         aOpt.SetNumSeparator(m_xNumberingSeparatorED->get_text());
282     }
283     aOpt.SetNumType(m_xFormatBox->get_active_id().toUInt32());
284     aOpt.SetSeparator(m_xSepEdit->get_sensitive() ? m_xSepEdit->get_text() : OUString());
285     aOpt.SetCaption(m_xTextEdit->get_text());
286     aOpt.SetPos(m_xPosBox->get_active());
287     aOpt.IgnoreSeqOpts() = true;
288     aOpt.CopyAttributes() = bCopyAttributes;
289     aOpt.SetCharacterStyle( sCharacterStyle );
290     rView.InsertCaption( &aOpt );
291     our_aSepTextSave = m_xSepEdit->get_text();
292 }
293 
run()294 short SwCaptionDialog::run()
295 {
296     short nRet = SfxDialogController::run();
297     if (nRet == RET_OK)
298         Apply();
299     return nRet;
300 }
301 
IMPL_LINK_NOARG(SwCaptionDialog,OptionHdl,weld::Button &,void)302 IMPL_LINK_NOARG(SwCaptionDialog, OptionHdl, weld::Button&, void)
303 {
304     OUString sFieldTypeName = m_xCategoryBox->get_active_text();
305     if(sFieldTypeName == m_sNone)
306         sFieldTypeName.clear();
307     SwSequenceOptionDialog aDlg(m_xDialog.get(), rView, sFieldTypeName);
308     aDlg.SetApplyBorderAndShadow(bCopyAttributes);
309     aDlg.SetCharacterStyle( sCharacterStyle );
310     aDlg.SetOrderNumberingFirst( bOrderNumberingFirst );
311     aDlg.run();
312     bCopyAttributes = aDlg.IsApplyBorderAndShadow();
313     sCharacterStyle = aDlg.GetCharacterStyle();
314     //#i61007# order of captions
315     if( bOrderNumberingFirst != aDlg.IsOrderNumberingFirst() )
316     {
317         bOrderNumberingFirst = aDlg.IsOrderNumberingFirst();
318         SW_MOD()->GetModuleConfig()->SetCaptionOrderNumberingFirst(bOrderNumberingFirst);
319         ApplyCaptionOrder();
320     }
321     DrawSample();
322 }
323 
IMPL_LINK_NOARG(SwCaptionDialog,SelectListBoxHdl,weld::ComboBox &,void)324 IMPL_LINK_NOARG(SwCaptionDialog, SelectListBoxHdl, weld::ComboBox&, void)
325 {
326     DrawSample();
327 }
328 
ModifyHdl()329 void SwCaptionDialog::ModifyHdl()
330 {
331     SwWrtShell &rSh = rView.GetWrtShell();
332     OUString sFieldTypeName = m_xCategoryBox->get_active_text();
333     bool bCorrectFieldName = !sFieldTypeName.isEmpty();
334     bool bNone = sFieldTypeName == m_sNone;
335     SwFieldType* pType = (bCorrectFieldName && !bNone)
336                     ? rSh.GetFieldType( SwFieldIds::SetExp, sFieldTypeName )
337                     : nullptr;
338     m_xOKButton->set_sensitive( bCorrectFieldName &&
339                         (!pType ||
340                             static_cast<SwSetExpFieldType*>(pType)->GetType() == nsSwGetSetExpType::GSE_SEQ) );
341     m_xOptionButton->set_sensitive(m_xOKButton->get_sensitive() && !bNone);
342     m_xNumberingSeparatorFT->set_sensitive(bOrderNumberingFirst && !bNone);
343     m_xNumberingSeparatorED->set_sensitive(bOrderNumberingFirst && !bNone);
344     m_xFormatText->set_sensitive(!bNone);
345     m_xFormatBox->set_sensitive(!bNone);
346     m_xSepText->set_sensitive(!bNone);
347     m_xSepEdit->set_sensitive(!bNone);
348     DrawSample();
349 }
350 
IMPL_LINK_NOARG(SwCaptionDialog,ModifyEntryHdl,weld::Entry &,void)351 IMPL_LINK_NOARG(SwCaptionDialog, ModifyEntryHdl, weld::Entry&, void)
352 {
353     ModifyHdl();
354 }
355 
IMPL_LINK_NOARG(SwCaptionDialog,ModifyComboHdl,weld::ComboBox &,void)356 IMPL_LINK_NOARG(SwCaptionDialog, ModifyComboHdl, weld::ComboBox&, void)
357 {
358     OUString sText = m_xCategoryBox->get_active_text();
359     OUString sAllowedText = m_aTextFilter.filter(sText);
360     if (sText != sAllowedText)
361     {
362         m_xCategoryBox->set_entry_text(sAllowedText);
363         m_xCategoryBox->select_entry_region(sAllowedText.getLength(), sAllowedText.getLength());
364     }
365     ModifyHdl();
366 }
367 
IMPL_LINK_NOARG(SwCaptionDialog,CaptionHdl,weld::Button &,void)368 IMPL_LINK_NOARG(SwCaptionDialog, CaptionHdl, weld::Button&, void)
369 {
370     SfxItemSet aSet(rView.GetDocShell()->GetDoc()->GetAttrPool());
371     SwCaptionOptDlg aDlg(m_xDialog.get(), aSet);
372     aDlg.run();
373 }
374 
DrawSample()375 void SwCaptionDialog::DrawSample()
376 {
377     OUString aStr;
378     OUString sCaption = m_xTextEdit->get_text();
379 
380     // number
381     OUString sFieldTypeName = m_xCategoryBox->get_active_text();
382     bool bNone = sFieldTypeName == m_sNone;
383     if( !bNone )
384     {
385         const sal_uInt16 nNumFormat = m_xFormatBox->get_active_id().toUInt32();
386         if (SVX_NUM_NUMBER_NONE != nNumFormat)
387         {
388             // category
389             //#i61007# order of captions
390             if( !bOrderNumberingFirst )
391             {
392                 aStr = sFieldTypeName;
393                 if ( !aStr.isEmpty() )
394                     aStr += " ";
395             }
396 
397             SwWrtShell &rSh = rView.GetWrtShell();
398             SwSetExpFieldType* pFieldType = static_cast<SwSetExpFieldType*>(rSh.GetFieldType(
399                                             SwFieldIds::SetExp, sFieldTypeName ));
400             if( pFieldType && pFieldType->GetOutlineLvl() < MAXLEVEL )
401             {
402                 SwNumberTree::tNumberVector aNumVector;
403                 aNumVector.insert(aNumVector.end(), pFieldType->GetOutlineLvl() + 1, 1);
404 
405                 OUString sNumber( rSh.GetOutlineNumRule()->
406                                 MakeNumString(aNumVector, false ));
407                 if( !sNumber.isEmpty() )
408                     aStr += sNumber + pFieldType->GetDelimiter();
409             }
410 
411             switch( nNumFormat )
412             {
413             case SVX_NUM_CHARS_UPPER_LETTER:    aStr += "A"; break;
414             case SVX_NUM_CHARS_UPPER_LETTER_N:  aStr += "A"; break;
415             case SVX_NUM_CHARS_LOWER_LETTER:    aStr += "a"; break;
416             case SVX_NUM_CHARS_LOWER_LETTER_N:  aStr += "a"; break;
417             case SVX_NUM_ROMAN_UPPER:           aStr += "I"; break;
418             case SVX_NUM_ROMAN_LOWER:           aStr += "i"; break;
419             default:                    aStr += "1"; break;
420             }
421             //#i61007# order of captions
422             if( bOrderNumberingFirst )
423             {
424                 aStr += m_xNumberingSeparatorED->get_text() + sFieldTypeName;
425             }
426 
427         }
428         if( !sCaption.isEmpty() )
429         {
430             aStr += m_xSepEdit->get_text();
431         }
432     }
433     aStr += sCaption;
434     // do preview!
435     m_aPreview.SetPreviewText(aStr);
436 }
437 
~SwCaptionDialog()438 SwCaptionDialog::~SwCaptionDialog()
439 {
440 }
441 
SwSequenceOptionDialog(weld::Window * pParent,SwView & rV,const OUString & rSeqFieldType)442 SwSequenceOptionDialog::SwSequenceOptionDialog(weld::Window *pParent, SwView &rV, const OUString& rSeqFieldType )
443     : GenericDialogController(pParent, "modules/swriter/ui/captionoptions.ui", "CaptionOptionsDialog")
444     , m_rView(rV)
445     , m_aFieldTypeName(rSeqFieldType)
446     , m_xLbLevel(m_xBuilder->weld_combo_box("level"))
447     , m_xEdDelim(m_xBuilder->weld_entry("separator"))
448     , m_xLbCharStyle(m_xBuilder->weld_combo_box("style"))
449     , m_xApplyBorderAndShadowCB(m_xBuilder->weld_check_button("border_and_shadow"))
450     , m_xLbCaptionOrder(m_xBuilder->weld_combo_box("caption_order"))
451 {
452     SwWrtShell &rSh = m_rView.GetWrtShell();
453 
454     const OUString sNone(SwResId(SW_STR_NONE));
455 
456     m_xLbLevel->append_text(sNone);
457     for (sal_uInt16 n = 0; n < MAXLEVEL; ++n)
458         m_xLbLevel->append_text(OUString::number(n + 1));
459 
460     SwSetExpFieldType* pFieldType = static_cast<SwSetExpFieldType*>(rSh.GetFieldType(
461                                         SwFieldIds::SetExp, m_aFieldTypeName ));
462 
463     sal_Unicode nLvl = MAXLEVEL;
464     OUString sDelim(": ");
465     if( pFieldType )
466     {
467         sDelim = pFieldType->GetDelimiter();
468         nLvl = pFieldType->GetOutlineLvl();
469     }
470 
471     m_xLbLevel->set_active(nLvl < MAXLEVEL ? nLvl + 1 : 0);
472     m_xEdDelim->set_text(sDelim);
473 
474     m_xLbCharStyle->append_text(sNone);
475     ::FillCharStyleListBox(*m_xLbCharStyle, m_rView.GetDocShell(), true, true);
476     m_xLbCharStyle->set_active(0);
477 }
478 
Apply()479 void SwSequenceOptionDialog::Apply()
480 {
481     SwWrtShell &rSh = m_rView.GetWrtShell();
482     SwSetExpFieldType* pFieldType = static_cast<SwSetExpFieldType*>(rSh.GetFieldType(
483                                         SwFieldIds::SetExp, m_aFieldTypeName ));
484 
485     sal_Int8 nLvl = static_cast<sal_Int8>(m_xLbLevel->get_active() - 1);
486     sal_Unicode cDelim = m_xEdDelim->get_text()[0];
487 
488     bool bUpdate = true;
489     if( pFieldType )
490     {
491         pFieldType->SetDelimiter( OUString(cDelim) );
492         pFieldType->SetOutlineLvl( nLvl );
493     }
494     else if( !m_aFieldTypeName.isEmpty() && nLvl < MAXLEVEL )
495     {
496         // then we have to insert that
497         SwSetExpFieldType aFieldType( rSh.GetDoc(), m_aFieldTypeName, nsSwGetSetExpType::GSE_SEQ );
498         aFieldType.SetDelimiter( OUString(cDelim) );
499         aFieldType.SetOutlineLvl( nLvl );
500         rSh.InsertFieldType( aFieldType );
501     }
502     else
503         bUpdate = false;
504 
505     if( bUpdate )
506         rSh.UpdateExpFields();
507 }
508 
GetCharacterStyle() const509 OUString  SwSequenceOptionDialog::GetCharacterStyle() const
510 {
511     if (m_xLbCharStyle->get_active() != -1)
512         return m_xLbCharStyle->get_active_text();
513     return OUString();
514 }
515 
SetCharacterStyle(const OUString & rStyle)516 void SwSequenceOptionDialog::SetCharacterStyle(const OUString& rStyle)
517 {
518     const int nPos = m_xLbCharStyle->find_text(rStyle);
519     if (nPos == -1)
520         m_xLbCharStyle->set_active(0);
521     else
522         m_xLbCharStyle->set_active(nPos);
523 }
524 
525 // #i61007# order of captions
ApplyCaptionOrder()526 void SwCaptionDialog::ApplyCaptionOrder()
527 {
528     m_xNumberingSeparatorFT->set_sensitive(bOrderNumberingFirst);
529     m_xNumberingSeparatorED->set_sensitive(bOrderNumberingFirst);
530 }
531 
532 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
533