LibreOffice Module sw (master) 1
cption.cxx
Go to the documentation of this file.
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 <utility>
21#include <view.hxx>
22#include <wrtsh.hxx>
23#include <cption.hxx>
24#include <fldmgr.hxx>
25#include <expfld.hxx>
26#include <numrule.hxx>
27#include <poolfmt.hxx>
28#include <docsh.hxx>
29#include <calc.hxx>
30#include <uitool.hxx>
31#include <doc.hxx>
32#include <modcfg.hxx>
33#include <swmodule.hxx>
34#include <com/sun/star/frame/XModel.hpp>
35#include <com/sun/star/text/XTextGraphicObjectsSupplier.hpp>
36#include <com/sun/star/text/XTextTablesSupplier.hpp>
37#include <com/sun/star/text/XTextEmbeddedObjectsSupplier.hpp>
38#include <com/sun/star/text/XTextFramesSupplier.hpp>
39#include <comphelper/string.hxx>
40#include <vcl/weld.hxx>
41#include <strings.hrc>
42#include <SwStyleNameMapper.hxx>
43
44using namespace ::com::sun::star;
45
46namespace {
47
48class SwSequenceOptionDialog : public weld::GenericDialogController
49{
50 SwView& m_rView;
51 OUString m_aFieldTypeName;
52
53 std::unique_ptr<weld::ComboBox> m_xLbLevel;
54 std::unique_ptr<weld::Entry> m_xEdDelim;
55
56 std::unique_ptr<weld::ComboBox> m_xLbCharStyle;
57 std::unique_ptr<weld::CheckButton> m_xApplyBorderAndShadowCB;
58
59 //#i61007# order of captions
60 std::unique_ptr<weld::ComboBox> m_xLbCaptionOrder;
61
62public:
63 SwSequenceOptionDialog(weld::Window *pParent, SwView &rV, OUString aSeqFieldType);
64 void Apply();
65
66 bool IsApplyBorderAndShadow() const { return m_xApplyBorderAndShadowCB->get_active(); }
67 void SetApplyBorderAndShadow( bool bSet ) { m_xApplyBorderAndShadowCB->set_active(bSet); }
68
69 //#i61007# order of captions
70 bool IsOrderNumberingFirst() const { return m_xLbCaptionOrder->get_active() == 1; }
71 void SetOrderNumberingFirst(bool bSet) { m_xLbCaptionOrder->set_active(bSet ? 1 : 0); }
72
73 void SetCharacterStyle(const OUString& rStyle);
74 OUString GetCharacterStyle() const;
75};
76
77}
78
79OUString SwCaptionDialog::s_aSepTextSave(": "); // Caption separator text
80
81//Resolves: tdf#47427 disallow typing *or* pasting invalid content into the category box
82OUString TextFilterAutoConvert::filter(const OUString &rText)
83{
84 if (!rText.isEmpty() && rText != m_sNone && !SwCalc::IsValidVarName(rText))
85 return m_sLastGoodText;
86 m_sLastGoodText = rText;
87 return rText;
88}
89
91 : SfxDialogController(pParent, "modules/swriter/ui/insertcaption.ui", "InsertCaptionDialog")
92 , m_sNone(SwResId(SW_STR_NONE))
93 , m_aTextFilter(m_sNone)
94 , m_rView(rV)
95 , m_pMgr(new SwFieldMgr(m_rView.GetWrtShellPtr()))
96 , m_bCopyAttributes(false)
97 , m_bOrderNumberingFirst(SW_MOD()->GetModuleConfig()->IsCaptionOrderNumberingFirst())
98 , m_xTextEdit(m_xBuilder->weld_entry("caption_edit"))
99 , m_xCategoryBox(m_xBuilder->weld_combo_box("category"))
100 , m_xFormatText(m_xBuilder->weld_label("numbering_label"))
101 , m_xFormatBox(m_xBuilder->weld_combo_box("numbering"))
102 , m_xNumberingSeparatorFT(m_xBuilder->weld_label("num_separator"))
103 , m_xNumberingSeparatorED(m_xBuilder->weld_entry("num_separator_edit"))
104 , m_xSepText(m_xBuilder->weld_label("separator_label"))
105 , m_xSepEdit(m_xBuilder->weld_entry("separator_edit"))
106 , m_xPosBox(m_xBuilder->weld_combo_box("position"))
107 , m_xOKButton(m_xBuilder->weld_button("ok"))
108 , m_xAutoCaptionButton(m_xBuilder->weld_button("auto"))
109 , m_xOptionButton(m_xBuilder->weld_button("options"))
110 , m_xPreview(new weld::CustomWeld(*m_xBuilder, "preview", m_aPreview))
111{
112 //#i61007# order of captions
115 uno::Reference< frame::XModel > xModel = m_rView.GetDocShell()->GetBaseModel();
116
119 {
121 uno::Reference< text::XTextEmbeddedObjectsSupplier > xObjs(xModel, uno::UNO_QUERY);
122 m_xNameAccess = xObjs->getEmbeddedObjects();
123 }
124
125 m_xCategoryBox->connect_changed(LINK(this, SwCaptionDialog, ModifyComboHdl));
126 Link<weld::Entry&,void> aLk = LINK(this, SwCaptionDialog, ModifyEntryHdl);
127 m_xTextEdit->connect_changed(aLk);
128 m_xNumberingSeparatorED->connect_changed(aLk);
129 m_xSepEdit->connect_changed(aLk);
130
131 m_xFormatBox->connect_changed(LINK(this, SwCaptionDialog, SelectListBoxHdl));
132 m_xOKButton->connect_clicked(LINK(this, SwCaptionDialog, OKHdl));
133 m_xOptionButton->connect_clicked(LINK(this, SwCaptionDialog, OptionHdl));
134 m_xAutoCaptionButton->connect_clicked(LINK(this, SwCaptionDialog, CaptionHdl));
135 m_xAutoCaptionButton->set_accessible_description(SwResId(STR_A11Y_DESC_AUTO));
136
137 m_xCategoryBox->append_text(m_sNone);
138 size_t nCount = m_pMgr->GetFieldTypeCount();
139 for (size_t i = 0; i < nCount; ++i)
140 {
141 SwFieldType *pType = m_pMgr->GetFieldType( SwFieldIds::Unknown, i );
142 if( pType->Which() == SwFieldIds::SetExp &&
143 static_cast<SwSetExpFieldType *>( pType)->GetType() & nsSwGetSetExpType::GSE_SEQ )
144 m_xCategoryBox->append_text(pType->GetName());
145 }
146
147 OUString sString;
148 sal_uInt16 nPoolId = 0;
150 {
152
153 SwSetExpFieldType* pTypeIll= static_cast<SwSetExpFieldType*>(rSh.GetFieldType(SwFieldIds::SetExp, SwResId(STR_POOLCOLL_LABEL_ABB)));
154 if(rSh.IsUsed(*pTypeIll)) //default to illustration for legacy docs
155 {
156 nPoolId = RES_POOLCOLL_LABEL_ABB;
157
158 }
159
160 sString = m_rView.GetOldGrfCat();
161 m_bCopyAttributes = true;
162 //if not OLE
163 if(!m_xNameAccess.is())
164 {
165 uno::Reference< text::XTextGraphicObjectsSupplier > xGraphics(xModel, uno::UNO_QUERY);
166 m_xNameAccess = xGraphics->getGraphicObjects();
167 }
168
169 }
170 else if( eType & SelectionType::Table )
171 {
172 nPoolId = RES_POOLCOLL_LABEL_TABLE;
173 sString = m_rView.GetOldTabCat();
174 uno::Reference< text::XTextTablesSupplier > xTables(xModel, uno::UNO_QUERY);
175 m_xNameAccess = xTables->getTextTables();
176 }
177 else if( eType & SelectionType::Frame )
178 {
179 nPoolId = RES_POOLCOLL_LABEL_FRAME;
180 sString = m_rView.GetOldFrameCat();
181 uno::Reference< text::XTextFramesSupplier > xFrames(xModel, uno::UNO_QUERY);
182 m_xNameAccess = xFrames->getTextFrames();
183 }
184 else if( eType == SelectionType::Text )
185 {
186 nPoolId = RES_POOLCOLL_LABEL_FRAME;
187 sString = m_rView.GetOldFrameCat();
188 }
190 {
192 sString = m_rView.GetOldDrwCat();
193 }
194 if( nPoolId )
195 {
196 if (sString.isEmpty())
197 sString = SwStyleNameMapper::GetUIName(nPoolId, OUString());
198 auto nIndex = m_xCategoryBox->find_text(sString);
199 if (nIndex != -1)
200 m_xCategoryBox->set_active(nIndex);
201 else
202 m_xCategoryBox->set_entry_text(sString);
203 }
204
205 // aFormatBox
206 sal_uInt16 nSelFormat = SVX_NUM_ARABIC;
207 nCount = m_pMgr->GetFieldTypeCount();
208 for ( size_t i = nCount; i; )
209 {
210 SwFieldType* pFieldType = m_pMgr->GetFieldType(SwFieldIds::Unknown, --i);
211 if (pFieldType->GetName() == m_xCategoryBox->get_active_text())
212 {
213 nSelFormat = o3tl::narrowing<sal_uInt16>(static_cast<SwSetExpFieldType*>(pFieldType)->GetSeqFormat());
214 break;
215 }
216 }
217
218 sal_uInt16 nFormatCount = m_pMgr->GetFormatCount(SwFieldTypesEnum::Sequence, false);
219 for ( sal_uInt16 i = 0; i < nFormatCount; ++i )
220 {
221 const sal_uInt16 nFormatId = m_pMgr->GetFormatId(SwFieldTypesEnum::Sequence, i);
222 m_xFormatBox->append(OUString::number(nFormatId), m_pMgr->GetFormatStr(SwFieldTypesEnum::Sequence, i));
223 if (nFormatId == nSelFormat)
224 m_xFormatBox->set_active(i);
225 }
226
227 // aPosBox
235 {
236 m_xPosBox->append_text(SwResId(STR_CAPTION_ABOVE));
237 m_xPosBox->append_text(SwResId(STR_CAPTION_BELOW));
238 }
239 else if(eType == SelectionType::Frame
241 {
242 m_xPosBox->append_text(SwResId(STR_CAPTION_BEGINNING));
243 m_xPosBox->append_text(SwResId(STR_CAPTION_END));
244 }
245
247 {
248 m_xPosBox->set_active(0);
249 }
250 else
251 {
252 m_xPosBox->set_active(1);
253 }
254
255 ModifyHdl();
256
257 m_xSepEdit->set_text(s_aSepTextSave);
258 m_xTextEdit->grab_focus();
259 DrawSample();
260}
261
263{
264 Apply();
265 m_xDialog->response(RET_OK);
266}
267
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 {
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;
290 m_rView.InsertCaption( &aOpt );
291 s_aSepTextSave = m_xSepEdit->get_text();
292}
293
295{
296 short nRet = SfxDialogController::run();
297 if (nRet == RET_OK)
298 Apply();
299 return nRet;
300}
301
303{
304 OUString sFieldTypeName = m_xCategoryBox->get_active_text();
305 if(sFieldTypeName == m_sNone)
306 sFieldTypeName.clear();
307 auto pDlg = std::make_shared<SwSequenceOptionDialog>(m_xDialog.get(), m_rView, sFieldTypeName);
308 pDlg->SetApplyBorderAndShadow(m_bCopyAttributes);
309 pDlg->SetCharacterStyle( m_sCharacterStyle );
310 pDlg->SetOrderNumberingFirst( m_bOrderNumberingFirst );
311
312 GenericDialogController::runAsync(pDlg, [pDlg, this](sal_Int32 nResult){
313 if (nResult == RET_OK) {
314 pDlg->Apply();
315 m_bCopyAttributes = pDlg->IsApplyBorderAndShadow();
316 m_sCharacterStyle = pDlg->GetCharacterStyle();
317 //#i61007# order of captions
318 if( m_bOrderNumberingFirst != pDlg->IsOrderNumberingFirst() )
319 {
320 m_bOrderNumberingFirst = pDlg->IsOrderNumberingFirst();
321 SW_MOD()->GetModuleConfig()->SetCaptionOrderNumberingFirst(m_bOrderNumberingFirst);
322 ApplyCaptionOrder();
323 }
324 DrawSample();
325 }
326 });
327}
328
330{
331 DrawSample();
332}
333
335{
337 OUString sFieldTypeName = m_xCategoryBox->get_active_text();
338 bool bCorrectFieldName = !sFieldTypeName.isEmpty();
339 bool bNone = sFieldTypeName == m_sNone;
340 SwFieldType* pType = (bCorrectFieldName && !bNone)
341 ? rSh.GetFieldType( SwFieldIds::SetExp, sFieldTypeName )
342 : nullptr;
343 m_xOKButton->set_sensitive( bCorrectFieldName &&
344 (!pType ||
345 static_cast<SwSetExpFieldType*>(pType)->GetType() == nsSwGetSetExpType::GSE_SEQ) );
346 m_xOptionButton->set_sensitive(m_xOKButton->get_sensitive() && !bNone);
347 m_xNumberingSeparatorFT->set_sensitive(m_bOrderNumberingFirst && !bNone);
348 m_xNumberingSeparatorED->set_sensitive(m_bOrderNumberingFirst && !bNone);
349 m_xFormatText->set_sensitive(!bNone);
350 m_xFormatBox->set_sensitive(!bNone);
351 m_xSepText->set_sensitive(!bNone);
352 m_xSepEdit->set_sensitive(!bNone);
353 DrawSample();
354}
355
357{
358 ModifyHdl();
359}
360
362{
363 OUString sText = m_xCategoryBox->get_active_text();
364 OUString sAllowedText = m_aTextFilter.filter(sText);
365 if (sText != sAllowedText)
366 {
367 m_xCategoryBox->set_entry_text(sAllowedText);
368 m_xCategoryBox->select_entry_region(sAllowedText.getLength(), sAllowedText.getLength());
369 }
370 ModifyHdl();
371}
372
374{
375 SfxItemSet aSet(m_rView.GetDocShell()->GetDoc()->GetAttrPool());
376 SwCaptionOptDlg aDlg(m_xDialog.get(), aSet);
377 aDlg.run();
378}
379
381{
382 OUString aStr;
383 OUString sCaption = m_xTextEdit->get_text();
384
385 // number
386 OUString sFieldTypeName = m_xCategoryBox->get_active_text();
387 bool bNone = sFieldTypeName == m_sNone;
388 if( !bNone )
389 {
390 const sal_uInt16 nNumFormat = m_xFormatBox->get_active_id().toUInt32();
391 if (SVX_NUM_NUMBER_NONE != nNumFormat)
392 {
393 // category
394 //#i61007# order of captions
396 {
397 aStr = sFieldTypeName;
398 if ( !aStr.isEmpty() )
399 aStr += " ";
400 }
401
403 SwSetExpFieldType* pFieldType = static_cast<SwSetExpFieldType*>(rSh.GetFieldType(
404 SwFieldIds::SetExp, sFieldTypeName ));
405 if( pFieldType && pFieldType->GetOutlineLvl() < MAXLEVEL )
406 {
408 aNumVector.insert(aNumVector.end(), pFieldType->GetOutlineLvl() + 1, 1);
409
410 OUString sNumber( rSh.GetOutlineNumRule()->
411 MakeNumString(aNumVector, false ));
412 if( !sNumber.isEmpty() )
413 aStr += sNumber + pFieldType->GetDelimiter();
414 }
415
416 switch( nNumFormat )
417 {
418 case SVX_NUM_CHARS_UPPER_LETTER: aStr += "A"; break;
419 case SVX_NUM_CHARS_UPPER_LETTER_N: aStr += "A"; break;
420 case SVX_NUM_CHARS_LOWER_LETTER: aStr += "a"; break;
421 case SVX_NUM_CHARS_LOWER_LETTER_N: aStr += "a"; break;
422 case SVX_NUM_ROMAN_UPPER: aStr += "I"; break;
423 case SVX_NUM_ROMAN_LOWER: aStr += "i"; break;
424 default: aStr += "1"; break;
425 }
426 //#i61007# order of captions
428 {
429 aStr += m_xNumberingSeparatorED->get_text() + sFieldTypeName;
430 }
431
432 }
433 if( !sCaption.isEmpty() )
434 {
435 aStr += m_xSepEdit->get_text();
436 }
437 }
438 aStr += sCaption;
439 // do preview!
441}
442
444{
445}
446
447SwSequenceOptionDialog::SwSequenceOptionDialog(weld::Window *pParent, SwView &rV, OUString aSeqFieldType )
448 : GenericDialogController(pParent, "modules/swriter/ui/captionoptions.ui", "CaptionOptionsDialog")
449 , m_rView(rV)
450 , m_aFieldTypeName(std::move(aSeqFieldType))
451 , m_xLbLevel(m_xBuilder->weld_combo_box("level"))
452 , m_xEdDelim(m_xBuilder->weld_entry("separator"))
453 , m_xLbCharStyle(m_xBuilder->weld_combo_box("style"))
454 , m_xApplyBorderAndShadowCB(m_xBuilder->weld_check_button("border_and_shadow"))
455 , m_xLbCaptionOrder(m_xBuilder->weld_combo_box("caption_order"))
456{
458
459 const OUString sNone(SwResId(SW_STR_NONE));
460
461 m_xLbLevel->append_text(sNone);
462 for (sal_uInt16 n = 0; n < MAXLEVEL; ++n)
463 m_xLbLevel->append_text(OUString::number(n + 1));
464
465 SwSetExpFieldType* pFieldType = static_cast<SwSetExpFieldType*>(rSh.GetFieldType(
466 SwFieldIds::SetExp, m_aFieldTypeName ));
467
468 sal_Unicode nLvl = MAXLEVEL;
469 OUString sDelim(": ");
470 if( pFieldType )
471 {
472 sDelim = pFieldType->GetDelimiter();
473 nLvl = pFieldType->GetOutlineLvl();
474 }
475
476 m_xLbLevel->set_active(nLvl < MAXLEVEL ? nLvl + 1 : 0);
477 m_xEdDelim->set_text(sDelim);
478
479 m_xLbCharStyle->append_text(sNone);
480 ::FillCharStyleListBox(*m_xLbCharStyle, m_rView.GetDocShell(), true, true);
481 m_xLbCharStyle->set_active(0);
482}
483
484void SwSequenceOptionDialog::Apply()
485{
486 SwWrtShell &rSh = m_rView.GetWrtShell();
487 SwSetExpFieldType* pFieldType = static_cast<SwSetExpFieldType*>(rSh.GetFieldType(
488 SwFieldIds::SetExp, m_aFieldTypeName ));
489
490 sal_Int8 nLvl = static_cast<sal_Int8>(m_xLbLevel->get_active() - 1);
491 sal_Unicode cDelim = m_xEdDelim->get_text()[0];
492
493 bool bUpdate = true;
494 if( pFieldType )
495 {
496 pFieldType->SetDelimiter( OUString(cDelim) );
497 pFieldType->SetOutlineLvl( nLvl );
498 }
499 else if( !m_aFieldTypeName.isEmpty() && nLvl < MAXLEVEL )
500 {
501 // then we have to insert that
502 SwSetExpFieldType aFieldType( rSh.GetDoc(), m_aFieldTypeName, nsSwGetSetExpType::GSE_SEQ );
503 aFieldType.SetDelimiter( OUString(cDelim) );
504 aFieldType.SetOutlineLvl( nLvl );
505 rSh.InsertFieldType( aFieldType );
506 }
507 else
508 bUpdate = false;
509
510 if( bUpdate )
511 rSh.UpdateExpFields();
512}
513
514OUString SwSequenceOptionDialog::GetCharacterStyle() const
515{
516 if (m_xLbCharStyle->get_active() != -1)
517 return m_xLbCharStyle->get_active_text();
518 return OUString();
519}
520
521void SwSequenceOptionDialog::SetCharacterStyle(const OUString& rStyle)
522{
523 const int nPos = m_xLbCharStyle->find_text(rStyle);
524 if (nPos == -1)
525 m_xLbCharStyle->set_active(0);
526 else
527 m_xLbCharStyle->set_active(nPos);
528}
529
530// #i61007# order of captions
532{
535}
536
537/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Reference< XExecutableDialog > m_xDialog
void SetCategory(const OUString &rCat)
Definition: caption.hxx:56
void SetNumType(const sal_uInt16 nNT)
Definition: caption.hxx:59
bool & UseCaption()
Definition: caption.hxx:48
bool & CopyAttributes()
Definition: caption.hxx:83
void SetCaption(const OUString &rCap)
Definition: caption.hxx:65
void SetSeparator(const OUString &rSep)
Definition: caption.hxx:74
void SetPos(const sal_uInt16 nP)
Definition: caption.hxx:68
void SetCharacterStyle(const OUString &rStyle)
Definition: caption.hxx:77
bool & IgnoreSeqOpts()
Definition: caption.hxx:80
void SetNumSeparator(const OUString &rSet)
Definition: caption.hxx:62
css::uno::Reference< css::frame::XModel3 > GetBaseModel() const
static SW_DLLPUBLIC bool IsValidVarName(const OUString &rStr, OUString *pValidName=nullptr)
Definition: calc.cxx:1420
std::unique_ptr< weld::Label > m_xNumberingSeparatorFT
Definition: cption.hxx:51
bool m_bCopyAttributes
Definition: cption.hxx:40
SwView & m_rView
Definition: cption.hxx:36
css::uno::Reference< css::container::XNameAccess > m_xNameAccess
Definition: cption.hxx:43
bool m_bOrderNumberingFirst
Definition: cption.hxx:41
std::unique_ptr< weld::ComboBox > m_xPosBox
Definition: cption.hxx:55
void DrawSample()
Definition: cption.cxx:380
static OUString s_aSepTextSave
Definition: cption.hxx:74
std::unique_ptr< weld::Entry > m_xSepEdit
Definition: cption.hxx:54
void ApplyCaptionOrder()
Definition: cption.cxx:531
std::unique_ptr< weld::Label > m_xFormatText
Definition: cption.hxx:48
std::unique_ptr< weld::Entry > m_xNumberingSeparatorED
Definition: cption.hxx:52
std::unique_ptr< weld::ComboBox > m_xCategoryBox
Definition: cption.hxx:47
OUString m_sNone
Definition: cption.hxx:34
std::unique_ptr< weld::ComboBox > m_xFormatBox
Definition: cption.hxx:49
std::unique_ptr< weld::Label > m_xSepText
Definition: cption.hxx:53
std::unique_ptr< weld::Entry > m_xTextEdit
Definition: cption.hxx:46
virtual short run() override
Definition: cption.cxx:294
SwCaptionPreview m_aPreview
Definition: cption.hxx:45
virtual ~SwCaptionDialog() override
Definition: cption.cxx:443
OUString m_sCharacterStyle
Definition: cption.hxx:39
std::unique_ptr< weld::Button > m_xOptionButton
Definition: cption.hxx:58
std::unique_ptr< SwFieldMgr > m_pMgr
Definition: cption.hxx:37
void Apply()
Definition: cption.cxx:268
SwCaptionDialog(weld::Window *pParent, SwView &rV)
Definition: cption.cxx:90
std::unique_ptr< weld::Button > m_xAutoCaptionButton
Definition: cption.hxx:57
void ModifyHdl()
Definition: cption.cxx:334
std::unique_ptr< weld::Button > m_xOKButton
Definition: cption.hxx:56
void SetPreviewText(const OUString &rText)
Definition: optload.cxx:394
SwDoc * GetDoc()
returns Doc. But be careful!
Definition: docsh.hxx:204
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1337
SwFieldType * GetFieldType(size_t nField, SwFieldIds nResId=SwFieldIds::Unknown) const
get field types with a ResId, if 0 get all
Definition: edfld.cxx:64
const SwNumRule * GetOutlineNumRule() const
Definition: ednumber.cxx:117
SwFieldType * InsertFieldType(const SwFieldType &)
insert field type
Definition: edfld.cxx:339
void UpdateExpFields(bool bCloseDB=false)
only every expression fields update
Definition: edfld.cxx:315
bool IsUsed(const sw::BroadcastingModify &) const
Query if the paragraph-/character-/frame-/page-style is used.
Definition: edfmt.cxx:137
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:247
virtual OUString GetName() const
Only in derived classes.
Definition: fldbas.cxx:139
SwFieldIds Which() const
Definition: fldbas.hxx:276
const OUString & GetDelimiter() const
Number sequence fields chapterwise if required.
Definition: expfld.hxx:181
sal_uInt16 GetType() const
Definition: expfld.hxx:198
void SetOutlineLvl(sal_uInt8 n)
Definition: expfld.hxx:184
void SetDelimiter(const OUString &s)
Definition: expfld.hxx:182
sal_uInt8 GetOutlineLvl() const
Definition: expfld.hxx:183
static const OUString & GetUIName(const OUString &rName, SwGetPoolIdFromName)
SwDoc * GetDoc() const
Definition: viewsh.hxx:308
Definition: view.hxx:146
SwWrtShell & GetWrtShell() const
Definition: view.hxx:423
const OUString & GetOldGrfCat()
Definition: view2.cxx:3133
const OUString & GetOldFrameCat()
Definition: view2.cxx:3153
SwDocShell * GetDocShell()
Definition: view.cxx:1193
const OUString & GetOldDrwCat()
Definition: view2.cxx:3163
void InsertCaption(const InsCaptionOpt *pOpt)
Definition: viewdlg2.cxx:196
const OUString & GetOldTabCat()
Definition: view2.cxx:3143
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1723
virtual OUString filter(const OUString &rText) override
Definition: cption.cxx:82
OUString m_sLastGoodText
Definition: optload.hxx:48
IMPL_LINK_NOARG(SwCaptionDialog, OKHdl, weld::Button &, void)
Definition: cption.cxx:262
int nCount
DocumentType eType
SelectionType
std::unique_ptr< weld::Button > m_xOKButton
sal_Int32 nIndex
OUString aName
sal_Int64 n
sal_uInt16 nPos
aStr
std::vector< tSwNumTreeNumber > tNumberVector
OString strip(const OString &rIn, char c)
int i
const SwGetSetExpType GSE_SEQ
Sequence.
Definition: fldbas.hxx:209
@ RES_POOLCOLL_LABEL_DRAWING
Label drawing objects.
Definition: poolfmt.hxx:358
@ RES_POOLCOLL_LABEL_FRAME
Label frame.
Definition: poolfmt.hxx:348
@ RES_POOLCOLL_LABEL_FIGURE
Label figure.
Definition: poolfmt.hxx:349
@ RES_POOLCOLL_LABEL_TABLE
Label table.
Definition: poolfmt.hxx:347
@ RES_POOLCOLL_LABEL_ABB
Label illustration.
Definition: poolfmt.hxx:346
Reference< XModel > xModel
SVX_NUM_NUMBER_NONE
SVX_NUM_CHARS_LOWER_LETTER_N
SVX_NUM_CHARS_LOWER_LETTER
SVX_NUM_CHARS_UPPER_LETTER
SVX_NUM_ROMAN_UPPER
SVX_NUM_ROMAN_LOWER
SVX_NUM_ARABIC
SVX_NUM_CHARS_UPPER_LETTER_N
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:168
#define SW_MOD()
Definition: swmodule.hxx:254
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:92
sal_uInt16 sal_Unicode
signed char sal_Int8
SW_DLLPUBLIC void FillCharStyleListBox(weld::ComboBox &rToFill, SwDocShell *pDocSh, bool bSorted=false, bool bWithDefault=false)
Definition: uitool.cxx:781
const sal_Unicode cDelim
constexpr OUStringLiteral sNone
RET_OK