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