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