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