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