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