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