LibreOffice Module sw (master) 1
textsh1.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 <com/sun/star/i18n/WordType.hpp>
21#include <com/sun/star/linguistic2/XThesaurus.hpp>
22
23#include <hintids.hxx>
24#include <cmdid.h>
25#include <comphelper/lok.hxx>
26
27#include <i18nutil/unicode.hxx>
29#include <svtools/langtab.hxx>
30#include <svl/numformat.hxx>
31#include <svl/slstitm.hxx>
32#include <svl/stritem.hxx>
33#include <sfx2/htmlmode.hxx>
34#include <svl/whiter.hxx>
35#include <sfx2/bindings.hxx>
36#include <sfx2/viewfrm.hxx>
37#include <vcl/unohelp2.hxx>
38#include <vcl/weld.hxx>
39#include <sfx2/request.hxx>
40#include <svl/eitem.hxx>
41#include <editeng/lrspitem.hxx>
42#include <editeng/colritem.hxx>
43#include <editeng/tstpitem.hxx>
44#include <editeng/brushitem.hxx>
45#include <editeng/svxacorr.hxx>
46#include <svl/cjkoptions.hxx>
47#include <svl/ctloptions.hxx>
50#include <charfmt.hxx>
51#include <svx/SmartTagItem.hxx>
52#include <svx/xflgrit.hxx>
53#include <svx/xflhtit.hxx>
54#include <fmtinfmt.hxx>
55#include <wrtsh.hxx>
56#include <wview.hxx>
57#include <swmodule.hxx>
58#include <viewopt.hxx>
59#include <uitool.hxx>
60#include <textsh.hxx>
61#include <IMark.hxx>
62#include <swdtflvr.hxx>
63#include <swundo.hxx>
64#include <reffld.hxx>
65#include <docsh.hxx>
66#include <inputwin.hxx>
67#include <chrdlgmodes.hxx>
68#include <fmtcol.hxx>
69#include <cellatr.hxx>
70#include <edtwin.hxx>
71#include <fldmgr.hxx>
72#include <strings.hrc>
73#include <paratr.hxx>
74#include <vcl/svapp.hxx>
75#include <sfx2/app.hxx>
76#include <breakit.hxx>
77#include <SwSmartTagMgr.hxx>
78#include <editeng/acorrcfg.hxx>
79#include <swabstdlg.hxx>
80#include <sfx2/sfxdlg.hxx>
81#include <com/sun/star/container/XNameContainer.hpp>
82#include <com/sun/star/beans/XPropertySet.hpp>
83#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
84#include <com/sun/star/uno/Any.hxx>
85#include <com/sun/star/linguistic2/ProofreadingResult.hpp>
86#include <com/sun/star/linguistic2/XDictionary.hpp>
87#include <com/sun/star/linguistic2/XSpellAlternatives.hpp>
88#include <editeng/unolingu.hxx>
89#include <doc.hxx>
90#include <drawdoc.hxx>
91#include <view.hxx>
92#include <pam.hxx>
93#include <sfx2/objface.hxx>
94#include <langhelper.hxx>
95#include <uiitems.hxx>
96#include <svx/nbdtmgfact.hxx>
97#include <svx/nbdtmg.hxx>
98#include <SwRewriter.hxx>
99#include <svx/drawitem.hxx>
100#include <numrule.hxx>
101#include <memory>
102#include <xmloff/odffields.hxx>
103#include <bookmark.hxx>
104#include <linguistic/misc.hxx>
105#include <authfld.hxx>
106#include <config_wasm_strip.h>
107#if !ENABLE_WASM_STRIP_EXTRA
109#include <svtools/deeplcfg.hxx>
110#endif // ENABLE_WASM_STRIP_EXTRA
111#include <translatehelper.hxx>
113
114using namespace ::com::sun::star;
115using namespace com::sun::star::beans;
116using namespace ::com::sun::star::container;
117using namespace com::sun::star::style;
118using namespace svx::sidebar;
119
120static void sw_CharDialogResult(const SfxItemSet* pSet, SwWrtShell &rWrtSh, std::shared_ptr<SfxItemSet> const & pCoreSet, bool bSel, bool bSelectionPut, SfxRequest *pReq);
121
122static void sw_CharDialog(SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot, const SfxItemSet *pArgs, SfxRequest *pReq )
123{
124 FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( &rWrtSh.GetView()) != nullptr );
125 SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
126 auto pCoreSet = std::make_shared<SfxItemSetFixed<
131 SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
132 SID_HTML_MODE, SID_HTML_MODE,
133 SID_ATTR_CHAR_WIDTH_FIT_TO_LINE, SID_ATTR_CHAR_WIDTH_FIT_TO_LINE,
135 rWrtSh.GetCurAttr(*pCoreSet);
136
137 bool bSel = rWrtSh.HasSelection();
138 bool bSelectionPut = false;
139 if(bSel || rWrtSh.IsInWord())
140 {
141 if(!bSel)
142 {
143 rWrtSh.StartAction();
144 rWrtSh.Push();
146 rWrtSh.SelWrd();
147 }
148 pCoreSet->Put(SfxStringItem(FN_PARAM_SELECTION, rWrtSh.GetSelText()));
149 bSelectionPut = true;
150 if(!bSel)
151 {
153 rWrtSh.EndAction();
154 }
155 }
156 pCoreSet->Put(SfxUInt16Item(SID_ATTR_CHAR_WIDTH_FIT_TO_LINE, rWrtSh.GetScalingOfSelectedText()));
157
158 ::ConvertAttrCharToGen(*pCoreSet);
159
160 // Setting the BoxInfo
161 ::PrepareBoxInfo(*pCoreSet, rWrtSh);
162
163 pCoreSet->Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(rWrtSh.GetView().GetDocShell())));
165 if ( bUseDialog && GetActiveView() )
166 {
168 pDlg.reset(pFact->CreateSwCharDlg(rWrtSh.GetView().GetFrameWeld(), rWrtSh.GetView(), *pCoreSet, SwCharDlgMode::Std));
169
170 if (nSlot == FN_INSERT_HYPERLINK)
171 pDlg->SetCurPageId("hyperlink");
172 else if (nSlot == SID_CHAR_DLG_EFFECT)
173 pDlg->SetCurPageId("fonteffects");
174 else if (nSlot == SID_CHAR_DLG_POSITION)
175 pDlg->SetCurPageId("position");
176 else if (nSlot == SID_CHAR_DLG_FOR_PARAGRAPH)
177 pDlg->SetCurPageId("font");
178 else if (pReq)
179 {
180 const SfxStringItem* pItem = (*pReq).GetArg<SfxStringItem>(FN_PARAM_1);
181 if (pItem)
182 pDlg->SetCurPageId(OUStringToOString(pItem->GetValue(), RTL_TEXTENCODING_UTF8));
183 }
184 }
185
186 if (bUseDialog)
187 {
188 std::shared_ptr<SfxRequest> pRequest;
189 if (pReq)
190 {
191 pRequest = std::make_shared<SfxRequest>(*pReq);
192 pReq->Ignore(); // the 'old' request is not relevant any more
193 }
194 pDlg->StartExecuteAsync([pDlg, &rWrtSh, pCoreSet, bSel, bSelectionPut, pRequest](sal_Int32 nResult){
195 if (nResult == RET_OK)
196 {
197 sw_CharDialogResult(pDlg->GetOutputItemSet(), rWrtSh, pCoreSet, bSel, bSelectionPut, pRequest.get());
198 }
199 pDlg->disposeOnce();
200 });
201 }
202 else if (pArgs)
203 {
204 sw_CharDialogResult(pArgs, rWrtSh, pCoreSet, bSel, bSelectionPut, pReq);
205 }
206}
207
208static void sw_CharDialogResult(const SfxItemSet* pSet, SwWrtShell &rWrtSh, std::shared_ptr<SfxItemSet> const & pCoreSet, bool bSel, bool bSelectionPut, SfxRequest *pReq)
209{
210 SfxItemSet aTmpSet( *pSet );
211 ::ConvertAttrGenToChar(aTmpSet, *pCoreSet);
212
213 const SfxStringItem* pSelectionItem;
214 bool bInsert = false;
215 sal_Int32 nInsert = 0;
216
217 // The old item is for unknown reasons back in the set again.
218 if( !bSelectionPut && (pSelectionItem = aTmpSet.GetItemIfSet(FN_PARAM_SELECTION, false)) )
219 {
220 OUString sInsert = pSelectionItem->GetValue();
221 bInsert = !sInsert.isEmpty();
222 if(bInsert)
223 {
224 nInsert = sInsert.getLength();
225 rWrtSh.StartAction();
226 rWrtSh.Insert( sInsert );
227 rWrtSh.SetMark();
228 rWrtSh.ExtendSelection(false, sInsert.getLength());
230 aReq.AppendItem( SfxStringItem( FN_INSERT_STRING, sInsert ) );
231 aReq.Done();
232 SfxRequest aReq1( rWrtSh.GetView().GetViewFrame(), FN_CHAR_LEFT );
235 aReq1.Done();
236 }
237 }
239
240 SwTextFormatColl* pColl = rWrtSh.GetCurTextFormatColl();
241 if(bSel && rWrtSh.IsSelFullPara() && pColl && pColl->IsAutoUpdateFormat())
242 {
243 rWrtSh.AutoUpdatePara(pColl, aTmpSet);
244 }
245 else
246 rWrtSh.SetAttrSet( aTmpSet );
247 if (pReq)
248 pReq->Done(aTmpSet);
249 if(bInsert)
250 {
251 SfxRequest aReq1( rWrtSh.GetView().GetViewFrame(), FN_CHAR_RIGHT );
254 aReq1.Done();
255 rWrtSh.SwapPam();
256 rWrtSh.ClearMark();
257 rWrtSh.DontExpandFormat();
258 rWrtSh.EndAction();
259 }
260
261}
262
263
264static void sw_ParagraphDialogResult(SfxItemSet* pSet, SwWrtShell &rWrtSh, SfxRequest& rReq, SwPaM* pPaM)
265{
266 if (!pSet)
267 return;
268
269 rReq.Done( *pSet );
270 ::SfxToSwPageDescAttr( rWrtSh, *pSet );
271 // #i56253#
272 // enclose all undos.
273 // Thus, check conditions, if actions will be performed.
274 const bool bUndoNeeded( pSet->Count() ||
275 SfxItemState::SET == pSet->GetItemState(FN_NUMBER_NEWSTART) ||
276 SfxItemState::SET == pSet->GetItemState(FN_NUMBER_NEWSTART_AT) );
277 if ( bUndoNeeded )
278 {
280 }
281 if( pSet->Count() )
282 {
283 rWrtSh.StartAction();
284 if ( const SfxStringItem* pDropTextItem = pSet->GetItemIfSet(FN_DROP_TEXT, false) )
285 {
286 if ( !pDropTextItem->GetValue().isEmpty() )
287 rWrtSh.ReplaceDropText(pDropTextItem->GetValue(), pPaM);
288 }
289 rWrtSh.SetAttrSet(*pSet, SetAttrMode::DEFAULT, pPaM);
290 rWrtSh.EndAction();
291 SwTextFormatColl* pColl = rWrtSh.GetPaMTextFormatColl(pPaM);
292 if(pColl && pColl->IsAutoUpdateFormat())
293 {
294 rWrtSh.AutoUpdatePara(pColl, *pSet, pPaM);
295 }
296 }
297
298 if( SfxItemState::SET == pSet->GetItemState(FN_NUMBER_NEWSTART) )
299 {
300 //SetNumRuleStart(true) restarts the numbering at the value
301 //that is defined at the starting point of the numbering level
302 //otherwise the SetNodeNumStart() value determines the start
303 //if it's set to something different than USHRT_MAX
304
305 bool bStart = static_cast<const SfxBoolItem&>(pSet->Get(FN_NUMBER_NEWSTART)).GetValue();
306
307 // Default value for restart value has to be USHRT_MAX
308 // in order to indicate that the restart value of the list
309 // style has to be used on restart.
310 sal_uInt16 nNumStart = USHRT_MAX;
311 if( SfxItemState::SET == pSet->GetItemState(FN_NUMBER_NEWSTART_AT) )
312 {
313 nNumStart = static_cast<const SfxUInt16Item&>(pSet->Get(FN_NUMBER_NEWSTART_AT)).GetValue();
314 }
315 rWrtSh.SetNumRuleStart(bStart, pPaM);
316 rWrtSh.SetNodeNumStart(nNumStart);
317 }
318 else if( SfxItemState::SET == pSet->GetItemState(FN_NUMBER_NEWSTART_AT) )
319 {
320 rWrtSh.SetNodeNumStart(static_cast<const SfxUInt16Item&>(pSet->Get(FN_NUMBER_NEWSTART_AT)).GetValue());
321 rWrtSh.SetNumRuleStart(false, pPaM);
322 }
323 // #i56253#
324 if ( bUndoNeeded )
325 {
326 rWrtSh.EndUndo( SwUndoId::INSATTR );
327 }
328}
329
330namespace {
331
332void InsertBreak(SwWrtShell& rWrtSh,
333 sal_uInt16 nKind,
334 ::std::optional<sal_uInt16> oPageNumber,
335 const OUString& rTemplateName, std::optional<SwLineBreakClear> oClear)
336{
337 switch ( nKind )
338 {
339 case 1 :
340 rWrtSh.InsertLineBreak(oClear);
341 break;
342 case 2 :
343 rWrtSh.InsertColumnBreak(); break;
344 case 3 :
345 {
346 rWrtSh.StartAllAction();
347 if( !rTemplateName.isEmpty() )
348 rWrtSh.InsertPageBreak( &rTemplateName, oPageNumber );
349 else
350 rWrtSh.InsertPageBreak();
351 rWrtSh.EndAllAction();
352 }
353 }
354}
355
356OUString GetLocalURL(const SwWrtShell& rSh)
357{
358 SwField* pField = rSh.GetCurField();
359 if (!pField)
360 {
361 return OUString();
362 }
363
364 if (pField->GetTyp()->Which() != SwFieldIds::TableOfAuthorities)
365 {
366 return OUString();
367 }
368
369 const auto& rAuthorityField = *static_cast<const SwAuthorityField*>(pField);
370 SwAuthEntry* pAuthEntry = rAuthorityField.GetAuthEntry();
371 if (!pAuthEntry)
372 {
373 return OUString();
374 }
375
376 const OUString& rLocalURL = pAuthEntry->GetAuthorField(AUTH_FIELD_LOCAL_URL);
377 return rLocalURL;
378}
379
380}
381
383{
384 bool bUseDialog = true;
385 const SfxItemSet *pArgs = rReq.GetArgs();
386 SwWrtShell& rWrtSh = GetShell();
387 const SfxPoolItem* pItem = nullptr;
388 const sal_uInt16 nSlot = rReq.GetSlot();
389 if(pArgs)
390 pArgs->GetItemState(GetPool().GetWhich(nSlot), false, &pItem);
391 switch( nSlot )
392 {
393 case SID_UNICODE_NOTATION_TOGGLE:
394 {
395 tools::Long nMaxUnits = 256;
396 sal_Int32 nSelLength = rWrtSh.GetSelText().getLength();
397 if( rWrtSh.IsSelection() && !rWrtSh.IsMultiSelection() && (nSelLength < nMaxUnits) )
398 nMaxUnits = nSelLength;
399
400 tools::Long index = 0;
402 while( nMaxUnits-- && aToggle.AllowMoreInput(rWrtSh.GetChar(true, index-1)) )
403 --index;
404
405 OUString sReplacement = aToggle.ReplacementString();
406 if( !sReplacement.isEmpty() )
407 {
408 if (rWrtSh.HasReadonlySel() && !rWrtSh.CursorInsideInputField())
409 {
410 // Only break if there's something to do; don't nag with the dialog otherwise
411 rWrtSh.InfoReadOnlyDialog();
412 break;
413 }
414 SwRewriter aRewriter;
415 aRewriter.AddRule( UndoArg1, aToggle.StringToReplace() );
416 aRewriter.AddRule( UndoArg2, SwResId(STR_YIELDS) );
417 aRewriter.AddRule( UndoArg3, sReplacement );
418 rWrtSh.StartUndo(SwUndoId::REPLACE, &aRewriter);
419 rWrtSh.GetCursor()->Normalize(false);
420
421 rWrtSh.ClearMark();
422 if( rWrtSh.IsInSelect() ) // cancel any in-progress keyboard selection as well
423 rWrtSh.EndSelect();
424
425 for( sal_uInt32 i=aToggle.CharsToDelete(); i > 0; --i )
426 rWrtSh.DelLeft();
427 rWrtSh.Insert2( sReplacement );
428 rWrtSh.EndUndo(SwUndoId::REPLACE, &aRewriter);
429 }
430 }
431 break;
432
433 case SID_LANGUAGE_STATUS:
434 {
435 // get the language
436 OUString aNewLangText;
437 const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(SID_LANGUAGE_STATUS);
438 if (pItem2)
439 aNewLangText = pItem2->GetValue();
440
444 SfxViewFrame *pViewFrame = GetView().GetViewFrame();
445
446 if (aNewLangText == "*")
447 {
448 // open the dialog "Tools/Options/Language Settings - Language"
449 // to set the documents default language
451 ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateVclDialog(GetView().GetFrameWeld(), SID_LANGUAGE_OPTIONS));
452 pDlg->Execute();
453 }
454 else
455 {
459 rWrtSh.StartAction();
460 // prevent view from jumping because of (temporary) selection changes
461 rWrtSh.LockView( true );
462
463 // setting the new language...
464 if (!aNewLangText.isEmpty())
465 {
466 static const OUStringLiteral aSelectionLangPrefix(u"Current_");
467 static const OUStringLiteral aParagraphLangPrefix(u"Paragraph_");
468 static const OUStringLiteral aDocumentLangPrefix(u"Default_");
469
474
475 sal_Int32 nPos = 0;
476 bool bForSelection = true;
477 bool bForParagraph = false;
478 if (-1 != (nPos = aNewLangText.indexOf( aSelectionLangPrefix )))
479 {
480 // ... for the current selection
481 aNewLangText = aNewLangText.replaceAt(nPos, aSelectionLangPrefix.getLength(), u"");
482 bForSelection = true;
483 }
484 else if (-1 != (nPos = aNewLangText.indexOf(aParagraphLangPrefix)))
485 {
486 // ... for the current paragraph language
487 aNewLangText = aNewLangText.replaceAt(nPos, aParagraphLangPrefix.getLength(), u"");
488 bForSelection = true;
489 bForParagraph = true;
490 }
491 else if (-1 != (nPos = aNewLangText.indexOf(aDocumentLangPrefix)))
492 {
493 // ... as default document language
494 aNewLangText = aNewLangText.replaceAt(nPos, aDocumentLangPrefix.getLength(), u"");
495 bForSelection = false;
496 }
497
498 if (bForParagraph || !bForSelection)
499 {
500 rWrtSh.Push(); // save selection for later restoration
501 rWrtSh.ClearMark(); // fdo#67796: invalidate table crsr
502 }
503
504 if (bForParagraph)
506
507 if (!bForSelection) // document language to be changed...
508 {
509 rWrtSh.SelAll();
510 rWrtSh.ExtendedSelectAll();
511 }
512
513 rWrtSh.StartUndo( ( !bForParagraph && !bForSelection ) ? SwUndoId::SETDEFTATTR : SwUndoId::EMPTY );
514 if (aNewLangText == "LANGUAGE_NONE")
515 SwLangHelper::SetLanguage_None( rWrtSh, bForSelection, aCoreSet );
516 else if (aNewLangText == "RESET_LANGUAGES")
518 else
519 SwLangHelper::SetLanguage( rWrtSh, aNewLangText, bForSelection, aCoreSet );
520 rWrtSh.EndUndo();
521
522 if (bForParagraph || !bForSelection)
523 {
524 rWrtSh.Pop(SwCursorShell::PopMode::DeleteCurrent); // restore selection...
525 }
526 }
527
528 rWrtSh.LockView( false );
529 rWrtSh.EndAction();
530 }
531
532 // invalidate slot to get the new language displayed
533 pViewFrame->GetBindings().Invalidate( nSlot );
534
535 rReq.Done();
536 break;
537 }
538
539 case SID_THES:
540 {
541 // replace word/selection with text from selected sub menu entry
542 OUString aReplaceText;
543 const SfxStringItem* pItem2 = rReq.GetArg(FN_PARAM_THES_WORD_REPLACE);
544 if (pItem2)
545 aReplaceText = pItem2->GetValue();
546 if (!aReplaceText.isEmpty())
547 {
548 SwView &rView2 = rWrtSh.GetView();
549 const bool bSelection = rWrtSh.HasSelection();
550 const OUString aLookUpText = rView2.GetThesaurusLookUpText( bSelection );
551 rView2.InsertThesaurusSynonym( aReplaceText, aLookUpText, bSelection );
552 }
553 }
554 break;
555
556 case SID_CHARMAP:
557 {
558 InsertSymbol( rReq );
559 }
560 break;
563 {
564 OUString aStr;
565 const SfxStringItem* pFont = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
566 const SfxStringItem* pNameItem = rReq.GetArg<SfxStringItem>(nSlot);
567 if ( pNameItem )
568 aStr = pNameItem->GetValue();
569 bool bFont = pFont && !pFont->GetValue().isEmpty();
571 rWrtSh.InsertFootnote( aStr, nSlot == FN_INSERT_ENDNOTE, !bFont );
572 if ( bFont )
573 {
574 rWrtSh.Left( SwCursorSkipMode::Chars, true, 1, false );
576 rWrtSh.GetCurAttr( aSet );
577 rWrtSh.SetAttrSet( aSet, SetAttrMode::DONTEXPAND );
578 rWrtSh.ResetSelect(nullptr, false);
579 rWrtSh.EndSelect();
580 rWrtSh.GotoFootnoteText();
581 }
583 rReq.Done();
584 }
585 break;
587 {
590 GetView().GetFrameWeld(), rWrtSh));
591 pDlg->SetHelpId(GetStaticInterface()->GetSlot(nSlot)->GetCommand());
592 if ( pDlg->Execute() == RET_OK )
593 {
594 const sal_uInt16 nId = pDlg->IsEndNote() ? FN_INSERT_ENDNOTE : FN_INSERT_FOOTNOTE;
595 SfxRequest aReq( GetView().GetViewFrame(), nId );
596 if ( !pDlg->GetStr().isEmpty() )
597 aReq.AppendItem( SfxStringItem( nId, pDlg->GetStr() ) );
598 if ( !pDlg->GetFontName().isEmpty() )
599 aReq.AppendItem( SfxStringItem( FN_PARAM_1, pDlg->GetFontName() ) );
600 ExecuteSlot( aReq );
601 }
602
603 rReq.Ignore();
604 }
605 break;
608 {
610 break;
611 }
612 case SID_INSERTDOC:
613 {
614 GetView().ExecuteInsertDoc( rReq, pItem );
615 break;
616 }
617 case FN_FORMAT_RESET:
618 {
619 // #i78856, reset all attributes but not the language attributes
620 // (for this build an array of all relevant attributes and
621 // remove the languages from that)
623
624 constexpr std::pair<sal_uInt16, sal_uInt16> aResetableSetRange[] = {
625 // tdf#40496: we don't want to change writing direction, so exclude RES_FRAMEDIR:
627 { RES_FRAMEDIR + 1, RES_FRMATR_END - 1 },
635 };
636 for (const auto& [nBegin, nEnd] : aResetableSetRange)
637 {
638 for (sal_uInt16 i = nBegin; i <= nEnd; ++i)
639 aAttribs.insert( i );
640 }
641 rWrtSh.ResetAttr( aAttribs );
642
643 // also clear the direct formatting flag inside SwTableBox(es)
645
646 rReq.Done();
647 break;
648 }
650 {
651 if ( pItem )
652 {
653 ::std::optional<sal_uInt16> oPageNumber;
654 std::optional<SwLineBreakClear> oClear;
655 OUString aTemplateName;
656 sal_uInt16 nKind = static_cast<const SfxInt16Item*>(pItem)->GetValue();
657 const SfxStringItem* pTemplate = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
658 const SfxUInt16Item* pNumber = rReq.GetArg<SfxUInt16Item>(FN_PARAM_2);
659 const SfxBoolItem* pIsNumberFilled = rReq.GetArg<SfxBoolItem>(FN_PARAM_3);
660 if ( pTemplate )
661 aTemplateName = pTemplate->GetValue();
662 if ( pNumber && pIsNumberFilled && pIsNumberFilled->GetValue() )
663 oPageNumber = pNumber->GetValue();
664
665 InsertBreak(rWrtSh, nKind, oPageNumber, aTemplateName, oClear);
666 }
667 else
668 {
670
671 std::shared_ptr<AbstractSwBreakDlg> pAbstractDialog(pFact->CreateSwBreakDlg(GetView().GetFrameWeld(), rWrtSh));
672 std::shared_ptr<weld::DialogController> pDialogController(pAbstractDialog->getDialogController());
673
674 weld::DialogController::runAsync(pDialogController,
675 [pAbstractDialog, &rWrtSh] (sal_Int32 nResult) {
676 if( RET_OK == nResult )
677 {
678 sal_uInt16 nKind = pAbstractDialog->GetKind();
679 OUString aTemplateName = pAbstractDialog->GetTemplateName();
680 ::std::optional<sal_uInt16> oPageNumber = pAbstractDialog->GetPageNumber();
681 std::optional<SwLineBreakClear> oClear = pAbstractDialog->GetClear();
682
683 InsertBreak(rWrtSh, nKind, oPageNumber, aTemplateName, oClear);
684 }
685 });
686 }
687
688 break;
689 }
691 {
692 const SfxStringItem* pBookmarkText = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
693 SwPaM* pCursorPos = rWrtSh.GetCursor();
694 if ( pItem )
695 {
696 rWrtSh.StartAction();
697 OUString sName = static_cast<const SfxStringItem*>(pItem)->GetValue();
698
699 if (pBookmarkText)
700 {
701 OUString aBookmarkText = pBookmarkText->GetValue();
702 // Split node to remember where the start position is.
703 bool bSuccess = rWrtSh.GetDoc()->getIDocumentContentOperations().SplitNode(
704 *pCursorPos->GetPoint(), /*bChkTableStart=*/false);
705 if (bSuccess)
706 {
707 SwPaM aBookmarkPam(*pCursorPos->GetPoint());
708 aBookmarkPam.Move(fnMoveBackward, GoInContent);
709
710 // Paste HTML content.
712 rWrtSh, pCursorPos, aBookmarkText.toUtf8(), /*bSetSelection=*/true);
713 if (pCursorPos->GetPoint()->GetContentIndex() == 0)
714 {
715 // The paste created a last empty text node, remove it.
716 SwPaM aPam(*pCursorPos->GetPoint());
717 aPam.SetMark();
720 }
721
722 // Undo the above SplitNode().
723 aBookmarkPam.SetMark();
724 aBookmarkPam.Move(fnMoveForward, GoInContent);
726 aBookmarkPam);
727 *aBookmarkPam.GetMark() = *pCursorPos->GetPoint();
728 *pCursorPos = aBookmarkPam;
729 }
730 }
731
732 rWrtSh.SetBookmark( vcl::KeyCode(), sName );
733 if (pBookmarkText)
734 {
735 pCursorPos->DeleteMark();
736 }
737 rWrtSh.EndAction();
738 break;
739 }
740 [[fallthrough]];
741 }
742 case FN_EDIT_BOOKMARK:
743 {
744 ::std::optional<OUString> oName;
745 if (pItem)
746 {
747 oName.emplace(static_cast<const SfxStringItem*>(pItem)->GetValue());
748 }
749 {
751 ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateSwInsertBookmarkDlg(GetView().GetFrameWeld(), rWrtSh, oName ? &*oName : nullptr));
753 aContext.maEndDialogFn = [](sal_Int32){};
754 pDlg->StartExecuteAsync(aContext);
755 }
756
757 break;
758 }
759 case FN_DELETE_BOOKMARK:
760 {
762 {
763 IDocumentMarkAccess* const pMarkAccess = rWrtSh.getIDocumentMarkAccess();
764 pMarkAccess->deleteMark(pMarkAccess->findMark(static_cast<const SfxStringItem*>(pItem)->GetValue()), false);
765 }
766 break;
767 }
768 case FN_SET_REMINDER:
769 {
770 // collect and sort navigator reminder names
771 IDocumentMarkAccess* const pMarkAccess = rWrtSh.getIDocumentMarkAccess();
772 std::vector< OUString > vNavMarkNames;
774 ppMark != pMarkAccess->getAllMarksEnd();
775 ++ppMark)
776 {
778 vNavMarkNames.push_back((*ppMark)->GetName());
779 }
780 std::sort(vNavMarkNames.begin(), vNavMarkNames.end());
781
782 // we are maxed out so delete the first one
783 // this assumes that IDocumentMarkAccess generates Names in ascending order
784 if(vNavMarkNames.size() == MAX_MARKS)
785 pMarkAccess->deleteMark(pMarkAccess->findMark(vNavMarkNames[0]), false);
786
788 SwView::SetActMark(vNavMarkNames.size() < MAX_MARKS ? vNavMarkNames.size() : MAX_MARKS-1);
789
790 break;
791 }
793 {
794 SvxSwAutoFormatFlags aFlags(SvxAutoCorrCfg::Get().GetAutoCorrect()->GetSwFlags());
795 // This must always be false for the postprocessing.
796 aFlags.bAFormatByInput = false;
797 aFlags.bWithRedlining = true;
798 rWrtSh.AutoFormat( &aFlags );
799 aFlags.bWithRedlining = false;
800
801 SfxViewFrame* pVFrame = GetView().GetViewFrame();
802 if (pVFrame->HasChildWindow(FN_REDLINE_ACCEPT))
804
807
808 xDlg->Execute();
809 rReq.Done();
810 }
811 break;
812
814 {
815 SvxSwAutoFormatFlags aFlags(SvxAutoCorrCfg::Get().GetAutoCorrect()->GetSwFlags());
816 // This must always be false for the postprocessing.
817 aFlags.bAFormatByInput = false;
818 rWrtSh.AutoFormat( &aFlags );
819 rReq.Done();
820 }
821 break;
823 {
825 bool bSet = pItem ? static_cast<const SfxBoolItem*>(pItem)->GetValue() : !rACfg.IsAutoFormatByInput();
826 if( bSet != rACfg.IsAutoFormatByInput() )
827 {
828 rACfg.SetAutoFormatByInput( bSet );
829 rACfg.Commit();
831 if ( !pItem )
832 rReq.AppendItem( SfxBoolItem( GetPool().GetWhich(nSlot), bSet ) );
833 rReq.Done();
834 }
835 }
836 break;
837 case FN_AUTO_CORRECT:
838 {
839 // At first set to blank as default.
840 rWrtSh.AutoCorrect( *SvxAutoCorrCfg::Get().GetAutoCorrect(), ' ' );
841 rReq.Done();
842 }
843 break;
845 case FN_SORTING_DLG:
846 {
849 pDlg->Execute();
850 rReq.Done();
851 }
852 break;
854 {
856 rReq.Done();
857 }
858 break;
859 case FN_CALCULATE:
860 {
861 rtl::Reference<SwTransferable> pTransfer = new SwTransferable( rWrtSh );
862 pTransfer->CalculateAndCopy();
863 rReq.Done();
864 }
865 break;
867 {
868 SwField *pField = rWrtSh.GetCurField();
869 if(pField && pField->GetTypeId() == SwFieldTypesEnum::GetRef)
870 {
871 rWrtSh.StartAllAction();
872 rWrtSh.SwCursorShell::GotoRefMark( static_cast<SwGetRefField*>(pField)->GetSetRefName(),
873 static_cast<SwGetRefField*>(pField)->GetSubType(),
874 static_cast<SwGetRefField*>(pField)->GetSeqNo() );
875 rWrtSh.EndAllAction();
876 rReq.Done();
877 }
878 }
879 break;
880 case FN_EDIT_FORMULA:
881 {
882 const sal_uInt16 nId = SwInputChild::GetChildWindowId();
883 SfxViewFrame* pVFrame = GetView().GetViewFrame();
884 if(pItem)
885 {
886 //if the ChildWindow is active it has to be removed
887 if( pVFrame->HasChildWindow( nId ) )
888 {
889 pVFrame->ToggleChildWindow( nId );
890 pVFrame->GetBindings().InvalidateAll( true );
891 }
892
893 OUString sFormula(static_cast<const SfxStringItem*>(pItem)->GetValue());
894 SwFieldMgr aFieldMgr;
895 rWrtSh.StartAllAction();
896 bool bDelSel = rWrtSh.HasSelection();
897 if( bDelSel )
898 {
899 rWrtSh.StartUndo( SwUndoId::START );
900 rWrtSh.DelRight();
901 }
902 else
903 {
904 rWrtSh.EnterStdMode();
905 }
906
907 if( !bDelSel && aFieldMgr.GetCurField() && SwFieldTypesEnum::Formel == aFieldMgr.GetCurTypeId() )
908 aFieldMgr.UpdateCurField( aFieldMgr.GetCurField()->GetFormat(), OUString(), sFormula );
909 else if( !sFormula.isEmpty() )
910 {
911 if( rWrtSh.IsCursorInTable() )
912 {
915 rWrtSh.SetTableBoxFormulaAttrs( aSet );
916 rWrtSh.UpdateTable();
917 }
918 else
919 {
920 SvNumberFormatter* pFormatter = rWrtSh.GetNumberFormatter();
921 const sal_uInt32 nSysNumFormat = pFormatter->GetFormatIndex( NF_NUMBER_STANDARD, LANGUAGE_SYSTEM);
923 aFieldMgr.InsertField(aData);
924 }
925 }
926
927 if( bDelSel )
928 rWrtSh.EndUndo( SwUndoId::END );
929 rWrtSh.EndAllAction();
930 rReq.Done();
931 }
932 else
933 {
934 rWrtSh.EndAllTableBoxEdit();
935 pVFrame->ToggleChildWindow( nId );
936 if( !pVFrame->HasChildWindow( nId ) )
937 pVFrame->GetBindings().InvalidateAll( true );
938 rReq.Ignore();
939 }
940 }
941
942 break;
944 {
945 rWrtSh.UnProtectTables();
946 }
947 break;
948 case SID_EDIT_HYPERLINK:
949 GetView().GetViewFrame()->SetChildWindow(SID_HYPERLINK_DIALOG, true);
950 break;
951 case SID_REMOVE_HYPERLINK:
952 {
953 bool bSel = rWrtSh.HasSelection();
954 if(!bSel)
955 {
956 rWrtSh.StartAction();
957 rWrtSh.Push();
959 rWrtSh.SelWrd();
960 }
961 //now remove the attribute
962 rWrtSh.ResetAttr({ RES_TXTATR_INETFMT });
963 if(!bSel)
964 {
966 rWrtSh.EndAction();
967 }
968 }
969 break;
970 case SID_ATTR_BRUSH_CHAR :
971 case SID_ATTR_CHAR_SCALEWIDTH :
972 case SID_ATTR_CHAR_ROTATED :
973 case FN_TXTATR_INET :
975 {
976 const sal_uInt16 nWhich = GetPool().GetWhich( nSlot );
977 if ( pArgs && pArgs->GetItemState( nWhich ) == SfxItemState::SET )
978 bUseDialog = false;
979 [[fallthrough]];
980 }
981 case SID_CHAR_DLG:
982 case SID_CHAR_DLG_EFFECT:
983 case SID_CHAR_DLG_POSITION:
984 {
985 sw_CharDialog( rWrtSh, bUseDialog, nSlot, pArgs, &rReq );
986 }
987 break;
988 case SID_CHAR_DLG_FOR_PARAGRAPH:
989 {
990 rWrtSh.Push(); //save current cursor
992 sw_CharDialog( rWrtSh, bUseDialog, nSlot, pArgs, &rReq );
993 rWrtSh.Pop(SwCursorShell::PopMode::DeleteCurrent); // restore old cursor
994 }
995 break;
996 case SID_ATTR_LRSPACE :
997 case SID_ATTR_ULSPACE :
998 case SID_ATTR_BRUSH :
999 case SID_PARA_VERTALIGN :
1000 case SID_ATTR_PARA_NUMRULE :
1001 case SID_ATTR_PARA_REGISTER :
1002 case SID_ATTR_PARA_PAGENUM :
1004 case FN_NUMBER_NEWSTART :
1006 case FN_FORMAT_DROPCAPS :
1007 case FN_DROP_TEXT:
1008 case SID_ATTR_PARA_LRSPACE:
1009 {
1010 const sal_uInt16 nWhich = GetPool().GetWhich( nSlot );
1011 if ( pArgs && pArgs->GetItemState( nWhich ) == SfxItemState::SET )
1012 bUseDialog = false;
1013 [[fallthrough]];
1014 }
1015 case SID_PARA_DLG:
1016 {
1017 SwPaM* pPaM = nullptr;
1018
1019 if ( pArgs )
1020 {
1021 const SwPaMItem* pPaMItem = pArgs->GetItemIfSet( GetPool().GetWhich( FN_PARAM_PAM ), false );
1022 if ( pPaMItem )
1023 pPaM = pPaMItem->GetValue( );
1024 }
1025
1026 if ( !pPaM )
1027 pPaM = rWrtSh.GetCursor();
1028
1029 FieldUnit eMetric = ::GetDfltMetric( dynamic_cast<SwWebView*>( &GetView()) != nullptr );
1030 SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
1031
1032 bool bApplyCharUnit = ::HasCharUnit( dynamic_cast<SwWebView*>( &GetView()) != nullptr );
1033 SW_MOD()->PutItem(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, bApplyCharUnit));
1034
1037 // FillAttribute support:
1039 // Includes SID_ATTR_TABSTOP_POS:
1040 SID_ATTR_TABSTOP_DEFAULTS, SID_ATTR_TABSTOP_OFFSET,
1041 SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
1042 SID_ATTR_PARA_MODEL, SID_ATTR_PARA_KEEP,
1043 // Items to hand over XPropertyList things like XColorList,
1044 // XHatchList, XGradientList, and XBitmapList to the Area
1045 // TabPage:
1046 SID_COLOR_TABLE, SID_PATTERN_LIST,
1047 SID_HTML_MODE, SID_HTML_MODE,
1048 SID_ATTR_PARA_PAGENUM, SID_ATTR_PARA_PAGENUM,
1049 FN_PARAM_1, FN_PARAM_1,
1052
1053 // get also the list level indent values merged as LR-SPACE item, if needed.
1054 rWrtSh.GetPaMAttr( pPaM, aCoreSet, true );
1055
1056 // create needed items for XPropertyList entries from the DrawModel so that
1057 // the Area TabPage can access them
1058 // Do this after GetCurAttr, this resets the ItemSet content again
1060
1061 aCoreSet.Put(SvxColorListItem(pDrawModel->GetColorList(), SID_COLOR_TABLE));
1062 aCoreSet.Put(SvxGradientListItem(pDrawModel->GetGradientList(), SID_GRADIENT_LIST));
1063 aCoreSet.Put(SvxHatchListItem(pDrawModel->GetHatchList(), SID_HATCH_LIST));
1064 aCoreSet.Put(SvxBitmapListItem(pDrawModel->GetBitmapList(), SID_BITMAP_LIST));
1065 aCoreSet.Put(SvxPatternListItem(pDrawModel->GetPatternList(), SID_PATTERN_LIST));
1066 aCoreSet.Put(SfxUInt16Item(SID_HTML_MODE,
1067 ::GetHtmlMode(GetView().GetDocShell())));
1068
1069 // Tabulators: Put DefaultTabs into ItemSet
1070 const SvxTabStopItem& rDefTabs =
1072
1073 const sal_uInt16 nDefDist = o3tl::narrowing<sal_uInt16>(::GetTabDist( rDefTabs ));
1074 SfxUInt16Item aDefDistItem( SID_ATTR_TABSTOP_DEFAULTS, nDefDist );
1075 aCoreSet.Put( aDefDistItem );
1076
1077 // Current tabulator
1078 SfxUInt16Item aTabPos( SID_ATTR_TABSTOP_POS, 0 );
1079 aCoreSet.Put( aTabPos );
1080
1081 // Left border as offset
1082 //#i24363# tab stops relative to indent
1084 aCoreSet.Get( RES_LR_SPACE ).GetTextLeft() : 0;
1085 SfxInt32Item aOff( SID_ATTR_TABSTOP_OFFSET, nOff );
1086 aCoreSet.Put( aOff );
1087
1088 // Setting the BoxInfo
1089 ::PrepareBoxInfo( aCoreSet, rWrtSh );
1090
1091 // Current page format
1092 ::SwToSfxPageDescAttr( aCoreSet );
1093
1094 // Properties of numbering
1095 if (rWrtSh.GetNumRuleAtCurrCursorPos())
1096 {
1097 SfxBoolItem aStart( FN_NUMBER_NEWSTART, rWrtSh.IsNumRuleStart( pPaM ) );
1098 aCoreSet.Put(aStart);
1100 rWrtSh.GetNodeNumStart( pPaM ) );
1101 aCoreSet.Put(aStartAt);
1102 }
1104
1105 if ( bUseDialog && GetActiveView() )
1106 {
1107 OString sDefPage;
1108 if (pItem)
1109 sDefPage = OUStringToOString(static_cast<const SfxStringItem*>(pItem)->GetValue(), RTL_TEXTENCODING_UTF8);
1110
1112 pDlg.reset(pFact->CreateSwParaDlg(GetView().GetFrameWeld(), GetView(), aCoreSet, false, sDefPage));
1113 }
1114
1115 if ( !bUseDialog )
1116 {
1117 if ( nSlot == SID_ATTR_PARA_LRSPACE)
1118 {
1119 SvxLRSpaceItem aParaMargin(static_cast<const SvxLRSpaceItem&>(pArgs->Get(nSlot)));
1120 aParaMargin.SetWhich( RES_LR_SPACE);
1121 aCoreSet.Put(aParaMargin);
1122
1123 sw_ParagraphDialogResult(&aCoreSet, rWrtSh, rReq, pPaM);
1124 }
1125 else
1126 sw_ParagraphDialogResult(const_cast<SfxItemSet*>(pArgs), rWrtSh, rReq, pPaM);
1127 }
1128 else if (pDlg)
1129 {
1130 auto pRequest = std::make_shared<SfxRequest>(rReq);
1131 rReq.Ignore(); // the 'old' request is not relevant any more
1132
1133 auto vCursors = CopyPaMRing(*pPaM); // tdf#134439 make a copy to use at later apply
1134 pDlg->StartExecuteAsync([pDlg, &rWrtSh, pDrawModel, pRequest, nDefDist, vCursors](sal_Int32 nResult){
1135 if (nResult == RET_OK)
1136 {
1137 // Apply defaults if necessary.
1138 SfxItemSet* pSet = const_cast<SfxItemSet*>(pDlg->GetOutputItemSet());
1139 sal_uInt16 nNewDist;
1140 const SfxUInt16Item* pDefaultsItem = pSet->GetItemIfSet(SID_ATTR_TABSTOP_DEFAULTS, false);
1141 if (pDefaultsItem && nDefDist != (nNewDist = pDefaultsItem->GetValue()) )
1142 {
1143 SvxTabStopItem aDefTabs( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP );
1144 MakeDefTabs( nNewDist, aDefTabs );
1145 rWrtSh.SetDefault( aDefTabs );
1146 pSet->ClearItem( SID_ATTR_TABSTOP_DEFAULTS );
1147 }
1148
1149 const SfxPoolItem* pItem2 = nullptr;
1150 if (SfxItemState::SET == pSet->GetItemState(FN_PARAM_1, false, &pItem2))
1151 {
1152 pSet->Put(SfxStringItem(FN_DROP_TEXT, static_cast<const SfxStringItem*>(pItem2)->GetValue()));
1153 pSet->ClearItem(FN_PARAM_1);
1154 }
1155
1156 if (const SwFormatDrop* pDropItem = pSet->GetItemIfSet(RES_PARATR_DROP, false))
1157 {
1158 OUString sCharStyleName;
1159 if (pDropItem->GetCharFormat())
1160 sCharStyleName = pDropItem->GetCharFormat()->GetName();
1162 }
1163
1164 const XFillGradientItem* pTempGradItem = pSet->GetItem<XFillGradientItem>(XATTR_FILLGRADIENT);
1165 if (pTempGradItem && pTempGradItem->GetName().isEmpty())
1166 {
1167 // MigrateItemSet guarantees unique gradient names
1169 aMigrateSet.Put(XFillGradientItem("gradient", pTempGradItem->GetGradientValue()));
1170 SdrModel::MigrateItemSet(&aMigrateSet, pSet, pDrawModel);
1171 }
1172
1173 const XFillHatchItem* pTempHatchItem = pSet->GetItem<XFillHatchItem>(XATTR_FILLHATCH);
1174 if (pTempHatchItem && pTempHatchItem->GetName().isEmpty())
1175 {
1177 aMigrateSet.Put(XFillHatchItem("hatch", pTempHatchItem->GetHatchValue()));
1178 SdrModel::MigrateItemSet(&aMigrateSet, pSet, pDrawModel);
1179 }
1180
1181 sw_ParagraphDialogResult(pSet, rWrtSh, *pRequest, vCursors->front().get());
1182 }
1183 pDlg->disposeOnce();
1184 });
1185 }
1186 }
1187 break;
1188 case FN_NUM_CONTINUE:
1189 {
1190 OUString sContinuedListId;
1191 const SwNumRule* pRule =
1192 rWrtSh.SearchNumRule( true, sContinuedListId );
1193 // #i86492#
1194 // Search also for bullet list
1195 if ( !pRule )
1196 {
1197 pRule = rWrtSh.SearchNumRule( false, sContinuedListId );
1198 }
1199 if ( pRule )
1200 {
1201 rWrtSh.SetCurNumRule( *pRule, false, sContinuedListId );
1202 }
1203 }
1204 break;
1205
1206 case FN_SELECT_PARA:
1207 {
1208 if ( !rWrtSh.IsSttOfPara() )
1209 rWrtSh.SttPara();
1210 else
1211 rWrtSh.EnterStdMode();
1212 rWrtSh.EndPara( true );
1213 }
1214 break;
1215
1216 case SID_DEC_INDENT:
1217 case SID_INC_INDENT:
1218 //According to the requirement, modified the behavior when user
1219 //using the indent button on the toolbar. Now if we increase/decrease indent for a
1220 //paragraph which has bullet style it will increase/decrease the bullet level.
1221 {
1222 //If the current paragraph has bullet call the function to
1223 //increase or decrease the bullet level.
1224 //Why could I know whether a paragraph has bullet or not by checking the below conditions?
1225 //Please refer to the "case KEY_TAB:" section in SwEditWin::KeyInput(..) :
1226 // if( rSh.GetCurNumRule() && rSh.IsSttOfPara() &&
1227 // !rSh.HasReadonlySel() )
1228 // eKeyState = KS_NumDown;
1229 //Above code demonstrates that when the cursor is at the start of a paragraph which has bullet,
1230 //press TAB will increase the bullet level.
1231 //So I copied from that ^^
1232 if ( rWrtSh.GetNumRuleAtCurrCursorPos() && !rWrtSh.HasReadonlySel() )
1233 {
1234 rWrtSh.NumUpDown( SID_INC_INDENT == nSlot );
1235 }
1236 else //execute the original processing functions
1237 {
1238 //below is copied of the old codes
1239 rWrtSh.MoveLeftMargin( SID_INC_INDENT == nSlot, rReq.GetModifier() != KEY_MOD1 );
1240 }
1241 }
1242 rReq.Done();
1243 break;
1244
1247 rWrtSh.MoveLeftMargin( FN_INC_INDENT_OFFSET == nSlot, rReq.GetModifier() == KEY_MOD1 );
1248 rReq.Done();
1249 break;
1250
1251 case SID_ATTR_CHAR_COLOR2:
1252 {
1253 Color aSet;
1254 const SfxStringItem* pColorStringItem = nullptr;
1255 bool bHasItem = false;
1256
1257 if(pItem)
1258 {
1259 aSet = static_cast<const SvxColorItem*>(pItem)->GetValue();
1260 bHasItem = true;
1261 }
1262 else if (pArgs && (pColorStringItem = pArgs->GetItemIfSet(SID_ATTR_COLOR_STR, false)))
1263 {
1264 OUString sColor = pColorStringItem->GetValue();
1265 aSet = Color(ColorTransparency, sColor.toInt32(16));
1266 bHasItem = true;
1267 }
1268
1269 if (bHasItem)
1270 {
1271 SwEditWin& rEditWin = GetView().GetEditWin();
1272 rEditWin.SetWaterCanTextColor(aSet);
1273 SwApplyTemplate* pApply = rEditWin.GetApplyTemplate();
1274
1275 // If there is a selection, then set the color on it
1276 // otherwise, it'll be the color for the next text to be typed
1277 if(!pApply || pApply->nColor != SID_ATTR_CHAR_COLOR_EXT)
1278 {
1280 }
1281
1282 rReq.Done();
1283 }
1284 }
1285 break;
1286 case SID_ATTR_CHAR_COLOR_BACKGROUND:
1287 case SID_ATTR_CHAR_COLOR_BACKGROUND_EXT:
1288 case SID_ATTR_CHAR_COLOR_EXT:
1289 {
1290 Color aSet;
1291 const SfxStringItem* pColorStringItem = nullptr;
1292
1293 if (pArgs && (pColorStringItem = pArgs->GetItemIfSet(SID_ATTR_COLOR_STR, false)))
1294 {
1295 OUString sColor = pColorStringItem->GetValue();
1296 if (sColor == "transparent")
1297 aSet = COL_TRANSPARENT;
1298 else
1299 aSet = Color(ColorTransparency, sColor.toInt32(16));
1300 }
1301 else if (pItem)
1302 aSet = static_cast<const SvxColorItem*>(pItem)->GetValue();
1303 else
1304 aSet = COL_TRANSPARENT;
1305
1306 SwEditWin& rEdtWin = GetView().GetEditWin();
1307 if (nSlot != SID_ATTR_CHAR_COLOR_EXT)
1308 rEdtWin.SetWaterCanTextBackColor(aSet);
1309 else if (pItem)
1310 rEdtWin.SetWaterCanTextColor(aSet);
1311
1312 SwApplyTemplate* pApply = rEdtWin.GetApplyTemplate();
1313 SwApplyTemplate aTempl;
1314 if (!pApply && (rWrtSh.HasSelection() || rReq.IsAPI()))
1315 {
1316 if (nSlot != SID_ATTR_CHAR_COLOR_EXT)
1317 {
1319
1320 rWrtSh.GetCurAttr( aCoreSet );
1321
1322 // Remove highlight if already set of the same color
1323 const SvxBrushItem& rBrushItem = aCoreSet.Get(RES_CHRATR_BACKGROUND);
1324 if ( aSet == rBrushItem.GetColor() )
1325 aSet = COL_TRANSPARENT;
1326
1327 ApplyCharBackground(aSet, rWrtSh);
1328 }
1329 else
1330 rWrtSh.SetAttrItem(
1332 }
1333 else if (nSlot == SID_ATTR_CHAR_COLOR_BACKGROUND_EXT)
1334 {
1335 if (!pApply || pApply->nColor != SID_ATTR_CHAR_COLOR_BACKGROUND)
1336 {
1337 aTempl.nColor = SID_ATTR_CHAR_COLOR_BACKGROUND;
1338 rEdtWin.SetApplyTemplate(aTempl);
1339 }
1340 }
1341 else
1342 {
1343 if(!pApply || pApply->nColor != nSlot)
1344 aTempl.nColor = nSlot;
1345 rEdtWin.SetApplyTemplate(aTempl);
1346 }
1347
1348 rReq.Done();
1349 }
1350 break;
1351
1353 if (!rWrtSh.IsAddMode())
1354 rWrtSh.MoveParagraph();
1355 rReq.Done();
1356 break;
1357
1359 if (!rWrtSh.IsAddMode())
1360 rWrtSh.MoveParagraph(SwNodeOffset(-1));
1361 rReq.Done();
1362 break;
1363 case SID_RUBY_DIALOG:
1364 case SID_HYPERLINK_DIALOG:
1365 {
1366 SfxRequest aReq(nSlot, SfxCallMode::SLOT, SfxGetpApp()->GetPool());
1367 GetView().GetViewFrame()->ExecuteSlot( aReq);
1368 rReq.Ignore();
1369 }
1370 break;
1373 if(pArgs && pArgs->Count())
1374 {
1375 OUString sStyleName;
1376 if(pItem)
1377 sStyleName = static_cast<const SfxStringItem*>(pItem)->GetValue();
1378 bool bOn = true;
1379 if( SfxItemState::SET == pArgs->GetItemState(FN_PARAM_1, false, &pItem))
1380 bOn = static_cast<const SfxBoolItem*>(pItem)->GetValue();
1381 rWrtSh.ChangeHeaderOrFooter(sStyleName, FN_INSERT_PAGEHEADER == nSlot, bOn, !rReq.IsAPI());
1382 rReq.Done();
1383 }
1384 break;
1386 if(GetView().GetDocShell()->IsReadOnly())
1387 {
1390 rWrtSh.ShowCursor();
1391 }
1392 break;
1395 {
1396 bool bSetBlockMode = !rWrtSh.IsBlockMode();
1397 if( pArgs && SfxItemState::SET == pArgs->GetItemState(nSlot, false, &pItem))
1398 bSetBlockMode = static_cast<const SfxBoolItem*>(pItem)->GetValue();
1399 if( ( nSlot == FN_SELECTION_MODE_DEFAULT ) != bSetBlockMode )
1400 rWrtSh.EnterBlockMode();
1401 else
1402 rWrtSh.EnterStdMode();
1405 rBnd.Update(FN_STAT_SELMODE);
1406 }
1407 break;
1408 case SID_OPEN_HYPERLINK:
1409 case SID_COPY_HYPERLINK_LOCATION:
1410 {
1412 rWrtSh.GetCurAttr(aSet);
1413 if(SfxItemState::SET <= aSet.GetItemState( RES_TXTATR_INETFMT ))
1414 {
1415 const SwFormatINetFormat& rINetFormat = aSet.Get(RES_TXTATR_INETFMT);
1416 if( nSlot == SID_COPY_HYPERLINK_LOCATION )
1417 {
1418 OUString hyperlinkLocation = rINetFormat.GetValue();
1419 ::uno::Reference< datatransfer::clipboard::XClipboard > xClipboard = GetView().GetEditWin().GetClipboard();
1420
1422 }
1423 else
1424 rWrtSh.ClickToINetAttr(rINetFormat);
1425 }
1426 else
1427 {
1428 SwField* pField = rWrtSh.GetCurField();
1429 if (pField && pField->GetTyp()->Which() == SwFieldIds::TableOfAuthorities)
1430 {
1431 const auto& rAuthorityField = *static_cast<const SwAuthorityField*>(pField);
1432 if (rAuthorityField.HasURL())
1433 {
1434 // Bibliography entry with URL also provides a hyperlink.
1435 const OUString& rURL
1436 = rAuthorityField.GetAuthEntry()->GetAuthorField(AUTH_FIELD_URL);
1437 ::LoadURL(rWrtSh, rURL, LoadUrlFlags::NewView, /*rTargetFrameName=*/OUString());
1438 }
1439 }
1440 }
1441 }
1442 break;
1443 case FN_OPEN_LOCAL_URL:
1444 {
1445 OUString aLocalURL = GetLocalURL(rWrtSh);
1446 if (!aLocalURL.isEmpty())
1447 {
1448 ::LoadURL(rWrtSh, aLocalURL, LoadUrlFlags::NewView, /*rTargetFrameName=*/OUString());
1449 }
1450 }
1451 break;
1452 case SID_OPEN_XML_FILTERSETTINGS:
1453 {
1455 }
1456 break;
1458 {
1459 }
1460 break;
1462 {
1463 }
1464 break;
1466 {
1467 }
1468 break;
1470 {
1471 }
1472 break;
1474 {
1475 }
1476 break;
1478 {
1479 GetView().UpdateWordCount(this, nSlot);
1480 }
1481 break;
1482 case FN_PROTECT_FIELDS:
1484 {
1486 DocumentSettingId aSettingId = nSlot == FN_PROTECT_FIELDS
1489 rIDSA.set(aSettingId, !rIDSA.get(aSettingId));
1490 // Invalidate so that toggle state gets updated
1491 SfxViewFrame* pViewFrame = GetView().GetViewFrame();
1492 pViewFrame->GetBindings().Invalidate(nSlot);
1493 pViewFrame->GetBindings().Update(nSlot);
1494 }
1495 break;
1496 case SID_FM_CTL_PROPERTIES:
1497 {
1498 SwPosition aPos(*GetShell().GetCursor()->GetPoint());
1499 sw::mark::IFieldmark* pFieldBM = GetShell().getIDocumentMarkAccess()->getFieldmarkFor(aPos);
1500 if ( !pFieldBM )
1501 {
1502 aPos.AdjustContent(-1);
1503 pFieldBM = GetShell().getIDocumentMarkAccess()->getFieldmarkFor(aPos);
1504 }
1505
1506 if ( pFieldBM && pFieldBM->GetFieldname() == ODF_FORMDROPDOWN
1507 && !(rWrtSh.GetCurrSection() && rWrtSh.GetCurrSection()->IsProtect()) )
1508 {
1511 if (pDlg->Execute() == RET_OK)
1512 {
1513 pFieldBM->Invalidate();
1514 rWrtSh.InvalidateWindows( SwRect(rWrtSh.GetView().GetVisArea()) );
1515 rWrtSh.UpdateCursor(); // cursor position might be invalid
1516 }
1517 }
1518 else if ( pFieldBM && pFieldBM->GetFieldname() == ODF_FORMDATE )
1519 {
1521 sw::mark::DateFieldmark& rDateField = dynamic_cast<sw::mark::DateFieldmark&>(*pFieldBM);
1522 ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateDateFormFieldDialog(rWrtSh.GetView().GetFrameWeld(), &rDateField, *GetView().GetDocShell()->GetDoc()));
1523 if (pDlg->Execute() == RET_OK)
1524 {
1525 rDateField.Invalidate();
1526 rWrtSh.InvalidateWindows( SwRect(rWrtSh.GetView().GetVisArea()) );
1527 rWrtSh.UpdateCursor(); // cursor position might be invalid
1528 }
1529 }
1530 else
1531 {
1532 SfxRequest aReq( GetView().GetViewFrame(), SID_FM_CTL_PROPERTIES );
1533 aReq.AppendItem( SfxBoolItem( SID_FM_CTL_PROPERTIES, true ) );
1534 rWrtSh.GetView().GetFormShell()->Execute( aReq );
1535 }
1536 }
1537 break;
1538 case SID_FM_TRANSLATE:
1539 {
1540#if !ENABLE_WASM_STRIP_EXTRA
1541 const SfxPoolItem* pTargetLangStringItem = nullptr;
1542 if (pArgs && SfxItemState::SET == pArgs->GetItemState(SID_ATTR_TARGETLANG_STR, false, &pTargetLangStringItem))
1543 {
1544 SvxDeeplOptions& rDeeplOptions = SvxDeeplOptions::Get();
1545 if (rDeeplOptions.getAPIUrl().isEmpty() || rDeeplOptions.getAuthKey().isEmpty())
1546 {
1547 SAL_WARN("sw.ui", "SID_FM_TRANSLATE: API options are not set");
1548 break;
1549 }
1550 const OString aAPIUrl = OUStringToOString(rtl::Concat2View(rDeeplOptions.getAPIUrl() + "?tag_handling=html"), RTL_TEXTENCODING_UTF8).trim();
1551 const OString aAuthKey = OUStringToOString(rDeeplOptions.getAuthKey(), RTL_TEXTENCODING_UTF8).trim();
1552 OString aTargetLang = OUStringToOString(static_cast<const SfxStringItem*>(pTargetLangStringItem)->GetValue(), RTL_TEXTENCODING_UTF8);
1553 SwTranslateHelper::TranslateAPIConfig aConfig({aAPIUrl, aAuthKey, aTargetLang});
1554 SwTranslateHelper::TranslateDocument(rWrtSh, aConfig);
1555 }
1556 else
1557 {
1559 std::shared_ptr<AbstractSwTranslateLangSelectDlg> pAbstractDialog(pFact->CreateSwTranslateLangSelectDlg(GetView().GetFrameWeld(), rWrtSh));
1560 std::shared_ptr<weld::DialogController> pDialogController(pAbstractDialog->getDialogController());
1561 weld::DialogController::runAsync(pDialogController, [] (sal_Int32 /*nResult*/) { });
1562 }
1563#endif // ENABLE_WASM_STRIP_EXTRA
1564 }
1565 break;
1566 case SID_SPELLCHECK_IGNORE:
1567 {
1568 SwPaM *pPaM = rWrtSh.GetCursor();
1569 if (pPaM)
1571 }
1572 break;
1573 case SID_SPELLCHECK_IGNORE_ALL:
1574 {
1575 OUString sApplyText;
1576 const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
1577 if (pItem2)
1578 sApplyText = pItem2->GetValue();
1579
1580 if(sApplyText == "Grammar")
1581 {
1582 linguistic2::ProofreadingResult aGrammarCheckRes;
1583 sal_Int32 nErrorInResult = -1;
1584 uno::Sequence< OUString > aSuggestions;
1585 sal_Int32 nErrorPosInText = -1;
1586 SwRect aToFill;
1587 bool bCorrectionRes = rWrtSh.GetGrammarCorrection( aGrammarCheckRes, nErrorPosInText, nErrorInResult, aSuggestions, nullptr, aToFill );
1588 if(bCorrectionRes)
1589 {
1590 try {
1591 uno::Reference< linguistic2::XDictionary > xDictionary = LinguMgr::GetIgnoreAllList();
1592 aGrammarCheckRes.xProofreader->ignoreRule(
1593 aGrammarCheckRes.aErrors[ nErrorInResult ].aRuleIdentifier,
1594 aGrammarCheckRes.aLocale );
1595 // refresh the layout of the actual paragraph (faster)
1596 SwPaM *pPaM = rWrtSh.GetCursor();
1597 if (pPaM)
1599 if (xDictionary.is())
1600 {
1601 // refresh the layout of all paragraphs (workaround to launch a dictionary event)
1602 xDictionary->setActive(false);
1603 xDictionary->setActive(true);
1604 }
1605 }
1606 catch( const uno::Exception& )
1607 {
1608 }
1609 }
1610 }
1611 else if (sApplyText == "Spelling")
1612 {
1613 SwRect aToFill;
1614 uno::Reference<linguistic2::XSpellAlternatives> xSpellAlt(rWrtSh.GetCorrection(nullptr, aToFill));
1615 if (!xSpellAlt.is())
1616 return;
1617 uno::Reference< linguistic2::XDictionary > xDictionary = LinguMgr::GetIgnoreAllList();
1618 OUString sWord(xSpellAlt->getWord());
1620 sWord, false, OUString() );
1621 if (linguistic::DictionaryError::NONE != nAddRes && xDictionary.is() && !xDictionary->getEntry(sWord).is())
1622 {
1623 SvxDicError(rWrtSh.GetView().GetFrameWeld(), nAddRes);
1624 }
1625 }
1626 }
1627 break;
1628 case SID_SPELLCHECK_APPLY_SUGGESTION:
1629 {
1630 OUString sApplyText;
1631 const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
1632 if (pItem2)
1633 sApplyText = pItem2->GetValue();
1634
1635 static const OUStringLiteral sSpellingRule(u"Spelling_");
1636 static const OUStringLiteral sGrammarRule(u"Grammar_");
1637
1638 bool bGrammar = false;
1639 sal_Int32 nPos = 0;
1640 uno::Reference< linguistic2::XSpellAlternatives > xSpellAlt;
1641 if(-1 != (nPos = sApplyText.indexOf( sGrammarRule )))
1642 {
1643 sApplyText = sApplyText.replaceAt(nPos, sGrammarRule.getLength(), u"");
1644 bGrammar = true;
1645 }
1646 else if (-1 != (nPos = sApplyText.indexOf( sSpellingRule )))
1647 {
1648 sApplyText = sApplyText.replaceAt(nPos, sSpellingRule.getLength(), u"");
1649 SwRect aToFill;
1650 xSpellAlt.set(rWrtSh.GetCorrection(nullptr, aToFill));
1651 bGrammar = false;
1652 }
1653
1654 if (!bGrammar && !xSpellAlt.is())
1655 return;
1656
1657 bool bOldIns = rWrtSh.IsInsMode();
1658 rWrtSh.SetInsMode();
1659
1660 OUString aTmp( sApplyText );
1661 OUString aOrig( bGrammar ? OUString() : xSpellAlt->getWord() );
1662
1663 // if original word has a trailing . (likely the end of a sentence)
1664 // and the replacement text hasn't, then add it to the replacement
1665 if (!aTmp.isEmpty() && !aOrig.isEmpty() &&
1666 aOrig.endsWith(".") && /* !IsAlphaNumeric ??*/
1667 !aTmp.endsWith("."))
1668 {
1669 aTmp += ".";
1670 }
1671
1672 SwRewriter aRewriter;
1673
1674 aRewriter.AddRule(UndoArg1, rWrtSh.GetCursorDescr());
1675 aRewriter.AddRule(UndoArg2, SwResId(STR_YIELDS));
1676
1677 OUString aTmpStr = SwResId(STR_START_QUOTE) +
1678 aTmp + SwResId(STR_END_QUOTE);
1679 aRewriter.AddRule(UndoArg3, aTmpStr);
1680
1681 rWrtSh.StartUndo(SwUndoId::UI_REPLACE, &aRewriter);
1682 rWrtSh.StartAction();
1683
1684 rWrtSh.Replace(aTmp, false);
1685
1686 rWrtSh.EndAction();
1687 rWrtSh.EndUndo();
1688
1689 rWrtSh.SetInsMode( bOldIns );
1690 }
1691 break;
1692 default:
1693 OSL_ENSURE(false, "wrong dispatcher");
1694 return;
1695 }
1696}
1697
1699{
1700 SwWrtShell &rSh = GetShell();
1701 SfxWhichIter aIter( rSet );
1702 sal_uInt16 nWhich = aIter.FirstWhich();
1703 while ( nWhich )
1704 {
1705 switch ( nWhich )
1706 {
1708 if( !rSh.IsCursorInFootnote() )
1709 rSet.DisableItem( nWhich );
1710 break;
1711
1712 case SID_LANGUAGE_STATUS:
1713 {
1714 // the value of used script types
1715 OUString aScriptTypesInUse( OUString::number( static_cast<int>(rSh.GetScriptType()) ) );
1716
1717 // get keyboard language
1718 OUString aKeyboardLang;
1719 SwEditWin& rEditWin = GetView().GetEditWin();
1720 LanguageType nLang = rEditWin.GetInputLanguage();
1722 aKeyboardLang = SvtLanguageTable::GetLanguageString( nLang );
1723
1724 // get the language that is in use
1725 OUString aCurrentLang = "*";
1727 if (nLang != LANGUAGE_DONTKNOW)
1728 {
1731 {
1732 if (nLang == LANGUAGE_NONE)
1733 {
1734 aCurrentLang += ";-";
1735 }
1736 else
1737 {
1738 aCurrentLang += ";" + LanguageTag(nLang).getBcp47(false);
1739 }
1740 }
1741 }
1742
1743 // build sequence for status value
1744 uno::Sequence< OUString > aSeq{ aCurrentLang,
1745 aScriptTypesInUse,
1746 aKeyboardLang,
1748
1749 // set sequence as status value
1750 SfxStringListItem aItem( SID_LANGUAGE_STATUS );
1751 aItem.SetStringList( aSeq );
1752 rSet.Put( aItem );
1753 }
1754 break;
1755
1756 case SID_THES:
1757 {
1758 // is there a valid selection to get text from?
1759 OUString aText;
1760 bool bValid = !rSh.HasSelection() ||
1761 (rSh.IsSelOnePara() && !rSh.IsMultiSelection());
1762 // prevent context menu from showing when cursor is not in or at the end of a word
1763 // (GetCurWord will return the next word if there is none at the current position...)
1764 const sal_Int16 nWordType = ::i18n::WordType::DICTIONARY_WORD;
1765 bool bWord = rSh.IsInWord( nWordType ) || rSh.IsStartWord( nWordType ) || rSh.IsEndWord( nWordType );
1766 if (bValid && bWord)
1767 aText = rSh.HasSelection()? rSh.GetSelText() : rSh.GetCurWord();
1768
1770 LanguageTag aLanguageTag( nLang);
1771 const lang::Locale& aLocale( aLanguageTag.getLocale());
1772
1773 // disable "Thesaurus" context menu entry if there is nothing to look up
1774 uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() );
1775 if (aText.isEmpty() ||
1776 !xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( aLocale ))
1777 rSet.DisableItem( SID_THES );
1778 else
1779 {
1780 // set word and locale to look up as status value
1781 OUString aStatusVal = aText + "#" + aLanguageTag.getBcp47();
1782 rSet.Put( SfxStringItem( SID_THES, aStatusVal ) );
1783 }
1784 }
1785 break;
1786
1787 case FN_NUMBER_NEWSTART :
1788 if(!rSh.GetNumRuleAtCurrCursorPos())
1789 rSet.DisableItem(nWhich);
1790 else
1792 rSh.IsNumRuleStart()));
1793 break;
1794
1795 case FN_EDIT_FORMULA:
1796 case SID_CHARMAP:
1797 case SID_CHARMAP_CONTROL:
1798 {
1799 const SelectionType nType = rSh.GetSelectionType();
1800 if (!(nType & SelectionType::Text) &&
1803 {
1804 rSet.DisableItem(nWhich);
1805 }
1806 else if ( nWhich == FN_EDIT_FORMULA
1807 && rSh.CursorInsideInputField() )
1808 {
1809 rSet.DisableItem( nWhich );
1810 }
1811 }
1812 break;
1813
1814 case FN_INSERT_ENDNOTE:
1815 case FN_INSERT_FOOTNOTE:
1817 {
1818 const FrameTypeFlags nNoType =
1820 if ( rSh.GetFrameType(nullptr,true) & nNoType )
1821 rSet.DisableItem(nWhich);
1822
1823 if ( rSh.CursorInsideInputField() )
1824 {
1825 rSet.DisableItem( nWhich );
1826 }
1827 }
1828 break;
1829
1831 case SID_INSERTDOC:
1832 case FN_INSERT_GLOSSARY:
1833 case FN_EXPAND_GLOSSARY:
1834 if ( rSh.CursorInsideInputField() )
1835 {
1836 rSet.DisableItem( nWhich );
1837 }
1838 break;
1839
1840 case FN_INSERT_TABLE:
1841 if ( rSh.CursorInsideInputField()
1842 || rSh.GetTableFormat()
1843 || (rSh.GetFrameType(nullptr,true) & FrameTypeFlags::FOOTNOTE) )
1844 {
1845 rSet.DisableItem( nWhich );
1846 }
1847 break;
1848
1849 case FN_CALCULATE:
1850 if ( !rSh.IsSelection() )
1851 rSet.DisableItem(nWhich);
1852 break;
1853 case FN_GOTO_REFERENCE:
1854 {
1855 SwField *pField = rSh.GetCurField();
1856 if ( !pField || (pField->GetTypeId() != SwFieldTypesEnum::GetRef) )
1857 rSet.DisableItem(nWhich);
1858 }
1859 break;
1860 case FN_AUTOFORMAT_AUTO:
1861 {
1862 rSet.Put( SfxBoolItem( nWhich, SvxAutoCorrCfg::Get().IsAutoFormatByInput() ));
1863 }
1864 break;
1865
1866 case SID_DEC_INDENT:
1867 case SID_INC_INDENT:
1868 {
1869 //if the paragraph has bullet we'll do the following things:
1870 //1: if the bullet level is the first level, disable the decrease-indent button
1871 //2: if the bullet level is the last level, disable the increase-indent button
1872 if ( rSh.GetNumRuleAtCurrCursorPos() && !rSh.HasReadonlySel() )
1873 {
1874 const sal_uInt8 nLevel = rSh.GetNumLevel();
1875 if ( ( nLevel == ( MAXLEVEL - 1 ) && nWhich == SID_INC_INDENT )
1876 || ( nLevel == 0 && nWhich == SID_DEC_INDENT ) )
1877 {
1878 rSet.DisableItem( nWhich );
1879 }
1880 }
1881 else
1882 {
1883 sal_uInt16 nHtmlMode = ::GetHtmlMode( GetView().GetDocShell() );
1884 nHtmlMode &= HTMLMODE_ON | HTMLMODE_SOME_STYLES;
1885 if ( ( nHtmlMode == HTMLMODE_ON )
1886 || !rSh.IsMoveLeftMargin( SID_INC_INDENT == nWhich ) )
1887 {
1888 rSet.DisableItem( nWhich );
1889 }
1890 }
1891 }
1892 break;
1893
1896 {
1897 sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell());
1898 nHtmlMode &= HTMLMODE_ON|HTMLMODE_SOME_STYLES;
1899 if( (nHtmlMode == HTMLMODE_ON) ||
1900 !rSh.IsMoveLeftMargin( FN_INC_INDENT_OFFSET == nWhich,
1901 false ))
1902 rSet.DisableItem( nWhich );
1903 }
1904 break;
1905
1906 case SID_ATTR_CHAR_COLOR2:
1907 {
1908 SfxItemSet aSet( GetPool() );
1909 rSh.GetCurAttr( aSet );
1910 const SvxColorItem& aColorItem = aSet.Get(RES_CHRATR_COLOR);
1911 rSet.Put( aColorItem.CloneSetWhich(SID_ATTR_CHAR_COLOR2) );
1912 }
1913 break;
1914 case SID_ATTR_CHAR_COLOR_BACKGROUND:
1915 {
1916 // Always use the visible background
1917 SfxItemSet aSet( GetPool() );
1918 rSh.GetCurAttr( aSet );
1919 const SvxBrushItem& aBrushItem = aSet.Get(RES_CHRATR_HIGHLIGHT);
1920 if( aBrushItem.GetColor() != COL_TRANSPARENT )
1921 {
1922 rSet.Put( SvxColorItem(aBrushItem.GetColor(), nWhich) );
1923 }
1924 else
1925 {
1926 const SvxBrushItem& aBrushItem2 = aSet.Get(RES_CHRATR_BACKGROUND);
1927 rSet.Put( SvxColorItem(aBrushItem2.GetColor(), nWhich) );
1928 }
1929 }
1930 break;
1931 case SID_ATTR_CHAR_COLOR_BACKGROUND_EXT:
1932 {
1933 SwEditWin& rEdtWin = GetView().GetEditWin();
1934 SwApplyTemplate* pApply = rEdtWin.GetApplyTemplate();
1935 rSet.Put(SfxBoolItem(nWhich, pApply && pApply->nColor == SID_ATTR_CHAR_COLOR_BACKGROUND));
1936 }
1937 break;
1938 case SID_ATTR_CHAR_COLOR_EXT:
1939 {
1940 SwEditWin& rEdtWin = GetView().GetEditWin();
1941 SwApplyTemplate* pApply = rEdtWin.GetApplyTemplate();
1942 rSet.Put(SfxBoolItem(nWhich, pApply && pApply->nColor == nWhich));
1943 }
1944 break;
1945 case FN_SET_REMINDER:
1946 case FN_INSERT_BOOKMARK:
1947 if( rSh.IsTableMode()
1948 || rSh.CursorInsideInputField() )
1949 {
1950 rSet.DisableItem( nWhich );
1951 }
1952 break;
1953
1954 case FN_INSERT_BREAK:
1955 if ( rSh.HasReadonlySel()
1956 && !rSh.CursorInsideInputField() )
1957 {
1958 rSet.DisableItem( nWhich );
1959 }
1960 break;
1961
1966 {
1967 rSet.DisableItem( nWhich );
1968 }
1969 break;
1970
1974 {
1975 bool bState = false;
1976 bool bAllState = true;
1977 bool bIsPhysical = false;
1978
1979 OUString aStyleName;
1980 std::vector<OUString> aList;
1981 static const OUStringLiteral sPhysical(u"IsPhysical");
1982 static const OUStringLiteral sDisplay(u"DisplayName");
1983 const OUString sHeaderOn(nWhich == FN_INSERT_PAGEHEADER ? OUString("HeaderIsOn") : OUString("FooterIsOn"));
1984
1985 uno::Reference< XStyleFamiliesSupplier > xSupplier(GetView().GetDocShell()->GetBaseModel(), uno::UNO_QUERY);
1986 if (xSupplier.is())
1987 {
1988 uno::Reference< XNameContainer > xContainer;
1989 uno::Reference< XNameAccess > xFamilies = xSupplier->getStyleFamilies();
1990 if (xFamilies->getByName("PageStyles") >>= xContainer)
1991 {
1992 const uno::Sequence< OUString > aSeqNames = xContainer->getElementNames();
1993 for (const auto& rName : aSeqNames)
1994 {
1995 aStyleName = rName;
1996 uno::Reference<XPropertySet> xPropSet(xContainer->getByName(aStyleName), uno::UNO_QUERY);
1997 if (xPropSet.is() && (xPropSet->getPropertyValue(sPhysical) >>= bIsPhysical) && bIsPhysical)
1998 {
1999 xPropSet->getPropertyValue(sDisplay) >>= aStyleName;
2000 if ((xPropSet->getPropertyValue(sHeaderOn)>>= bState) && bState)
2001 aList.push_back(aStyleName);
2002 else
2003 bState = false;
2004
2005 // Check if all entries have the same state
2006 bAllState &= bState;
2007 }
2008 else
2009 bIsPhysical = false;
2010 }
2011 }
2012 }
2013
2014 if (bAllState && aList.size() > 1)
2015 aList.push_back("_ALL_");
2016
2017 rSet.Put(SfxStringListItem(nWhich, &aList));
2018 }
2019 else
2020 {
2021 rSet.Put( SfxObjectShellItem( nWhich, GetView().GetDocShell() ));
2022 }
2023 break;
2025 case FN_SORTING_DLG:
2026 if(!rSh.HasSelection() ||
2027 (FN_TABLE_SORT_DIALOG == nWhich && !rSh.GetTableFormat()))
2028 rSet.DisableItem( nWhich );
2029 break;
2030
2031 case SID_RUBY_DIALOG:
2032 {
2034 || rSh.CursorInsideInputField() )
2035 {
2036 GetView().GetViewFrame()->GetBindings().SetVisibleState( nWhich, false );
2037 rSet.DisableItem(nWhich);
2038 }
2039 else
2040 GetView().GetViewFrame()->GetBindings().SetVisibleState( nWhich, true );
2041 }
2042 break;
2043
2044 case SID_FM_TRANSLATE:
2045 {
2046#if !ENABLE_WASM_STRIP_EXTRA
2047 const SvxDeeplOptions& rDeeplOptions = SvxDeeplOptions::Get();
2048 if (rDeeplOptions.getAPIUrl().isEmpty() || rDeeplOptions.getAuthKey().isEmpty())
2049 {
2050 rSet.DisableItem(nWhich);
2051 }
2052#endif
2053 }
2054 break;
2055
2056 case SID_HYPERLINK_DIALOG:
2057 if( GetView().GetDocShell()->IsReadOnly()
2058 || ( !GetView().GetViewFrame()->HasChildWindow(nWhich)
2059 && rSh.HasReadonlySel() )
2060 || rSh.CursorInsideInputField() )
2061 {
2062 rSet.DisableItem(nWhich);
2063 }
2064 else
2065 {
2066 rSet.Put(SfxBoolItem( nWhich, nullptr != GetView().GetViewFrame()->GetChildWindow( nWhich ) ));
2067 }
2068 break;
2069
2070 case SID_EDIT_HYPERLINK:
2071 case SID_COPY_HYPERLINK_LOCATION:
2072 {
2074 rSh.GetCurAttr(aSet);
2075 if(SfxItemState::SET > aSet.GetItemState( RES_TXTATR_INETFMT ) || rSh.HasReadonlySel())
2076 {
2077 rSet.DisableItem(nWhich);
2078 }
2079 }
2080 break;
2081 case SID_REMOVE_HYPERLINK:
2082 {
2084 rSh.GetCurAttr(aSet);
2085
2086 // If a hyperlink is selected, either alone or along with other text...
2087 if ((aSet.GetItemState(RES_TXTATR_INETFMT) < SfxItemState::SET &&
2088 aSet.GetItemState(RES_TXTATR_INETFMT) != SfxItemState::DONTCARE) ||
2089 rSh.HasReadonlySel())
2090 {
2091 rSet.DisableItem(nWhich);
2092 }
2093 }
2094 break;
2095 case SID_TRANSLITERATE_HALFWIDTH:
2096 case SID_TRANSLITERATE_FULLWIDTH:
2097 case SID_TRANSLITERATE_HIRAGANA:
2098 case SID_TRANSLITERATE_KATAKANA:
2099 {
2101 {
2102 GetView().GetViewFrame()->GetBindings().SetVisibleState( nWhich, false );
2103 rSet.DisableItem(nWhich);
2104 }
2105 else
2106 GetView().GetViewFrame()->GetBindings().SetVisibleState( nWhich, true );
2107 }
2108 break;
2110 if(!GetView().GetDocShell()->IsReadOnly())
2111 rSet.DisableItem( nWhich );
2112 else
2113 {
2115 }
2116 break;
2119 rSet.Put(SfxBoolItem(nWhich, (nWhich == FN_SELECTION_MODE_DEFAULT) != rSh.IsBlockMode()));
2120 break;
2121 case SID_OPEN_HYPERLINK:
2122 {
2124 rSh.GetCurAttr(aSet);
2125
2126 bool bAuthorityFieldURL = false;
2127 SwField* pField = rSh.GetCurField();
2128 if (pField && pField->GetTyp()->Which() == SwFieldIds::TableOfAuthorities)
2129 {
2130 // Bibliography entry with URL also provides a hyperlink.
2131 const auto& rAuthorityField = *static_cast<const SwAuthorityField*>(pField);
2132 bAuthorityFieldURL = rAuthorityField.HasURL();
2133 }
2134 if (SfxItemState::SET > aSet.GetItemState(RES_TXTATR_INETFMT, false)
2135 && !bAuthorityFieldURL)
2136 rSet.DisableItem(nWhich);
2137 }
2138 break;
2139 case FN_OPEN_LOCAL_URL:
2140 {
2141 if (GetLocalURL(rSh).isEmpty())
2142 {
2143 rSet.DisableItem(nWhich);
2144 }
2145 }
2146 break;
2147 case SID_OPEN_SMARTTAGMENU:
2148 {
2149 std::vector< OUString > aSmartTagTypes;
2150 uno::Sequence< uno::Reference< container::XStringKeyMap > > aStringKeyMaps;
2151 uno::Reference<text::XTextRange> xRange;
2152
2153 rSh.GetSmartTagTerm( aSmartTagTypes, aStringKeyMaps, xRange );
2154
2155 if ( xRange.is() && !aSmartTagTypes.empty() )
2156 {
2157 uno::Sequence < uno::Sequence< uno::Reference< smarttags::XSmartTagAction > > > aActionComponentsSequence;
2158 uno::Sequence < uno::Sequence< sal_Int32 > > aActionIndicesSequence;
2159
2160 const SmartTagMgr& rSmartTagMgr = SwSmartTagMgr::Get();
2161 rSmartTagMgr.GetActionSequences( aSmartTagTypes,
2162 aActionComponentsSequence,
2163 aActionIndicesSequence );
2164
2165 uno::Reference <frame::XController> xController = GetView().GetController();
2166 lang::Locale aLocale( SW_BREAKITER()->GetLocale( GetAppLanguageTag() ) );
2167 const OUString& aApplicationName( rSmartTagMgr.GetApplicationName() );
2168 const OUString aRangeText = xRange->getString();
2169
2170 const SvxSmartTagItem aItem( SID_OPEN_SMARTTAGMENU,
2171 aActionComponentsSequence,
2172 aActionIndicesSequence,
2173 aStringKeyMaps,
2174 xRange,
2176 std::move(aLocale),
2177 aApplicationName,
2178 aRangeText );
2179
2180 rSet.Put( aItem );
2181 }
2182 else
2183 rSet.DisableItem(nWhich);
2184 }
2185 break;
2186
2187 case FN_NUM_NUMBERING_ON:
2188 rSet.Put(SfxBoolItem(FN_NUM_NUMBERING_ON,rSh.SelectionHasNumber()));
2189 break;
2190
2191 case FN_NUM_BULLET_ON:
2192 rSet.Put(SfxBoolItem(FN_NUM_BULLET_ON,rSh.SelectionHasBullet()));
2193 break;
2194
2195 case FN_NUM_BULLET_OFF:
2197 !rSh.SelectionHasNumber())));
2198 break;
2199
2200 case FN_BUL_NUM_RULE_INDEX:
2201 case FN_NUM_NUM_RULE_INDEX:
2202 case FN_OUTLINE_RULE_INDEX:
2203 {
2204 SwNumRule* pCurRule = const_cast<SwNumRule*>(GetShell().GetNumRuleAtCurrCursorPos());
2205 if( pCurRule )
2206 {
2207 sal_uInt16 nActNumLvl = GetShell().GetNumLevel();
2208 if( nActNumLvl < MAXLEVEL )
2209 {
2210 nActNumLvl = 1<<nActNumLvl;
2211 }
2212 SvxNumRule aSvxRule = pCurRule->MakeSvxNumRule();
2213 if ( GetShell().HasBullet())
2214 {
2215 rSet.Put(SfxUInt16Item(FN_BUL_NUM_RULE_INDEX, USHRT_MAX));
2216 rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX, USHRT_MAX));
2217 NBOTypeMgrBase* pBullets = NBOutlineTypeMgrFact::CreateInstance(NBOType::Bullets);
2218 if ( pBullets )
2219 {
2220 const sal_uInt16 nBulIndex = pBullets->GetNBOIndexForNumRule(aSvxRule,nActNumLvl);
2221 rSet.Put(SfxUInt16Item(FN_BUL_NUM_RULE_INDEX,nBulIndex));
2222 }
2223 }else if ( GetShell().HasNumber() )
2224 {
2225 rSet.Put(SfxUInt16Item(FN_BUL_NUM_RULE_INDEX, USHRT_MAX));
2226 rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX, USHRT_MAX));
2227 NBOTypeMgrBase* pNumbering = NBOutlineTypeMgrFact::CreateInstance(NBOType::Numbering);
2228 if ( pNumbering )
2229 {
2230 const sal_uInt16 nBulIndex = pNumbering->GetNBOIndexForNumRule(aSvxRule,nActNumLvl);
2231 rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX,nBulIndex));
2232 }
2233 }
2234
2235 if ( nWhich == FN_OUTLINE_RULE_INDEX )
2236 {
2237 rSet.Put(SfxUInt16Item(FN_OUTLINE_RULE_INDEX, USHRT_MAX));
2238 NBOTypeMgrBase* pOutline = NBOutlineTypeMgrFact::CreateInstance(NBOType::Outline);
2239 if ( pOutline )
2240 {
2241 const sal_uInt16 nIndex = pOutline->GetNBOIndexForNumRule(aSvxRule,nActNumLvl);
2242 rSet.Put(SfxUInt16Item(FN_OUTLINE_RULE_INDEX,nIndex));
2243 }
2244 }
2245 }
2246 }
2247 break;
2248 case FN_NUM_CONTINUE:
2249 {
2250 // #i86492#
2251 // Search also for bullet list
2252 OUString aDummy;
2253 const SwNumRule* pRule =
2254 rSh.SearchNumRule( true, aDummy );
2255 if ( !pRule )
2256 {
2257 pRule = rSh.SearchNumRule( false, aDummy );
2258 }
2259 if ( !pRule )
2260 rSet.DisableItem(nWhich);
2261 }
2262 break;
2263 case SID_INSERT_RLM :
2264 case SID_INSERT_LRM :
2265 {
2266 SvtCTLOptions aCTLOptions;
2267 bool bEnabled = aCTLOptions.IsCTLFontEnabled();
2268 GetView().GetViewFrame()->GetBindings().SetVisibleState( nWhich, bEnabled );
2269 if(!bEnabled)
2270 rSet.DisableItem(nWhich);
2271 }
2272 break;
2273 case SID_FM_CTL_PROPERTIES:
2274 {
2275 bool bDisable = false;
2276
2277 // First get the state from the form shell
2279 aSet.Put(SfxBoolItem( SID_FM_CTL_PROPERTIES, true ));
2280 GetShell().GetView().GetFormShell()->GetState( aSet );
2281
2282 if(SfxItemState::DISABLED == aSet.GetItemState(SID_FM_CTL_PROPERTIES))
2283 {
2284 bDisable = true;
2285 }
2286
2287 // Enable it if we have a valid object other than what form shell knows
2288 SwPosition aPos(*GetShell().GetCursor()->GetPoint());
2289 sw::mark::IFieldmark* pFieldBM = GetShell().getIDocumentMarkAccess()->getFieldmarkFor(aPos);
2290 if ( !pFieldBM && aPos.GetContentIndex() > 0)
2291 {
2292 aPos.AdjustContent(-1);
2293 pFieldBM = GetShell().getIDocumentMarkAccess()->getFieldmarkFor(aPos);
2294 }
2295 if ( pFieldBM && (pFieldBM->GetFieldname() == ODF_FORMDROPDOWN || pFieldBM->GetFieldname() == ODF_FORMDATE) )
2296 {
2297 bDisable = false;
2298 }
2299
2300 if(bDisable)
2301 rSet.DisableItem(nWhich);
2302 }
2303 break;
2304 case SID_COPY:
2305 case SID_CUT:
2306 {
2307 if (GetObjectShell()->isContentExtractionLocked())
2308 rSet.DisableItem(nWhich);
2309 break;
2310 }
2311 case FN_PROTECT_FIELDS:
2313 {
2314 DocumentSettingId aSettingId = nWhich == FN_PROTECT_FIELDS
2317 bool bProtected = rSh.getIDocumentSettingAccess().get(aSettingId);
2318 rSet.Put(SfxBoolItem(nWhich, bProtected));
2319 }
2320 break;
2322 {
2323 if (!GetShell().CursorInsideContentControl())
2324 {
2325 rSet.DisableItem(nWhich);
2326 }
2327 }
2328 break;
2329 }
2330 nWhich = aIter.NextWhich();
2331 }
2332}
2333
2334/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString sCharStyleName
@ UndoArg1
Definition: SwRewriter.hxx:29
@ UndoArg3
Definition: SwRewriter.hxx:31
@ UndoArg2
Definition: SwRewriter.hxx:30
SfxApplication * SfxGetpApp()
#define SW_BREAKITER()
Definition: breakit.hxx:121
#define GetWhich(nSlot)
sal_uInt16 GetValue() const
const OUString & GetValue() const
void Execute(SfxRequest &)
void GetState(SfxItemSet &)
virtual bool DeleteAndJoin(SwPaM &, SwDeleteFlags flags=SwDeleteFlags::Default)=0
complete delete of a given PaM
virtual bool SplitNode(const SwPosition &rPos, bool bChkTableStart)=0
Split a node at rPos (implemented only for TextNode).
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
Provides access to the marks of a document.
virtual const_iterator_t getAllMarksEnd() const =0
returns a STL-like random access iterator to the end of the sequence of marks.
virtual ::sw::mark::IFieldmark * getFieldmarkFor(const SwPosition &pos) const =0
virtual const_iterator_t findMark(const OUString &rMark) const =0
Finds a mark by name.
virtual std::unique_ptr< ILazyDeleter > deleteMark(const IDocumentMarkAccess::const_iterator_t &ppMark, bool isMoveNodes)=0
Deletes a mark.
virtual const_iterator_t getAllMarksBegin() const =0
returns a STL-like random access iterator to the begin of the sequence of marks.
static SW_DLLPUBLIC MarkType GetType(const ::sw::mark::IMark &rMark)
Returns the MarkType used to create the mark.
Definition: docbm.cxx:476
Provides access to settings of a document.
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
virtual void set(DocumentSettingId id, bool value)=0
Set the specified document setting.
const css::lang::Locale & getLocale(bool bResolveSystem=true) const
const OUString & getBcp47(bool bResolveSystem=true) const
static css::uno::Reference< css::linguistic2::XDictionary > GetIgnoreAllList()
OUString const & GetName() const
XBitmapListRef GetBitmapList() const
XGradientListRef GetGradientList() const
XPatternListRef GetPatternList() const
XColorListRef GetColorList() const
XHatchListRef GetHatchList() const
static void MigrateItemSet(const SfxItemSet *pSourceSet, SfxItemSet *pDestSet, SdrModel *pNewModel)
static SfxAbstractDialogFactory * Create()
void SetVisibleState(sal_uInt16 nId, bool bShow)
void Update(sal_uInt16 nId)
void Invalidate(sal_uInt16 nId)
void InvalidateAll(bool bWithMsg)
bool GetValue() const
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
sal_uInt16 Count() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void DisableItem(sal_uInt16 nWhich)
bool IsReadOnly() const
sal_uInt16 GetSlot() const
void Ignore()
const SfxItemSet * GetArgs() const
const T * GetArg(sal_uInt16 nSlotId) const
void AppendItem(const SfxPoolItem &)
sal_uInt16 GetModifier() const
bool IsAPI() const
void Done(bool bRemove=false)
SfxItemPool & GetPool() const
static void HandleOpenXmlFilterSettings(SfxRequest &)
virtual SfxObjectShell * GetObjectShell()
static SfxInterface * GetStaticInterface()
const SfxPoolItem * ExecuteSlot(SfxRequest &rReq, const SfxInterface *pIF=nullptr)
void SetStringList(const css::uno::Sequence< OUString > &rList)
void ToggleChildWindow(sal_uInt16)
SfxBindings & GetBindings()
bool HasChildWindow(sal_uInt16)
void SetChildWindow(sal_uInt16 nId, bool bVisible, bool bSetFocus=true)
weld::Window * GetFrameWeld() const
css::uno::Reference< css::frame::XController > GetController() const
SfxViewFrame * GetViewFrame() const
static SfxViewShell * Current()
sal_uInt16 FirstWhich()
sal_uInt16 NextWhich()
const OUString & GetApplicationName() const
void GetActionSequences(std::vector< OUString > &rSmartTagTypes, css::uno::Sequence< css::uno::Sequence< css::uno::Reference< css::smarttags::XSmartTagAction > > > &rActionComponentsSequence, css::uno::Sequence< css::uno::Sequence< sal_Int32 > > &rActionIndicesSequence) const
sal_uInt32 GetFormatIndex(NfIndexTableOffset, LanguageType eLnge=LANGUAGE_DONTKNOW)
bool IsCTLFontEnabled() const
static OUString GetLanguageString(const LanguageType eType)
bool IsAutoFormatByInput() const
static SvxAutoCorrCfg & Get()
void SetAutoFormatByInput(bool bSet)
const Color & GetColor() const
const OUString & getAuthKey() const
const OUString & getAPIUrl() const
static SvxDeeplOptions & Get()
virtual VclPtr< VclAbstractDialog > CreateDateFormFieldDialog(weld::Widget *pParent, sw::mark::IDateFieldmark *pDateField, SwDoc &rDoc)=0
virtual VclPtr< VclAbstractDialog > CreateSwInsertBookmarkDlg(weld::Window *pParent, SwWrtShell &rSh, OUString const *pSelected)=0
virtual std::shared_ptr< AbstractSwTranslateLangSelectDlg > CreateSwTranslateLangSelectDlg(weld::Window *pParent, SwWrtShell &rSh)=0
virtual VclPtr< AbstractSwModalRedlineAcceptDlg > CreateSwModalRedlineAcceptDlg(weld::Window *pParent)=0
virtual VclPtr< AbstractInsFootNoteDlg > CreateInsFootNoteDlg(weld::Window *pParent, SwWrtShell &rSh, bool bEd=false)=0
virtual VclPtr< VclAbstractDialog > CreateDropDownFormFieldDialog(weld::Widget *pParent, sw::mark::IFieldmark *pDropDownField)=0
virtual std::shared_ptr< AbstractSwBreakDlg > CreateSwBreakDlg(weld::Window *pParent, SwWrtShell &rSh)=0
virtual VclPtr< SfxAbstractTabDialog > CreateSwCharDlg(weld::Window *pParent, SwView &pVw, const SfxItemSet &rCoreSet, SwCharDlgMode nDialogMode, const OUString *pFormatStr=nullptr)=0
virtual VclPtr< VclAbstractDialog > CreateSwSortingDialog(weld::Window *pParent, SwWrtShell &rSh)=0
virtual VclPtr< SfxAbstractTabDialog > CreateSwParaDlg(weld::Window *pParent, SwView &rVw, const SfxItemSet &rCoreSet, bool bDraw, const OString &sDefPage=OString())=0
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
OUString const & GetAuthorField(ToxAuthorityField ePos) const
Definition: authfld.hxx:195
invariant for SwAuthorityField is that it is always registered at its SwAuthorityFieldType via AddFie...
Definition: authfld.hxx:155
bool HasURL() const
Definition: authfld.cxx:610
SwAuthEntry * GetAuthEntry() const
Definition: authfld.hxx:182
static std::shared_ptr< std::vector< std::unique_ptr< SwPaM > > > CopyPaMRing(SwPaM &rOrig)
Definition: basesh.cxx:3182
SwWrtShell & GetShell()
Definition: basesh.cxx:2827
SwView & GetView()
Definition: basesh.hxx:59
void ExtendedSelectAll(bool bFootnotes=true)
Definition: crsrsh.cxx:594
SAL_DLLPRIVATE void UpdateCursor(sal_uInt16 eFlags=SwCursorShell::SCROLLWIN|SwCursorShell::CHKRANGE, bool bIdleEnd=false)
Definition: crsrsh.cxx:1576
OUString GetCursorDescr() const
Returns textual description of the current selection.
Definition: crsrsh.cxx:3670
void Push()
store a copy of the current cursor on the cursor stack
Definition: crsrsh.cxx:2251
bool IsSelOnePara() const
Definition: crsrsh.cxx:1076
bool EndAllTableBoxEdit()
Definition: trvltbl.cxx:913
void ShowCursor()
Definition: crsrsh.cxx:2410
void StartAction()
Definition: crsrsh.cxx:226
const SwTableNode * IsCursorInTable() const
Definition: crsrsh.hxx:909
void SwapPam()
Definition: crsrsh.cxx:976
bool IsInWord(sal_Int16 nWordType=css::i18n::WordType::ANYWORD_IGNOREWHITESPACES) const
Definition: crstrvl1.cxx:36
bool IsMultiSelection() const
Definition: crsrsh.hxx:904
::sw::mark::IMark * SetBookmark(const vcl::KeyCode &, const OUString &rName, IDocumentMarkAccess::MarkType eMark=IDocumentMarkAccess::MarkType::BOOKMARK)
Definition: crbm.cxx:78
void GetSmartTagTerm(std::vector< OUString > &rSmartTagTypes, css::uno::Sequence< css::uno::Reference< css::container::XStringKeyMap > > &rStringKeyMaps, css::uno::Reference< css::text::XTextRange > &rRange) const
Definition: crsrsh.cxx:3739
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
Definition: crsrsh.cxx:194
OUString GetSelText() const
get selected text of a node at current cursor
Definition: crsrsh.cxx:2559
bool ExtendSelection(bool bEnd=true, sal_Int32 nCount=1)
extend current SSelection by n characters
Definition: crsrsh.cxx:2641
bool IsSelection() const
Definition: crsrsh.hxx:899
bool CursorInsideInputField() const
Definition: crstrvl.cxx:960
SwField * GetCurField(const bool bIncludeInputFieldAtStart=false) const
Definition: crstrvl.cxx:939
bool IsEndWord(sal_Int16 nWordType=css::i18n::WordType::ANYWORD_IGNOREWHITESPACES) const
Definition: crstrvl1.cxx:31
bool IsSelFullPara() const
Definition: crsrsh.cxx:3395
void EndAction(const bool bIdleEnd=false)
Definition: crsrsh.cxx:243
bool GotoFootnoteText()
jump from content to footnote
Definition: trvlfnfl.cxx:89
void ClearMark()
Definition: crsrsh.cxx:939
void SetMark()
Definition: crsrsh.hxx:895
SwTextContentControl * CursorInsideContentControl() const
Definition: crstrvl.cxx:970
bool HasReadonlySel(bool isReplace=false) const
Definition: crsrsh.cxx:3359
bool IsTableMode() const
Definition: crsrsh.hxx:659
bool IsStartWord(sal_Int16 nWordType=css::i18n::WordType::ANYWORD_IGNOREWHITESPACES) const
Definition: crstrvl1.cxx:27
bool IsCursorInFootnote() const
Definition: crsrsh.cxx:1151
sal_Unicode GetChar(bool bEnd=true, tools::Long nOffset=0)
get the nth character of the current SSelection
Definition: crsrsh.cxx:2615
SwFEShell * GetFEShell()
For Core - it knows the DocShell but not the WrtShell!
Definition: docsh.cxx:1225
SwDoc * GetDoc()
returns Doc. But be careful!
Definition: docsh.hxx:204
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:321
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:161
void UpdateTable()
update fields of a listing
Definition: edtab.cxx:255
bool GetCurAttr(SfxItemSet &, const bool bMergeIndentValuesOfNumRule=false) const
Definition: edattr.cxx:171
void StartAllAction()
For all views of this document.
Definition: edws.cxx:86
sal_uInt16 GetScalingOfSelectedText() const
Definition: edattr.cxx:821
void AutoFormat(const SvxSwAutoFormatFlags *pAFlags)
Set our styles according to the respective rules.
Definition: autofmt.cxx:2695
bool GetGrammarCorrection(css::linguistic2::ProofreadingResult &rResult, sal_Int32 &rErrorPosInText, sal_Int32 &rErrorIndexInResult, css::uno::Sequence< OUString > &rSuggestions, const Point *pPt, SwRect &rSelectRect)
Definition: edlingu.cxx:974
bool IsMoveLeftMargin(bool bRight, bool bModulus=true) const
Adjust left margin via object bar (similar to adjustment of numerations).
Definition: edattr.cxx:490
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
Definition: edws.cxx:223
sal_uInt16 GetNodeNumStart(SwPaM *pPaM) const
Definition: ednumber.cxx:858
void SetNumRuleStart(bool bFlag, SwPaM *pCursor)
Set (and query if) a numbering with StartFlag starts at current PointPos.
Definition: ednumber.cxx:800
void SetAttrItem(const SfxPoolItem &, SetAttrMode nFlags=SetAttrMode::DEFAULT, const bool bParagraphSetting=false)
Definition: edatmisc.cxx:98
void SetAttrSet(const SfxItemSet &, SetAttrMode nFlags=SetAttrMode::DEFAULT, SwPaM *pCursor=nullptr, const bool bParagraphSetting=false)
Definition: edatmisc.cxx:129
SwFrameFormat * GetTableFormat()
Definition: edws.cxx:183
SvNumberFormatter * GetNumberFormatter()
Query NumberFormatter from document.
Definition: editsh.cxx:756
void SetDefault(const SfxPoolItem &)
Set attribute as new default attribute in document.
Definition: edatmisc.cxx:84
void Insert2(const OUString &, const bool bForceExpandHints=false)
Definition: editsh.cxx:79
void SetNodeNumStart(sal_uInt16 nStt)
Definition: ednumber.cxx:832
const SwSection * GetCurrSection() const
Definition: edsect.cxx:71
bool SelectionHasNumber() const
Definition: ednumber.cxx:148
void SetCurNumRule(const SwNumRule &, const bool bCreateNewList, const OUString &sContinuedListId=OUString(), const bool bResetIndentAttrs=false)
Optional parameter <bResetIndentAttrs> (default value false).
Definition: ednumber.cxx:738
void SetTableBoxFormulaAttrs(const SfxItemSet &rSet)
Definition: edtab.cxx:342
bool IsNumRuleStart(SwPaM *pPaM=nullptr) const
Definition: ednumber.cxx:825
bool DontExpandFormat()
If Cursor is at the end of a character style in which the DontExpand-flag is not yet set,...
Definition: editsh.cxx:745
SvtScriptType GetScriptType() const
returns the script type of the selection
Definition: edattr.cxx:662
bool SelectionHasBullet() const
Definition: ednumber.cxx:183
bool MoveParagraph(SwNodeOffset nOffset=SwNodeOffset(1))
Definition: ednumber.cxx:364
sal_uInt8 GetNumLevel() const
Definition: ednumber.cxx:669
bool GetPaMAttr(SwPaM *pPaM, SfxItemSet &, const bool bMergeIndentValuesOfNumRule=false) const
Apply / remove attributes.
Definition: edattr.cxx:59
css::uno::Reference< css::linguistic2::XSpellAlternatives > GetCorrection(const Point *pPt, SwRect &rSelectRect)
Get a list of potential corrections for misspelled word.
Definition: edlingu.cxx:909
const SwNumRule * GetNumRuleAtCurrCursorPos() const
Definition: ednumber.cxx:694
static void IgnoreGrammarErrorAt(SwPaM &rErrorPosition)
Definition: edlingu.cxx:1700
void ReplaceDropText(const OUString &rStr, SwPaM *pPaM=nullptr)
Definition: editsh.cxx:503
SwTextFormatColl * GetPaMTextFormatColl(SwPaM *pPaM) const
Get the named paragraph format of the selection(s) described by a SwPaM.
Definition: edattr.cxx:243
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
Definition: edws.cxx:234
void NumUpDown(bool bDown=true)
Definition: ednumber.cxx:277
bool Replace(const OUString &rNewStr, bool bRegExpRplc)
Replace a selected range in a TextNode by given string.
Definition: eddel.cxx:313
SwTextFormatColl * GetCurTextFormatColl() const
Get the named paragraph format of the current selection.
Definition: edattr.cxx:238
OUString GetCurWord() const
request current word
Definition: editsh.cxx:409
void ResetAttr(const o3tl::sorted_vector< sal_uInt16 > &attrs=o3tl::sorted_vector< sal_uInt16 >(), SwPaM *pCursor=nullptr)
Definition: edatmisc.cxx:32
void EndAllAction()
Definition: edws.cxx:97
void MoveLeftMargin(bool bRight, bool bModulus=true)
Definition: edattr.cxx:543
LanguageType GetCurLang() const
Definition: edattr.cxx:801
const SwNumRule * SearchNumRule(const bool bNum, OUString &sListId)
Searches for a text node with a numbering rule.
Definition: ednumber.cxx:872
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Definition: edtwin.hxx:61
void SetWaterCanTextColor(const Color &rCol)
Definition: edtwin.hxx:239
void SetApplyTemplate(const SwApplyTemplate &)
Apply template.
Definition: edtwin.cxx:5267
void SetWaterCanTextBackColor(const Color &rCol)
Definition: edtwin.hxx:241
SwApplyTemplate * GetApplyTemplate() const
Definition: edtwin.hxx:234
FrameTypeFlags GetFrameType(const Point *pPt, bool bStopAtFly) const
For return values see above FrameType.
Definition: fews.cxx:237
void UnProtectTables()
Unprotect all tables in selection.
Definition: fetab.cxx:1064
bool UpdateTableStyleFormatting(SwTableNode *pTableNode=nullptr, bool bResetDirect=false, OUString const *pStyleName=nullptr)
Update the direct formatting according to the current table style.
Definition: fetab.cxx:1318
void UpdateCurField(sal_uInt32 nFormat, const OUString &rPar1, const OUString &rPar2, std::unique_ptr< SwField > _pField=nullptr)
Definition: fldmgr.cxx:1536
SwFieldTypesEnum GetCurTypeId() const
Definition: fldmgr.cxx:889
bool InsertField(SwInsertField_Data &rData)
Definition: fldmgr.cxx:895
SwField * GetCurField()
Definition: fldmgr.cxx:430
SwFieldIds Which() const
Definition: fldbas.hxx:273
Base class of all fields.
Definition: fldbas.hxx:292
SwFieldTypesEnum GetTypeId() const
Definition: fldbas.cxx:257
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
Definition: fldbas.hxx:403
SwFieldType * GetTyp() const
Definition: fldbas.hxx:398
If SwFormatDrop is a Client, it is the CharFormat that describes the font for the DropCaps.
Definition: paratr.hxx:63
const OUString & GetValue() const
Definition: fmtinfmt.hxx:75
bool IsAutoUpdateFormat() const
Query / set bAutoUpdateFormat-flag.
Definition: format.hxx:188
SvxNumRule MakeSvxNumRule() const
Definition: number.cxx:937
SwPaM * GetValue() const
Definition: uiitems.hxx:103
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:187
const SwPosition * GetMark() const
Definition: pam.hxx:263
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:642
void Normalize(bool bPointFirst=true)
Normalizes PaM, i.e.
Definition: pam.cxx:700
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
Definition: pam.cxx:668
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
void AddRule(SwUndoArg eWhat, const OUString &rWith)
Definition: SwRewriter.cxx:25
bool IsProtect() const
Definition: section.cxx:326
static SwSmartTagMgr & Get()
Represents the style of a paragraph.
Definition: fmtcol.hxx:59
void InsertSymbol(SfxRequest &)
Definition: textsh.cxx:923
void GetState(SfxItemSet &)
Definition: textsh1.cxx:1698
void Execute(SfxRequest &)
Definition: textsh1.cxx:382
bool IsSelectionInReadonly() const
Definition: viewopt.hxx:574
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:433
void SetReadonlySelectionOption(bool bSet)
Definition: viewsh.cxx:2504
const IDocumentSettingAccess & getIDocumentSettingAccess() const
Provides access to the document setting interface.
Definition: viewsh.cxx:2803
const IDocumentMarkAccess * getIDocumentMarkAccess() const
Provides access to the document bookmark interface.
Definition: viewsh.cxx:2807
void InvalidateWindows(const SwRect &rRect)
Definition: viewsh.cxx:556
SwDoc * GetDoc() const
Definition: viewsh.hxx:290
void LockView(bool b)
Definition: viewsh.hxx:472
const SfxItemPool & GetAttrPool() const
Definition: viewsh.hxx:624
Definition: view.hxx:146
static void SetActMark(sal_Int32 nSet)
Definition: viewmdi.cxx:717
virtual FmFormShell * GetFormShell() override
Definition: view.hxx:581
void ExecuteInsertDoc(SfxRequest &rRequest, const SfxPoolItem *pItem)
Definition: view2.cxx:2617
const tools::Rectangle & GetVisArea() const
Definition: view.hxx:429
void ExecNumberingOutline(SfxItemPool &)
Definition: view0.cxx:717
OUString GetThesaurusLookUpText(bool bSelection) const
Definition: viewling.cxx:480
SwEditWin & GetEditWin()
Definition: view.hxx:419
SwDocShell * GetDocShell()
Definition: view.cxx:1160
void UpdateWordCount(SfxShell *, sal_uInt16)
Definition: view1.cxx:202
void ExecFormatFootnote()
Definition: view0.cxx:710
void InsertThesaurusSynonym(const OUString &rSynonmText, const OUString &rLookUpText, bool bValidSelection)
Definition: viewling.cxx:485
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
void EnterBlockMode()
Definition: select.cxx:651
void AutoUpdatePara(SwTextFormatColl *pColl, const SfxItemSet &rStyleSet, SwPaM *pPaM=nullptr)
Definition: wrtsh1.cxx:1891
bool IsSttOfPara() const
Definition: wrtsh.hxx:196
void EndSelect()
Definition: select.cxx:425
bool DelLeft()
Definition: delete.cxx:134
void InsertLineBreak(std::optional< SwLineBreakClear > oClear=std::nullopt)
Definition: wrtsh1.cxx:959
bool Left(SwCursorSkipMode nMode, bool bSelect, sal_uInt16 nCount, bool bBasicCall, bool bVisual=false)
Definition: move.cxx:110
bool SttPara(bool bSelect=false)
Definition: move.cxx:356
void Insert(const OUString &)
Definition: wrtsh1.cxx:224
void SetInsMode(bool bOn=true)
Definition: select.cxx:670
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1706
void EnterStdMode()
Definition: select.cxx:551
void EndPara(bool bSelect=false)
Definition: move.cxx:362
bool IsBlockMode() const
Definition: wrtsh.hxx:168
bool IsInSelect() const
Definition: wrtsh.hxx:144
void InsertColumnBreak()
Definition: wrtsh1.cxx:997
void InfoReadOnlyDialog(bool bAsync=false)
Definition: wrtsh1.cxx:2656
void InsertFootnote(const OUString &, bool bEndNote=false, bool bEdit=true)
Definition: wrtsh1.cxx:1155
void SelAll()
Definition: select.cxx:123
void ChangeHeaderOrFooter(std::u16string_view rStyleName, bool bHeader, bool bOn, bool bShowWarning)
Definition: wrtsh1.cxx:2124
bool DelRight(bool isReplaceHeuristic=false)
Definition: delete.cxx:291
void AutoCorrect(SvxAutoCorrect &rACorr, sal_Unicode cChar)
Definition: wrtsh1.cxx:1938
bool HasSelection() const
Definition: wrtsh.hxx:147
bool IsInsMode() const
Definition: wrtsh.hxx:172
void InsertPageBreak(const OUString *pPageDesc=nullptr, const ::std::optional< sal_uInt16 > &rPgNum=std::nullopt)
Definition: wrtsh1.cxx:921
bool IsAddMode() const
Definition: wrtsh.hxx:163
tools::Long ResetSelect(const Point *, bool)
Definition: select.cxx:333
bool SelWrd(const Point *=nullptr)
Definition: select.cxx:73
void ClickToINetAttr(const SwFormatINetFormat &rItem, LoadUrlFlags nFilter=LoadUrlFlags::NONE)
Definition: wrtsh2.cxx:455
bool SelectTextAttr(sal_uInt16 nWhich, const SwTextAttr *pAttr=nullptr)
Definition: move.cxx:725
bool Pop(SwCursorShell::PopMode, ::std::optional< SwCallLink > &roLink)
Definition: wrtsh1.cxx:2030
const SwView & GetView() const
Definition: wrtsh.hxx:443
OUString ReplacementString()
bool AllowMoreInput(sal_Unicode uChar)
OUString StringToReplace()
sal_uInt32 CharsToDelete()
void reset(reference_type *pBody)
const XGradient & GetGradientValue() const
const XHatch & GetHatchValue() const
std::pair< const_iterator, bool > insert(Value &&x)
virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule &aNum, sal_uInt16 mLevel, sal_uInt16 nFromIndex=0)=0
Fieldmark representing a date form field.
void Invalidate() override
LanguageType GetInputLanguage() const
css::uno::Reference< css::datatransfer::clipboard::XClipboard > GetClipboard()
static void CopyStringTo(const OUString &rContent, const css::uno::Reference< css::datatransfer::clipboard::XClipboard > &rxClipboard, const vcl::ILibreOfficeKitNotifier *pNotifier=nullptr)
static bool runAsync(const std::shared_ptr< DialogController > &rController, const std::function< void(sal_Int32)> &)
#define FN_INSERT_FOOTNOTE
Definition: cmdid.h:277
#define FN_FORMAT_DROPCAPS
Definition: cmdid.h:336
#define FN_INSERT_BOOKMARK
Definition: cmdid.h:201
#define FN_INSERT_BREAK_DLG
Definition: cmdid.h:203
#define FN_NUM_BULLET_MOVEUP
Definition: cmdid.h:92
#define FN_GOTO_REFERENCE
Definition: cmdid.h:116
#define FN_AUTOFORMAT_APPLY
Definition: cmdid.h:320
#define FN_NUM_BULLET_OFF
Definition: cmdid.h:96
#define FN_INSERT_FOOTNOTE_DLG
Definition: cmdid.h:210
#define FN_OPEN_LOCAL_URL
Definition: cmdid.h:515
#define FN_FORMAT_APPLY_HEAD3
Definition: cmdid.h:496
#define FN_NUM_CONTINUE
Definition: cmdid.h:140
#define FN_EDIT_BOOKMARK
Definition: cmdid.h:317
#define FN_AUTO_CORRECT
Definition: cmdid.h:519
#define FN_DROP_TEXT
Definition: cmdid.h:832
#define FN_FORMAT_LINENUMBER
Definition: cmdid.h:482
#define FN_SORTING_DLG
Definition: cmdid.h:507
#define FN_INSERT_TABLE
Definition: cmdid.h:228
#define FN_CONTENT_CONTROL_PROPERTIES
Definition: cmdid.h:223
#define FN_FORMAT_APPLY_HEAD1
Definition: cmdid.h:494
#define FN_DROP_CHAR_STYLE_NAME
Definition: cmdid.h:833
#define FN_EDIT_FORMULA
Definition: cmdid.h:84
#define FN_INSERT_PAGEHEADER
Definition: cmdid.h:290
#define FN_READONLY_SELECTION_MODE
Definition: cmdid.h:741
#define FN_SELECT_PARA
Definition: cmdid.h:125
#define FN_TABLE_SORT_DIALOG
Definition: cmdid.h:393
#define FN_TXTATR_INET
Definition: cmdid.h:754
#define FN_FORMAT_FOOTNOTE_DLG
Definition: cmdid.h:342
#define FN_FORMAT_APPLY_TEXTBODY
Definition: cmdid.h:498
#define FN_STAT_SELMODE
Definition: cmdid.h:850
#define FN_AUTOFORMAT_AUTO
Definition: cmdid.h:321
#define FN_EXPAND_GLOSSARY
Definition: cmdid.h:511
#define FN_PARAM_MOVE_COUNT
Definition: cmdid.h:783
#define FN_INSERT_ENDNOTE
Definition: cmdid.h:293
#define FN_INSERT_HYPERLINK
Definition: cmdid.h:214
#define FN_AUTOFORMAT_REDLINE_APPLY
Definition: cmdid.h:324
#define FN_DEC_INDENT_OFFSET
Definition: cmdid.h:489
#define FN_PARAM_MOVE_SELECTION
Definition: cmdid.h:784
#define FN_INSERT_GLOSSARY
Definition: cmdid.h:601
#define FN_INSERT_PAGEBREAK
Definition: cmdid.h:221
#define FN_NUMBER_NEWSTART
Definition: cmdid.h:473
#define FN_NUMBER_NEWSTART_AT
Definition: cmdid.h:474
#define FN_PARAM_SELECTION
Definition: cmdid.h:815
#define FN_FORMAT_APPLY_DEFAULT
Definition: cmdid.h:497
#define FN_SET_REMINDER
Definition: cmdid.h:279
#define FN_INSERT_STRING
Definition: cmdid.h:229
#define FN_NUMBERING_OUTLINE_DLG
Definition: cmdid.h:506
#define FN_CHAR_LEFT
Definition: cmdid.h:659
#define FN_WORDCOUNT_DIALOG
Definition: cmdid.h:610
#define FN_PROTECT_FIELDS
Definition: cmdid.h:307
#define FN_CHAR_RIGHT
Definition: cmdid.h:660
#define FN_FORMAT_APPLY_HEAD2
Definition: cmdid.h:495
#define FN_INSERT_COLUMN_BREAK
Definition: cmdid.h:204
#define FN_TABLE_UNSET_READ_ONLY
Definition: cmdid.h:414
#define FN_CALCULATE
Definition: cmdid.h:508
#define FN_INSERT_PAGEFOOTER
Definition: cmdid.h:291
#define FN_FORMAT_CURRENT_FOOTNOTE_DLG
Definition: cmdid.h:343
#define FN_SELECTION_MODE_BLOCK
Definition: cmdid.h:743
#define FN_REDLINE_ACCEPT
Definition: cmdid.h:134
#define FN_PARAM_PAM
Definition: cmdid.h:841
#define FN_NUM_BULLET_MOVEDOWN
Definition: cmdid.h:93
#define FN_SELECTION_MODE_DEFAULT
Definition: cmdid.h:742
#define FN_PROTECT_BOOKMARKS
Definition: cmdid.h:308
#define FN_INC_INDENT_OFFSET
Definition: cmdid.h:488
ColorTransparency
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
const OUStringLiteral sColor
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
Definition: dialoghelp.cxx:19
OString sFormula
float u
FrameTypeFlags
values can be combined via logical or
Definition: fesh.hxx:63
constexpr OUStringLiteral IsReadOnly(u"IsReadOnly")
@ TableOfAuthorities
FieldUnit
SelectionType
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(120)
constexpr TypedWhichId< SvxShadowItem > RES_SHADOW(107)
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
constexpr sal_uInt16 RES_FRMATR_END(133)
constexpr sal_uInt16 RES_CHRATR_END(46)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
constexpr sal_uInt16 RES_PARATR_BEGIN(RES_TXTATR_END)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_HIGHLIGHT(42)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
constexpr sal_uInt16 RES_PARATR_END(82)
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_BACKGROUND(21)
constexpr sal_uInt16 RES_CHRATR_BEGIN(HINT_BEGIN)
constexpr sal_uInt16 RES_UNKNOWNATR_BEGIN(RES_BOXATR_END)
constexpr sal_uInt16 RES_UNKNOWNATR_END(154)
constexpr TypedWhichId< SwFormatDrop > RES_PARATR_DROP(70)
constexpr TypedWhichId< SvXMLAttrContainerItem > RES_TXTATR_UNKNOWN_CONTAINER(54)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
const char sDisplay[]
HTMLMODE_SOME_STYLES
HTMLMODE_ON
const LanguageTag & GetAppLanguageTag()
Definition: init.cxx:732
sal_Int32 nIndex
constexpr sal_uInt16 KEY_MOD1
#define LANGUAGE_SYSTEM
#define LANGUAGE_NONE
#define LANGUAGE_DONTKNOW
sal_uInt16 nPos
Sequence< sal_Int8 > aSeq
#define SAL_WARN(area, stream)
aStr
const char * sName
constexpr OUStringLiteral aData
Definition: ww8scan.hxx:48
bool IsChangeCaseMapEnabled()
bool IsRubyEnabled()
LanguageType GetCurrentLanguage(SfxItemSet const &aSet, SvtScriptType nScriptType)
Definition: langhelper.cxx:469
void SetLanguage_None(SwWrtShell &rWrtSh, bool bIsForSelection, SfxItemSet &rCoreSet)
Definition: langhelper.cxx:296
void ResetLanguages(SwWrtShell &rWrtSh, OutlinerView const *pOLV=nullptr)
Definition: langhelper.cxx:356
void SelectCurrentPara(SwWrtShell &rWrtSh)
Definition: langhelper.cxx:561
void SetLanguage(SwWrtShell &rWrtSh, std::u16string_view rLangText, bool bIsForSelection, SfxItemSet &rCoreSet)
Definition: langhelper.cxx:214
OUString GetTextForLanguageGuessing(EditEngine const *rEditEngine, const ESelection &rDocSelection)
Definition: langhelper.cxx:535
SW_DLLPUBLIC void PasteHTMLToPaM(SwWrtShell &rWrtSh, SwPaM *pCursor, const OString &rData, bool bSetSelection)
SW_DLLPUBLIC void TranslateDocument(SwWrtShell &rWrtSh, const TranslateAPIConfig &rConfig)
int i
index
DictionaryError AddEntryToDic(uno::Reference< XDictionary > const &rxDic, const OUString &rWord, bool bIsNeg, const OUString &rRplcTxt, bool bStripDot)
const SwGetSetExpType GSE_FORMULA
Formula.
Definition: fldbas.hxx:206
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
long Long
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
Definition: nodeoffset.hxx:16
constexpr OUStringLiteral ODF_FORMDATE
constexpr OUStringLiteral ODF_FORMDROPDOWN
sal_Int16 nId
const char GetValue[]
bool GoInContent(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:1179
SwMoveFnCollection const & fnMoveBackward
Definition: paminit.cxx:60
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
Definition: paminit.cxx:61
QPRO_FUNC_TYPE nType
static SfxItemSet & rSet
static LanguageType nLang
Definition: srtdlg.cxx:51
sal_uInt16 nColor
Definition: view.hxx:118
Marks a position in the document model.
Definition: pam.hxx:37
sal_Int32 GetContentIndex() const
Definition: pam.hxx:84
void AdjustContent(sal_Int32 nDelta)
Adjust content index, only valid to call this if the position points to a SwContentNode subclass.
Definition: pam.cxx:261
std::function< void(sal_Int32)> maEndDialogFn
Reference< XController > xController
SwView * GetActiveView()
Definition: swmodul1.cxx:116
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:165
#define SW_MOD()
Definition: swmodule.hxx:256
uno::Reference< linguistic2::XThesaurus > GetThesaurus()
Definition: swtypes.cxx:59
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:92
@ UI_INSERT_FOOTNOTE
static void sw_CharDialogResult(const SfxItemSet *pSet, SwWrtShell &rWrtSh, std::shared_ptr< SfxItemSet > const &pCoreSet, bool bSel, bool bSelectionPut, SfxRequest *pReq)
Definition: textsh1.cxx:208
static void sw_ParagraphDialogResult(SfxItemSet *pSet, SwWrtShell &rWrtSh, SfxRequest &rReq, SwPaM *pPaM)
Definition: textsh1.cxx:264
static void sw_CharDialog(SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot, const SfxItemSet *pArgs, SfxRequest *pReq)
Definition: textsh1.cxx:122
@ AUTH_FIELD_LOCAL_URL
Definition: toxe.hxx:117
@ AUTH_FIELD_URL
Definition: toxe.hxx:110
unsigned char sal_uInt8
void SwToSfxPageDescAttr(SfxItemSet &rSet)
Definition: uitool.cxx:716
SW_DLLPUBLIC SwTwips GetTabDist(const SvxTabStopItem &rTabs)
Definition: uitool.cxx:649
SW_DLLPUBLIC void ConvertAttrGenToChar(SfxItemSet &rSet, const SfxItemSet &rOrigSet, bool bPara=false)
Convert general attributes to the corresponding character attributes.
Definition: uitool.cxx:144
SW_DLLPUBLIC void ConvertAttrCharToGen(SfxItemSet &rSet, bool bPara=false)
Convert character specific attributes to general ones used by tab pages.
Definition: uitool.cxx:105
bool HasCharUnit(bool bWeb)
Definition: uitool.cxx:872
SW_DLLPUBLIC FieldUnit GetDfltMetric(bool bWeb)
Definition: uitool.cxx:755
SW_DLLPUBLIC void PrepareBoxInfo(SfxItemSet &rSet, const SwWrtShell &rSh)
Definition: uitool.cxx:81
void SfxToSwPageDescAttr(const SwWrtShell &rShell, SfxItemSet &rSet)
Definition: uitool.cxx:655
void ApplyCharBackground(const Color &rBackgroundColor, SwWrtShell &rShell)
Apply character background on the shell.
Definition: uitool.cxx:196
SW_DLLPUBLIC void MakeDefTabs(SwTwips nDefDist, SvxTabStopItem &rTabs)
Definition: uitool.cxx:637
short SvxDicError(weld::Window *pParent, linguistic::DictionaryError nError)
RET_OK
#define MAX_MARKS
Definition: view.hxx:84
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:332
void LoadURL(SwViewShell &rVSh, const OUString &rURL, LoadUrlFlags nFilter, const OUString &rTargetFrameName)
Definition: wrtsh2.cxx:504
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
constexpr TypedWhichId< XFillHatchItem > XATTR_FILLHATCH(XATTR_FILL_FIRST+3)
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLUSESLIDEBACKGROUND)
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
constexpr TypedWhichId< XFillGradientItem > XATTR_FILLGRADIENT(XATTR_FILL_FIRST+2)
NF_NUMBER_STANDARD