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