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 virtual short run() override
77 {
79 if (nRet == RET_OK)
80 Apply();
81 return nRet;
82 }
83};
84
85}
86
87OUString SwCaptionDialog::s_aSepTextSave(": "); // Caption separator text
88
89//Resolves: tdf#47427 disallow typing *or* pasting invalid content into the category box
90OUString TextFilterAutoConvert::filter(const OUString &rText)
91{
92 if (!rText.isEmpty() && rText != m_sNone && !SwCalc::IsValidVarName(rText))
93 return m_sLastGoodText;
94 m_sLastGoodText = rText;
95 return rText;
96}
97
99 : SfxDialogController(pParent, "modules/swriter/ui/insertcaption.ui", "InsertCaptionDialog")
100 , m_sNone(SwResId(SW_STR_NONE))
101 , m_aTextFilter(m_sNone)
102 , m_rView(rV)
103 , m_pMgr(new SwFieldMgr(m_rView.GetWrtShellPtr()))
104 , m_bCopyAttributes(false)
105 , m_bOrderNumberingFirst(SW_MOD()->GetModuleConfig()->IsCaptionOrderNumberingFirst())
106 , m_xTextEdit(m_xBuilder->weld_entry("caption_edit"))
107 , m_xCategoryBox(m_xBuilder->weld_combo_box("category"))
108 , m_xFormatText(m_xBuilder->weld_label("numbering_label"))
109 , m_xFormatBox(m_xBuilder->weld_combo_box("numbering"))
110 , m_xNumberingSeparatorFT(m_xBuilder->weld_label("num_separator"))
111 , m_xNumberingSeparatorED(m_xBuilder->weld_entry("num_separator_edit"))
112 , m_xSepText(m_xBuilder->weld_label("separator_label"))
113 , m_xSepEdit(m_xBuilder->weld_entry("separator_edit"))
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
123 uno::Reference< frame::XModel > xModel = m_rView.GetDocShell()->GetBaseModel();
124
127 {
129 uno::Reference< text::XTextEmbeddedObjectsSupplier > xObjs(xModel, uno::UNO_QUERY);
130 m_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_xOKButton->connect_clicked(LINK(this, SwCaptionDialog, OKHdl));
141 m_xOptionButton->connect_clicked(LINK(this, SwCaptionDialog, OptionHdl));
142 m_xAutoCaptionButton->connect_clicked(LINK(this, SwCaptionDialog, CaptionHdl));
143 m_xAutoCaptionButton->set_accessible_description(SwResId(STR_A11Y_DESC_AUTO));
144
145 m_xCategoryBox->append_text(m_sNone);
146 size_t nCount = m_pMgr->GetFieldTypeCount();
147 for (size_t i = 0; i < nCount; ++i)
148 {
149 SwFieldType *pType = m_pMgr->GetFieldType( SwFieldIds::Unknown, i );
150 if( pType->Which() == SwFieldIds::SetExp &&
151 static_cast<SwSetExpFieldType *>( pType)->GetType() & nsSwGetSetExpType::GSE_SEQ )
152 m_xCategoryBox->append_text(pType->GetName());
153 }
154
155 OUString sString;
156 sal_uInt16 nPoolId = 0;
158 {
160
161 SwSetExpFieldType* pTypeIll= static_cast<SwSetExpFieldType*>(rSh.GetFieldType(SwFieldIds::SetExp, SwResId(STR_POOLCOLL_LABEL_ABB)));
162 if(rSh.IsUsed(*pTypeIll)) //default to illustration for legacy docs
163 {
164 nPoolId = RES_POOLCOLL_LABEL_ABB;
165
166 }
167
168 sString = m_rView.GetOldGrfCat();
169 m_bCopyAttributes = true;
170 //if not OLE
171 if(!m_xNameAccess.is())
172 {
173 uno::Reference< text::XTextGraphicObjectsSupplier > xGraphics(xModel, uno::UNO_QUERY);
174 m_xNameAccess = xGraphics->getGraphicObjects();
175 }
176
177 }
178 else if( eType & SelectionType::Table )
179 {
180 nPoolId = RES_POOLCOLL_LABEL_TABLE;
181 sString = m_rView.GetOldTabCat();
182 uno::Reference< text::XTextTablesSupplier > xTables(xModel, uno::UNO_QUERY);
183 m_xNameAccess = xTables->getTextTables();
184 }
185 else if( eType & SelectionType::Frame )
186 {
187 nPoolId = RES_POOLCOLL_LABEL_FRAME;
188 sString = m_rView.GetOldFrameCat();
189 uno::Reference< text::XTextFramesSupplier > xFrames(xModel, uno::UNO_QUERY);
190 m_xNameAccess = xFrames->getTextFrames();
191 }
192 else if( eType == SelectionType::Text )
193 {
194 nPoolId = RES_POOLCOLL_LABEL_FRAME;
195 sString = m_rView.GetOldFrameCat();
196 }
198 {
200 sString = m_rView.GetOldDrwCat();
201 }
202 if( nPoolId )
203 {
204 if (sString.isEmpty())
205 sString = SwStyleNameMapper::GetUIName(nPoolId, OUString());
206 auto nIndex = m_xCategoryBox->find_text(sString);
207 if (nIndex != -1)
208 m_xCategoryBox->set_active(nIndex);
209 else
210 m_xCategoryBox->set_entry_text(sString);
211 }
212
213 // aFormatBox
214 sal_uInt16 nSelFormat = SVX_NUM_ARABIC;
215 nCount = m_pMgr->GetFieldTypeCount();
216 for ( size_t i = nCount; i; )
217 {
218 SwFieldType* pFieldType = m_pMgr->GetFieldType(SwFieldIds::Unknown, --i);
219 if (pFieldType->GetName() == m_xCategoryBox->get_active_text())
220 {
221 nSelFormat = o3tl::narrowing<sal_uInt16>(static_cast<SwSetExpFieldType*>(pFieldType)->GetSeqFormat());
222 break;
223 }
224 }
225
226 sal_uInt16 nFormatCount = m_pMgr->GetFormatCount(SwFieldTypesEnum::Sequence, false);
227 for ( sal_uInt16 i = 0; i < nFormatCount; ++i )
228 {
229 const sal_uInt16 nFormatId = m_pMgr->GetFormatId(SwFieldTypesEnum::Sequence, i);
230 m_xFormatBox->append(OUString::number(nFormatId), m_pMgr->GetFormatStr(SwFieldTypesEnum::Sequence, i));
231 if (nFormatId == nSelFormat)
232 m_xFormatBox->set_active(i);
233 }
234
235 // aPosBox
243 {
244 m_xPosBox->append_text(SwResId(STR_CAPTION_ABOVE));
245 m_xPosBox->append_text(SwResId(STR_CAPTION_BELOW));
246 }
247 else if(eType == SelectionType::Frame
249 {
250 m_xPosBox->append_text(SwResId(STR_CAPTION_BEGINNING));
251 m_xPosBox->append_text(SwResId(STR_CAPTION_END));
252 }
253
255 {
256 m_xPosBox->set_active(0);
257 }
258 else
259 {
260 m_xPosBox->set_active(1);
261 }
262
263 ModifyHdl();
264
265 m_xSepEdit->set_text(s_aSepTextSave);
266 m_xTextEdit->grab_focus();
267 DrawSample();
268}
269
271{
272 Apply();
273 m_xDialog->response(RET_OK);
274}
275
277{
278 InsCaptionOpt aOpt;
279 aOpt.UseCaption() = true;
280 OUString aName(m_xCategoryBox->get_active_text());
281 if ( aName == m_sNone )
282 {
283 aOpt.SetCategory( OUString() );
284 aOpt.SetNumSeparator( OUString() );
285 }
286 else
287 {
290 }
291 aOpt.SetNumType(m_xFormatBox->get_active_id().toUInt32());
292 aOpt.SetSeparator(m_xSepEdit->get_sensitive() ? m_xSepEdit->get_text() : OUString());
293 aOpt.SetCaption(m_xTextEdit->get_text());
294 aOpt.SetPos(m_xPosBox->get_active());
295 aOpt.IgnoreSeqOpts() = true;
298 m_rView.InsertCaption( &aOpt );
299 s_aSepTextSave = m_xSepEdit->get_text();
300}
301
303{
304 short nRet = SfxDialogController::run();
305 if (nRet == RET_OK)
306 Apply();
307 return nRet;
308}
309
311{
312 OUString sFieldTypeName = m_xCategoryBox->get_active_text();
313 if(sFieldTypeName == m_sNone)
314 sFieldTypeName.clear();
315 auto pDlg = std::make_shared<SwSequenceOptionDialog>(m_xDialog.get(), m_rView, sFieldTypeName);
316 pDlg->SetApplyBorderAndShadow(m_bCopyAttributes);
317 pDlg->SetCharacterStyle( m_sCharacterStyle );
318 pDlg->SetOrderNumberingFirst( m_bOrderNumberingFirst );
319
320 GenericDialogController::runAsync(pDlg, [pDlg, this](sal_Int32 nResult){
321 if (nResult == RET_OK) {
322 m_bCopyAttributes = pDlg->IsApplyBorderAndShadow();
323 m_sCharacterStyle = pDlg->GetCharacterStyle();
324 //#i61007# order of captions
325 if( m_bOrderNumberingFirst != pDlg->IsOrderNumberingFirst() )
326 {
327 m_bOrderNumberingFirst = pDlg->IsOrderNumberingFirst();
328 SW_MOD()->GetModuleConfig()->SetCaptionOrderNumberingFirst(m_bOrderNumberingFirst);
329 ApplyCaptionOrder();
330 }
331 DrawSample();
332 }
333 });
334}
335
337{
338 DrawSample();
339}
340
342{
344 OUString sFieldTypeName = m_xCategoryBox->get_active_text();
345 bool bCorrectFieldName = !sFieldTypeName.isEmpty();
346 bool bNone = sFieldTypeName == m_sNone;
347 SwFieldType* pType = (bCorrectFieldName && !bNone)
348 ? rSh.GetFieldType( SwFieldIds::SetExp, sFieldTypeName )
349 : nullptr;
350 m_xOKButton->set_sensitive( bCorrectFieldName &&
351 (!pType ||
352 static_cast<SwSetExpFieldType*>(pType)->GetType() == nsSwGetSetExpType::GSE_SEQ) );
353 m_xOptionButton->set_sensitive(m_xOKButton->get_sensitive() && !bNone);
354 m_xNumberingSeparatorFT->set_sensitive(m_bOrderNumberingFirst && !bNone);
355 m_xNumberingSeparatorED->set_sensitive(m_bOrderNumberingFirst && !bNone);
356 m_xFormatText->set_sensitive(!bNone);
357 m_xFormatBox->set_sensitive(!bNone);
358 m_xSepText->set_sensitive(!bNone);
359 m_xSepEdit->set_sensitive(!bNone);
360 DrawSample();
361}
362
364{
365 ModifyHdl();
366}
367
369{
370 OUString sText = m_xCategoryBox->get_active_text();
371 OUString sAllowedText = m_aTextFilter.filter(sText);
372 if (sText != sAllowedText)
373 {
374 m_xCategoryBox->set_entry_text(sAllowedText);
375 m_xCategoryBox->select_entry_region(sAllowedText.getLength(), sAllowedText.getLength());
376 }
377 ModifyHdl();
378}
379
381{
382 SfxItemSet aSet(m_rView.GetDocShell()->GetDoc()->GetAttrPool());
383 SwCaptionOptDlg aDlg(m_xDialog.get(), aSet);
384 aDlg.run();
385}
386
388{
389 OUString aStr;
390 OUString sCaption = m_xTextEdit->get_text();
391
392 // number
393 OUString sFieldTypeName = m_xCategoryBox->get_active_text();
394 bool bNone = sFieldTypeName == m_sNone;
395 if( !bNone )
396 {
397 const sal_uInt16 nNumFormat = m_xFormatBox->get_active_id().toUInt32();
398 if (SVX_NUM_NUMBER_NONE != nNumFormat)
399 {
400 // category
401 //#i61007# order of captions
403 {
404 aStr = sFieldTypeName;
405 if ( !aStr.isEmpty() )
406 aStr += " ";
407 }
408
410 SwSetExpFieldType* pFieldType = static_cast<SwSetExpFieldType*>(rSh.GetFieldType(
411 SwFieldIds::SetExp, sFieldTypeName ));
412 if( pFieldType && pFieldType->GetOutlineLvl() < MAXLEVEL )
413 {
415 aNumVector.insert(aNumVector.end(), pFieldType->GetOutlineLvl() + 1, 1);
416
417 OUString sNumber( rSh.GetOutlineNumRule()->
418 MakeNumString(aNumVector, false ));
419 if( !sNumber.isEmpty() )
420 aStr += sNumber + pFieldType->GetDelimiter();
421 }
422
423 switch( nNumFormat )
424 {
425 case SVX_NUM_CHARS_UPPER_LETTER: aStr += "A"; break;
426 case SVX_NUM_CHARS_UPPER_LETTER_N: aStr += "A"; break;
427 case SVX_NUM_CHARS_LOWER_LETTER: aStr += "a"; break;
428 case SVX_NUM_CHARS_LOWER_LETTER_N: aStr += "a"; break;
429 case SVX_NUM_ROMAN_UPPER: aStr += "I"; break;
430 case SVX_NUM_ROMAN_LOWER: aStr += "i"; break;
431 default: aStr += "1"; break;
432 }
433 //#i61007# order of captions
435 {
436 aStr += m_xNumberingSeparatorED->get_text() + sFieldTypeName;
437 }
438
439 }
440 if( !sCaption.isEmpty() )
441 {
442 aStr += m_xSepEdit->get_text();
443 }
444 }
445 aStr += sCaption;
446 // do preview!
448}
449
451{
452}
453
454SwSequenceOptionDialog::SwSequenceOptionDialog(weld::Window *pParent, SwView &rV, OUString aSeqFieldType )
455 : GenericDialogController(pParent, "modules/swriter/ui/captionoptions.ui", "CaptionOptionsDialog")
456 , m_rView(rV)
457 , m_aFieldTypeName(std::move(aSeqFieldType))
458 , m_xLbLevel(m_xBuilder->weld_combo_box("level"))
459 , m_xEdDelim(m_xBuilder->weld_entry("separator"))
460 , m_xLbCharStyle(m_xBuilder->weld_combo_box("style"))
461 , m_xApplyBorderAndShadowCB(m_xBuilder->weld_check_button("border_and_shadow"))
462 , m_xLbCaptionOrder(m_xBuilder->weld_combo_box("caption_order"))
463{
465
466 const OUString sNone(SwResId(SW_STR_NONE));
467
468 m_xLbLevel->append_text(sNone);
469 for (sal_uInt16 n = 0; n < MAXLEVEL; ++n)
470 m_xLbLevel->append_text(OUString::number(n + 1));
471
472 SwSetExpFieldType* pFieldType = static_cast<SwSetExpFieldType*>(rSh.GetFieldType(
473 SwFieldIds::SetExp, m_aFieldTypeName ));
474
475 sal_Unicode nLvl = MAXLEVEL;
476 OUString sDelim(": ");
477 if( pFieldType )
478 {
479 sDelim = pFieldType->GetDelimiter();
480 nLvl = pFieldType->GetOutlineLvl();
481 }
482
483 m_xLbLevel->set_active(nLvl < MAXLEVEL ? nLvl + 1 : 0);
484 m_xEdDelim->set_text(sDelim);
485
486 m_xLbCharStyle->append_text(sNone);
487 ::FillCharStyleListBox(*m_xLbCharStyle, m_rView.GetDocShell(), true, true);
488 m_xLbCharStyle->set_active(0);
489}
490
491void SwSequenceOptionDialog::Apply()
492{
493 SwWrtShell &rSh = m_rView.GetWrtShell();
494 SwSetExpFieldType* pFieldType = static_cast<SwSetExpFieldType*>(rSh.GetFieldType(
495 SwFieldIds::SetExp, m_aFieldTypeName ));
496
497 sal_Int8 nLvl = static_cast<sal_Int8>(m_xLbLevel->get_active() - 1);
498 sal_Unicode cDelim = m_xEdDelim->get_text()[0];
499
500 bool bUpdate = true;
501 if( pFieldType )
502 {
503 pFieldType->SetDelimiter( OUString(cDelim) );
504 pFieldType->SetOutlineLvl( nLvl );
505 }
506 else if( !m_aFieldTypeName.isEmpty() && nLvl < MAXLEVEL )
507 {
508 // then we have to insert that
509 SwSetExpFieldType aFieldType( rSh.GetDoc(), m_aFieldTypeName, nsSwGetSetExpType::GSE_SEQ );
510 aFieldType.SetDelimiter( OUString(cDelim) );
511 aFieldType.SetOutlineLvl( nLvl );
512 rSh.InsertFieldType( aFieldType );
513 }
514 else
515 bUpdate = false;
516
517 if( bUpdate )
518 rSh.UpdateExpFields();
519}
520
521OUString SwSequenceOptionDialog::GetCharacterStyle() const
522{
523 if (m_xLbCharStyle->get_active() != -1)
524 return m_xLbCharStyle->get_active_text();
525 return OUString();
526}
527
528void SwSequenceOptionDialog::SetCharacterStyle(const OUString& rStyle)
529{
530 const int nPos = m_xLbCharStyle->find_text(rStyle);
531 if (nPos == -1)
532 m_xLbCharStyle->set_active(0);
533 else
534 m_xLbCharStyle->set_active(nPos);
535}
536
537// #i61007# order of captions
539{
542}
543
544/* 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:1419
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:387
static OUString s_aSepTextSave
Definition: cption.hxx:74
std::unique_ptr< weld::Entry > m_xSepEdit
Definition: cption.hxx:54
void ApplyCaptionOrder()
Definition: cption.cxx:538
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:302
SwCaptionPreview m_aPreview
Definition: cption.hxx:45
virtual ~SwCaptionDialog() override
Definition: cption.cxx:450
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:276
SwCaptionDialog(weld::Window *pParent, SwView &rV)
Definition: cption.cxx:98
std::unique_ptr< weld::Button > m_xAutoCaptionButton
Definition: cption.hxx:57
void ModifyHdl()
Definition: cption.cxx:341
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:1326
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:338
void UpdateExpFields(bool bCloseDB=false)
only every expression fields update
Definition: edfld.cxx:314
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:242
virtual OUString GetName() const
Only in derived classes.
Definition: fldbas.cxx:137
SwFieldIds Which() const
Definition: fldbas.hxx:273
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:290
Definition: view.hxx:146
SwWrtShell & GetWrtShell() const
Definition: view.hxx:416
const OUString & GetOldGrfCat()
Definition: view2.cxx:3040
const OUString & GetOldFrameCat()
Definition: view2.cxx:3060
SwDocShell * GetDocShell()
Definition: view.cxx:1160
const OUString & GetOldDrwCat()
Definition: view2.cxx:3070
void InsertCaption(const InsCaptionOpt *pOpt)
Definition: viewdlg2.cxx:196
const OUString & GetOldTabCat()
Definition: view2.cxx:3050
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1706
virtual OUString filter(const OUString &rText) override
Definition: cption.cxx:90
OUString m_sLastGoodText
Definition: optload.hxx:48
virtual short run()
IMPL_LINK_NOARG(SwCaptionDialog, OKHdl, weld::Button &, void)
Definition: cption.cxx:270
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:205
@ 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:165
#define SW_MOD()
Definition: swmodule.hxx:256
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:780
const sal_Unicode cDelim
constexpr OUStringLiteral sNone
RET_OK