LibreOffice Module sw (master)  1
view2.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 <config_features.h>
21 #include <config_fuzzers.h>
22 
23 #include <com/sun/star/util/SearchAlgorithms2.hpp>
24 #include <o3tl/any.hxx>
25 #include <vcl/graphicfilter.hxx>
26 #include <com/sun/star/sdb/DatabaseContext.hpp>
27 #include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
28 #include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
29 #include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
30 #include <com/sun/star/ui/dialogs/ListboxControlActions.hpp>
31 #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
32 #include <com/sun/star/linguistic2/XProofreadingIterator.hpp>
33 #include <com/sun/star/linguistic2/XDictionary.hpp>
34 #include <officecfg/Office/Common.hxx>
35 #include <SwCapObjType.hxx>
36 #include <SwStyleNameMapper.hxx>
37 #include <docary.hxx>
38 #include <hintids.hxx>
39 #include <SwRewriter.hxx>
40 #include <numrule.hxx>
41 #include <swundo.hxx>
42 #include <svl/PasswordHelper.hxx>
43 #include <svl/urihelper.hxx>
44 #include <sfx2/passwd.hxx>
45 #include <sfx2/sfxdlg.hxx>
46 #include <sfx2/filedlghelper.hxx>
47 #include <editeng/langitem.hxx>
48 #include <svx/viewlayoutitem.hxx>
49 #include <svx/zoomslideritem.hxx>
50 #include <svx/linkwarn.hxx>
51 #include <sfx2/htmlmode.hxx>
52 #include <vcl/svapp.hxx>
53 #include <sfx2/app.hxx>
54 #include <sfx2/request.hxx>
55 #include <sfx2/bindings.hxx>
56 #include <editeng/lrspitem.hxx>
58 #include <unotools/syslocale.hxx>
59 #include <editeng/unolingu.hxx>
60 #include <vcl/weld.hxx>
61 #include <editeng/tstpitem.hxx>
62 #include <sfx2/event.hxx>
63 #include <sfx2/docfile.hxx>
64 #include <sfx2/docfilt.hxx>
65 #include <sfx2/fcontnr.hxx>
66 #include <editeng/sizeitem.hxx>
67 #include <sfx2/dispatch.hxx>
68 #include <svl/whiter.hxx>
69 #include <svl/ptitem.hxx>
70 #include <sfx2/viewfrm.hxx>
71 #include <vcl/errinf.hxx>
72 #include <tools/urlobj.hxx>
73 #include <svx/svdview.hxx>
74 #include <swtypes.hxx>
75 #include <swwait.hxx>
76 #include <redlndlg.hxx>
77 #include <gotodlg.hxx>
78 #include <view.hxx>
79 #include <uivwimp.hxx>
80 #include <docsh.hxx>
81 #include <doc.hxx>
82 #include <printdata.hxx>
86 #include <IDocumentUndoRedo.hxx>
89 #include <IDocumentStatistics.hxx>
90 #include <wrtsh.hxx>
91 #include <viewopt.hxx>
92 #include <basesh.hxx>
93 #include <swmodule.hxx>
94 #include <uitool.hxx>
95 #include <shellio.hxx>
96 #include <fmtinfmt.hxx>
97 #include <mdiexp.hxx>
98 #include <drawbase.hxx>
99 #include <frmatr.hxx>
100 #include <frmmgr.hxx>
101 #include <pagedesc.hxx>
102 #include <section.hxx>
103 #include <tox.hxx>
104 #include <edtwin.hxx>
105 #include <wview.hxx>
106 #include <cmdid.h>
107 #include <sfx2/strings.hrc>
108 #include <sfx2/sfxresid.hxx>
109 #include <strings.hrc>
110 #include <swerror.h>
111 #include <globals.hrc>
112 #include <fmtclds.hxx>
113 #include <sfx2/templatedlg.hxx>
114 #include <dbconfig.hxx>
115 #include <dbmgr.hxx>
116 #include <reffld.hxx>
117 #include <comphelper/lok.hxx>
118 
119 #include <PostItMgr.hxx>
120 
122 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
123 
124 #include <svx/svxdlg.hxx>
125 #include <swabstdlg.hxx>
126 #include <fmthdft.hxx>
127 #include <unotextrange.hxx>
128 #include <docstat.hxx>
129 #include <wordcountdialog.hxx>
130 #include <sfx2/sidebar/Sidebar.hxx>
131 
134 #include <vcl/settings.hxx>
135 #include <i18nutil/searchopt.hxx>
136 #include <osl/diagnose.h>
137 #include <paratr.hxx>
138 #include <rootfrm.hxx>
139 #include <frameformats.hxx>
140 
141 #include <viewimp.hxx>
142 #include <pagefrm.hxx>
143 
144 #include <memory>
145 #include <string_view>
146 #include <svl/slstitm.hxx>
147 
149 
150 #include <ndtxt.hxx>
151 
152 const char sStatusDelim[] = " : ";
153 
154 using namespace sfx2;
155 using namespace ::com::sun::star;
156 using namespace ::com::sun::star::i18n;
157 using namespace ::com::sun::star::util;
158 using namespace ::com::sun::star::uno;
159 using namespace ::com::sun::star::lang;
160 using namespace ::com::sun::star::scanner;
161 using namespace ::com::sun::star::beans;
162 using namespace ::com::sun::star::container;
163 using namespace ::com::sun::star::sdb;
164 using namespace ::com::sun::star::ui::dialogs;
165 
166 static void lcl_SetAllTextToDefaultLanguage( SwWrtShell &rWrtSh, sal_uInt16 nWhichId )
167 {
168  if (!(nWhichId == RES_CHRATR_LANGUAGE ||
169  nWhichId == RES_CHRATR_CJK_LANGUAGE ||
170  nWhichId == RES_CHRATR_CTL_LANGUAGE))
171  return;
172 
173  rWrtSh.StartAction();
174  rWrtSh.LockView( true );
175  rWrtSh.Push();
176 
177  // prepare to apply new language to all text in document
178  rWrtSh.SelAll();
179  rWrtSh.ExtendedSelectAll();
180 
181  // set language attribute to default for all text
182  rWrtSh.ResetAttr({ nWhichId });
183 
185  rWrtSh.LockView( false );
186  rWrtSh.EndAction();
187 
188 }
189 
199 OUString SwView::GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUString& rPgStr)
200 {
201  // Show user-defined page number in brackets if any.
202  OUString extra;
203  if (!rPgStr.isEmpty() && std::u16string_view(OUString::number(nPhyNum)) != rPgStr)
204  extra = rPgStr;
205  else if (nPhyNum != nVirtNum)
206  extra = OUString::number(nVirtNum);
207 
208  sal_uInt16 nPageCount = GetWrtShell().GetPageCnt();
209  sal_uInt16 nPrintedPhyNum = nPhyNum;
210  sal_uInt16 nPrintedPageCount = nPageCount;
211  if (!GetWrtShell().getIDocumentDeviceAccess().getPrintData().IsPrintEmptyPages())
212  SwDoc::CalculateNonBlankPages(*m_pWrtShell->GetLayout(), nPrintedPageCount, nPrintedPhyNum);
213  // Show printed page numbers only, when they are different
214  OUString aStr( nPageCount != nPrintedPageCount
215  ? SwResId(STR_PAGE_COUNT_PRINTED)
216  : (extra.isEmpty() ? SwResId(STR_PAGE_COUNT) : SwResId(STR_PAGE_COUNT_CUSTOM)));
217  aStr = aStr.replaceFirst("%1", OUString::number(nPhyNum));
218  aStr = aStr.replaceFirst("%2", OUString::number(nPageCount));
219  if (nPageCount != nPrintedPageCount)
220  {
221  aStr = aStr.replaceFirst("%3", OUString::number(nPrintedPhyNum));
222  aStr = aStr.replaceFirst("%4", OUString::number(nPrintedPageCount));
223  }
224  else
225  aStr = aStr.replaceFirst("%3", extra);
226 
227  return aStr;
228 }
229 
230 ErrCode SwView::InsertGraphic( const OUString &rPath, const OUString &rFilter,
231  bool bLink, GraphicFilter *pFilter )
232 {
233  SwWait aWait( *GetDocShell(), true );
234 
235  Graphic aGraphic;
236  ErrCode aResult = ERRCODE_NONE;
237  if( !pFilter )
238  {
239  pFilter = &GraphicFilter::GetGraphicFilter();
240  }
241  aResult = GraphicFilter::LoadGraphic( rPath, rFilter, aGraphic, pFilter );
242 
243  if( ERRCODE_NONE == aResult )
244  {
245  GraphicNativeMetadata aMetadata;
246  if ( aMetadata.read(aGraphic) )
247  {
248  const Degree10 aRotation = aMetadata.getRotation();
249  if (aRotation)
250  {
251  GraphicNativeTransform aTransform( aGraphic );
252  aTransform.rotate( aRotation );
253  }
254  }
255 
256  SwFlyFrameAttrMgr aFrameManager( true, GetWrtShellPtr(), Frmmgr_Type::GRF, nullptr );
257  SwWrtShell& rShell = GetWrtShell();
258 
259  // #i123922# determine if we really want to insert or replace the graphic at a selected object
260  const bool bReplaceMode(rShell.HasSelection() && SelectionType::Frame == rShell.GetSelectionType());
261 
262  if(bReplaceMode)
263  {
264  // #i123922# Do same as in D&D, ReRead graphic and all is done
265  rShell.ReRead(
266  bLink ? rPath : OUString(),
267  bLink ? rFilter : OUString(),
268  &aGraphic);
269  }
270  else
271  {
272  rShell.StartAction();
273  if( bLink )
274  {
275  SwDocShell* pDocSh = GetDocShell();
276  INetURLObject aTemp(
277  pDocSh->HasName() ?
279  OUString());
280 
281  OUString sURL = URIHelper::SmartRel2Abs(
282  aTemp, rPath, URIHelper::GetMaybeFileHdl() );
283  aGraphic.setOriginURL(sURL);
284  rShell.Insert( sURL, rFilter, aGraphic, &aFrameManager );
285  }
286  else
287  {
288  rShell.Insert( OUString(), OUString(), aGraphic, &aFrameManager );
289  }
290 
291  // it is too late after "EndAction" because the Shell can already be destroyed.
292  rShell.EndAction();
293  }
294  }
295  return aResult;
296 }
297 
299 {
300  bool bReturn = false;
301  SwDocShell* pDocShell = GetDocShell();
302  SwDoc* pDoc = pDocShell->GetDoc();
303 
304  OUString sGraphicFormat = SwResId(STR_POOLFRM_GRAPHIC);
305 
306 // No file pickers in a non-desktop (mobile app) build.
307 
308 #if HAVE_FEATURE_DESKTOP
309  // when in HTML mode insert only as a link
310  const sal_uInt16 nHtmlMode = ::GetHtmlMode(pDocShell);
311  std::unique_ptr<FileDialogHelper> pFileDlg(new FileDialogHelper(
312  ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE,
313  FileDialogFlags::Graphic, GetFrameWeld()));
314  pFileDlg->SetTitle(SwResId(STR_INSERT_GRAPHIC ));
315  pFileDlg->SetContext( FileDialogHelper::WriterInsertImage );
316 
317  uno::Reference < XFilePicker3 > xFP = pFileDlg->GetFilePicker();
318  uno::Reference < XFilePickerControlAccess > xCtrlAcc(xFP, UNO_QUERY);
319  if(nHtmlMode & HTMLMODE_ON)
320  {
321  xCtrlAcc->setValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0, makeAny(true));
322  xCtrlAcc->enableControl( ExtendedFilePickerElementIds::CHECKBOX_LINK, false);
323  }
324 
325  std::vector<OUString> aFormats;
326  const size_t nArrLen = pDoc->GetFrameFormats()->size();
327  for( size_t i = 0; i < nArrLen; ++i )
328  {
329  const SwFrameFormat* pFormat = (*pDoc->GetFrameFormats())[ i ];
330  if(pFormat->IsDefault() || pFormat->IsAuto())
331  continue;
332  aFormats.push_back(pFormat->GetName());
333  }
334 
335  // pool formats
336 
337  const std::vector<OUString>& rFramePoolArr(
339  for(const auto & i : rFramePoolArr)
340  {
341  aFormats.push_back(i);
342  }
343 
344  std::sort(aFormats.begin(), aFormats.end());
345  aFormats.erase(std::unique(aFormats.begin(), aFormats.end()), aFormats.end());
346 
347  Sequence<OUString> aListBoxEntries(aFormats.size());
348  OUString* pEntries = aListBoxEntries.getArray();
349  sal_Int16 nSelect = 0;
350  for( size_t i = 0; i < aFormats.size(); ++i )
351  {
352  pEntries[i] = aFormats[i];
353  if(pEntries[i] == sGraphicFormat)
354  nSelect = i;
355  }
356  try
357  {
358  Any aTemplates(&aListBoxEntries, cppu::UnoType<decltype(aListBoxEntries)>::get());
359 
360  xCtrlAcc->setValue( ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE,
361  ListboxControlActions::ADD_ITEMS , aTemplates );
362 
363  Any aSelectPos(&nSelect, cppu::UnoType<decltype(nSelect)>::get());
364  xCtrlAcc->setValue( ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE,
365  ListboxControlActions::SET_SELECT_ITEM, aSelectPos );
366  }
367  catch (const Exception&)
368  {
369  OSL_FAIL("control access failed");
370  }
371 #endif
372 
373  const SfxStringItem* pName = rReq.GetArg<SfxStringItem>(SID_INSERT_GRAPHIC);
374  bool bShowError = !pName;
375  if( pName
376 #if HAVE_FEATURE_DESKTOP
377  || ERRCODE_NONE == pFileDlg->Execute()
378 #endif
379  )
380  {
381 
382  OUString aFileName, aFilterName;
383  if ( pName )
384  {
385  aFileName = pName->GetValue();
386  const SfxStringItem* pFilter = rReq.GetArg<SfxStringItem>(FN_PARAM_FILTER);
387  if ( pFilter )
388  aFilterName = pFilter->GetValue();
389  }
390 #if HAVE_FEATURE_DESKTOP
391  else
392  {
393  aFileName = pFileDlg->GetPath();
394  aFilterName = pFileDlg->GetCurrentFilter();
395  rReq.AppendItem( SfxStringItem( SID_INSERT_GRAPHIC, aFileName ) );
396  rReq.AppendItem( SfxStringItem( FN_PARAM_FILTER, aFilterName ) );
397 
398  bool bAsLink = false;
399  if(nHtmlMode & HTMLMODE_ON)
400  bAsLink = true;
401  else
402  {
403  try
404  {
405  Any aVal = xCtrlAcc->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0);
406  OSL_ENSURE(aVal.hasValue(), "Value CBX_INSERT_AS_LINK not found");
407  bAsLink = !aVal.hasValue() || *o3tl::doAccess<bool>(aVal);
408  Any aTemplateValue = xCtrlAcc->getValue(
409  ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE,
410  ListboxControlActions::GET_SELECTED_ITEM );
411  OUString sTmpl;
412  aTemplateValue >>= sTmpl;
413  rReq.AppendItem( SfxStringItem( FN_PARAM_2, sTmpl) );
414  }
415  catch (const Exception&)
416  {
417  OSL_FAIL("control access failed");
418  }
419  }
420  rReq.AppendItem( SfxBoolItem( FN_PARAM_1, bAsLink ) );
421  }
422  const SfxBoolItem* pAsLink = rReq.GetArg<SfxBoolItem>(FN_PARAM_1);
423  const SfxStringItem* pStyle = rReq.GetArg<SfxStringItem>(FN_PARAM_2);
424 #endif
425 
426  bool bAsLink = false;
427 
428 #if HAVE_FEATURE_DESKTOP
429  if( nHtmlMode & HTMLMODE_ON )
430  bAsLink = true;
431  else
432  {
433  if ( rReq.GetArgs() )
434  {
435  if ( pAsLink )
436  bAsLink = pAsLink->GetValue();
437  if ( pStyle && !pStyle->GetValue().isEmpty() )
438  sGraphicFormat = pStyle->GetValue();
439  }
440  else
441  {
442  Any aVal = xCtrlAcc->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0);
443  OSL_ENSURE(aVal.hasValue(), "Value CBX_INSERT_AS_LINK not found");
444  bAsLink = !aVal.hasValue() || *o3tl::doAccess<bool>(aVal);
445  Any aTemplateValue = xCtrlAcc->getValue(
446  ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE,
447  ListboxControlActions::GET_SELECTED_ITEM );
448  OUString sTmpl;
449  aTemplateValue >>= sTmpl;
450  if( !sTmpl.isEmpty() )
451  sGraphicFormat = sTmpl;
452  rReq.AppendItem( SfxStringItem( FN_PARAM_2, sGraphicFormat ) );
453  rReq.AppendItem( SfxBoolItem( FN_PARAM_1, bAsLink ) );
454  }
455 
456  // really store as link only?
458  {
459  SvxLinkWarningDialog aWarnDlg(GetFrameWeld(), pFileDlg->GetPath());
460  if (aWarnDlg.run() != RET_OK)
461  bAsLink=false; // don't store as link
462  }
463  }
464 #endif
465 
466  SwWrtShell& rSh = GetWrtShell();
467  rSh.LockPaint();
468  rSh.StartAction();
469 
470  SwRewriter aRewriter;
471  aRewriter.AddRule(UndoArg1, SwResId(STR_GRAPHIC_DEFNAME));
472 
473  // #i123922# determine if we really want to insert or replace the graphic at a selected object
474  const bool bReplaceMode(rSh.HasSelection() && SelectionType::Frame == rSh.GetSelectionType());
475 
476  rSh.StartUndo(SwUndoId::INSERT, &aRewriter);
477 
478  ErrCode nError = InsertGraphic( aFileName, aFilterName, bAsLink, &GraphicFilter::GetGraphicFilter() );
479 
480  // format not equal to current filter (with autodetection)
481  if( nError == ERRCODE_GRFILTER_FORMATERROR )
482  nError = InsertGraphic( aFileName, OUString(), bAsLink, &GraphicFilter::GetGraphicFilter() );
483 
484  // #i123922# no new FrameFormat for replace mode, only when new object was created,
485  // else this would reset the current setting for the frame holding the graphic
486  if ( !bReplaceMode && rSh.IsFrameSelected() )
487  {
488  SwFrameFormat* pFormat = pDoc->FindFrameFormatByName( sGraphicFormat );
489  if(!pFormat)
490  pFormat = pDoc->MakeFrameFormat(sGraphicFormat,
491  pDocShell->GetDoc()->GetDfltFrameFormat(),
492  true, false);
493  rSh.SetFrameFormat( pFormat );
494  }
495 
496  TranslateId pResId;
497  if( nError == ERRCODE_GRFILTER_OPENERROR )
498  pResId = STR_GRFILTER_OPENERROR;
499  else if( nError == ERRCODE_GRFILTER_IOERROR )
500  pResId = STR_GRFILTER_IOERROR;
501  else if( nError ==ERRCODE_GRFILTER_FORMATERROR )
502  pResId = STR_GRFILTER_FORMATERROR;
503  else if( nError ==ERRCODE_GRFILTER_VERSIONERROR )
504  pResId = STR_GRFILTER_VERSIONERROR;
505  else if( nError ==ERRCODE_GRFILTER_FILTERERROR )
506  pResId = STR_GRFILTER_FILTERERROR;
507  else if( nError ==ERRCODE_GRFILTER_TOOBIG )
508  pResId = STR_GRFILTER_TOOBIG;
509 
510  rSh.EndAction();
511  rSh.UnlockPaint();
512  if (pResId)
513  {
514  if( bShowError )
515  {
516  std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
517  VclMessageType::Info, VclButtonsType::Ok,
518  SwResId(pResId)));
519  xInfoBox->run();
520  }
521  rReq.Ignore();
522  }
523  else
524  {
525  // set the specific graphic attributes to the graphic
526  bReturn = true;
527  AutoCaption( GRAPHIC_CAP );
528  rReq.Done();
529  }
530 
531  rSh.EndUndo(); // due to possible change of Shell
532  }
533 
534  return bReturn;
535 }
536 
538 {
539  const sal_uInt16 nSlot = rReq.GetSlot();
540  const SfxItemSet* pArgs = rReq.GetArgs();
541  const SfxPoolItem* pItem;
542  bool bIgnore = false;
543  switch( nSlot )
544  {
545  case SID_CREATE_SW_DRAWVIEW:
546  m_pWrtShell->getIDocumentDrawModelAccess().GetOrCreateDrawModel();
547  break;
548 
550  {
554  aContext.maEndDialogFn = [](sal_Int32){};
555  pDlg->StartExecuteAsync(aContext);
556  break;
557  }
558  case FN_EDIT_LINK_DLG:
559  EditLinkDlg();
560  break;
561  case SID_REFRESH_VIEW:
562  GetEditWin().Invalidate();
563  m_pWrtShell->Reformat();
564  break;
565  case FN_PAGEUP:
566  case FN_PAGEUP_SEL:
567  case FN_PAGEDOWN:
568  case FN_PAGEDOWN_SEL:
569  {
570  tools::Rectangle aVis( GetVisArea() );
571  SwEditWin& rTmpWin = GetEditWin();
572  if ( FN_PAGEUP == nSlot || FN_PAGEUP_SEL == nSlot )
573  PageUpCursor(FN_PAGEUP_SEL == nSlot);
574  else
575  PageDownCursor(FN_PAGEDOWN_SEL == nSlot);
576 
577  rReq.SetReturnValue(SfxBoolItem(nSlot,
578  aVis != GetVisArea()));
579  //#i42732# - notify the edit window that from now on we do not use the input language
580  rTmpWin.SetUseInputLanguage( false );
581  }
582  break;
583  case SID_ZOOM_IN:
584  case SID_ZOOM_OUT:
585  {
586  tools::Long nFact = m_pWrtShell->GetViewOptions()->GetZoom();
587  if (SID_ZOOM_IN == nSlot)
588  nFact = basegfx::zoomtools::zoomIn(nFact);
589  else
590  nFact = basegfx::zoomtools::zoomOut(nFact);
591  SetZoom(SvxZoomType::PERCENT, nFact);
592  }
593  break;
594  case FN_TO_PREV_PAGE:
595  case FN_TO_NEXT_PAGE:
596  {
597  sal_uInt16 nPage = 0;
598  if (m_pWrtShell->IsCursorVisible())
599  nPage = m_pWrtShell->GetCursor()->GetPageNum();
600  else
601  {
602  SwFrame* pPageFrame = m_pWrtShell->Imp()->GetFirstVisPage(m_pWrtShell->GetOut());
603  if (pPageFrame)
604  nPage = pPageFrame->GetPhyPageNum();
605  }
606  if (nPage != 0)
607  {
608  sal_uInt16 nOldPage(nPage);
609  if (FN_TO_PREV_PAGE == nSlot && nPage > 1)
610  nPage--;
611  else if (FN_TO_NEXT_PAGE == nSlot && nPage < m_pWrtShell->GetPageCount())
612  nPage++;
613  if (nPage != nOldPage)
614  {
615  m_pWrtShell->LockPaint();
616  if (IsDrawMode())
617  LeaveDrawCreate();
618  m_pWrtShell->EnterStdMode();
619  m_pWrtShell->GotoPage(nPage, true);
620  // set visible area (borrowed from SwView::PhyPageUp/Down)
621  const Point aPt(m_aVisArea.Left(), m_pWrtShell->GetPagePos(nPage).Y());
622  Point aAlPt(AlignToPixel(aPt));
623  if(aPt.Y() != aAlPt.Y())
624  aAlPt.AdjustY(3 * GetEditWin().PixelToLogic(Size(0, 1)).Height());
625  SetVisArea(aAlPt);
626  m_pWrtShell->UnlockPaint();
627  }
628  }
629  }
630  break;
631  case FN_SELECTION_CYCLE:
632  {
633  if (m_pWrtShell->IsSelFrameMode())
634  break;
635  if (!m_pWrtShell->IsStdMode())
636  m_pWrtShell->EnterStdMode();
637  SwShellCursor *pCursor = m_pWrtShell->SwCursorShell::GetCursor_();
638  Point CurrMarkPt = pCursor->GetMkPos();
639  Point CurrPointPt = pCursor->GetPtPos();
640  sal_uInt16 nStep = m_aSelectCycle.nStep;
641  if (nStep && (CurrMarkPt != m_aSelectCycle.m_MarkPt || CurrPointPt != m_aSelectCycle.m_PointPt))
642  nStep = 0;
643  switch(nStep)
644  {
645  case 0:
646  m_aSelectCycle.m_pInitialCursor = CurrPointPt;
647  m_pWrtShell->SwCursorShell::ClearMark();
648  m_pWrtShell->SelWrd(&CurrPointPt);
649  break;
650  case 1:
651  m_pWrtShell->SelSentence(&CurrPointPt);
652  break;
653  case 2:
654  m_pWrtShell->SelPara(&CurrPointPt);
655  break;
656  case 3:
657  m_pWrtShell->SwCursorShell::ClearMark();
658  m_pWrtShell->SwCursorShell::SetCursor(m_aSelectCycle.m_pInitialCursor);
659  break;
660  }
661  nStep++;
662  nStep %= 4;
663  pCursor = m_pWrtShell->SwCursorShell::GetCursor_();
664  m_aSelectCycle.m_MarkPt = pCursor->GetMkPos();
665  m_aSelectCycle.m_PointPt = pCursor->GetPtPos();
666  m_aSelectCycle.nStep = nStep;
667  }
668  break;
669  case FN_REDLINE_ON:
670  {
671  if( pArgs &&
672  SfxItemState::SET == pArgs->GetItemState(nSlot, false, &pItem ))
673  {
674  IDocumentRedlineAccess& rIDRA = m_pWrtShell->getIDocumentRedlineAccess();
675  Sequence <sal_Int8> aPasswd = rIDRA.GetRedlinePassword();
676  if( aPasswd.hasElements() )
677  {
678  OSL_ENSURE( !static_cast<const SfxBoolItem*>(pItem)->GetValue(), "SwView::Execute(): password set and redlining off doesn't match!" );
679 
680  // dummy password from OOXML import: only confirmation dialog
681  if (aPasswd.getLength() == 1 && aPasswd[0] == 1)
682  {
683  std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(m_pWrtShell->GetView().GetFrameWeld(),
684  VclMessageType::Warning, VclButtonsType::YesNo,
685  SfxResId(RID_SVXSTR_END_REDLINING_WARNING)));
686  xWarn->set_default_response(RET_NO);
687  if (xWarn->run() == RET_YES)
688  rIDRA.SetRedlinePassword(Sequence <sal_Int8> ());
689  else
690  break;
691  }
692  else
693  {
694  // xmlsec05: new password dialog
695  SfxPasswordDialog aPasswdDlg(GetFrameWeld());
696  aPasswdDlg.SetMinLen(1);
697  //#i69751# the result of Execute() can be ignored
698  (void)aPasswdDlg.run();
699  OUString sNewPasswd(aPasswdDlg.GetPassword());
700  Sequence <sal_Int8> aNewPasswd = rIDRA.GetRedlinePassword();
701  SvPasswordHelper::GetHashPassword( aNewPasswd, sNewPasswd );
702  if(SvPasswordHelper::CompareHashPassword(aPasswd, sNewPasswd))
703  rIDRA.SetRedlinePassword(Sequence <sal_Int8> ());
704  else
705  { // xmlsec05: message box for wrong password
706  break;
707  }
708  }
709  }
710 
711  SwDocShell* pDocShell = GetDocShell();
712  pDocShell->SetChangeRecording( static_cast<const SfxBoolItem*>(pItem)->GetValue(), /*bLockAllViews=*/true );
713 
714  // Notify all view shells of this document, as the track changes mode is document-global.
715  for (SfxViewFrame* pViewFrame = SfxViewFrame::GetFirst(pDocShell); pViewFrame; pViewFrame = SfxViewFrame::GetNext(*pViewFrame, pDocShell))
716  {
717  pViewFrame->GetBindings().Invalidate(FN_REDLINE_ON);
718  pViewFrame->GetBindings().Update(FN_REDLINE_ON);
719  }
720  }
721  }
722  break;
723  case FN_REDLINE_PROTECT :
724  {
725  IDocumentRedlineAccess& rIDRA = m_pWrtShell->getIDocumentRedlineAccess();
726  Sequence <sal_Int8> aPasswd = rIDRA.GetRedlinePassword();
727  if( pArgs && SfxItemState::SET == pArgs->GetItemState(nSlot, false, &pItem )
728  && static_cast<const SfxBoolItem*>(pItem)->GetValue() == aPasswd.hasElements() )
729  break;
730 
731  // xmlsec05: new password dialog
732  // message box for wrong password
733  SfxPasswordDialog aPasswdDlg(GetFrameWeld());
734  aPasswdDlg.SetMinLen(1);
735  if (!aPasswd.hasElements())
736  aPasswdDlg.ShowExtras(SfxShowExtras::CONFIRM);
737  if (aPasswdDlg.run())
738  {
740  OUString sNewPasswd(aPasswdDlg.GetPassword());
741  Sequence <sal_Int8> aNewPasswd =
742  rIDRA.GetRedlinePassword();
743  SvPasswordHelper::GetHashPassword( aNewPasswd, sNewPasswd );
744  if(!aPasswd.hasElements())
745  {
746  rIDRA.SetRedlinePassword(aNewPasswd);
747  }
748  else if(SvPasswordHelper::CompareHashPassword(aPasswd, sNewPasswd))
749  {
750  rIDRA.SetRedlinePassword(Sequence <sal_Int8> ());
751  nOn = RedlineFlags::NONE;
752  }
753  const RedlineFlags nMode = rIDRA.GetRedlineFlags();
754  m_pWrtShell->SetRedlineFlagsAndCheckInsMode( (nMode & ~RedlineFlags::On) | nOn);
755  rReq.AppendItem( SfxBoolItem( FN_REDLINE_PROTECT, !(nMode&RedlineFlags::On) ) );
756  }
757  else
758  bIgnore = true;
759  }
760  break;
761  case FN_REDLINE_SHOW:
762 
763  if( pArgs &&
764  SfxItemState::SET == pArgs->GetItemState(nSlot, false, &pItem))
765  {
766  // tdf#125754 avoid recursive layout
767  // because all views share the layout, have to use AllAction
768  const bool bShow = static_cast<const SfxBoolItem*>(pItem)->GetValue();
769  m_pWrtShell->StartAllAction();
770  // always show redline insertions in Hide Changes mode
771  if ( m_pWrtShell->GetViewOptions()->IsShowChangesInMargin() &&
772  m_pWrtShell->GetViewOptions()->IsShowChangesInMargin2() )
773  {
774  GetDocShell()->GetDoc()->GetDocumentRedlineManager().HideAll(/*bDeletion=*/!bShow);
775  }
776  m_pWrtShell->GetLayout()->SetHideRedlines( !bShow );
777  m_pWrtShell->EndAllAction();
778  if (m_pWrtShell->IsRedlineOn())
779  m_pWrtShell->SetInsMode();
780  }
781  break;
783  case FN_REDLINE_ACCEPT:
784  GetViewFrame()->ToggleChildWindow(nSlot);
785  break;
790  {
791  SwDoc *pDoc = m_pWrtShell->GetDoc();
792  SwPaM *pCursor = m_pWrtShell->GetCursor();
793  const SwRedlineTable& rRedlineTable = pDoc->getIDocumentRedlineAccess().GetRedlineTable();
795  if (pArgs && pArgs->GetItemState(nSlot, false, &pItem) == SfxItemState::SET)
796  {
797  const sal_Int64 nChangeId = static_cast<const SfxUInt32Item*>(pItem)->GetValue();
798  for (SwRedlineTable::size_type i = 0; i < rRedlineTable.size(); ++i)
799  {
800  if (nChangeId == rRedlineTable[i]->GetId())
801  nRedline = i;
802  }
803  }
804 
805  if( pCursor->HasMark() && nRedline == SwRedlineTable::npos)
806  {
807  if (FN_REDLINE_ACCEPT_DIRECT == nSlot || FN_REDLINE_ACCEPT_TONEXT == nSlot)
808  m_pWrtShell->AcceptRedlinesInSelection();
809  else
810  m_pWrtShell->RejectRedlinesInSelection();
811  }
812  else
813  {
814  // We check for a redline at the start of the selection/cursor, not the point.
815  // This ensures we work properly with FN_REDLINE_NEXT_CHANGE, which leaves the
816  // point at the *end* of the redline and the mark at the start (so GetRedline
817  // would return NULL if called on the point)
818  const SwRangeRedline* pRedline = nullptr;
819  if (nRedline != SwRedlineTable::npos)
820  {
821  // A redline was explicitly requested by specifying an
822  // index, don't guess based on the cursor position.
823 
824  if (nRedline < rRedlineTable.size())
825  pRedline = rRedlineTable[nRedline];
826  }
827  else
828  pRedline = pDoc->getIDocumentRedlineAccess().GetRedline(*pCursor->Start(), &nRedline);
829 
830  assert(pRedline != nullptr);
831  if (pRedline)
832  {
833  if (FN_REDLINE_ACCEPT_DIRECT == nSlot || FN_REDLINE_ACCEPT_TONEXT == nSlot)
834  m_pWrtShell->AcceptRedline(nRedline);
835  else
836  m_pWrtShell->RejectRedline(nRedline);
837  }
838  }
839  if (FN_REDLINE_ACCEPT_TONEXT == nSlot || FN_REDLINE_REJECT_TONEXT == nSlot)
840  {
841  // Go to next change after accepting or rejecting one (tdf#101977)
842  GetViewFrame()->GetDispatcher()->Execute(FN_REDLINE_NEXT_CHANGE, SfxCallMode::ASYNCHRON);
843  }
844  }
845  break;
846 
848  {
849  // If a parameter is provided, try going to the nth change, not to
850  // the next one.
851  SwDoc* pDoc = m_pWrtShell->GetDoc();
852  const SwRedlineTable& rRedlineTable = pDoc->getIDocumentRedlineAccess().GetRedlineTable();
854  if (pArgs && pArgs->GetItemState(nSlot, false, &pItem) == SfxItemState::SET)
855  {
856  const sal_uInt32 nChangeId = static_cast<const SfxUInt32Item*>(pItem)->GetValue();
857  for (SwRedlineTable::size_type i = 0; i < rRedlineTable.size(); ++i)
858  {
859  if (nChangeId == rRedlineTable[i]->GetId())
860  nRedline = i;
861  }
862  }
863 
864  const SwRangeRedline *pNext = nullptr;
865  if (nRedline < rRedlineTable.size())
866  pNext = m_pWrtShell->GotoRedline(nRedline, true);
867  else
868  pNext = m_pWrtShell->SelNextRedline();
869 
870  if (pNext)
871  {
873  {
874  OString aPayload(".uno:CurrentTrackedChangeId=");
875  sal_uInt32 nRedlineId = pNext->GetId();
876  aPayload += OString::number(nRedlineId);
877  libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, aPayload.getStr());
878  }
879 
880  m_pWrtShell->SetInSelect();
881  }
882 
883  }
884  break;
885 
887  {
888  const SwRangeRedline *pPrev = m_pWrtShell->SelPrevRedline();
889 
890  if (pPrev)
891  {
893  {
894  OString aPayload(".uno:CurrentTrackedChangeId=");
895  sal_uInt32 nRedlineId = pPrev->GetId();
896  aPayload += OString::number(nRedlineId);
897  libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, aPayload.getStr());
898  }
899 
900  m_pWrtShell->SetInSelect();
901  }
902  }
903  break;
904 
905  case SID_DOCUMENT_COMPARE:
906  case SID_DOCUMENT_MERGE:
907  {
908  OUString sFileName, sFilterName;
909  sal_Int16 nVersion = 0;
910  bool bHasFileName = false;
911  m_pViewImpl->SetParam( 0 );
912  bool bNoAcceptDialog = false;
913 
914  if( pArgs )
915  {
916  if( SfxItemState::SET == pArgs->GetItemState( SID_FILE_NAME, false, &pItem ))
917  sFileName = static_cast<const SfxStringItem*>(pItem)->GetValue();
918  bHasFileName = !sFileName.isEmpty();
919 
920  if( SfxItemState::SET == pArgs->GetItemState( SID_FILTER_NAME, false, &pItem ))
921  sFilterName = static_cast<const SfxStringItem*>(pItem)->GetValue();
922 
923  if( SfxItemState::SET == pArgs->GetItemState( SID_VERSION, false, &pItem ))
924  {
925  nVersion = static_cast<const SfxInt16Item *>(pItem)->GetValue();
926  m_pViewImpl->SetParam( nVersion );
927  }
928  if( SfxItemState::SET == pArgs->GetItemState( SID_NO_ACCEPT_DIALOG, false, &pItem ))
929  {
930  bNoAcceptDialog = static_cast<const SfxBoolItem *>(pItem)->GetValue();
931  }
932  }
933 
934  m_pViewImpl->InitRequest( rReq );
935  tools::Long nFound = InsertDoc( nSlot, sFileName, sFilterName, nVersion );
936 
937  if ( bHasFileName )
938  {
939  rReq.SetReturnValue( SfxInt32Item( nSlot, nFound ));
940 
941  if (nFound > 0 && !bNoAcceptDialog) // show Redline browser
942  {
943  SfxViewFrame* pVFrame = GetViewFrame();
945 
946  // re-initialize the Redline dialog
947  const sal_uInt16 nId = SwRedlineAcceptChild::GetChildWindowId();
948  SwRedlineAcceptChild *pRed = static_cast<SwRedlineAcceptChild*>(
949  pVFrame->GetChildWindow(nId));
950  if (pRed)
951  pRed->ReInitDlg(GetDocShell());
952  }
953  }
954  else
955  bIgnore = true;
956  }
957  break;
958  case FN_SYNC_LABELS:
959  GetViewFrame()->ShowChildWindow(nSlot);
960  break;
961  case FN_ESCAPE:
962  {
963  if ( m_pWrtShell->HasDrawViewDrag() )
964  {
965  m_pWrtShell->BreakDrag();
966  m_pWrtShell->EnterSelFrameMode();
967  }
968  else if ( m_pWrtShell->IsDrawCreate() )
969  {
970  GetDrawFuncPtr()->BreakCreate();
971  AttrChangedNotify(nullptr); // shell change if needed
972  }
973  else if ( m_pWrtShell->HasSelection() || IsDrawMode() )
974  {
975  SdrView *pSdrView = m_pWrtShell->HasDrawView() ? m_pWrtShell->GetDrawView() : nullptr;
976  if(pSdrView && pSdrView->AreObjectsMarked() &&
977  pSdrView->GetHdlList().GetFocusHdl())
978  {
979  const_cast<SdrHdlList&>(pSdrView->GetHdlList()).ResetFocusHdl();
980  }
981  else
982  {
983  if(pSdrView)
984  {
985  LeaveDrawCreate();
986  Point aPt(LONG_MIN, LONG_MIN);
987  //go out of the frame
988  m_pWrtShell->SelectObj(aPt, SW_LEAVE_FRAME);
989  SfxBindings& rBind = GetViewFrame()->GetBindings();
990  rBind.Invalidate( SID_ATTR_SIZE );
991  }
992  m_pWrtShell->EnterStdMode();
993  AttrChangedNotify(nullptr); // shell change if necessary
994  }
995  }
996  else if ( GetEditWin().GetApplyTemplate() )
997  {
998  GetEditWin().SetApplyTemplate(SwApplyTemplate());
999  }
1000  else if( static_cast<SfxObjectShell*>(GetDocShell())->IsInPlaceActive() )
1001  {
1002  Escape();
1003  }
1004  else if ( GetEditWin().IsChainMode() )
1005  {
1006  GetEditWin().SetChainMode( false );
1007  }
1008  else if( m_pWrtShell->GetFlyFrameFormat() )
1009  {
1010  const SwFrameFormat* pFormat = m_pWrtShell->GetFlyFrameFormat();
1011  if(m_pWrtShell->GotoFly( pFormat->GetName(), FLYCNTTYPE_FRM ))
1012  {
1013  m_pWrtShell->HideCursor();
1014  m_pWrtShell->EnterSelFrameMode();
1015  }
1016  }
1017  else
1018  {
1019  SfxBoolItem aItem( SID_WIN_FULLSCREEN, false );
1020  GetViewFrame()->GetDispatcher()->ExecuteList(SID_WIN_FULLSCREEN,
1021  SfxCallMode::RECORD, { &aItem });
1022  bIgnore = true;
1023  }
1024  }
1025  break;
1026  case SID_ATTR_BORDER_INNER:
1027  case SID_ATTR_BORDER_OUTER:
1028  case SID_ATTR_BORDER_SHADOW:
1029  if(pArgs)
1030  m_pWrtShell->SetAttrSet(*pArgs);
1031  break;
1032 
1033  case SID_ATTR_PAGE:
1034  case SID_ATTR_PAGE_SIZE:
1035  case SID_ATTR_PAGE_MAXSIZE:
1036  case SID_ATTR_PAGE_PAPERBIN:
1037  case SID_ATTR_PAGE_EXT1:
1038  case FN_PARAM_FTN_INFO:
1039  {
1040  if(pArgs)
1041  {
1042  const size_t nCurIdx = m_pWrtShell->GetCurPageDesc();
1043  SwPageDesc aPageDesc( m_pWrtShell->GetPageDesc( nCurIdx ) );
1044  ::ItemSetToPageDesc( *pArgs, aPageDesc );
1045  // change the descriptor of the core
1046  m_pWrtShell->ChgPageDesc( nCurIdx, aPageDesc );
1047  }
1048  }
1049  break;
1050  case FN_GOTO_PAGE:
1051  {
1052  SwGotoPageDlg aDlg(GetViewFrame()->GetFrameWeld(), &GetViewFrame()->GetBindings());
1053  if (aDlg.run() == RET_OK)
1054  GetWrtShell().GotoPage(aDlg.GetPageSelection(), true);
1055  }
1056  break;
1057  case FN_EDIT_CURRENT_TOX:
1058  {
1059  GetViewFrame()->GetDispatcher()->Execute(
1060  FN_INSERT_MULTI_TOX, SfxCallMode::ASYNCHRON);
1061  }
1062  break;
1063  case FN_UPDATE_CUR_TOX:
1064  {
1065  const SwTOXBase* pBase = m_pWrtShell->GetCurTOX();
1066  if(pBase)
1067  {
1068  // tdf#106374: don't jump view on the update
1069  const bool bWasLocked = m_pWrtShell->IsViewLocked();
1070  m_pWrtShell->LockView(true);
1071  m_pWrtShell->StartAction();
1072  if(TOX_INDEX == pBase->GetType())
1073  m_pWrtShell->ApplyAutoMark();
1074  m_pWrtShell->UpdateTableOf( *pBase );
1075  m_pWrtShell->EndAction();
1076  if (!bWasLocked)
1077  m_pWrtShell->LockView(false);
1078  }
1079  }
1080  break;
1081  case FN_UPDATE_TOX:
1082  {
1083  m_pWrtShell->StartAction();
1084  m_pWrtShell->EnterStdMode();
1085  bool bOldCursorInReadOnly = m_pWrtShell->IsReadOnlyAvailable();
1086  m_pWrtShell->SetReadOnlyAvailable( true );
1087 
1088  for( int i = 0; i < 2; ++i )
1089  {
1090  if( m_pWrtShell->GetTOXCount() == 1 )
1091  ++i;
1092 
1093  while( m_pWrtShell->GotoPrevTOXBase() )
1094  ; // jump to the first "table of ..."
1095 
1096  // if we are not in one, jump to next
1097  const SwTOXBase* pBase = m_pWrtShell->GetCurTOX();
1098  if( !pBase )
1099  {
1100  m_pWrtShell->GotoNextTOXBase();
1101  pBase = m_pWrtShell->GetCurTOX();
1102  }
1103 
1104  bool bAutoMarkApplied = false;
1105  while( pBase )
1106  {
1107  if(TOX_INDEX == pBase->GetType() && !bAutoMarkApplied)
1108  {
1109  m_pWrtShell->ApplyAutoMark();
1110  bAutoMarkApplied = true;
1111  }
1112  // pBase is needed only for the interface. Should be changed in future! (JP 1996)
1113  m_pWrtShell->UpdateTableOf( *pBase );
1114 
1115  if( m_pWrtShell->GotoNextTOXBase() )
1116  pBase = m_pWrtShell->GetCurTOX();
1117  else
1118  pBase = nullptr;
1119  }
1120  }
1121  m_pWrtShell->SetReadOnlyAvailable( bOldCursorInReadOnly );
1122  m_pWrtShell->EndAction();
1123  }
1124  break;
1125  case SID_ATTR_BRUSH:
1126  {
1127  if(pArgs && SfxItemState::SET == pArgs->GetItemState(RES_BACKGROUND, false, &pItem))
1128  {
1129  const size_t nCurIdx = m_pWrtShell->GetCurPageDesc();
1130  SwPageDesc aDesc( m_pWrtShell->GetPageDesc( nCurIdx ));
1131  SwFrameFormat& rMaster = aDesc.GetMaster();
1132  rMaster.SetFormatAttr(*pItem);
1133  m_pWrtShell->ChgPageDesc( nCurIdx, aDesc);
1134  }
1135  }
1136  break;
1137  case SID_CLEARHISTORY:
1138  {
1139  m_pWrtShell->DelAllUndoObj();
1140  }
1141  break;
1142  case SID_UNDO:
1143  {
1144  m_pShell->ExecuteSlot(rReq);
1145  }
1146  break;
1147 #if defined(_WIN32) || defined UNX
1148  case SID_TWAIN_SELECT:
1149  case SID_TWAIN_TRANSFER:
1150  GetViewImpl()->ExecuteScan( rReq );
1151  break;
1152 #endif
1153 
1154  case SID_ATTR_DEFTABSTOP:
1155  {
1156  if(pArgs && SfxItemState::SET == pArgs->GetItemState(SID_ATTR_DEFTABSTOP, false, &pItem))
1157  {
1158  SvxTabStopItem aDefTabs( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP );
1159  const sal_uInt16 nTab = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
1160  MakeDefTabs( nTab, aDefTabs );
1161  m_pWrtShell->SetDefault( aDefTabs );
1162  }
1163  }
1164  break;
1165  case SID_ATTR_LANGUAGE :
1166  if(pArgs && SfxItemState::SET == pArgs->GetItemState(SID_ATTR_LANGUAGE, false, &pItem))
1167  {
1168  SvxLanguageItem aLang(static_cast<const SvxLanguageItem*>(pItem)->GetLanguage(), RES_CHRATR_LANGUAGE);
1169  m_pWrtShell->SetDefault( aLang );
1171  }
1172  break;
1173  case SID_ATTR_CHAR_CTL_LANGUAGE:
1174  if(pArgs && SfxItemState::SET == pArgs->GetItemState(RES_CHRATR_CTL_LANGUAGE, false, &pItem))
1175  {
1176  m_pWrtShell->SetDefault( *pItem );
1178  }
1179  break;
1180  case SID_ATTR_CHAR_CJK_LANGUAGE:
1181  if(pArgs && SfxItemState::SET == pArgs->GetItemState(RES_CHRATR_CJK_LANGUAGE, false, &pItem))
1182  {
1183  m_pWrtShell->SetDefault( *pItem );
1185  }
1186  break;
1188  {
1189  m_pWrtShell->EnterStdMode();
1190  size_t nPos(m_pWrtShell->GetOutlinePos());
1191  if (nPos != SwOutlineNodes::npos)
1192  {
1193  SwNode* pNode = m_pWrtShell->GetNodes().GetOutLineNds()[nPos];
1195  !m_pWrtShell->GetAttrOutlineContentVisible(nPos));
1196  m_pWrtShell->InvalidateOutlineContentVisibility();
1197  m_pWrtShell->GotoOutline(nPos);
1198  }
1199  }
1200  break;
1201  case FN_NAV_ELEMENT:
1202  {
1203  // nothing here on purpose - if removed only the listbox that changed is changed
1204  }
1205  break;
1206  case FN_SCROLL_PREV:
1207  case FN_SCROLL_NEXT:
1208  {
1209  bool *pbNext = new bool(true);
1210  if (nSlot == FN_SCROLL_PREV)
1211  *pbNext = false;
1212  MoveNavigationHdl(pbNext);
1213  }
1214  break;
1215  case SID_JUMPTOMARK:
1216  if( pArgs && SfxItemState::SET == pArgs->GetItemState(SID_JUMPTOMARK, false, &pItem))
1217  JumpToSwMark( static_cast<const SfxStringItem*>(pItem)->GetValue() );
1218  break;
1219  case SID_GALLERY :
1220  // First make sure that the sidebar is visible
1221  GetViewFrame()->ShowChildWindow(SID_SIDEBAR);
1222 
1224  u"GalleryPanel",
1225  GetViewFrame()->GetFrame().GetFrameInterface());
1226  break;
1227  case SID_AVMEDIA_PLAYER :
1228  GetViewFrame()->ChildWindowExecute(rReq);
1229  break;
1230  case SID_VIEW_DATA_SOURCE_BROWSER:
1231  {
1232  SfxViewFrame* pVFrame = GetViewFrame();
1233  pVFrame->ChildWindowExecute(rReq);
1234  if(pVFrame->HasChildWindow(SID_BROWSER))
1235  {
1236  const SwDBData& rData = GetWrtShell().GetDBData();
1237  SwModule::ShowDBObj(*this, rData);
1238  }
1239  }
1240  break;
1242  {
1243  bool bShow = false;
1244  if( pArgs &&
1245  SfxItemState::SET == pArgs->GetItemState(nSlot, false, &pItem ))
1246  bShow = static_cast<const SfxBoolItem*>(pItem)->GetValue();
1247  if((bShow && m_bInMailMerge) != GetViewFrame()->HasChildWindow(nSlot))
1248  GetViewFrame()->ToggleChildWindow(nSlot);
1249  //if fields have been successfully inserted call the "real"
1250  //mail merge dialog
1251 #if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS
1252  SwWrtShell &rSh = GetWrtShell();
1253  if(m_bInMailMerge && rSh.IsAnyDatabaseFieldInDoc())
1254  {
1255  SwDBManager* pDBManager = rSh.GetDBManager();
1256  if (pDBManager)
1257  {
1258  SwDBData aData = rSh.GetDBData();
1259  rSh.EnterStdMode(); // force change in text shell; necessary for mixing DB fields
1260  AttrChangedNotify(nullptr);
1261 
1262  Sequence<PropertyValue> aProperties(3);
1263  PropertyValue* pValues = aProperties.getArray();
1264  pValues[0].Name = "DataSourceName";
1265  pValues[1].Name = "Command";
1266  pValues[2].Name = "CommandType";
1267  pValues[0].Value <<= aData.sDataSource;
1268  pValues[1].Value <<= aData.sCommand;
1269  pValues[2].Value <<= aData.nCommandType;
1270  pDBManager->ExecuteFormLetter(rSh, aProperties);
1271  }
1272  }
1273 #endif
1274  m_bInMailMerge &= bShow;
1275  GetViewFrame()->GetBindings().Invalidate(FN_INSERT_FIELD);
1276  }
1277  break;
1278  case FN_QRY_MERGE:
1279  {
1280  bool bUseCurrentDocument = true;
1281  bool bQuery = !pArgs || SfxItemState::SET != pArgs->GetItemState(nSlot);
1282  if(bQuery)
1283  {
1284  SfxViewFrame* pTmpFrame = GetViewFrame();
1287  if (RET_OK == pDlg->Execute())
1288  bUseCurrentDocument = pDlg->IsThisDocument();
1289  else
1290  break;
1291  }
1292  GenerateFormLetter(bUseCurrentDocument);
1293  }
1294  break;
1295  case SID_RECHECK_DOCUMENT:
1296  {
1297  SwDocShell* pDocShell = GetDocShell();
1298  SwDoc* pDoc = pDocShell->GetDoc();
1299  uno::Reference< linguistic2::XProofreadingIterator > xGCIterator( pDoc->GetGCIterator() );
1300  if( xGCIterator.is() )
1301  {
1302  xGCIterator->resetIgnoreRules();
1303  }
1304  // reset ignore lists
1305  pDoc->SpellItAgainSam( true, false, false );
1306  // clear ignore dictionary
1307  uno::Reference< linguistic2::XDictionary > xDictionary = LinguMgr::GetIgnoreAllList();
1308  if( xDictionary.is() )
1309  xDictionary->clear();
1310  // put cursor to the start of the document
1311  m_pWrtShell->StartOfSection();
1312  [[fallthrough]]; // call spell/grammar dialog
1313  }
1315  {
1316  SfxViewFrame* pViewFrame = GetViewFrame();
1317  if (rReq.GetArgs() != nullptr)
1319  static_cast<const SfxBoolItem&>( (rReq.GetArgs()->
1320  Get(FN_SPELL_GRAMMAR_DIALOG))).GetValue());
1321  else
1323 
1325  rReq.Ignore ();
1326  }
1327  break;
1328  case SID_ALIGN_ANY_LEFT :
1329  case SID_ALIGN_ANY_HCENTER :
1330  case SID_ALIGN_ANY_RIGHT :
1331  case SID_ALIGN_ANY_JUSTIFIED:
1332  case SID_ALIGN_ANY_TOP :
1333  case SID_ALIGN_ANY_VCENTER :
1334  case SID_ALIGN_ANY_BOTTOM :
1335  case SID_ALIGN_ANY_HDEFAULT :
1336  case SID_ALIGN_ANY_VDEFAULT :
1337  {
1338  sal_uInt16 nAlias = 0;
1339  if( m_nSelectionType & (SelectionType::DrawObjectEditMode|SelectionType::Text) )
1340  {
1341  switch( nSlot )
1342  {
1343  case SID_ALIGN_ANY_LEFT : nAlias = SID_ATTR_PARA_ADJUST_LEFT; break;
1344  case SID_ALIGN_ANY_HCENTER : nAlias = SID_ATTR_PARA_ADJUST_CENTER; break;
1345  case SID_ALIGN_ANY_RIGHT : nAlias = SID_ATTR_PARA_ADJUST_RIGHT; break;
1346  case SID_ALIGN_ANY_JUSTIFIED: nAlias = SID_ATTR_PARA_ADJUST_BLOCK; break;
1347  case SID_ALIGN_ANY_TOP : nAlias = SID_TABLE_VERT_NONE; break;
1348  case SID_ALIGN_ANY_VCENTER : nAlias = SID_TABLE_VERT_CENTER; break;
1349  case SID_ALIGN_ANY_BOTTOM : nAlias = SID_TABLE_VERT_BOTTOM; break;
1350  }
1351  }
1352  else
1353  {
1354  switch( nSlot )
1355  {
1356  case SID_ALIGN_ANY_LEFT : nAlias = SID_OBJECT_ALIGN_LEFT ; break;
1357  case SID_ALIGN_ANY_HCENTER : nAlias = SID_OBJECT_ALIGN_CENTER ; break;
1358  case SID_ALIGN_ANY_RIGHT : nAlias = SID_OBJECT_ALIGN_RIGHT ; break;
1359  case SID_ALIGN_ANY_TOP : nAlias = SID_OBJECT_ALIGN_UP ; break;
1360  case SID_ALIGN_ANY_VCENTER : nAlias = SID_OBJECT_ALIGN_MIDDLE ; break;
1361  case SID_ALIGN_ANY_BOTTOM : nAlias = SID_OBJECT_ALIGN_DOWN ; break;
1362  }
1363  }
1364  //these slots are either re-mapped to text or object alignment
1365  if (nAlias)
1366  GetViewFrame()->GetDispatcher()->Execute(
1367  nAlias, SfxCallMode::ASYNCHRON);
1368  }
1369  break;
1370  case SID_RESTORE_EDITING_VIEW:
1371  {
1372  //#i33307# restore editing position
1373  Point aCursorPos;
1374  bool bSelectObj;
1375  if(m_pViewImpl->GetRestorePosition(aCursorPos, bSelectObj))
1376  {
1377  m_pWrtShell->SwCursorShell::SetCursor( aCursorPos, !bSelectObj );
1378  if( bSelectObj )
1379  {
1380  m_pWrtShell->SelectObj( aCursorPos );
1381  m_pWrtShell->EnterSelFrameMode( &aCursorPos );
1382  }
1383  }
1384  }
1385  break;
1386  case SID_INSERT_GRAPHIC:
1387  {
1388  rReq.SetReturnValue(SfxBoolItem(nSlot, InsertGraphicDlg( rReq )));
1389  }
1390  break;
1391  case SID_MOVE_SHAPE_HANDLE:
1392  {
1393  if (pArgs && pArgs->Count() >= 3)
1394  {
1395  SdrView *pSdrView = m_pWrtShell->HasDrawView() ? m_pWrtShell->GetDrawView() : nullptr;
1396  if (pSdrView == nullptr)
1397  break;
1398  const SfxUInt32Item* handleNumItem = rReq.GetArg<SfxUInt32Item>(FN_PARAM_1);
1399  const SfxUInt32Item* newPosXTwips = rReq.GetArg<SfxUInt32Item>(FN_PARAM_2);
1400  const SfxUInt32Item* newPosYTwips = rReq.GetArg<SfxUInt32Item>(FN_PARAM_3);
1401  const SfxInt32Item* OrdNum = rReq.GetArg<SfxInt32Item>(FN_PARAM_4);
1402 
1403  const sal_uLong handleNum = handleNumItem->GetValue();
1404  const sal_uLong newPosX = newPosXTwips->GetValue();
1405  const sal_uLong newPosY = newPosYTwips->GetValue();
1406  const Point mPoint(newPosX, newPosY);
1407  const SdrHdl* handle = pSdrView->GetHdlList().GetHdl(handleNum);
1408  if (!handle)
1409  {
1410  break;
1411  }
1412 
1413  if (handle->GetKind() == SdrHdlKind::Anchor || handle->GetKind() == SdrHdlKind::Anchor_TR)
1414  m_pWrtShell->FindAnchorPos(mPoint, /*bMoveIt=*/true);
1415  else
1416  pSdrView->MoveShapeHandle(handleNum, mPoint, OrdNum ? OrdNum->GetValue() : -1);
1417  }
1418  break;
1419  }
1420 
1421  default:
1422  OSL_ENSURE(false, "wrong dispatcher");
1423  return;
1424  }
1425  if(!bIgnore)
1426  rReq.Done();
1427 }
1428 
1430 {
1431  sal_uInt16 nId = rReq.GetSlot();
1432  bool bRet = false;
1433 
1435  {
1437  bRet = true;
1438  }
1439  return bRet || SfxShell::IsConditionalFastCall(rReq);
1440 
1441 }
1442 
1445 {
1446  SfxBindings &rBnd = GetViewFrame()->GetBindings();
1447  rBnd.Invalidate(FN_STAT_PAGE);
1448 }
1449 
1451 {
1452  SfxBindings &rBnd = GetViewFrame()->GetBindings();
1453  rBnd.Invalidate( FN_STAT_WORDCOUNT );
1454  rBnd.Update( FN_STAT_WORDCOUNT );
1455 }
1456 
1459 {
1460  SwWrtShell& rShell = GetWrtShell();
1461 
1462  SfxWhichIter aIter( rSet );
1463  sal_uInt16 nWhich = aIter.FirstWhich();
1464  OSL_ENSURE( nWhich, "empty set");
1465 
1466  //get section change event
1467  const SwSection* CurrSect = rShell.GetCurrSection();
1468  if( CurrSect )
1469  {
1470  const OUString& sCurrentSectionName = CurrSect->GetSectionName();
1471  if(sCurrentSectionName != m_sOldSectionName)
1472  {
1474  }
1475  m_sOldSectionName = sCurrentSectionName;
1476  }
1477  else if (!m_sOldSectionName.isEmpty())
1478  {
1480  m_sOldSectionName= OUString();
1481  }
1482  //get column change event
1483  if(rShell.bColumnChange())
1484  {
1486  }
1487 
1488  while( nWhich )
1489  {
1490  switch( nWhich )
1491  {
1492  case FN_STAT_PAGE: {
1493  // number of pages, log. page number
1494  sal_uInt16 nPage, nLogPage;
1495  OUString sDisplay;
1496  rShell.GetPageNumber( -1, rShell.IsCursorVisible(), nPage, nLogPage, sDisplay );
1497  bool bExtendedTooltip(!sDisplay.isEmpty() &&
1498  std::u16string_view(OUString::number(nPage)) != sDisplay &&
1499  nPage != nLogPage);
1500  OUString aTooltip = bExtendedTooltip ? SwResId(STR_BOOKCTRL_HINT_EXTENDED)
1501  : SwResId(STR_BOOKCTRL_HINT);
1502  std::vector<OUString> aStringList
1503  {
1504  GetPageStr(nPage, nLogPage, sDisplay),
1505  aTooltip
1506  };
1508  //if existing page number is not equal to old page number, send out this event.
1509  if (m_nOldPageNum != nLogPage )
1510  {
1511  if (m_nOldPageNum != 0)
1512  SwCursorShell::FirePageChangeEvent(m_nOldPageNum, nLogPage);
1513  m_nOldPageNum = nLogPage;
1514  }
1515  const sal_uInt16 nCnt = GetWrtShell().GetPageCnt();
1516  if (m_nPageCnt != nCnt) // notify Basic
1517  {
1518  m_nPageCnt = nCnt;
1519  SfxGetpApp()->NotifyEvent(SfxEventHint(SfxEventHintId::SwEventPageCount, SwDocShell::GetEventName(STR_SW_EVENT_PAGE_COUNT), GetViewFrame()->GetObjectShell()), false);
1520  }
1521  }
1522  break;
1523 
1524  case FN_STAT_WORDCOUNT:
1525  {
1526  SwDocStat selectionStats;
1527  SwDocStat documentStats;
1528  rShell.CountWords(selectionStats);
1529  documentStats = rShell.GetDoc()->getIDocumentStatistics().GetUpdatedDocStat( true /* complete-async */, false /* don't update fields */ );
1530 
1531  sal_uLong nWord = selectionStats.nWord ? selectionStats.nWord : documentStats.nWord;
1532  sal_uLong nChar = selectionStats.nChar ? selectionStats.nChar : documentStats.nChar;
1533  TranslateId pResId = selectionStats.nWord ? STR_WORDCOUNT : STR_WORDCOUNT_NO_SELECTION;
1534  TranslateNId pWordResId = selectionStats.nWord ? STR_WORDCOUNT_WORDARG : STR_WORDCOUNT_WORDARG_NO_SELECTION;
1535  TranslateNId pCharResId = selectionStats.nWord ? STR_WORDCOUNT_CHARARG : STR_WORDCOUNT_CHARARG_NO_SELECTION;
1536 
1538  OUString aWordArg = SwResId(pWordResId, nWord).replaceAll("$1", rLocaleData.getNum(nWord, 0));
1539  OUString aCharArg = SwResId(pCharResId, nChar).replaceAll("$1", rLocaleData.getNum(nChar, 0));
1540  OUString aWordCount(SwResId(pResId));
1541  aWordCount = aWordCount.replaceAll("$1", aWordArg);
1542  aWordCount = aWordCount.replaceAll("$2", aCharArg);
1543 
1544  rSet.Put( SfxStringItem( FN_STAT_WORDCOUNT, aWordCount ) );
1545 
1546  SwWordCountWrapper *pWrdCnt = static_cast<SwWordCountWrapper*>(GetViewFrame()->GetChildWindow(SwWordCountWrapper::GetChildWindowId()));
1547  if (pWrdCnt)
1548  pWrdCnt->SetCounts(selectionStats, documentStats);
1549  }
1550  break;
1551 
1552  case FN_STAT_TEMPLATE:
1553  {
1555  rShell.GetCurPageStyle()));
1556 
1557  }
1558  break;
1559  case SID_ATTR_ZOOM:
1560  {
1561  if ( ( GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) || !GetDocShell()->IsInPlaceActive() )
1562  {
1563  const SwViewOption* pVOpt = rShell.GetViewOptions();
1564  SvxZoomType eZoom = pVOpt->GetZoomType();
1565  SvxZoomItem aZoom(eZoom,
1566  pVOpt->GetZoom());
1567  if( pVOpt->getBrowseMode() )
1568  {
1569  aZoom.SetValueSet(
1570  SvxZoomEnableFlags::N50|
1571  SvxZoomEnableFlags::N75|
1572  SvxZoomEnableFlags::N100|
1573  SvxZoomEnableFlags::N150|
1574  SvxZoomEnableFlags::N200);
1575  }
1576  rSet.Put( aZoom );
1577  }
1578  else
1579  rSet.DisableItem( SID_ATTR_ZOOM );
1580  }
1581  break;
1582  case SID_ATTR_VIEWLAYOUT:
1583  {
1584  if ( ( GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) || !GetDocShell()->IsInPlaceActive() )
1585  {
1586  const SwViewOption* pVOpt = rShell.GetViewOptions();
1587  const sal_uInt16 nColumns = pVOpt->GetViewLayoutColumns();
1588  const bool bBookMode = pVOpt->IsViewLayoutBookMode();
1589  SvxViewLayoutItem aViewLayout(nColumns, bBookMode);
1590  rSet.Put( aViewLayout );
1591  }
1592  else
1593  rSet.DisableItem( SID_ATTR_VIEWLAYOUT );
1594  }
1595  break;
1596  case SID_ATTR_ZOOMSLIDER:
1597  {
1598  if ( ( GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) || !GetDocShell()->IsInPlaceActive() )
1599  {
1600  const SwViewOption* pVOpt = rShell.GetViewOptions();
1601  const sal_uInt16 nCurrentZoom = pVOpt->GetZoom();
1602  SvxZoomSliderItem aZoomSliderItem( nCurrentZoom, MINZOOM, MAXZOOM );
1603  aZoomSliderItem.AddSnappingPoint( 100 );
1604 
1605  if ( !m_pWrtShell->getIDocumentSettingAccess().get(DocumentSettingId::BROWSE_MODE) )
1606  {
1607  const sal_uInt16 nColumns = pVOpt->GetViewLayoutColumns();
1608  const bool bAutomaticViewLayout = 0 == nColumns;
1609  const SwPostItMgr* pMgr = GetPostItMgr();
1610 
1611  // snapping points:
1612  // automatic mode: 1 Page, 2 Pages, 100%
1613  // n Columns mode: n Pages, 100%
1614  // n Columns book mode: nPages without gaps, 100%
1615  const SwRect aPageRect( m_pWrtShell->GetAnyCurRect( CurRectType::PageCalc ) );
1616  const SwRect aRootRect( m_pWrtShell->GetAnyCurRect( CurRectType::PagesArea ) ); // width of columns
1617  Size aPageSize( aPageRect.SSize() );
1618  aPageSize.AdjustWidth(pMgr->HasNotes() && pMgr->ShowNotes() ?
1619  pMgr->GetSidebarWidth() + pMgr->GetSidebarBorderWidth() :
1620  0 );
1621 
1622  Size aRootSize( aRootRect.SSize() );
1623 
1624  const MapMode aTmpMap( MapUnit::MapTwip );
1625  const Size& rEditSize = GetEditWin().GetOutputSizePixel();
1626  const Size aWindowSize( GetEditWin().PixelToLogic( rEditSize, aTmpMap ) );
1627 
1628  const tools::Long nOf = pVOpt->GetDocumentBorder() * 2;
1629  tools::Long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width();
1630  nTmpWidth += nOf;
1631  aPageSize.AdjustHeight(nOf );
1632  tools::Long nFac = aWindowSize.Width() * 100 / nTmpWidth;
1633 
1634  tools::Long nVisPercent = aWindowSize.Height() * 100 / aPageSize.Height();
1635  nFac = std::min( nFac, nVisPercent );
1636 
1637  if (nFac >= MINZOOM)
1638  {
1639  aZoomSliderItem.AddSnappingPoint( nFac );
1640  }
1641 
1642  if ( bAutomaticViewLayout )
1643  {
1644  nTmpWidth += aPageSize.Width() + pVOpt->GetGapBetweenPages();
1645  nFac = aWindowSize.Width() * 100 / nTmpWidth;
1646  nFac = std::min( nFac, nVisPercent );
1647  if (nFac >= MINZOOM)
1648  {
1649  aZoomSliderItem.AddSnappingPoint( nFac );
1650  }
1651  }
1652  }
1653 
1654  rSet.Put( aZoomSliderItem );
1655  }
1656  else
1657  rSet.DisableItem( SID_ATTR_ZOOMSLIDER );
1658  }
1659  break;
1660  case SID_ATTR_POSITION:
1661  case SID_ATTR_SIZE:
1662  {
1663  if( !rShell.IsFrameSelected() && !rShell.IsObjSelected() )
1665  else
1666  {
1667  FlyMode eFrameMode = SwBaseShell::GetFrameMode();
1668  if ( eFrameMode == FLY_DRAG_START || eFrameMode == FLY_DRAG )
1669  {
1670  if ( nWhich == SID_ATTR_POSITION )
1671  rSet.Put( SfxPointItem( SID_ATTR_POSITION,
1672  rShell.GetAnchorObjDiff()));
1673  else
1674  rSet.Put( SvxSizeItem( SID_ATTR_SIZE,
1675  rShell.GetObjSize()));
1676  }
1677  }
1678  }
1679  break;
1680  case SID_TABLE_CELL:
1681 
1682  if( rShell.IsFrameSelected() || rShell.IsObjSelected() )
1683  {
1684  // #i39171# Don't put a SvxSizeItem into a slot which is defined as SfxStringItem.
1685  // SvxPosSizeStatusBarControl no longer resets to empty display if only one slot
1686  // has no item, so SID_TABLE_CELL can remain empty (the SvxSizeItem is supplied
1687  // in SID_ATTR_SIZE).
1688  }
1689  else
1690  {
1691  OUString sStr;
1692  if( rShell.IsCursorInTable() )
1693  {
1694  // table name + cell coordinate
1695  sStr = rShell.GetTableFormat()->GetName() + ":";
1696  sStr += rShell.GetBoxNms();
1697  }
1698  else
1699  {
1700  const SwSection* pCurrSect = rShell.GetCurrSection();
1701  if( pCurrSect )
1702  {
1703  switch( pCurrSect->GetType() )
1704  {
1707  {
1708  const SwTOXBase* pTOX = m_pWrtShell->GetCurTOX();
1709  if( pTOX )
1710  sStr = pTOX->GetTOXName();
1711  else
1712  {
1713  OSL_ENSURE( false,
1714  "Unknown kind of section" );
1715  sStr = pCurrSect->GetSectionName();
1716  }
1717  }
1718  break;
1719  default:
1720  sStr = pCurrSect->GetSectionName();
1721  break;
1722  }
1723  }
1724  }
1725 
1726  const SwNumRule* pNumRule = rShell.GetNumRuleAtCurrCursorPos();
1727  const bool bOutlineNum = pNumRule && pNumRule->IsOutlineRule();
1728 
1729  if (pNumRule && !bOutlineNum ) // cursor in numbering
1730  {
1731  sal_uInt8 nNumLevel = rShell.GetNumLevel();
1732  if ( nNumLevel < MAXLEVEL )
1733  {
1734  if(!pNumRule->IsAutoRule())
1735  {
1737  rShell.GetCurAttr(aSet);
1738  if(SfxItemState::DEFAULT <=
1740  {
1741  const OUString& rNumStyle =
1742  aSet.Get(RES_PARATR_NUMRULE).GetValue();
1743  if(!rNumStyle.isEmpty())
1744  {
1745  if(!sStr.isEmpty())
1746  sStr += sStatusDelim;
1747  sStr += rNumStyle;
1748  }
1749  }
1750  }
1751  if (!sStr.isEmpty())
1752  sStr += sStatusDelim;
1753  sStr += SwResId(STR_NUM_LEVEL) + OUString::number( nNumLevel + 1 );
1754 
1755  }
1756  }
1757  const int nOutlineLevel = rShell.GetCurrentParaOutlineLevel();
1758  if( nOutlineLevel != 0 )
1759  {
1760  if (!sStr.isEmpty())
1761  sStr += " , ";
1762  if( bOutlineNum )
1763  {
1764  sStr += SwResId(STR_OUTLINE_NUMBERING) +
1765  sStatusDelim + SwResId(STR_NUM_LEVEL);
1766  }
1767  else
1768  sStr += SwResId(STR_NUM_OUTLINE);
1769  sStr += OUString::number( nOutlineLevel);
1770  }
1771 
1772  if( rShell.HasReadonlySel() )
1773  {
1774  if (!sStr.isEmpty())
1775  sStr = sStatusDelim + sStr;
1776  sStr = SwResId(SW_STR_READONLY) + sStr;
1777  }
1778  if (!sStr.isEmpty())
1779  rSet.Put( SfxStringItem( SID_TABLE_CELL, sStr ));
1780  }
1781  break;
1782  case FN_STAT_SELMODE:
1783  {
1784  if(rShell.IsStdMode())
1785  rSet.Put(SfxUInt16Item(FN_STAT_SELMODE, 0));
1786  else if(rShell.IsAddMode())
1787  rSet.Put(SfxUInt16Item(FN_STAT_SELMODE, 2));
1788  else if(rShell.IsBlockMode())
1789  rSet.Put(SfxUInt16Item(FN_STAT_SELMODE, 3));
1790  else
1791  rSet.Put(SfxUInt16Item(FN_STAT_SELMODE, 1));
1792  break;
1793  }
1794  case SID_ATTR_INSERT:
1795  if( rShell.IsRedlineOn() )
1796  rSet.DisableItem( nWhich );
1797  else
1798  {
1799  rSet.Put(SfxBoolItem(SID_ATTR_INSERT,rShell.IsInsMode()));
1800  }
1801  break;
1802  }
1803  nWhich = aIter.NextWhich();
1804  }
1805 }
1806 
1812 {
1813  SwWrtShell &rSh = GetWrtShell();
1814  const SfxItemSet* pArgs = rReq.GetArgs();
1815  const SfxPoolItem* pItem=nullptr;
1816  bool bUp = false;
1817  sal_uInt16 nWhich = rReq.GetSlot();
1818  switch( nWhich )
1819  {
1820  case FN_STAT_PAGE:
1821  {
1822  GetViewFrame()->GetDispatcher()->Execute( FN_GOTO_PAGE,
1823  SfxCallMode::SYNCHRON|SfxCallMode::RECORD );
1824  }
1825  break;
1826 
1827  case FN_STAT_WORDCOUNT:
1828  {
1829  GetViewFrame()->GetDispatcher()->Execute(FN_WORDCOUNT_DIALOG,
1830  SfxCallMode::SYNCHRON|SfxCallMode::RECORD );
1831  }
1832  break;
1833 
1834  case FN_STAT_BOOKMARK:
1835  if ( pArgs )
1836  {
1837  if (SfxItemState::SET == pArgs->GetItemState( nWhich, true, &pItem))
1838  {
1839  const IDocumentMarkAccess* pMarkAccess = rSh.getIDocumentMarkAccess();
1840  const sal_Int32 nIdx = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
1841  if(nIdx < pMarkAccess->getBookmarksCount())
1842  {
1844  rSh.EnterStdMode();
1845  rSh.GotoMark( *ppBookmark );
1846  }
1847  else
1848  OSL_FAIL("SwView::ExecuteStatusLine(..)"
1849  " - Ignoring out of range bookmark index");
1850  }
1851  }
1852  break;
1853 
1854  case FN_STAT_TEMPLATE:
1855  {
1856  GetViewFrame()->GetDispatcher()->Execute(FN_FORMAT_PAGE_DLG,
1857  SfxCallMode::SYNCHRON|SfxCallMode::RECORD );
1858  }
1859  break;
1860  case SID_ATTR_ZOOM:
1861  {
1862  if ( ( GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) || !GetDocShell()->IsInPlaceActive() )
1863  {
1864  const SfxItemSet *pSet = nullptr;
1866  if ( pArgs )
1867  pSet = pArgs;
1868  else
1869  {
1870  const SwViewOption& rViewOptions = *rSh.GetViewOptions();
1872  SvxZoomItem aZoom( rViewOptions.GetZoomType(), rViewOptions.GetZoom() );
1873 
1874  const bool bBrowseMode = rSh.GetViewOptions()->getBrowseMode();
1875  if( bBrowseMode )
1876  {
1877  aZoom.SetValueSet(
1878  SvxZoomEnableFlags::N50|
1879  SvxZoomEnableFlags::N75|
1880  SvxZoomEnableFlags::N100|
1881  SvxZoomEnableFlags::N150|
1882  SvxZoomEnableFlags::N200);
1883  }
1884  aCoreSet.Put( aZoom );
1885 
1886  if ( !bBrowseMode )
1887  {
1888  const SvxViewLayoutItem aViewLayout( rViewOptions.GetViewLayoutColumns(), rViewOptions.IsViewLayoutBookMode() );
1889  aCoreSet.Put( aViewLayout );
1890  }
1891 
1893  pDlg.disposeAndReset(pFact->CreateSvxZoomDialog(GetViewFrame()->GetFrameWeld(), aCoreSet));
1894  pDlg->SetLimits( MINZOOM, MAXZOOM );
1895  if( pDlg->Execute() != RET_CANCEL )
1896  pSet = pDlg->GetOutputItemSet();
1897  }
1898 
1899  const SfxPoolItem* pViewLayoutItem = nullptr;
1900  if ( pSet && SfxItemState::SET == pSet->GetItemState(SID_ATTR_VIEWLAYOUT, true, &pViewLayoutItem))
1901  {
1902  const sal_uInt16 nColumns = static_cast<const SvxViewLayoutItem *>(pViewLayoutItem)->GetValue();
1903  const bool bBookMode = static_cast<const SvxViewLayoutItem *>(pViewLayoutItem)->IsBookMode();
1904  SetViewLayout( nColumns, bBookMode );
1905  }
1906 
1907  if ( pSet && SfxItemState::SET == pSet->GetItemState(SID_ATTR_ZOOM, true, &pItem))
1908  {
1909  SvxZoomType eType = static_cast<const SvxZoomItem *>(pItem)->GetType();
1910  SetZoom( eType, static_cast<const SvxZoomItem *>(pItem)->GetValue() );
1911  }
1912  bUp = true;
1913  if ( pItem )
1914  rReq.AppendItem( *pItem );
1915  rReq.Done();
1916  }
1917  }
1918  break;
1919 
1920  case SID_ATTR_VIEWLAYOUT:
1921  {
1923  ( ( GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) || !GetDocShell()->IsInPlaceActive() ) )
1924  {
1925  if ( SfxItemState::SET == pArgs->GetItemState(SID_ATTR_VIEWLAYOUT, true, &pItem ))
1926  {
1927  const sal_uInt16 nColumns = static_cast<const SvxViewLayoutItem *>(pItem)->GetValue();
1928  const bool bBookMode = (0 != nColumns && 0 == (nColumns % 2)) &&
1929  static_cast<const SvxViewLayoutItem *>(pItem)->IsBookMode();
1930 
1931  SetViewLayout( nColumns, bBookMode );
1932  }
1933 
1934  bUp = true;
1935  rReq.Done();
1936 
1937  InvalidateRulerPos();
1938  }
1939  }
1940  break;
1941 
1942  case SID_ATTR_ZOOMSLIDER:
1943  {
1944  if ( pArgs && ( ( GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) || !GetDocShell()->IsInPlaceActive() ) )
1945  {
1946  if ( SfxItemState::SET == pArgs->GetItemState(SID_ATTR_ZOOMSLIDER, true, &pItem ))
1947  {
1948  const sal_uInt16 nCurrentZoom = static_cast<const SvxZoomSliderItem *>(pItem)->GetValue();
1949  SetZoom( SvxZoomType::PERCENT, nCurrentZoom );
1950  }
1951 
1952  bUp = true;
1953  rReq.Done();
1954  }
1955  }
1956  break;
1957 
1958  case SID_ATTR_SIZE:
1959  {
1960  sal_uInt16 nId = 0;
1961  if( rSh.IsCursorInTable() )
1962  nId = FN_FORMAT_TABLE_DLG;
1963  else if( rSh.GetCurTOX() )
1964  nId = FN_INSERT_MULTI_TOX;
1965  else if( rSh.GetCurrSection() )
1966  nId = FN_EDIT_REGION;
1967  else
1968  {
1969  const SwNumRule* pNumRule = rSh.GetNumRuleAtCurrCursorPos();
1970  if( pNumRule ) // cursor in numbering
1971  {
1972  if( pNumRule->IsAutoRule() )
1973  nId = FN_NUMBER_BULLETS;
1974  else
1975  {
1976  // start dialog of the painter
1977  nId = 0;
1978  }
1979  }
1980  else if( rSh.IsFrameSelected() )
1981  nId = FN_FORMAT_FRAME_DLG;
1982  else if( rSh.IsObjSelected() )
1983  nId = SID_ATTR_TRANSFORM;
1984  }
1985  if( nId )
1986  GetViewFrame()->GetDispatcher()->Execute(nId,
1987  SfxCallMode::SYNCHRON | SfxCallMode::RECORD );
1988  }
1989  break;
1990 
1991  case FN_STAT_SELMODE:
1992  {
1993  if ( pArgs )
1994  {
1995  if (SfxItemState::SET == pArgs->GetItemState( nWhich, true, &pItem))
1996  {
1997  switch ( static_cast<const SfxUInt16Item *>(pItem)->GetValue() )
1998  {
1999  case 0: rSh.EnterStdMode(); break;
2000  case 1: rSh.EnterExtMode(); break;
2001  case 2: rSh.EnterAddMode(); break;
2002  case 3: rSh.EnterBlockMode(); break;
2003  }
2004  }
2005  }
2006  bUp = true;
2007  break;
2008  }
2009  case FN_SET_ADD_MODE:
2010  rSh.ToggleAddMode();
2011  nWhich = FN_STAT_SELMODE;
2012  bUp = true;
2013  break;
2014  case FN_SET_BLOCK_MODE:
2015  rSh.ToggleBlockMode();
2016  nWhich = FN_STAT_SELMODE;
2017  bUp = true;
2018  break;
2019  case FN_SET_EXT_MODE:
2020  rSh.ToggleExtMode();
2021  nWhich = FN_STAT_SELMODE;
2022  bUp = true;
2023  break;
2024  case SID_ATTR_INSERT:
2025  SwPostItMgr* pMgr = GetPostItMgr();
2026  if ( pMgr && pMgr->HasActiveSidebarWin() )
2027  {
2029  }
2030  else
2031  rSh.ToggleInsMode();
2032  bUp = true;
2033  break;
2034 
2035  }
2036  if ( bUp )
2037  {
2038  SfxBindings &rBnd = GetViewFrame()->GetBindings();
2039  rBnd.Invalidate(nWhich);
2040  rBnd.Update(nWhich);
2041  }
2042 }
2043 
2044 void SwView::InsFrameMode(sal_uInt16 nCols)
2045 {
2046  if ( m_pWrtShell->HasWholeTabSelection() )
2047  {
2048  SwFlyFrameAttrMgr aMgr( true, m_pWrtShell.get(), Frmmgr_Type::TEXT, nullptr );
2049 
2050  const SwFrameFormat &rPageFormat =
2051  m_pWrtShell->GetPageDesc(m_pWrtShell->GetCurPageDesc()).GetMaster();
2052  SwTwips lWidth = rPageFormat.GetFrameSize().GetWidth();
2053  const SvxLRSpaceItem &rLR = rPageFormat.GetLRSpace();
2054  lWidth -= rLR.GetLeft() + rLR.GetRight();
2055  aMgr.SetSize(Size(lWidth, aMgr.GetSize().Height()));
2056  if(nCols > 1)
2057  {
2058  SwFormatCol aCol;
2059  aCol.Init( nCols, aCol.GetGutterWidth(), aCol.GetWishWidth() );
2060  aMgr.SetCol( aCol );
2061  }
2062  aMgr.InsertFlyFrame();
2063  }
2064  else
2065  GetEditWin().InsFrame(nCols);
2066 }
2067 
2070 {
2071  bool bWeb = dynamic_cast<SwWebView*>( this ) != nullptr;
2073  ScopedVclPtr<SfxAbstractLinksDialog> pDlg(pFact->CreateLinksDialog(GetViewFrame()->GetFrameWeld(), &GetWrtShell().GetLinkManager(), bWeb));
2074  pDlg->Execute();
2075 }
2076 
2077 namespace sw {
2078 
2079 auto PrepareJumpToTOXMark(SwDoc const& rDoc, OUString const& rName)
2080  -> std::optional<std::pair<SwTOXMark, sal_Int32>>
2081 {
2082  sal_Int32 const first(rName.indexOf(toxMarkSeparator));
2083  if (first == -1)
2084  {
2085  SAL_WARN("sw.ui", "JumpToTOXMark: missing separator");
2086  return std::optional<std::pair<SwTOXMark, sal_Int32>>();
2087  }
2088  sal_Int32 const counter(rName.copy(0, first).toInt32());
2089  if (counter <= 0)
2090  {
2091  SAL_WARN("sw.ui", "JumpToTOXMark: invalid counter");
2092  return std::optional<std::pair<SwTOXMark, sal_Int32>>();
2093  }
2094  sal_Int32 const second(rName.indexOf(toxMarkSeparator, first + 1));
2095  if (second == -1)
2096  {
2097  SAL_WARN("sw.ui", "JumpToTOXMark: missing separator");
2098  return std::optional<std::pair<SwTOXMark, sal_Int32>>();
2099  }
2100  OUString const entry(rName.copy(first + 1, second - (first + 1)));
2101  if (rName.getLength() < second + 2)
2102  {
2103  SAL_WARN("sw.ui", "JumpToTOXMark: invalid tox");
2104  return std::optional<std::pair<SwTOXMark, sal_Int32>>();
2105  }
2106  sal_uInt16 const indexType(rName[second + 1]);
2107  OUString const indexName(rName.copy(second + 2));
2108  SwTOXType const* pType(nullptr);
2109  switch (indexType)
2110  {
2111  case 'A':
2112  pType = rDoc.GetTOXType(TOX_INDEX, 0);
2113  assert(pType);
2114  break;
2115  case 'C':
2116  pType = rDoc.GetTOXType(TOX_CONTENT, 0);
2117  assert(pType);
2118  break;
2119  case 'U':
2120  for (auto i = rDoc.GetTOXTypeCount(TOX_USER); 0 < i; )
2121  {
2122  --i;
2123  auto const pTmp(rDoc.GetTOXType(TOX_USER, i));
2124  if (pTmp->GetTypeName() == indexName)
2125  {
2126  pType = pTmp;
2127  break;
2128  }
2129  }
2130  break;
2131  }
2132  if (!pType)
2133  {
2134  SAL_WARN("sw.ui", "JumpToTOXMark: tox doesn't exist");
2135  return std::optional<std::pair<SwTOXMark, sal_Int32>>();
2136  }
2137  // type and alt text are the search keys
2138  SwTOXMark tmp(pType);
2139  tmp.SetAlternativeText(entry);
2140  return std::optional<std::pair<SwTOXMark, sal_Int32>>(std::pair<SwTOXMark, sal_Int32>(tmp, counter));
2141 }
2142 
2143 } // namespace sw
2144 
2145 static auto JumpToTOXMark(SwWrtShell & rSh, OUString const& rName) -> bool
2146 {
2147  std::optional<std::pair<SwTOXMark, sal_Int32>> const tmp(
2148  sw::PrepareJumpToTOXMark(*rSh.GetDoc(), rName));
2149  if (!tmp)
2150  {
2151  return false;
2152  }
2153  SwTOXMark const* pMark(&tmp->first);
2154  // hack: check first if one exists
2155  if (&tmp->first != &rSh.GetDoc()->GotoTOXMark(tmp->first, TOX_SAME_NXT, rSh.IsReadOnlyAvailable()))
2156  {
2157  for (sal_Int32 i = 0; i < tmp->second; ++i)
2158  {
2159  pMark = &rSh.GotoTOXMark(*pMark, TOX_SAME_NXT);
2160  }
2161  return true;
2162  }
2163  else
2164  {
2165  SAL_WARN("sw.ui", "JumpToTOXMark: tox mark doesn't exist");
2166  return false;
2167  }
2168 }
2169 
2170 bool SwView::JumpToSwMark( std::u16string_view rMark )
2171 {
2172  bool bRet = false;
2173  if( !rMark.empty() )
2174  {
2175  // place bookmark at top-center
2176  bool bSaveCC = m_bCenterCursor;
2177  bool bSaveCT = m_bTopCursor;
2178  SetCursorAtTop( true );
2179 
2180  // For scrolling the FrameSet, the corresponding shell needs to have the focus.
2181  bool bHasShFocus = m_pWrtShell->HasShellFocus();
2182  if( !bHasShFocus )
2183  m_pWrtShell->ShellGetFocus();
2184 
2185  const SwFormatINetFormat* pINet;
2186  OUString sCmp;
2187  OUString sMark( INetURLObject::decode( rMark,
2189 
2190  sal_Int32 nLastPos, nPos = sMark.indexOf( cMarkSeparator );
2191  if( -1 != nPos )
2192  while( -1 != ( nLastPos = sMark.indexOf( cMarkSeparator, nPos + 1 )) )
2193  nPos = nLastPos;
2194 
2196  IDocumentMarkAccess* const pMarkAccess = m_pWrtShell->getIDocumentMarkAccess();
2197  if( -1 != nPos )
2198  sCmp = sMark.copy(nPos + 1).replaceAll(" ", "");
2199 
2200  if( !sCmp.isEmpty() )
2201  {
2202  OUString sName( sMark.copy( 0, nPos ) );
2203  sCmp = sCmp.toAsciiLowerCase();
2204  FlyCntType eFlyType = FLYCNTTYPE_ALL;
2205 
2206  if (sCmp == "drawingobject")
2207  bRet = m_pWrtShell->GotoDrawingObject(sName);
2208  else if( sCmp == "region" )
2209  {
2210  m_pWrtShell->EnterStdMode();
2211  bRet = m_pWrtShell->GotoRegion( sName );
2212  }
2213  else if( sCmp == "outline" )
2214  {
2215  m_pWrtShell->EnterStdMode();
2216  bRet = m_pWrtShell->GotoOutline( sName );
2217  }
2218  else if( sCmp == "frame" )
2219  eFlyType = FLYCNTTYPE_FRM;
2220  else if( sCmp == "graphic" )
2221  eFlyType = FLYCNTTYPE_GRF;
2222  else if( sCmp == "ole" )
2223  eFlyType = FLYCNTTYPE_OLE;
2224  else if( sCmp == "table" )
2225  {
2226  m_pWrtShell->EnterStdMode();
2227  bRet = m_pWrtShell->GotoTable( sName );
2228  }
2229  else if( sCmp == "sequence" )
2230  {
2231  m_pWrtShell->EnterStdMode();
2232  sal_Int32 nNoPos = sName.indexOf( cSequenceMarkSeparator );
2233  if ( nNoPos != -1 )
2234  {
2235  sal_uInt16 nSeqNo = sName.copy( nNoPos + 1 ).toInt32();
2236  sName = sName.copy( 0, nNoPos );
2237  bRet = m_pWrtShell->GotoRefMark(sName, REF_SEQUENCEFLD, nSeqNo);
2238  }
2239  }
2240  else if (sCmp == "toxmark")
2241  {
2242  bRet = JumpToTOXMark(*m_pWrtShell, sName);
2243  }
2244  else if( sCmp == "text" )
2245  {
2246  // normal text search
2247  m_pWrtShell->EnterStdMode();
2248 
2249  i18nutil::SearchOptions2 aSearchOpt(
2250  SearchAlgorithms_ABSOLUTE, 0,
2251  sName, OUString(),
2252  SvtSysLocale().GetLanguageTag().getLocale(),
2253  0,0,0,
2254  TransliterationFlags::IGNORE_CASE,
2255  SearchAlgorithms2::ABSOLUTE,
2256  '\\' );
2257 
2258  //todo/mba: assuming that notes shouldn't be searched
2259  if( m_pWrtShell->SearchPattern( aSearchOpt, false/*bSearchInNotes*/, SwDocPositions::Start, SwDocPositions::End ))
2260  {
2261  m_pWrtShell->EnterStdMode(); // remove the selection
2262  bRet = true;
2263  }
2264  }
2265  else if( pMarkAccess->getAllMarksEnd() != (ppMark = pMarkAccess->findMark(sMark)) )
2266  {
2267  bRet = m_pWrtShell->GotoMark( *ppMark, false );
2268  }
2269  else if( nullptr != ( pINet = m_pWrtShell->FindINetAttr( sMark ) )) {
2270  m_pWrtShell->addCurrentPosition();
2271  bRet = m_pWrtShell->GotoINetAttr( *pINet->GetTextINetFormat() );
2272  }
2273 
2274  // for all types of Flys
2275  if( FLYCNTTYPE_ALL != eFlyType && m_pWrtShell->GotoFly( sName, eFlyType ))
2276  {
2277  bRet = true;
2278  if( FLYCNTTYPE_FRM == eFlyType )
2279  {
2280  // TextFrames: set Cursor in the frame
2281  m_pWrtShell->UnSelectFrame();
2282  m_pWrtShell->LeaveSelFrameMode();
2283  }
2284  else
2285  {
2286  m_pWrtShell->HideCursor();
2287  m_pWrtShell->EnterSelFrameMode();
2288  }
2289  }
2290  }
2291  else if( pMarkAccess->getAllMarksEnd() != (ppMark = pMarkAccess->findMark(sMark)))
2292  {
2293  bRet = m_pWrtShell->GotoMark( *ppMark, false );
2294  }
2295  else if( nullptr != ( pINet = m_pWrtShell->FindINetAttr( sMark ) ))
2296  bRet = m_pWrtShell->GotoINetAttr( *pINet->GetTextINetFormat() );
2297 
2298  // make selection visible later
2299  if ( m_aVisArea.IsEmpty() )
2300  m_bMakeSelectionVisible = true;
2301 
2302  // reset ViewStatus
2303  SetCursorAtTop( bSaveCT, bSaveCC );
2304 
2305  if(!m_pWrtShell->IsFrameSelected() && !m_pWrtShell->IsObjSelected())
2306  m_pWrtShell->ShowCursor();
2307 
2308  if( !bHasShFocus )
2309  m_pWrtShell->ShellLoseFocus();
2310  }
2311  return bRet;
2312 }
2313 
2314 // #i67305# Undo after insert from file:
2315 // Undo "Insert form file" crashes with documents imported from binary filter (.sdw) => disabled
2316 // Undo "Insert form file" crashes with (.odt) documents crashes if these documents contains
2317 // page styles with active header/footer => disabled for those documents
2318 static size_t lcl_PageDescWithHeader( const SwDoc& rDoc )
2319 {
2320  size_t nRet = 0;
2321  size_t nCnt = rDoc.GetPageDescCnt();
2322  for( size_t i = 0; i < nCnt; ++i )
2323  {
2324  const SwPageDesc& rPageDesc = rDoc.GetPageDesc( i );
2325  const SwFrameFormat& rMaster = rPageDesc.GetMaster();
2326  const SfxPoolItem* pItem;
2327  if( ( SfxItemState::SET == rMaster.GetAttrSet().GetItemState( RES_HEADER, false, &pItem ) &&
2328  static_cast<const SwFormatHeader*>(pItem)->IsActive() ) ||
2329  ( SfxItemState::SET == rMaster.GetAttrSet().GetItemState( RES_FOOTER, false, &pItem ) &&
2330  static_cast<const SwFormatFooter*>(pItem)->IsActive()) )
2331  ++nRet;
2332  }
2333  return nRet; // number of page styles with active header/footer
2334 }
2335 
2336 void SwView::ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem )
2337 {
2338  m_pViewImpl->InitRequest( rRequest );
2339  m_pViewImpl->SetParam( pItem ? 1 : 0 );
2340  const sal_uInt16 nSlot = rRequest.GetSlot();
2341 
2342  if ( !pItem )
2343  {
2344  InsertDoc( nSlot, "", "" );
2345  }
2346  else
2347  {
2348  OUString sFile, sFilter;
2349  sFile = static_cast<const SfxStringItem *>( pItem )->GetValue();
2350  if ( SfxItemState::SET == rRequest.GetArgs()->GetItemState( FN_PARAM_1, true, &pItem ) )
2351  sFilter = static_cast<const SfxStringItem *>(pItem )->GetValue();
2352 
2353  bool bHasFileName = !sFile.isEmpty();
2354  tools::Long nFound = InsertDoc( nSlot, sFile, sFilter );
2355 
2356  if ( bHasFileName )
2357  {
2358  rRequest.SetReturnValue( SfxBoolItem( nSlot, nFound != -1 ) );
2359  rRequest.Done();
2360  }
2361  }
2362 }
2363 
2364 tools::Long SwView::InsertDoc( sal_uInt16 nSlotId, const OUString& rFileName, const OUString& rFilterName, sal_Int16 nVersion )
2365 {
2366  std::unique_ptr<SfxMedium> pMed;
2367  SwDocShell* pDocSh = GetDocShell();
2368 
2369  if( !rFileName.isEmpty() )
2370  {
2371  SfxObjectFactory& rFact = pDocSh->GetFactory();
2372  std::shared_ptr<const SfxFilter> pFilter = rFact.GetFilterContainer()->GetFilter4FilterName( rFilterName );
2373  if ( !pFilter )
2374  {
2375  pMed.reset(new SfxMedium(rFileName, StreamMode::READ, nullptr, nullptr ));
2376  SfxFilterMatcher aMatcher( rFact.GetFilterContainer()->GetName() );
2377  pMed->UseInteractionHandler( true );
2378  ErrCode nErr = aMatcher.GuessFilter(*pMed, pFilter, SfxFilterFlags::NONE);
2379  if ( nErr )
2380  pMed.reset();
2381  else
2382  pMed->SetFilter( pFilter );
2383  }
2384  else
2385  pMed.reset(new SfxMedium(rFileName, StreamMode::READ, pFilter, nullptr));
2386  }
2387  else
2388  {
2389  m_pViewImpl->StartDocumentInserter(
2390  // tdf#118578 allow inserting any Writer document except GlobalDoc
2391  SwDocShell::Factory().GetFactoryName(),
2392  LINK( this, SwView, DialogClosedHdl ),
2393  nSlotId
2394  );
2395  return -1;
2396  }
2397 
2398  if( !pMed )
2399  return -1;
2400 
2401  return InsertMedium( nSlotId, std::move(pMed), nVersion );
2402 }
2403 
2404 tools::Long SwView::InsertMedium( sal_uInt16 nSlotId, std::unique_ptr<SfxMedium> pMedium, sal_Int16 nVersion )
2405 {
2406  bool bInsert = false, bCompare = false;
2407  tools::Long nFound = 0;
2408  SwDocShell* pDocSh = GetDocShell();
2409 
2410  switch( nSlotId )
2411  {
2412  case SID_DOCUMENT_MERGE: break;
2413  case SID_DOCUMENT_COMPARE: bCompare = true; break;
2414  case SID_INSERTDOC: bInsert = true; break;
2415 
2416  default:
2417  OSL_ENSURE( false, "unknown SlotId!" );
2418  bInsert = true;
2419  break;
2420  }
2421 
2422  if( bInsert )
2423  {
2424  uno::Reference< frame::XDispatchRecorder > xRecorder =
2425  GetViewFrame()->GetBindings().GetRecorder();
2426  if ( xRecorder.is() )
2427  {
2428  SfxRequest aRequest(GetViewFrame(), SID_INSERTDOC);
2429  aRequest.AppendItem(SfxStringItem(SID_INSERTDOC, pMedium->GetOrigURL()));
2430  if(pMedium->GetFilter())
2431  aRequest.AppendItem(SfxStringItem(FN_PARAM_1, pMedium->GetFilter()->GetName()));
2432  aRequest.Done();
2433  }
2434 
2435  SfxObjectShellRef aRef( pDocSh );
2436 
2437  ErrCode nError = SfxObjectShell::HandleFilter( pMedium.get(), pDocSh );
2438  // #i16722# aborted?
2439  if(nError != ERRCODE_NONE)
2440  {
2441  return -1;
2442  }
2443 
2444  pMedium->Download(); // start download if needed
2445  if( aRef.is() && 1 < aRef->GetRefCount() ) // still a valid ref?
2446  {
2447  SwReaderPtr pRdr;
2448  Reader *pRead = pDocSh->StartConvertFrom(*pMedium, pRdr, m_pWrtShell.get());
2449  if( pRead ||
2450  (pMedium->GetFilter()->GetFilterFlags() & SfxFilterFlags::STARONEFILTER) )
2451  {
2452  size_t nUndoCheck = 0;
2453  SwDoc *pDoc = pDocSh->GetDoc();
2454  if( pRead && pDocSh->GetDoc() )
2455  nUndoCheck = lcl_PageDescWithHeader( *pDoc );
2456  ErrCode nErrno;
2457  { //Scope for SwWait-Object, to be able to execute slots
2458  //outside this scope.
2459  SwWait aWait( *GetDocShell(), true );
2460  m_pWrtShell->StartAllAction();
2461  if ( m_pWrtShell->HasSelection() )
2462  m_pWrtShell->DelRight(); // delete selections
2463  if( pRead )
2464  {
2465  nErrno = pRdr->Read( *pRead ); // and insert document
2466  pRdr.reset();
2467  }
2468  else
2469  {
2470  ::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo());
2471  uno::Reference<text::XTextRange> const xInsertPosition(
2473  *m_pWrtShell->GetCursor()->GetPoint(), nullptr));
2474  nErrno = pDocSh->ImportFrom(*pMedium, xInsertPosition)
2476  }
2477 
2478  }
2479 
2480  // update all "table of ..." sections if needed
2481  if( m_pWrtShell->IsUpdateTOX() )
2482  {
2483  SfxRequest aReq( FN_UPDATE_TOX, SfxCallMode::SLOT, GetPool() );
2484  Execute( aReq );
2485  m_pWrtShell->SetUpdateTOX( false ); // reset
2486  }
2487 
2488  if( pDoc )
2489  { // Disable Undo for .sdw or
2490  // if the number of page styles with header/footer has changed
2491  if( !pRead || nUndoCheck != lcl_PageDescWithHeader( *pDoc ) )
2492  {
2494  }
2495  }
2496 
2497  m_pWrtShell->EndAllAction();
2498  if( nErrno )
2499  {
2500  ErrorHandler::HandleError( nErrno );
2501  nFound = nErrno.IsError() ? -1 : 0;
2502  }
2503  else
2504  nFound = 0;
2505  }
2506  }
2507  }
2508  else
2509  {
2510  SfxObjectShellRef xDocSh;
2511  SfxObjectShellLock xLockRef;
2512 
2513  const int nRet = SwFindDocShell( xDocSh, xLockRef, pMedium->GetName(), OUString(),
2514  OUString(), nVersion, pDocSh );
2515  if( nRet )
2516  {
2517  SwWait aWait( *GetDocShell(), true );
2518  m_pWrtShell->StartAllAction();
2519 
2520  m_pWrtShell->EnterStdMode(); // delete selections
2521 
2522  if( bCompare )
2523  nFound = m_pWrtShell->CompareDoc( *static_cast<SwDocShell*>( xDocSh.get() )->GetDoc() );
2524  else
2525  nFound = m_pWrtShell->MergeDoc( *static_cast<SwDocShell*>( xDocSh.get() )->GetDoc() );
2526 
2527  m_pWrtShell->EndAllAction();
2528 
2529  if (!bCompare && !nFound)
2530  {
2531  std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetEditWin().GetFrameWeld(),
2532  VclMessageType::Info, VclButtonsType::Ok,
2533  SwResId(STR_NO_MERGE_ENTRY)));
2534  xInfoBox->run();
2535  }
2536  if( nRet==2 && xDocSh.is() )
2537  xDocSh->DoClose();
2538  }
2539  }
2540 
2541  return nFound;
2542 }
2543 
2545 {
2546  m_bInMailMerge = true;
2547  SfxBindings& rBind = GetViewFrame()->GetBindings();
2550 }
2551 
2552 #if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS
2553 
2554 namespace
2555 {
2556  bool lcl_NeedAdditionalDataSource( const uno::Reference< XDatabaseContext >& _rDatasourceContext )
2557  {
2558  Sequence < OUString > aNames = _rDatasourceContext->getElementNames();
2559 
2560  return ( !aNames.hasElements()
2561  || ( ( 1 == aNames.getLength() )
2562  && aNames.getConstArray()[0] == SW_MOD()->GetDBConfig()->GetBibliographySource().sDataSource
2563  )
2564  );
2565  }
2566 }
2567 
2568 #endif
2569 
2570 void SwView::GenerateFormLetter(bool bUseCurrentDocument)
2571 {
2572 #if !HAVE_FEATURE_DBCONNECTIVITY || ENABLE_FUZZERS
2573  (void) bUseCurrentDocument;
2574 #else
2575  if(bUseCurrentDocument)
2576  {
2577  if(!GetWrtShell().IsAnyDatabaseFieldInDoc())
2578  {
2579  //check availability of data sources (except biblio source)
2580  uno::Reference<XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
2581  uno::Reference<XDatabaseContext> xDBContext = DatabaseContext::create(xContext);
2582  bool bCallAddressPilot = false;
2583  if ( lcl_NeedAdditionalDataSource( xDBContext ) )
2584  {
2585  // no data sources are available - create a new one
2586  std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "modules/swriter/ui/datasourcesunavailabledialog.ui"));
2587  std::unique_ptr<weld::MessageDialog> xQuery(xBuilder->weld_message_dialog("DataSourcesUnavailableDialog"));
2588  // no cancel allowed
2589  if (RET_OK != xQuery->run())
2590  return;
2591  bCallAddressPilot = true;
2592  }
2593  else
2594  {
2595  //take an existing data source or create a new one?
2598  if(RET_OK == pConnectionsDlg->Execute())
2599  bCallAddressPilot = !pConnectionsDlg->IsUseExistingConnections();
2600  else
2601  return;
2602 
2603  }
2604  if(bCallAddressPilot)
2605  {
2606  GetViewFrame()->GetDispatcher()->Execute(
2607  SID_ADDRESS_DATA_SOURCE, SfxCallMode::SYNCHRON);
2608  if ( lcl_NeedAdditionalDataSource( xDBContext ) )
2609  // no additional data source has been created
2610  // -> assume that the user has cancelled the pilot
2611  return;
2612  }
2613 
2614  //call insert fields with database field page available, only
2615  SfxViewFrame* pVFrame = GetViewFrame();
2616  //at first hide the default field dialog if currently visible
2617  pVFrame->SetChildWindow(FN_INSERT_FIELD, false);
2618  //enable the status of the db field dialog - it is disabled in the status method
2619  //to prevent creation of the dialog without mail merge active
2620  EnableMailMerge();
2621  //then show the "Data base only" field dialog
2624  SfxCallMode::SYNCHRON, { &aOn });
2625  return;
2626  }
2627  else
2628  {
2629  OUString sSource;
2630  if(!GetWrtShell().IsFieldDataSourceAvailable(sSource))
2631  {
2632  std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "modules/swriter/ui/warndatasourcedialog.ui"));
2633  std::unique_ptr<weld::MessageDialog> xWarning(xBuilder->weld_message_dialog("WarnDataSourceDialog"));
2634  OUString sTmp(xWarning->get_primary_text());
2635  xWarning->set_primary_text(sTmp.replaceFirst("%1", sSource));
2636  if (RET_OK == xWarning->run())
2637  {
2639  ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateVclDialog( nullptr, SID_OPTIONS_DATABASES ));
2640  pDlg->Execute();
2641  }
2642  return ;
2643  }
2644  }
2645  SwDBManager* pDBManager = GetWrtShell().GetDBManager();
2646 
2647  SwDBData aData;
2648  SwWrtShell &rSh = GetWrtShell();
2649 
2650  std::vector<OUString> aDBNameList;
2651  std::vector<OUString> aAllDBNames;
2652  rSh.GetAllUsedDB( aDBNameList, &aAllDBNames );
2653  if(!aDBNameList.empty())
2654  {
2655  OUString sDBName(aDBNameList[0]);
2656  sal_Int32 nIdx {0};
2657  aData.sDataSource = sDBName.getToken(0, DB_DELIM, nIdx);
2658  aData.sCommand = sDBName.getToken(0, DB_DELIM, nIdx);
2659  aData.nCommandType = sDBName.getToken(0, DB_DELIM, nIdx).toInt32();
2660  }
2661  rSh.EnterStdMode(); // force change in text shell; necessary for mixing DB fields
2662  AttrChangedNotify(nullptr);
2663 
2664  if (pDBManager)
2665  {
2666  Sequence<PropertyValue> aProperties(3);
2667  PropertyValue* pValues = aProperties.getArray();
2668  pValues[0].Name = "DataSourceName";
2669  pValues[1].Name = "Command";
2670  pValues[2].Name = "CommandType";
2671  pValues[0].Value <<= aData.sDataSource;
2672  pValues[1].Value <<= aData.sCommand;
2673  pValues[2].Value <<= aData.nCommandType;
2674  pDBManager->ExecuteFormLetter(GetWrtShell(), aProperties);
2675  }
2676  }
2677  else
2678  {
2679  // call documents and template dialog
2680  SfxApplication* pSfxApp = SfxGetpApp();
2681  weld::Window* pTopWin = pSfxApp->GetTopWindow();
2682 
2683  SfxTemplateManagerDlg aDocTemplDlg(GetFrameWeld());
2684  int nRet = aDocTemplDlg.run();
2685  bool bNewWin = false;
2686  if ( nRet == RET_OK )
2687  {
2688  if ( pTopWin != pSfxApp->GetTopWindow() )
2689  {
2690  // the dialogue opens a document -> a new TopWindow appears
2691  pTopWin = pSfxApp->GetTopWindow();
2692  bNewWin = true;
2693  }
2694  }
2695 
2696  if (bNewWin)
2697  {
2698  // after the destruction of the dialogue its parent comes to top,
2699  // but we want that the new document is on top
2700  pTopWin->present();
2701  }
2702  }
2703 #endif
2704 }
2705 
2706 IMPL_LINK( SwView, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg, void )
2707 {
2708  if ( ERRCODE_NONE != _pFileDlg->GetError() )
2709  return;
2710 
2711  std::unique_ptr<SfxMedium> pMed = m_pViewImpl->CreateMedium();
2712  if ( !pMed )
2713  {
2714  std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetEditWin().GetFrameWeld(),
2715  VclMessageType::Info, VclButtonsType::Ok,
2716  SwResId(RID_SVXSTR_TXTFILTER_FILTERERROR)));
2717  xInfoBox->run();
2718  return;
2719  }
2720 
2721  const sal_uInt16 nSlot = m_pViewImpl->GetRequest()->GetSlot();
2722  tools::Long nFound = InsertMedium( nSlot, std::move(pMed), m_pViewImpl->GetParam() );
2723 
2724  if ( SID_INSERTDOC == nSlot )
2725  {
2726  if ( m_pViewImpl->GetParam() == 0 )
2727  {
2728  m_pViewImpl->GetRequest()->SetReturnValue( SfxBoolItem( nSlot, nFound != -1 ) );
2729  m_pViewImpl->GetRequest()->Ignore();
2730  }
2731  else
2732  {
2733  m_pViewImpl->GetRequest()->SetReturnValue( SfxBoolItem( nSlot, nFound != -1 ) );
2734  m_pViewImpl->GetRequest()->Done();
2735  }
2736  }
2737  else if ( SID_DOCUMENT_COMPARE == nSlot || SID_DOCUMENT_MERGE == nSlot )
2738  {
2739  m_pViewImpl->GetRequest()->SetReturnValue( SfxInt32Item( nSlot, nFound ) );
2740 
2741  if ( nFound > 0 ) // show Redline browser
2742  {
2743  SfxViewFrame* pVFrame = GetViewFrame();
2745 
2746  // re-initialize Redline dialog
2747  sal_uInt16 nId = SwRedlineAcceptChild::GetChildWindowId();
2748  SwRedlineAcceptChild* pRed = static_cast<SwRedlineAcceptChild*>(pVFrame->GetChildWindow( nId ));
2749  if ( pRed )
2750  pRed->ReInitDlg( GetDocShell() );
2751  }
2752  }
2753 }
2754 
2756 {
2757  if (m_pViewImpl)
2758  m_pViewImpl->ExecuteScan(rReq) ;
2759 }
2760 
2761 const OUString& SwView::GetOldGrfCat()
2762 {
2763  return GetCachedString(OldGrfCat);
2764 }
2765 
2766 void SwView::SetOldGrfCat(const OUString& sStr)
2767 {
2768  SetCachedString(OldGrfCat, sStr);
2769 }
2770 
2771 const OUString& SwView::GetOldTabCat()
2772 {
2773  return GetCachedString(OldTabCat);
2774 }
2775 
2776 void SwView::SetOldTabCat(const OUString& sStr)
2777 {
2778  SetCachedString(OldTabCat, sStr);
2779 }
2780 
2781 const OUString& SwView::GetOldFrameCat()
2782 {
2783  return GetCachedString(OldFrameCat);
2784 }
2785 
2786 void SwView::SetOldFrameCat(const OUString& sStr)
2787 {
2788  SetCachedString(OldFrameCat, sStr);
2789 }
2790 
2791 const OUString& SwView::GetOldDrwCat()
2792 {
2793  return GetCachedString(OldDrwCat);
2794 }
2795 
2796 void SwView::SetOldDrwCat(const OUString& sStr)
2797 {
2798  SwView::SetCachedString(OldDrwCat, sStr);
2799 }
2800 
2801 
2802 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
static void ShowPanel(std::u16string_view rsPanelId, const css::uno::Reference< css::frame::XFrame > &rxFrame, bool bFocus=false)
bool GetValue() const
bool is() const
#define MAXZOOM
Definition: view.hxx:81
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
Definition: nodeoffset.hxx:33
static void ShowDBObj(SwView const &rView, const SwDBData &rData)
Definition: swmodul1.cxx:365
Base class of the Writer layout elements.
Definition: frame.hxx:315
void StateStatusLine(SfxItemSet &)
get status of the status line
Definition: view2.cxx:1458
void EnterBlockMode()
Definition: select.cxx:651
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
#define FN_UPDATE_TOX
Definition: cmdid.h:504
#define MINZOOM
Definition: view.hxx:80
IDocumentStatistics const & getIDocumentStatistics() const
Definition: doc.cxx:373
virtual SfxObjectFactory & GetFactory() const =0
void ToggleBlockMode()
Definition: select.cxx:764
const OUString & GetOldGrfCat()
Definition: view2.cxx:2761
sal_Int32 nCommandType
Definition: swdbdata.hxx:32
FlyMode
Definition: mdiexp.hxx:40
OUString const & GetCurPageStyle() const
Definition: wrtsh1.cxx:1690
#define FN_EDIT_REGION
Definition: cmdid.h:108
void ItemSetToPageDesc(const SfxItemSet &rSet, SwPageDesc &rPageDesc)
Definition: uitool.cxx:281
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
SfxChildWindow * GetChildWindow(sal_uInt16)
bool IsInsMode() const
Definition: wrtsh.hxx:168
void ToggleInsMode()
Definition: wrtsh.hxx:167
bool IsDefault() const
Definition: format.hxx:113
#define FN_SET_ADD_MODE
Definition: cmdid.h:673
void SetCounts(const SwDocStat &rCurrCnt, const SwDocStat &rDocStat)
static SfxAbstractDialogFactory * Create()
virtual const css::uno::Sequence< sal_Int8 > & GetRedlinePassword() const =0
void ReRead(const OUString &rGrfName, const OUString &rFltName, const Graphic *pGraphic=nullptr)
Re-read if graphic is not ok. Current graphic is replaced by the new one.
Definition: editsh.cxx:295
virtual void SetChangeRecording(bool bActivate, bool bLockAllViews=false) override
Definition: docsh.cxx:1345
constexpr TypedWhichId< SwFormatHeader > RES_HEADER(96)
std::string GetValue
static const std::vector< OUString > & GetFrameFormatUINameArray()
const SwNumRule * GetNumRuleAtCurrCursorPos() const
Definition: ednumber.cxx:719
#define FN_STAT_BOOKMARK
Definition: cmdid.h:836
SfxDispatcher * GetDispatcher()
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
bool AreObjectsMarked() const
tools::Long InsertDoc(sal_uInt16 nSlotId, const OUString &rFileName, const OUString &rFilterName, sal_Int16 nVersion=0)
Definition: view2.cxx:2364
static SvxAbstractDialogFactory * Create()
sal_uIntPtr sal_uLong
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
long Long
tools::Long GetRight() const
Size GetObjSize() const
Definition: feshview.cxx:2380
OUString sDataSource
Definition: swdbdata.hxx:30
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
static const AllSettings & GetSettings()
void CountWords(SwDocStat &rStat) const
Count words in current selection.
Definition: editsh.cxx:1071
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
Definition: langhelper.cxx:390
SwFrameFormat * MakeFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom, bool bBroadcast=false, bool bAuto=true)
Definition: docfmt.cxx:822
bool Pop(SwCursorShell::PopMode=SwCursorShell::PopMode::DeleteStack)
Definition: wrtsh1.cxx:1843
bool IsAutoRule() const
Definition: numrule.hxx:230
sal_uInt16 GetPageSelection() const
Definition: gotodlg.hxx:33
Provides access to the marks of a document.
Definition: doc.hxx:188
#define FN_FORMAT_TABLE_DLG
Definition: cmdid.h:322
const ::avmedia::MediaItem * Execute(const SdrMarkView *pSdrView, SfxRequest const &rReq)
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:93
static SVL_DLLPUBLIC void GetHashPassword(css::uno::Sequence< sal_Int8 > &rPassHash, const char *pPass, sal_uInt32 nLen)
sal_uLong nChar
Definition: docstat.hxx:37
sal_Int16 nId
void setOriginURL(OUString const &rOriginURL)
sal_uInt16 FirstWhich()
const ContentProperties & rData
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:2716
void EnterStdMode()
Definition: select.cxx:551
void Done(bool bRemove=false)
void ExtendedSelectAll(bool bFootnotes=true)
Definition: crsrsh.cxx:594
virtual short run() override
weld::Window * GetTopWindow() const
IMPL_LINK(SvDDEObject, ImplGetDDEData, const DdeData *, pData, void)
Dialog to specify the properties of date form field.
virtual const SwDocStat & GetUpdatedDocStat(bool bCompleteAsync, bool bFields)=0
Updates the document statistics if the document has been modified and returns a reference to the resu...
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:144
void ExecuteScan(SfxRequest &rReq)
Definition: view2.cxx:2755
const OUString & GetOldFrameCat()
Definition: view2.cxx:2781
#define FN_STAT_PAGE
Definition: cmdid.h:832
void SetCachedString(CachedStringID id, const OUString &sStr)
Definition: view.hxx:680
static OUString decode(std::u16string_view rText, DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
bool JumpToSwMark(std::u16string_view rMark)
Definition: view2.cxx:2170
const SfxItemSet * GetArgs() const
void Invalidate(sal_uInt16 nId)
#define ERRCODE_GRFILTER_IOERROR
int SwFindDocShell(SfxObjectShellRef &xDocSh, SfxObjectShellLock &xLockRef, const OUString &rFileName, const OUString &rPasswd, const OUString &rFilter, sal_Int16 nVersion, SwDocShell *pDestSh)
Find the right DocShell and create a new one: The return value specifies what should happen to the Sh...
Definition: docsh2.cxx:1645
virtual short Execute()=0
#define FN_TO_PREV_PAGE
Definition: cmdid.h:730
RET_CANCEL
bool IsStdMode() const
Definition: wrtsh.hxx:149
virtual const SfxItemSet * GetOutputItemSet() const =0
sal_uInt8 GetNumLevel() const
Definition: ednumber.cxx:694
void SetUseInputLanguage(bool bNew)
#i42732# display status of font size/name depending on either the input language or the selection pos...
Definition: edtwin.cxx:6387
bool JumpToSwMark(SwViewShell const *pVwSh, std::u16string_view rMark)
Definition: edtwin3.cxx:117
SwFrameFormat * FindFrameFormatByName(const OUString &rName) const
Definition: docfmt.cxx:747
sal_uInt16 NextWhich()
void SetAttrOutlineContentVisible(bool bVisible)
Definition: ndtxt.cxx:4006
Degree10 getRotation() const
SfxApplication * SfxGetpApp()
const SwSection * GetCurrSection() const
Definition: edsect.cxx:71
SvxZoomType GetZoomType() const
Definition: viewopt.hxx:546
size_type size() const
Definition: docary.hxx:268
const SwTextINetFormat * GetTextINetFormat() const
Definition: fmtinfmt.hxx:70
bool IsRedlineOn() const
Definition: edredln.cxx:43
Used by the UI to modify the document model.
Definition: wrtsh.hxx:93
void ToggleChildWindow(sal_uInt16)
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:165
RET_NO
constexpr tools::Long Width() const
#define FN_NUMBER_BULLETS
Definition: cmdid.h:73
void disposeAndReset(reference_type *pBody)
void AddSnappingPoint(sal_Int32 nNew)
bool MoveShapeHandle(const sal_uInt32 handleNum, const Point &aEndPoint, const sal_Int32 aObjectOrdNum=-1)
virtual VclPtr< AbstractMailMergeFieldConnectionsDlg > CreateMailMergeFieldConnectionsDlg(weld::Window *pParent)=0
virtual VclPtr< AbstractMailMergeCreateFromDlg > CreateMailMergeCreateFromDlg(weld::Window *pParent)=0
#define FN_SYNC_LABELS
Definition: cmdid.h:463
RET_YES
virtual const_iterator_t findMark(const OUString &rMark) const =0
Finds a mark by name.
sal_uInt16 GetDocumentBorder() const
Definition: viewopt.hxx:456
static void SetFrameMode_(FlyMode eMode)
Definition: basesh.hxx:113
PropertiesInfo aProperties
bool getBrowseMode() const
Definition: viewopt.hxx:472
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
#define FN_EDIT_LINK_DLG
Definition: cmdid.h:71
const OUString & GetName() const
Definition: format.hxx:115
Footer, for pageformats Client of FrameFormat describing the footer.
Definition: fmthdft.hxx:64
#define FN_EDIT_CURRENT_TOX
Definition: cmdid.h:132
virtual void DelAllUndoObj()=0
Delete all Undo actions.
weld::Window * GetFrameWeld() const
#define FN_PARAM_FTN_INFO
Definition: cmdid.h:771
Point GetAnchorObjDiff() const
Methods for status line.
Definition: feshview.cxx:2393
const LocaleDataWrapper & GetUILocaleDataWrapper() const
#define ERRCODE_GRFILTER_OPENERROR
#define FN_STAT_SELMODE
Definition: cmdid.h:835
#define FN_TO_NEXT_PAGE
Definition: cmdid.h:729
bool IsBlockMode() const
Definition: wrtsh.hxx:164
#define ERRCODE_GRFILTER_FORMATERROR
SwDoc * GetDoc() const
Definition: viewsh.hxx:282
const IDocumentMarkAccess * getIDocumentMarkAccess() const
Provides access to the document bookmark interface.
Definition: viewsh.cxx:2720
const SwTOXBase * GetCurTOX() const
Get current listing before or at the Cursor.
Definition: edtox.cxx:191
const OUString & GetName() const
RedlineFlags on.
void SetAlternativeText(const OUString &rAlt)
Definition: tox.hxx:582
static css::uno::Reference< css::linguistic2::XDictionary > GetIgnoreAllList()
void Insert(SwField const &, SwPaM *pAnnotationRange=nullptr)
Definition: wrtsh2.cxx:62
auto PrepareJumpToTOXMark(SwDoc const &rDoc, OUString const &rName) -> std::optional< std::pair< SwTOXMark, sal_Int32 >>
Definition: view2.cxx:2079
const char * sName
const OUString & GetOldTabCat()
Definition: view2.cxx:2771
virtual bool IsConditionalFastCall(const SfxRequest &rReq) override
Definition: view2.cxx:1429
#define FN_INSERT_FIELD_DATA_ONLY
Definition: cmdid.h:212
#define FN_MAILMERGE_SENDMAIL_CHILDWINDOW
Definition: cmdid.h:269
#define FN_LINE_NUMBERING_DLG
Definition: cmdid.h:486
std::unique_ptr< SwReader, o3tl::default_delete< SwReader > > SwReaderPtr
Definition: docsh.hxx:44
void GenerateFormLetter(bool bUseCurrentDocument)
Definition: view2.cxx:2570
constexpr OUStringLiteral aData
Definition: ww8scan.hxx:48
const OUString & GetOldDrwCat()
Definition: view2.cxx:2791
DocumentType eType
static ErrCode LoadGraphic(const OUString &rPath, const OUString &rFilter, Graphic &rGraphic, GraphicFilter *pFilter=nullptr, sal_uInt16 *pDeterminedFormat=nullptr)
tools::Long zoomOut(tools::Long nCurrent)
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
Definition: dialoghelp.cxx:19
SwDBManager * GetDBManager() const
For evaluation of DB fields (new DB-manager).
Definition: edfld.cxx:327
SwDoc * GetDoc()
returns Doc. But be careful!
Definition: docsh.hxx:203
static ErrCode HandleFilter(SfxMedium *pMedium, SfxObjectShell const *pDoc)
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:137
#define FN_STAT_TEMPLATE
Definition: cmdid.h:833
#define FN_REDLINE_ACCEPT_DIRECT
Definition: cmdid.h:137
T * get() const
#define FN_PAGEUP
Definition: cmdid.h:671
sal_uInt16 char * pName
static void FireColumnChangeEvent(sal_uInt16 nOldColumn, sal_uInt16 nNewColumn)
Definition: crsrsh.cxx:446
const SwTableNode * IsCursorInTable() const
Definition: crsrsh.hxx:886
Style of a layout element.
Definition: frmfmt.hxx:59
void UpdateDocStats()
Definition: view2.cxx:1450
virtual bool IsThisDocument() const =0
bool HasSelection() const
Definition: wrtsh.hxx:144
#define SW_MOD()
Definition: swmodule.hxx:256
void GetAllUsedDB(std::vector< OUString > &rDBNameList, std::vector< OUString > const *pAllDBNames)
Definition: edfld.cxx:300
static constexpr auto npos
Definition: ndarr.hxx:79
virtual const_iterator_t getAllMarksEnd() const =0
returns a STL-like random access iterator to the end of the sequence of marks.
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
int i
void EditLinkDlg()
show "edit link" dialog
Definition: view2.cxx:2069
const OUString & GetSectionName() const
Definition: section.hxx:168
void ChildWindowExecute(SfxRequest &)
bool IsViewLayoutBookMode() const
Definition: viewopt.hxx:479
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Definition: edtwin.hxx:58
const SwPageDesc & GetPageDesc(const size_t i) const
Definition: doc.hxx:881
SVL_DLLPUBLIC Link< OUString *, bool > const & GetMaybeFileHdl()
FlyCntType
Definition: flyenum.hxx:23
virtual bool IsConditionalFastCall(const SfxRequest &rReq)
void Push()
store a copy of the current cursor on the cursor stack
Definition: crsrsh.cxx:2239
sal_Unicode const toxMarkSeparator
separator for toxmarks: #%19%19|toxmark
Definition: swtypes.hxx:129
tools::Long zoomIn(tools::Long nCurrent)
static DialogMask HandleError(ErrCode nId, weld::Window *pParent=nullptr, DialogMask nMask=DialogMask::MAX)
#define FN_REDLINE_ACCEPT_TONEXT
Definition: cmdid.h:145
sal_uInt16 GetGutterWidth(bool bMin=false) const
Definition: atrfrm.cxx:918
SfxBindings & GetBindings()
ErrCode InsertGraphic(const OUString &rPath, const OUString &rFilter, bool bLink, GraphicFilter *pFlt)
Definition: view2.cxx:230
void SetOldFrameCat(const OUString &sStr)
Definition: view2.cxx:2786
static void FireSectionChangeEvent(sal_uInt16 nOldSection, sal_uInt16 nNewSection)
Definition: crsrsh.cxx:457
vector_type::size_type size_type
Definition: docary.hxx:223
const OUString & GetValue() const
sal_uInt16 Count() const
HTMLMODE_ON
#define FN_REDLINE_PREV_CHANGE
Definition: cmdid.h:142
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:206
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:354
const T * GetArg(sal_uInt16 nSlotId) const
tools::Long GetLeft() const
void ShowExtras(SfxShowExtras nExtras)
static SfxViewFrame * GetNext(const SfxViewFrame &rPrev, const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
Definition: edws.cxx:223
static size_t lcl_PageDescWithHeader(const SwDoc &rDoc)
Definition: view2.cxx:2318
size_t GetPageDescCnt() const
Definition: doc.hxx:880
void NotifyEvent(const SfxEventHint &rEvent, bool bSynchron=true)
float u
void AddRule(SwUndoArg eWhat, const OUString &rWith)
Definition: SwRewriter.cxx:25
#define FN_SCROLL_NEXT
Definition: cmdid.h:181
SwDBData const & GetDBData() const
Database information.
Definition: edfld.cxx:290
const Point & GetMkPos() const
Definition: viscrs.hxx:143
virtual void present()=0
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
tools::ULong GetSidebarBorderWidth(bool bPx=false) const
Definition: PostItMgr.cxx:2125
#define FN_WORDCOUNT_DIALOG
Definition: cmdid.h:593
#define FN_SCROLL_PREV
Definition: cmdid.h:180
bool HasName() const
void LockPaint()
Definition: viewsh.hxx:603
const SwOutlineNodes & GetOutLineNds() const
Array of all OutlineNodes.
Definition: ndarr.hxx:229
SwNodes & GetNodes()
Node is in which nodes-array/doc?
Definition: node.hxx:695
#define FN_UPDATE_CUR_TOX
Definition: cmdid.h:505
OUString GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUString &rPgStr)
Create string for showing the page number in the statusbar.
Definition: view2.cxx:199
Shell * m_pShell
Reader * StartConvertFrom(SfxMedium &rMedium, SwReaderPtr &rpRdr, SwCursorShell const *pCursorSh=nullptr, SwPaM *pPaM=nullptr)
For inserting document.
Definition: docsh.cxx:139
bool HasReadonlySel() const
Definition: crsrsh.cxx:3344
void SelAll()
Definition: select.cxx:123
#define FN_SELECTION_CYCLE
Definition: cmdid.h:731
const char sStatusDelim[]
Definition: view2.cxx:152
sal_Int16 nVersion
#define FN_REDLINE_REJECT_TONEXT
Definition: cmdid.h:146
void ExecuteStatusLine(SfxRequest &)
execute method for the status line
Definition: view2.cxx:1811
tools::ULong GetSidebarWidth(bool bPx=false) const
Definition: PostItMgr.cxx:2099
SW_DLLPUBLIC void MakeDefTabs(SwTwips nDefDist, SvxTabStopItem &rTabs)
Definition: uitool.cxx:644
bool StartExecuteAsync(const std::function< void(sal_Int32)> &rEndDialogFn)
const sal_Unicode cMarkSeparator
Definition: swtypes.hxx:125
static auto JumpToTOXMark(SwWrtShell &rSh, OUString const &rName) -> bool
Definition: view2.cxx:2145
sal_uInt32 GetId() const
Definition: redline.hxx:182
#define DB_DELIM
Definition: swtypes.hxx:131
#define FN_STAT_WORDCOUNT
Definition: cmdid.h:837
#define FN_TOGGLE_OUTLINE_CONTENT_VISIBILITY
Definition: cmdid.h:188
#define FN_QRY_MERGE
Definition: cmdid.h:230
tools::Long SwTwips
Definition: swtypes.hxx:52
void SpellItAgainSam(bool bInvalid, bool bOnlyWrong, bool bSmartTags)
Re-trigger spelling in the idle handler.
Definition: doc.cxx:1160
const SwPosition * Start() const
Definition: pam.hxx:213
OUString GetBoxNms() const
Definition: trvltbl.cxx:746
SwFrameFormat * GetTableFormat()
Definition: edws.cxx:183
void SetMinLen(sal_uInt16 Len)
css::uno::Reference< css::linguistic2::XProofreadingIterator > const & GetGCIterator() const
Definition: docnew.cxx:123
const SwFrameFormat * GetDfltFrameFormat() const
Definition: doc.hxx:747
SW_DLLPUBLIC bool HasActiveSidebarWin() const
Definition: PostItMgr.cxx:2350
virtual void SetLimits(sal_uInt16 nMin, sal_uInt16 nMax)=0
virtual const SwRangeRedline * GetRedline(const SwPosition &rPos, SwRedlineTable::size_type *pFndPos) const =0
void StartAction()
Definition: crsrsh.cxx:226
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:450
void SetReturnValue(const SfxPoolItem &)
const LanguageTag & getLocale()
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
SdrHdl * GetFocusHdl() const
void Update(sal_uInt16 nId)
bool IsError() const
tools::Long InsertMedium(sal_uInt16 nSlotId, std::unique_ptr< SfxMedium > pMedium, sal_Int16 nVersion)
Definition: view2.cxx:2404
void ResetAttr(const o3tl::sorted_vector< sal_uInt16 > &attrs=o3tl::sorted_vector< sal_uInt16 >(), SwPaM *pCursor=nullptr)
Definition: edatmisc.cxx:32
#define ERRCODE_GRFILTER_TOOBIG
sal_uInt16 GetWishWidth() const
Definition: fmtclds.hxx:122
#define ERRCODE_GRFILTER_FILTERERROR
#define FN_FORMAT_FRAME_DLG
Definition: cmdid.h:320
void UpdatePageNums()
invalidate page numbering field
Definition: view2.cxx:1444
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:238
const PropertyValue * pValues
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
#define ERRCODE_GRFILTER_VERSIONERROR
SdrHdl * GetHdl(size_t nNum) const
void GotoMark(const ::sw::mark::IMark *const pMark)
Definition: wrtsh3.cxx:134
#define FN_NAV_ELEMENT
Definition: cmdid.h:179
sal_uInt16 GetSlot() const
void ExecuteInsertDoc(SfxRequest &rRequest, const SfxPoolItem *pItem)
Definition: view2.cxx:2336
bool IsAnyDatabaseFieldInDoc() const
Definition: edfld.cxx:382
bool HasChildWindow(sal_uInt16)
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:335
#define FN_INSERT_FIELD
Definition: cmdid.h:200
void ToggleInsModeOnActiveSidebarWin()
Definition: PostItMgr.cxx:2393
static void FirePageChangeEvent(sal_uInt16 nOldPage, sal_uInt16 nNewPage)
Definition: crsrsh.cxx:435
bool IsCursorVisible() const
Definition: crsrsh.hxx:520
void DisableItem(sal_uInt16 nWhich)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
void EnterExtMode()
Definition: select.cxx:584
#define FN_SPELL_GRAMMAR_DIALOG
Definition: cmdid.h:603
Rect covering the pages area.
static void CalculateNonBlankPages(const SwRootFrame &rLayout, sal_uInt16 &nDocPageCount, sal_uInt16 &nActualPage)
Definition: doc.cxx:642
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void ToggleAddMode()
Definition: select.cxx:758
#define ERRCODE_NONE
#define FN_SET_BLOCK_MODE
Definition: cmdid.h:706
constexpr tools::Long Height() const
void SetValueSet(SvxZoomEnableFlags nValues)
unsigned char sal_uInt8
sal_uInt16 GetPhyPageNum() const
Definition: trvlfrm.cxx:1695
#define STR_SW_EVENT_PAGE_COUNT
Definition: swevent.hxx:27
void LockView(bool b)
Definition: viewsh.hxx:463
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:424
TOXTypes GetType() const
Definition: tox.hxx:722
#define FN_REDLINE_NEXT_CHANGE
Definition: cmdid.h:141
std::shared_ptr< const SfxFilter > GetFilter4FilterName(const OUString &rName, SfxFilterFlags nMust=SfxFilterFlags::NONE, SfxFilterFlags nDont=SFX_FILTER_NOTINSTALLED) const
virtual const_iterator_t getBookmarksBegin() const =0
returns a STL-like random access iterator to the begin of the sequence the IBookmarks.
virtual bool ReInitDlg(SwDocShell *pDocSh) override
Definition: redlndlg.cxx:71
RET_OK
... page will be formatted if required.
tools::Long AdjustWidth(tools::Long n)
void SetChildWindow(sal_uInt16 nId, bool bVisible, bool bSetFocus=true)
const char sDisplay[]
const INetURLObject & GetURLObject() const
OUString GetPassword() const
sal_uInt16 GetZoom() const
Definition: viewopt.hxx:505
void Execute(SfxRequest &)
Definition: view2.cxx:537
size_t IsObjSelected() const
Definition: feshview.cxx:1240
virtual short run()
virtual short run() override
Reference< XComponentContext > getProcessComponentContext()
const Point & GetPtPos() const
Definition: viscrs.hxx:141
#define FN_PAGEDOWN
Definition: cmdid.h:672
void SetOldGrfCat(const OUString &sStr)
Definition: view2.cxx:2766
bool HasNotes() const
Definition: PostItMgr.cxx:2094
#define FN_FORMAT_PAGE_DLG
Definition: cmdid.h:317
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
#define FN_SET_EXT_MODE
Definition: cmdid.h:674
Header, for PageFormats Client of FrameFormat describing the header.
Definition: fmthdft.hxx:33
bool GetCurAttr(SfxItemSet &, const bool bMergeIndentValuesOfNumRule=false) const
Definition: edattr.cxx:171
static OUString GetEventName(sal_Int32 nId)
Definition: docsh.cxx:1317
bool bColumnChange()
Definition: crsrsh.cxx:468
void ShowChildWindow(sal_uInt16, bool bVisible=true)
const char cSequenceMarkSeparator
Definition: swtypes.hxx:127
void SetFrameFormat(SwFrameFormat *pFormat, bool bKeepOrient=false, Point const *pDocPos=nullptr)
If frame then set frame style.
Definition: fefly1.cxx:1225
bool read(Graphic const &rGraphic)
const std::u16string_view aStringList[]
#define ERR_SWG_READ_ERROR
Definition: swerror.h:25
void InsFrameMode(sal_uInt16 nCols)
Definition: view2.cxx:2044
static SVL_DLLPUBLIC bool CompareHashPassword(const css::uno::Sequence< sal_Int8 > &rOldPassHash, const OUString &sNewPass)
sal_uInt32 GetValue() const
static GraphicFilter & GetGraphicFilter()
SAL_DLLPRIVATE bool InsertGraphicDlg(SfxRequest &)
Definition: view2.cxx:298
static SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
constexpr TypedWhichId< SwFormatFooter > RES_FOOTER(97)
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
void AppendItem(const SfxPoolItem &)
#define SAL_WARN(area, stream)
void rotate(Degree10 aRotation)
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
OUString getNum(sal_Int64 nNumber, sal_uInt16 nDecimals, bool bUseThousandSep=true, bool bTrailingZeros=true) const
size_t size() const
const SdrHdlList & GetHdlList() const
bool IsAddMode() const
Definition: wrtsh.hxx:159
void EnableMailMerge()
Definition: view2.cxx:2544
SvxZoomType
#define SW_LEAVE_FRAME
Definition: fesh.hxx:167
virtual bool ImportFrom(SfxMedium &rMedium, css::uno::Reference< css::text::XTextRange > const &xInsertPosition)
void SetOldTabCat(const OUString &sStr)
Definition: view2.cxx:2776
sal_uInt16 GetPageNumber(const Point &rPoint) const
Page number of the page containing Point, O if no page.
Definition: fews.cxx:185
virtual VclPtr< VclAbstractDialog > CreateVclSwViewDialog(SwView &rView)=0
SectionType GetType() const
Definition: section.hxx:170
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:120
sal_uLong nWord
Definition: docstat.hxx:35
static css::uno::Reference< css::text::XTextRange > CreateXTextRange(SwDoc &rDoc, const SwPosition &rPos, const SwPosition *const pMark)
Definition: unoobj2.cxx:1214
int GetCurrentParaOutlineLevel() const
Get Outline level of current paragraph.
Definition: ednumber.cxx:402
const SwFormatPageDesc & GetPageDesc(bool=true) const
Definition: fmtpdsc.hxx:78
virtual const SwRedlineTable & GetRedlineTable() const =0
Point m_MarkPt
Definition: viscrs.hxx:119
bool ShowNotes() const
Definition: PostItMgr.cxx:2088
const SwFrameFormats * GetFrameFormats() const
Definition: doc.hxx:738
SfxFilterContainer * GetFilterContainer() const
virtual void SetRedlinePassword(const css::uno::Sequence< sal_Int8 > &rNewPassword)=0
static FlyMode GetFrameMode()
Definition: basesh.hxx:114
void Init(sal_uInt16 nNumCols, sal_uInt16 nGutterWidth, sal_uInt16 nAct)
This function allows to (repeatedly) initialize the columns.
Definition: atrfrm.cxx:969
void EnterAddMode()
Definition: select.cxx:626
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1525
#define FN_ESCAPE
Definition: cmdid.h:675
constexpr OUStringLiteral first
#define FN_REDLINE_SHOW
Definition: cmdid.h:122
#define FN_INSERT_MULTI_TOX
Definition: cmdid.h:283
void Ignore()
#define FN_REDLINE_REJECT_DIRECT
Definition: cmdid.h:138
void ExecuteFormLetter(SwWrtShell &rSh, const css::uno::Sequence< css::beans::PropertyValue > &rProperties)
Definition: dbmgr.cxx:2913
static constexpr size_type npos
Definition: docary.hxx:224
OUString const & GetName() const
bool IsAuto() const
Query / set AutoFormat-flag.
Definition: format.hxx:162
OUString sCommand
Definition: swdbdata.hxx:31
#define FN_REDLINE_ACCEPT
Definition: cmdid.h:130
aStr
bool IsFrameSelected() const
Definition: feshview.cxx:1248
sal_uInt16 GetViewLayoutColumns() const
Definition: viewopt.hxx:481
void SetOldDrwCat(const OUString &sStr)
Definition: view2.cxx:2796
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, bool bMobile=false)
no RedlineFlags
bool IsOutlineRule() const
Definition: numrule.hxx:242
static void lcl_SetAllTextToDefaultLanguage(SwWrtShell &rWrtSh, sal_uInt16 nWhichId)
Definition: view2.cxx:166
Definition: view.hxx:144
virtual VclPtr< AbstractSvxZoomDialog > CreateSvxZoomDialog(weld::Window *pParent, const SfxItemSet &rCoreSet)=0
sal_uInt16 nPos
OUString SfxResId(TranslateId aId)
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
sal_uInt16 GetGapBetweenPages() const
Definition: viewopt.hxx:457
void ToggleExtMode()
Definition: select.cxx:770
void UnlockPaint(bool bVirDev=false)
Definition: viewsh.hxx:608
#define FN_GOTO_PAGE
Definition: cmdid.h:508
const OUString & GetTOXName() const
Definition: tox.hxx:481
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:856
SdrHdlKind GetKind() const
void EndAction(const bool bIdleEnd=false)
Definition: crsrsh.cxx:243
SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const &rTheBaseURIRef, OUString const &rTheRelURIRef, Link< OUString *, bool > const &rMaybeFileHdl=Link< OUString *, bool >(), bool bCheckFileExists=true, bool bIgnoreFragment=false, INetURLObject::EncodeMechanism eEncodeMechanism=INetURLObject::EncodeMechanism::WasEncoded, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
Base class of the Writer document model elements.
Definition: node.hxx:81
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo
SfxMedium * GetMedium() const
css::uno::Any SAL_CALL makeAny(const SharedUNOComponent< INTERFACE, COMPONENT > &value)