LibreOffice Module sw (master)  1
view.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <config_features.h>
21 
22 #include <stdlib.h>
23 #include <hintids.hxx>
24 #include <comphelper/string.hxx>
25 #include <o3tl/any.hxx>
26 #include <officecfg/Office/Common.hxx>
27 #include <vcl/graph.hxx>
28 #include <vcl/inputctx.hxx>
29 #include <svl/eitem.hxx>
30 #include <unotools/configmgr.hxx>
31 #include <unotools/lingucfg.hxx>
32 #include <unotools/useroptions.hxx>
33 #include <sfx2/dispatch.hxx>
34 #include <sfx2/docfile.hxx>
35 #include <sfx2/objface.hxx>
36 #include <sfx2/request.hxx>
37 #include <svx/ruler.hxx>
38 #include <svx/srchdlg.hxx>
39 #include <svx/fmshell.hxx>
40 #include <svx/extrusionbar.hxx>
41 #include <svx/fontworkbar.hxx>
42 #include <svx/fmview.hxx>
43 #include <unotxvw.hxx>
44 #include <cmdid.h>
45 #include <svl/hint.hxx>
46 #include <swmodule.hxx>
47 #include <inputwin.hxx>
48 #include <uivwimp.hxx>
49 #include <edtwin.hxx>
50 #include <textsh.hxx>
51 #include <listsh.hxx>
52 #include <tabsh.hxx>
53 #include <grfsh.hxx>
54 #include <mediash.hxx>
55 #include <docsh.hxx>
56 #include <frmsh.hxx>
57 #include <olesh.hxx>
58 #include <drawsh.hxx>
59 #include <drawbase.hxx>
60 #include <drformsh.hxx>
61 #include <drwtxtsh.hxx>
62 #include <beziersh.hxx>
63 #include <navsh.hxx>
64 #include <globdoc.hxx>
65 #include <scroll.hxx>
66 #include <gloshdl.hxx>
67 #include <usrpref.hxx>
68 #include <srcview.hxx>
69 #include <doc.hxx>
70 #include <IDocumentUndoRedo.hxx>
74 #include <IDocumentState.hxx>
76 #include <drawdoc.hxx>
77 #include <wdocsh.hxx>
78 #include <wrtsh.hxx>
79 #include <barcfg.hxx>
80 #include <pview.hxx>
81 #include <swdtflvr.hxx>
82 #include <prtopt.hxx>
83 #include <com/sun/star/frame/FrameSearchFlag.hpp>
84 #include <com/sun/star/frame/XLayoutManager.hpp>
85 #include <com/sun/star/scanner/ScannerContext.hpp>
86 #include <com/sun/star/scanner/XScannerManager2.hpp>
88 #include <sal/log.hxx>
89 
90 #include <formatclipboard.hxx>
91 #include <PostItMgr.hxx>
92 #include <annotsh.hxx>
93 #include <swruler.hxx>
94 
95 #include <com/sun/star/document/XDocumentProperties.hpp>
96 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
97 
99 #include <sfx2/lokhelper.hxx>
100 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
101 #include <svtools/embedhlp.hxx>
102 #include <tools/UnitConversion.hxx>
103 
104 using namespace ::com::sun::star;
105 using namespace ::com::sun::star::uno;
106 using namespace ::com::sun::star::lang;
107 using namespace ::com::sun::star::scanner;
108 
109 #define SWVIEWFLAGS SfxViewShellFlags::HAS_PRINTOPTIONS
110 
111 // Statics. OMG.
112 
113 bool bDocSzUpdated = true;
114 
116 
117 bool SwView::s_bExtra = false;
118 bool SwView::s_bFound = false;
119 bool SwView::s_bJustOpened = false;
120 
121 std::unique_ptr<SearchAttrItemList> SwView::s_xSearchList;
122 std::unique_ptr<SearchAttrItemList> SwView::s_xReplaceList;
123 
125 {
126  return *GetViewFrame()->GetDispatcher();
127 }
128 
130 {
131  bool bResetVerbs = m_bVerbsActive;
132  if ( !GetViewFrame()->GetFrame().IsInPlace() &&
134  {
135  if ( m_pWrtShell->IsSelObjProtected(FlyProtectFlags::Content) == FlyProtectFlags::NONE )
136  {
137  if ( nSelType & SelectionType::Ole )
138  {
139  SetVerbs( GetWrtShell().GetOLEObject()->getSupportedVerbs() );
140  m_bVerbsActive = true;
141  bResetVerbs = false;
142  }
143  }
144  }
145  if ( bResetVerbs )
146  {
147  SetVerbs( Sequence< embed::VerbDescriptor >() );
148  m_bVerbsActive = false;
149  }
150 }
151 
152 // Called by the SwEditWin when it gets the focus.
153 
154 void SwView::GotFocus() const
155 {
156  // if we got the focus, and the form shell *is* on the top of the dispatcher
157  // stack, then we need to rebuild the stack (the form shell doesn't belong to
158  // the top then)
159  const SfxDispatcher& rDispatcher = const_cast< SwView* >( this )->GetDispatcher();
160  SfxShell* pTopShell = rDispatcher.GetShell( 0 );
161  FmFormShell* pAsFormShell = dynamic_cast<FmFormShell*>( pTopShell );
162  if ( pAsFormShell )
163  {
164  pAsFormShell->ForgetActiveControl();
165  const_cast< SwView* >( this )->AttrChangedNotify(nullptr);
166  }
167  else if ( m_pPostItMgr )
168  {
169  SwAnnotationShell* pAsAnnotationShell = dynamic_cast<SwAnnotationShell*>( pTopShell );
170  if ( pAsAnnotationShell )
171  {
172  m_pPostItMgr->SetActiveSidebarWin(nullptr);
173  const_cast< SwView* >( this )->AttrChangedNotify(nullptr);
174  }
175  }
176  if( GetWrtShellPtr() )
177  {
178  SwWrtShell& rWrtShell = GetWrtShell();
181  rWrtShell.GetViewOptions()->getBrowseMode() );
182  }
183 }
184 
185 // called by the FormShell when a form control is focused. This is
186 // a request to put the form shell on the top of the dispatcher stack
187 
188 IMPL_LINK_NOARG(SwView, FormControlActivated, LinkParamNone*, void)
189 {
190  // if a form control has been activated, and the form shell is not on the top
191  // of the dispatcher stack, then we need to activate it
192  const SfxDispatcher& rDispatcher = GetDispatcher();
193  const SfxShell* pTopShell = rDispatcher.GetShell( 0 );
194  const FmFormShell* pAsFormShell = dynamic_cast<const FmFormShell*>( pTopShell );
195  if ( !pAsFormShell )
196  {
197  // if we're editing text currently, cancel this
198  SdrView *pSdrView = m_pWrtShell ? m_pWrtShell->GetDrawView() : nullptr;
199  if ( pSdrView && pSdrView->IsTextEdit() )
200  pSdrView->SdrEndTextEdit( true );
201 
202  AttrChangedNotify(nullptr);
203  }
204 }
205 
206 namespace
207 {
208 uno::Reference<frame::XLayoutManager> getLayoutManager(const SfxViewFrame& rViewFrame)
209 {
210  uno::Reference<frame::XLayoutManager> xLayoutManager;
211  uno::Reference<beans::XPropertySet> xPropSet(rViewFrame.GetFrame().GetFrameInterface(),
212  uno::UNO_QUERY);
213  if (xPropSet.is())
214  {
215  try
216  {
217  xLayoutManager.set(xPropSet->getPropertyValue("LayoutManager"), uno::UNO_QUERY);
218  }
219  catch (const Exception& e)
220  {
221  SAL_WARN("sw.ui", "Failure getting layout manager: " + e.Message);
222  }
223  }
224  return xLayoutManager;
225 }
226 }
227 
228 void SwView::ShowUIElement(const OUString& sElementURL) const
229 {
230  if (auto xLayoutManager = getLayoutManager(*GetViewFrame()))
231  {
232  if (!xLayoutManager->getElement(sElementURL).is())
233  {
234  xLayoutManager->createElement(sElementURL);
235  xLayoutManager->showElement(sElementURL);
236  }
237  }
238 }
239 
241 {
242  // Attention: Maintain the SelectShell for the WebView additionally
243 
244  if(m_bInDtor)
245  return;
246 
247  // Decision if the UpdateTable has to be called
248  bool bUpdateTable = false;
249  const SwFrameFormat* pCurTableFormat = m_pWrtShell->GetTableFormat();
250  if(pCurTableFormat && pCurTableFormat != m_pLastTableFormat)
251  {
252  bUpdateTable = true; // can only be executed later
253  }
254  m_pLastTableFormat = pCurTableFormat;
255 
256  //SEL_TBL and SEL_TBL_CELLS can be ORed!
257  SelectionType nNewSelectionType = m_pWrtShell->GetSelectionType()
259 
261  nNewSelectionType |= SelectionType::FormControl;
262 
263  if ( nNewSelectionType == m_nSelectionType )
264  {
265  GetViewFrame()->GetBindings().InvalidateAll( false );
268  // For graphs and OLE the verb can be modified of course!
269  ImpSetVerb( nNewSelectionType );
270  }
271  else
272  {
273 
274  SfxDispatcher &rDispatcher = GetDispatcher();
275  SwToolbarConfigItem *pBarCfg = SW_MOD()->GetToolbarConfig();
276 
277  if ( m_pShell )
278  {
279  rDispatcher.Flush(); // Really erase all cached shells
280  //Remember to the old selection which toolbar was visible
281  ToolbarId eId = rDispatcher.GetObjectBarId(SFX_OBJECTBAR_OBJECT);
282  if (eId != ToolbarId::None)
283  pBarCfg->SetTopToolbar(m_nSelectionType, eId);
284 
285  for ( sal_uInt16 i = 0; true; ++i )
286  {
287  SfxShell *pSfxShell = rDispatcher.GetShell( i );
288  if ( dynamic_cast< const SwBaseShell *>( pSfxShell ) != nullptr
289  || dynamic_cast< const SwDrawTextShell *>( pSfxShell ) != nullptr
290  || dynamic_cast< const svx::ExtrusionBar*>( pSfxShell ) != nullptr
291  || dynamic_cast< const svx::FontworkBar*>( pSfxShell ) != nullptr
292  || dynamic_cast< const SwAnnotationShell *>( pSfxShell ) != nullptr
293  )
294  {
295  rDispatcher.Pop( *pSfxShell, SfxDispatcherPopFlags::POP_DELETE );
296  }
297  else if ( dynamic_cast< const FmFormShell *>( pSfxShell ) != nullptr )
298  {
299  rDispatcher.Pop( *pSfxShell );
300  }
301  else
302  break;
303  }
304  }
305 
306  bool bInitFormShell = false;
307  if (!m_pFormShell)
308  {
309  bInitFormShell = true;
310  m_pFormShell = new FmFormShell( this );
311  m_pFormShell->SetControlActivationHandler( LINK( this, SwView, FormControlActivated ) );
313  }
314 
315  bool bSetExtInpCntxt = false;
316  m_nSelectionType = nNewSelectionType;
317  ShellMode eShellMode;
318 
320  rDispatcher.Push( *m_pFormShell );
321 
322  m_pShell = new SwNavigationShell( *this );
323  rDispatcher.Push( *m_pShell );
324 
326  {
327  eShellMode = ShellMode::Object;
328  m_pShell = new SwOleShell( *this );
329  rDispatcher.Push( *m_pShell );
330  }
333  {
334  eShellMode = ShellMode::Frame;
335  m_pShell = new SwFrameShell( *this );
336  rDispatcher.Push( *m_pShell );
337  if(m_nSelectionType & SelectionType::Graphic )
338  {
339  eShellMode = ShellMode::Graphic;
340  m_pShell = new SwGrfShell( *this );
341  rDispatcher.Push( *m_pShell );
342  }
343  }
345  {
346  eShellMode = ShellMode::Draw;
347  m_pShell = new SwDrawShell( *this );
348  rDispatcher.Push( *m_pShell );
349 
351  {
352  eShellMode = ShellMode::Bezier;
353  m_pShell = new SwBezierShell( *this );
354  rDispatcher.Push( *m_pShell );
355  }
356 #if HAVE_FEATURE_AVMEDIA
358  {
359  eShellMode = ShellMode::Media;
360  m_pShell = new SwMediaShell( *this );
361  rDispatcher.Push( *m_pShell );
362  }
363 #endif
365  {
366  eShellMode = ShellMode::ExtrudedCustomShape;
367  m_pShell = new svx::ExtrusionBar(this);
368  rDispatcher.Push( *m_pShell );
369  }
371  {
372  eShellMode = ShellMode::FontWork;
373  m_pShell = new svx::FontworkBar(this);
374  rDispatcher.Push( *m_pShell );
375  }
376  }
378  {
379  eShellMode = ShellMode::DrawForm;
380  m_pShell = new SwDrawFormShell( *this );
381 
382  rDispatcher.Push( *m_pShell );
383  }
385  {
386  bSetExtInpCntxt = true;
387  eShellMode = ShellMode::DrawText;
388  rDispatcher.Push( *(new SwBaseShell( *this )) );
389  m_pShell = new SwDrawTextShell( *this );
390  rDispatcher.Push( *m_pShell );
391  }
393  {
394  eShellMode = ShellMode::PostIt;
395  m_pShell = new SwAnnotationShell( *this );
396  rDispatcher.Push( *m_pShell );
397  }
398  else
399  {
400  bSetExtInpCntxt = true;
401  eShellMode = ShellMode::Text;
403  {
404  eShellMode = ShellMode::ListText;
405  m_pShell = new SwListShell( *this );
406  rDispatcher.Push( *m_pShell );
407  }
408  m_pShell = new SwTextShell(*this);
409  rDispatcher.Push( *m_pShell );
411  {
412  eShellMode = eShellMode == ShellMode::ListText ? ShellMode::TableListText
414  m_pShell = new SwTableShell( *this );
415  rDispatcher.Push( *m_pShell );
416  }
417  }
418 
419  if ( m_nSelectionType & SelectionType::FormControl )
420  rDispatcher.Push( *m_pFormShell );
421 
422  m_pViewImpl->SetShellMode(eShellMode);
424 
425  if( !GetDocShell()->IsReadOnly() )
426  {
427  if( bSetExtInpCntxt && GetWrtShell().HasReadonlySel() )
428  bSetExtInpCntxt = false;
429 
430  InputContext aCntxt( GetEditWin().GetInputContext() );
431  aCntxt.SetOptions( bSetExtInpCntxt
432  ? (aCntxt.GetOptions() |
433  ( InputContextFlags::Text |
434  InputContextFlags::ExtText ))
435  : (aCntxt.GetOptions() & ~
436  InputContextFlags( InputContextFlags::Text |
437  InputContextFlags::ExtText )) );
438  GetEditWin().SetInputContext( aCntxt );
439  }
440 
441  // Show Mail Merge toolbar initially for documents with Database fields
442  if (!m_bInitOnceCompleted && GetWrtShell().IsAnyDatabaseFieldInDoc())
443  ShowUIElement("private:resource/toolbar/mailmerge");
444 
445  // Activate the toolbar to the new selection which also was active last time.
446  // Before a flush () must be, but does not affect the UI according to MBA and
447  // is not a performance problem.
448  // TODO/LATER: maybe now the Flush() command is superfluous?!
449  rDispatcher.Flush();
450 
451  Point aPnt = GetEditWin().OutputToScreenPixel(GetEditWin().GetPointerPosPixel());
452  aPnt = GetEditWin().PixelToLogic(aPnt);
453  GetEditWin().UpdatePointer(aPnt);
454 
455  SdrView* pDView = GetWrtShell().GetDrawView();
456  if ( bInitFormShell && pDView )
457  m_pFormShell->SetView(dynamic_cast<FmFormView*>( pDView) );
458 
459  }
460  // Opportune time for the communication with OLE objects?
461  if ( GetDocShell()->GetDoc()->IsOLEPrtNotifyPending() )
462  GetDocShell()->GetDoc()->PrtOLENotify( false );
463 
464  // now the table-update
465  if(bUpdateTable)
466  m_pWrtShell->UpdateTable();
467 
469 
470  m_bInitOnceCompleted = true;
471 }
472 
473 // Interaction: AttrChangedNotify() and TimeoutHdl.
474 // No Update if actions are still open, since the cursor on the core side
475 // can be somewhere in no man's land.
476 // But since we can no longer supply status and we want instead lock
477 // the dispatcher.
478 
479 extern "C"
480 {
481  static int lcl_CmpIds( const void *pFirst, const void *pSecond)
482  {
483  return *static_cast<sal_uInt16 const *>(pFirst) - *static_cast<sal_uInt16 const *>(pSecond);
484  }
485 }
486 
487 IMPL_LINK_NOARG(SwView, AttrChangedNotify, LinkParamNone*, void)
488 {
489  if ( GetEditWin().IsChainMode() )
490  GetEditWin().SetChainMode( false );
491 
492  //Opt: Not if PaintLocked. During unlock a notify will be once more triggered.
493  if( !m_pWrtShell->IsPaintLocked() && !g_bNoInterrupt &&
494  GetDocShell()->IsReadOnly() )
495  CheckReadonlyState();
496 
497  if( !m_pWrtShell->IsPaintLocked() && !g_bNoInterrupt )
498  CheckReadonlySelection();
499 
500  if( !m_bAttrChgNotified )
501  {
502  if (m_pWrtShell->ActionPend() || g_bNoInterrupt ||
503  GetDispatcher().IsLocked() || //do not confuse the SFX
504  GetViewFrame()->GetBindings().IsInUpdate() )//do not confuse the SFX
505  {
506  m_bAttrChgNotified = true;
507  m_aTimer.Start();
508 
509  const SfxPoolItem *pItem;
510  if ( SfxItemState::SET != GetObjectShell()->GetMedium()->GetItemSet()->
511  GetItemState( SID_HIDDEN, false, &pItem ) ||
512  !static_cast<const SfxBoolItem*>(pItem)->GetValue() )
513  {
514  GetViewFrame()->GetBindings().ENTERREGISTRATIONS();
515  m_bAttrChgNotifiedWithRegistrations = true;
516  }
517 
518  }
519  else
520  SelectShell();
521 
522  }
523 
524  // change ui if cursor is at a SwPostItField
525  if (m_pPostItMgr)
526  {
527  // only perform the code that is needed to determine, if at the
528  // actual cursor position is a post-it field
529  m_pPostItMgr->SetShadowState( m_pWrtShell->GetPostItFieldAtCursor() );
530  }
531 }
532 
533 IMPL_LINK_NOARG(SwView, TimeoutHdl, Timer *, void)
534 {
535  if (m_pWrtShell->ActionPend() || g_bNoInterrupt)
536  {
537  m_aTimer.Start();
538  return;
539  }
540 
541  if ( m_bAttrChgNotifiedWithRegistrations )
542  {
543  GetViewFrame()->GetBindings().LEAVEREGISTRATIONS();
544  m_bAttrChgNotifiedWithRegistrations = false;
545  }
546 
547  CheckReadonlyState();
548  CheckReadonlySelection();
549 
550  bool bOldUndo = m_pWrtShell->DoesUndo();
551  m_pWrtShell->DoUndo( false );
552  SelectShell();
553  m_pWrtShell->DoUndo( bOldUndo );
554  m_bAttrChgNotified = false;
555  GetViewImpl()->GetUNOObject_Impl()->NotifySelChanged();
556 }
557 
559 {
560  SfxDispatcher &rDis = GetDispatcher();
561  // To be able to recognize if it is already disabled!
562  SfxItemState eStateRO, eStateProtAll;
563  const SfxPoolItem *pItem;
564  // Query the status from a slot which is only known to us.
565  // Otherwise the slot is known from other; like the BasicIde
566  eStateRO = rDis.QueryState( FN_INSERT_BOOKMARK, pItem );
567  eStateProtAll = rDis.QueryState( FN_EDIT_REGION, pItem );
568  bool bChgd = false;
569 
570  if ( !m_pWrtShell->IsCursorReadonly() )
571  {
572  static sal_uInt16 aROIds[] =
573  {
574  SID_DELETE, FN_BACKSPACE, FN_SHIFT_BACKSPACE,
575  SID_UNDO,
576  SID_REDO, SID_REPEAT, SID_PASTE,
577  SID_PASTE_UNFORMATTED, FN_PASTE_NESTED_TABLE, FN_TABLE_PASTE_ROW_BEFORE,
578  FN_TABLE_PASTE_COL_BEFORE, SID_PASTE_SPECIAL, SID_SBA_BRW_INSERT,
579  SID_BACKGROUND_COLOR, FN_INSERT_BOOKMARK, SID_CHARMAP_CONTROL,
580  SID_CHARMAP, SID_EMOJI_CONTROL, FN_INSERT_SOFT_HYPHEN,
581  FN_INSERT_HARDHYPHEN, FN_INSERT_HARD_SPACE, FN_INSERT_NNBSP,
587  FN_CALCULATE, FN_FORMAT_RESET,
588  FN_POSTIT, FN_JAVAEDIT, SID_ATTR_PARA_ADJUST_LEFT,
589  SID_ATTR_PARA_ADJUST_RIGHT, SID_ATTR_PARA_ADJUST_CENTER,SID_ATTR_PARA_ADJUST_BLOCK,
590  SID_ATTR_PARA_LINESPACE_10, SID_ATTR_PARA_LINESPACE_15, SID_ATTR_PARA_LINESPACE_20,
591  SID_ATTR_CHAR_FONT, SID_ATTR_CHAR_FONTHEIGHT, SID_ATTR_CHAR_COLOR_BACKGROUND,
592  SID_ATTR_CHAR_COLOR_BACKGROUND_EXT, SID_ATTR_CHAR_COLOR_EXT,
593  SID_ATTR_CHAR_COLOR, SID_ATTR_CHAR_WEIGHT, SID_ATTR_CHAR_POSTURE,
594  SID_ATTR_CHAR_OVERLINE,
595  SID_ATTR_CHAR_UNDERLINE, SID_ATTR_FLASH, SID_ATTR_CHAR_STRIKEOUT,
596  SID_ULINE_VAL_SINGLE, SID_ULINE_VAL_DOUBLE, SID_ULINE_VAL_DOTTED,
597  SID_ATTR_CHAR_CONTOUR, SID_ATTR_CHAR_SHADOWED,
598  SID_ATTR_CHAR_AUTOKERN, SID_ATTR_CHAR_ESCAPEMENT, FN_SET_SUPER_SCRIPT,
599  FN_SET_SUB_SCRIPT, SID_ATTR_CHAR_CASEMAP, SID_ATTR_CHAR_LANGUAGE,
600  SID_ATTR_CHAR_KERNING, SID_CHAR_DLG, SID_ATTR_CHAR_WORDLINEMODE,
602  FN_FORMAT_DROPCAPS, SID_ATTR_PARA_ADJUST, SID_ATTR_PARA_LINESPACE,
603  SID_ATTR_PARA_SPLIT, SID_ATTR_PARA_KEEP, SID_ATTR_PARA_WIDOWS,
604  SID_ATTR_PARA_ORPHANS,
605  SID_ATTR_PARA_MODEL, SID_PARA_DLG,
606  FN_SELECT_PARA, SID_DEC_INDENT,
607  SID_INC_INDENT
608  };
609  static bool bFirst = true;
610  if ( bFirst )
611  {
612  qsort( static_cast<void*>(aROIds), SAL_N_ELEMENTS(aROIds), sizeof(sal_uInt16), lcl_CmpIds );
613  bFirst = false;
614  }
615  if ( SfxItemState::DISABLED == eStateRO )
616  {
617  rDis.SetSlotFilter( SfxSlotFilterState::ENABLED_READONLY, aROIds );
618  bChgd = true;
619  }
620  }
621  else if( m_pWrtShell->IsAllProtect() )
622  {
623  if ( SfxItemState::DISABLED == eStateProtAll )
624  {
625  static sal_uInt16 aAllProtIds[] = { SID_SAVEDOC, FN_EDIT_REGION };
626  static bool bAllProtFirst = true;
627  if ( bAllProtFirst )
628  {
629  qsort( static_cast<void*>(aAllProtIds), SAL_N_ELEMENTS(aAllProtIds), sizeof(sal_uInt16), lcl_CmpIds );
630  bAllProtFirst = false;
631  }
632  rDis.SetSlotFilter( SfxSlotFilterState::ENABLED_READONLY, aAllProtIds );
633  bChgd = true;
634  }
635  }
636  else if ( SfxItemState::DISABLED != eStateRO ||
637  SfxItemState::DISABLED != eStateProtAll )
638  {
639  bChgd = true;
640  rDis.SetSlotFilter();
641  }
642  if ( bChgd )
644 }
645 
647 {
648  SfxDisableFlags nDisableFlags = SfxDisableFlags::NONE;
649  SfxDispatcher &rDis = GetDispatcher();
650 
651  if( m_pWrtShell->HasReadonlySel() &&
652  ( !m_pWrtShell->GetDrawView() ||
653  !m_pWrtShell->GetDrawView()->GetMarkedObjectList().GetMarkCount() ))
654  nDisableFlags |= SfxDisableFlags::SwOnProtectedCursor;
655 
656  if( (SfxDisableFlags::SwOnProtectedCursor & nDisableFlags ) !=
657  (SfxDisableFlags::SwOnProtectedCursor & rDis.GetDisableFlags() ) )
658  {
659  // Additionally move at the Window the InputContext, so that
660  // in japanese / chinese versions the external input will be
661  // turned on or off. This but only if the correct shell is on
662  // the stack.
663  switch( m_pViewImpl->GetShellMode() )
664  {
665  case ShellMode::Text:
666  case ShellMode::ListText:
669  {
670 // Temporary solution!!! Should set the font of the current insertion point
671 // at each cursor movement, so outside of this "if". But TH does not
672 // evaluates the font at this time and the "purchase" appears to me
673 // as too expensive.
674 // Moreover, we don't have a font, but only attributes from which the
675 // text formatting and the correct font will be build together.
676 
677  InputContext aCntxt( GetEditWin().GetInputContext() );
678  aCntxt.SetOptions( SfxDisableFlags::SwOnProtectedCursor & nDisableFlags
679  ? (aCntxt.GetOptions() & ~
680  InputContextFlags( InputContextFlags::Text |
681  InputContextFlags::ExtText ))
682  : (aCntxt.GetOptions() |
683  ( InputContextFlags::Text |
684  InputContextFlags::ExtText )) );
685  GetEditWin().SetInputContext( aCntxt );
686  }
687  break;
688  default:
689  ;
690  }
691 
692  }
693 
694  if( nDisableFlags != rDis.GetDisableFlags() )
695  {
696  rDis.SetDisableFlags( nDisableFlags );
698  }
699 }
700 
702  : SfxViewShell( _pFrame, SWVIEWFLAGS ),
703  m_nNewPage(USHRT_MAX),
704  m_nOldPageNum(0),
705  m_pNumRuleNodeFromDoc(nullptr),
706  m_pEditWin( VclPtr<SwEditWin>::Create( &_pFrame->GetWindow(), *this ) ),
707  m_pShell(nullptr),
708  m_pFormShell(nullptr),
709  m_pHScrollbar(nullptr),
710  m_pVScrollbar(nullptr),
711  m_pScrollFill(VclPtr<ScrollBarBox>::Create( &_pFrame->GetWindow(), WB_SIZEABLE )),
712  m_pVRuler(VclPtr<SvxRuler>::Create(&GetViewFrame()->GetWindow(), m_pEditWin,
715  GetViewFrame()->GetBindings(),
717  m_pLastTableFormat(nullptr),
718  m_pFormatClipboard(new SwFormatClipboard()),
719  m_nSelectionType( SelectionType::All ),
720  m_nPageCnt(0),
721  m_nDrawSfxId( USHRT_MAX ),
722  m_nFormSfxId( USHRT_MAX ),
723  m_nLastPasteDestination( static_cast<SotExchangeDest>(0xFFFF) ),
724  m_nLeftBorderDistance( 0 ),
725  m_nRightBorderDistance( 0 ),
726  m_eLastSearchCommand( static_cast<SvxSearchCmd>(0xFFFF) ),
727  m_bWheelScrollInProgress(false),
728  m_bCenterCursor(false),
729  m_bTopCursor(false),
730  m_bTabColFromDoc(false),
731  m_bTabRowFromDoc(false),
732  m_bSetTabColFromDoc(false),
733  m_bSetTabRowFromDoc(false),
734  m_bAttrChgNotified(false),
735  m_bAttrChgNotifiedWithRegistrations(false),
736  m_bVerbsActive(false),
737  m_bDrawRotate(false),
738  m_bDrawSelMode(true),
739  m_bShowAtResize(true),
740  m_bInOuterResizePixel(false),
741  m_bInInnerResizePixel(false),
742  m_bPasteState(false),
743  m_bPasteSpecialState(false),
744  m_bInMailMerge(false),
745  m_bInDtor(false),
746  m_bOldShellWasPagePreview(false),
747  m_bIsPreviewDoubleClick(false),
748  m_bMakeSelectionVisible(false),
749  m_nLOKPageUpDownOffset(0)
750 {
751  static bool bRequestDoubleBuffering = getenv("VCL_DOUBLEBUFFERING_ENABLE");
752  if (bRequestDoubleBuffering)
754 
755  // According to discussion with MBA and further
756  // investigations, no old SfxViewShell will be set as parameter <pOldSh>,
757  // if function "New Window" is performed to open an additional view beside
758  // an already existing one.
759  // If the view is switch from one to another, the 'old' view is given by
760  // parameter <pOldSh>.
761 
762  bDocSzUpdated = true;
763 
764  CreateScrollbar( true );
765  CreateScrollbar( false );
766 
767  m_pViewImpl.reset(new SwView_Impl(this));
768  SetName("View");
770 
771  m_aTimer.SetTimeout( 120 );
772 
773  SwDocShell& rDocSh = dynamic_cast<SwDocShell&>(*_pFrame->GetObjectShell());
774  bool bOldModifyFlag = rDocSh.IsEnableSetModified();
775  if (bOldModifyFlag)
776  rDocSh.EnableSetModified( false );
777  // HACK: SwDocShell has some cached font info, VCL informs about font updates,
778  // but loading of docs with embedded fonts happens after SwDocShell is created
779  // but before SwEditWin (which handles the VCL event) is created. So update
780  // manually.
782  rDocSh.UpdateFontList();
783  bool bWebDShell = dynamic_cast<const SwWebDocShell*>(&rDocSh) != nullptr;
784 
785  const SwMasterUsrPref *pUsrPref = SW_MOD()->GetUsrPref(bWebDShell);
786  SwViewOption aUsrPref( *pUsrPref);
787 
789  SvtLinguOptions aLinguOpt;
790  SvtLinguConfig().GetOptions( aLinguOpt );
791  aUsrPref.SetOnlineSpell( aLinguOpt.bIsSpellAuto );
792 
793  bool bOldShellWasSrcView = false;
794 
795  // determine if there is an existing view for
796  // document
797  SfxViewShell* pExistingSh = nullptr;
798  if ( pOldSh )
799  {
800  pExistingSh = pOldSh;
801  // determine type of existing view
802  if (SwPagePreview* pPagePreview = dynamic_cast<SwPagePreview *>(pExistingSh))
803  {
804  m_sSwViewData = pPagePreview->GetPrevSwViewData();
805  m_sNewCursorPos = pPagePreview->GetNewCursorPos();
806  m_nNewPage = pPagePreview->GetNewPage();
809  }
810  else if (dynamic_cast<const SwSrcView *>(pExistingSh) != nullptr)
811  bOldShellWasSrcView = true;
812  }
813 
814  SAL_INFO( "sw.ui", "before create WrtShell" );
815  if (SwView *pView = dynamic_cast<SwView*>(pExistingSh))
816  {
817  m_pWrtShell.reset(new SwWrtShell(*pView->m_pWrtShell, m_pEditWin, *this));
818  }
819  else if (SwWrtShell *pWrtShell = dynamic_cast<SwWrtShell*>(rDocSh.GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell()))
820  {
821  m_pWrtShell.reset(new SwWrtShell(*pWrtShell, m_pEditWin, *this));
822  }
823  else
824  {
825  SwDoc& rDoc = *rDocSh.GetDoc();
826 
827  if( !bOldShellWasSrcView && bWebDShell && !m_bOldShellWasPagePreview )
828  aUsrPref.setBrowseMode( true );
829  else
831 
832  //For the BrowseMode we do not assume a factor.
833  if( aUsrPref.getBrowseMode() && aUsrPref.GetZoomType() != SvxZoomType::PERCENT )
834  {
835  aUsrPref.SetZoomType( SvxZoomType::PERCENT );
836  aUsrPref.SetZoom( 100 );
837  }
838  if (rDocSh.IsPreview())
839  {
840  aUsrPref.SetZoomType( SvxZoomType::WHOLEPAGE );
841  aUsrPref.SetViewLayoutBookMode( false );
842  aUsrPref.SetViewLayoutColumns( 1 );
843  }
844  m_pWrtShell.reset(new SwWrtShell(rDoc, m_pEditWin, *this, &aUsrPref));
845  // creating an SwView from a SwPagePreview needs to
846  // add the SwViewShell to the ring of the other SwViewShell(s)
848  {
849  SwViewShell& rPreviewViewShell = *static_cast<SwPagePreview*>(pExistingSh)->GetViewShell();
850  m_pWrtShell->MoveTo(&rPreviewViewShell);
851  // to update the field command et.al. if necessary
852  const SwViewOption* pPreviewOpt = rPreviewViewShell.GetViewOptions();
853  if( pPreviewOpt->IsFieldName() != aUsrPref.IsFieldName() ||
854  pPreviewOpt->IsShowHiddenField() != aUsrPref.IsShowHiddenField() ||
855  pPreviewOpt->IsShowHiddenPara() != aUsrPref.IsShowHiddenPara() ||
856  pPreviewOpt->IsShowHiddenChar() != aUsrPref.IsShowHiddenChar() )
857  rPreviewViewShell.ApplyViewOptions(aUsrPref);
858  // reset design mode at draw view for form
859  // shell, if needed.
860  if ( static_cast<SwPagePreview*>(pExistingSh)->ResetFormDesignMode() &&
861  m_pWrtShell->HasDrawView() )
862  {
863  SdrView* pDrawView = m_pWrtShell->GetDrawView();
864  pDrawView->SetDesignMode( static_cast<SwPagePreview*>(pExistingSh)->FormDesignModeToReset() );
865  }
866  }
867  }
868  SAL_INFO( "sw.ui", "after create WrtShell" );
870  SvxRulerSupportFlags::TABS |
871  SvxRulerSupportFlags::PARAGRAPH_MARGINS |
872  SvxRulerSupportFlags::BORDERS |
873  SvxRulerSupportFlags::NEGATIVE_MARGINS|
874  SvxRulerSupportFlags::REDUCED_METRIC,
877 
878  // assure that modified state of document
879  // isn't reset, if document is already modified.
880  const bool bIsDocModified = m_pWrtShell->GetDoc()->getIDocumentState().IsModified();
881 
882  // Thus among other things, the HRuler is not displayed in the read-only case.
883  aUsrPref.SetReadonly( m_pWrtShell->GetViewOptions()->IsReadonly() );
884 
885  // no margin for OLE!
886  Size aBrwsBorder;
887  if( SfxObjectCreateMode::EMBEDDED != rDocSh.GetCreateMode() )
888  aBrwsBorder = GetMargin();
889 
890  m_pWrtShell->SetBrowseBorder( aBrwsBorder );
891 
892  // In CTOR no shell changes may take place, which must be temporarily stored
893  // with the timer. Otherwise, the SFX removes them from the stack!
894  bool bOld = g_bNoInterrupt;
895  g_bNoInterrupt = true;
896 
897  m_pHRuler->SetActive();
898  m_pVRuler->SetActive();
899 
900  SfxViewFrame* pViewFrame = GetViewFrame();
901 
902  StartListening(*pViewFrame, DuplicateHandling::Prevent);
903  StartListening(rDocSh, DuplicateHandling::Prevent);
904 
905  // Set Zoom-factor from HRuler
906  Fraction aZoomFract( aUsrPref.GetZoom(), 100 );
907  m_pHRuler->SetZoom( aZoomFract );
908  m_pVRuler->SetZoom( aZoomFract );
909  m_pHRuler->SetDoubleClickHdl(LINK( this, SwView, ExecRulerClick ));
910  FieldUnit eMetric = pUsrPref->GetHScrollMetric();
911  m_pHRuler->SetUnit( eMetric );
912 
913  eMetric = pUsrPref->GetVScrollMetric();
914  m_pVRuler->SetUnit( eMetric );
915 
916  m_pHRuler->SetCharWidth( 371 ); // default character width
917  m_pVRuler->SetLineHeight( 551 ); // default line height
918 
919  // Set DocShell
920  m_xGlueDocShell.reset(new SwViewGlueDocShell(*this, rDocSh));
921  m_pPostItMgr.reset(new SwPostItMgr(this));
922 
923  // Check and process the DocSize. Via the handler, the shell could not
924  // be found, because the shell is not known in the SFX management
925  // within the CTOR phase.
926  DocSzChgd( m_pWrtShell->GetDocSize() );
927 
928  // Set AttrChangedNotify link
929  m_pWrtShell->SetChgLnk(LINK(this, SwView, AttrChangedNotify));
930 
931  if (rDocSh.GetCreateMode() == SfxObjectCreateMode::EMBEDDED &&
932  !rDocSh.GetVisArea(ASPECT_CONTENT).IsEmpty())
933  SetVisArea(rDocSh.GetVisArea(ASPECT_CONTENT),false);
934 
935  SAL_WARN_IF(
937  "sw.ui", "/org.openoffice.Office.Common/Undo/Steps <= 0");
939  {
940  m_pWrtShell->DoUndo();
941  }
942 
943  const bool bBrowse = m_pWrtShell->GetViewOptions()->getBrowseMode();
944  // Disable "multiple window"
945  SetNewWindowAllowed(!bBrowse);
946  // End of disabled multiple window
947 
950  m_pHScrollbar->SetAuto(bBrowse);
951  if( aUsrPref.IsViewHRuler() )
952  CreateTab();
953  if( aUsrPref.IsViewVRuler() )
954  CreateVRuler();
955 
956  m_pWrtShell->SetUIOptions( aUsrPref );
957  m_pWrtShell->SetReadOnlyAvailable( aUsrPref.IsCursorInProtectedArea() );
958  m_pWrtShell->ApplyAccessibilityOptions(SW_MOD()->GetAccessibilityOptions());
959 
960  if( m_pWrtShell->GetDoc()->getIDocumentState().IsUpdateExpField() )
961  {
962  if (m_pWrtShell->GetDoc()->GetDocumentFieldsManager().containsUpdatableFields())
963  {
964  CurrShell aCurr(m_pWrtShell.get());
965  m_pWrtShell->StartAction();
966  m_pWrtShell->CalcLayout();
967  m_pWrtShell->GetDoc()->getIDocumentFieldsAccess().UpdateFields(false);
968  m_pWrtShell->EndAction();
969  }
970  m_pWrtShell->GetDoc()->getIDocumentState().SetUpdateExpFieldStat( false );
971  }
972 
973  // Update all tables if necessary:
974  if( m_pWrtShell->GetDoc()->IsUpdateTOX() )
975  {
976  SfxRequest aSfxRequest( FN_UPDATE_TOX, SfxCallMode::SLOT, GetPool() );
977  Execute( aSfxRequest );
978  m_pWrtShell->GetDoc()->SetUpdateTOX( false ); // reset again
979  m_pWrtShell->SttEndDoc(true);
980  }
981 
982  // No ResetModified, if there is already a view to this doc.
983  SfxViewFrame* pVFrame = GetViewFrame();
984  SfxViewFrame* pFirst = SfxViewFrame::GetFirst(&rDocSh);
985  // Currently(360) the view is registered firstly after the CTOR,
986  // the following expression is also working if this changes.
987  // If the modification cannot be canceled by undo, then do NOT set
988  // the modify back.
989  // no reset of modified state, if document
990  // was already modified.
991  if (!m_pWrtShell->GetDoc()->GetIDocumentUndoRedo().IsUndoNoResetModified() &&
992  ( !pFirst || pFirst == pVFrame ) &&
993  !bIsDocModified )
994  {
995  m_pWrtShell->ResetModified();
996  }
997 
998  g_bNoInterrupt = bOld;
999 
1000  // If a new GlobalDoc will be created, the navigator will also be generated.
1001  if( dynamic_cast<const SwGlobalDocShell*>(&rDocSh) != nullptr &&
1002  !pVFrame->GetChildWindow( SID_NAVIGATOR ))
1003  {
1004  SfxBoolItem aNavi(SID_NAVIGATOR, true);
1005  GetDispatcher().ExecuteList(SID_NAVIGATOR, SfxCallMode::ASYNCHRON, { &aNavi });
1006  }
1007 
1008  uno::Reference< frame::XFrame > xFrame = pVFrame->GetFrame().GetFrameInterface();
1009 
1010  uno::Reference< frame::XFrame > xBeamerFrame = xFrame->findFrame(
1011  "_beamer", frame::FrameSearchFlag::CHILDREN);
1012  if(xBeamerFrame.is())
1013  {
1014  SwDBData aData = m_pWrtShell->GetDBData();
1015  SwModule::ShowDBObj( *this, aData );
1016  }
1017 
1018  // has anybody calls the attrchanged handler in the constructor?
1020  {
1021  GetViewFrame()->GetBindings().LEAVEREGISTRATIONS();
1022  if( m_aTimer.IsActive() )
1023  m_aTimer.Stop();
1024  }
1025 
1026  m_aTimer.SetInvokeHandler(LINK(this, SwView, TimeoutHdl));
1027  m_aTimer.SetDebugName( "sw::SwView m_aTimer" );
1029  if (bOldModifyFlag)
1030  rDocSh.EnableSetModified();
1031  InvalidateBorder();
1032 
1033  if( !m_pHScrollbar->IsVisible( true ) )
1034  ShowHScrollbar( false );
1035  if( !m_pVScrollbar->IsVisible( true ) )
1036  ShowVScrollbar( false );
1037 
1038  GetViewFrame()->GetWindow().AddChildEventListener( LINK( this, SwView, WindowChildEventListener ) );
1039 }
1040 
1042  : m_rView(rView)
1043 {
1044  // Set DocShell
1045  rDocSh.SetView(&m_rView);
1046  SW_MOD()->SetView(&m_rView);
1047 }
1048 
1050 {
1051  SwDocShell* pDocSh = m_rView.GetDocShell();
1052  if (pDocSh && pDocSh->GetView() == &m_rView)
1053  pDocSh->SetView(nullptr);
1054  if (SW_MOD()->GetView() == &m_rView)
1055  SW_MOD()->SetView(nullptr);
1056 }
1057 
1059 {
1060  // Notify other LOK views that we are going away.
1061  SfxLokHelper::notifyOtherViews(this, LOK_CALLBACK_VIEW_CURSOR_VISIBLE, "visible", "false");
1062  SfxLokHelper::notifyOtherViews(this, LOK_CALLBACK_TEXT_VIEW_SELECTION, "selection", "");
1063  SfxLokHelper::notifyOtherViews(this, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", "EMPTY");
1064 
1065  // Need to remove activated field's button before disposing EditWin.
1067 
1068  GetViewFrame()->GetWindow().RemoveChildEventListener( LINK( this, SwView, WindowChildEventListener ) );
1069  m_pPostItMgr.reset();
1070 
1071  m_bInDtor = true;
1072  m_pEditWin->Hide(); // prevent problems with painting
1073 
1074  // Set pointer in SwDocShell to the view again
1075  m_xGlueDocShell.reset();
1076 
1078  GetViewFrame()->GetBindings().LEAVEREGISTRATIONS();
1079 
1080  // the last view must end the text edit
1081  SdrView *pSdrView = m_pWrtShell ? m_pWrtShell->GetDrawView() : nullptr;
1082  if( pSdrView && pSdrView->IsTextEdit() )
1083  pSdrView->SdrEndTextEdit( true );
1084 
1085  SetWindow( nullptr );
1086 
1087  m_pViewImpl->Invalidate();
1088  EndListening(*GetViewFrame());
1089  EndListening(*GetDocShell());
1091  m_pWrtShell.reset(); // reset here so that it is not accessible by the following dtors.
1096  m_pGlosHdl.reset();
1097  m_pViewImpl.reset();
1098 
1099  // If this was enabled in the ctor for the frame, then disable it here.
1100  static bool bRequestDoubleBuffering = getenv("VCL_DOUBLEBUFFERING_ENABLE");
1101  if (bRequestDoubleBuffering)
1104 
1105  m_pFormatClipboard.reset();
1106 }
1107 
1109 {
1110  SfxObjectShell* pDocShell = GetViewFrame()->GetObjectShell();
1111  return dynamic_cast<SwDocShell*>( pDocShell );
1112 }
1113 
1114 // Remember CursorPos
1115 
1116 void SwView::WriteUserData( OUString &rUserData, bool bBrowse )
1117 {
1118  // The browse flag will be passed from Sfx when documents are browsed
1119  // (not to be confused with the BrowseMode).
1120  // Then that stored data are not persistent!
1121 
1122  const SwRect& rRect = m_pWrtShell->GetCharRect();
1123  const tools::Rectangle& rVis = GetVisArea();
1124 
1125  rUserData = OUString::number( rRect.Left() );
1126  rUserData += ";";
1127  rUserData += OUString::number( rRect.Top() );
1128  rUserData += ";";
1129  rUserData += OUString::number( m_pWrtShell->GetViewOptions()->GetZoom() );
1130  rUserData += ";";
1131  rUserData += OUString::number( rVis.Left() );
1132  rUserData += ";";
1133  rUserData += OUString::number( rVis.Top() );
1134  rUserData += ";";
1135  rUserData += OUString::number( bBrowse ? SAL_MIN_INT32 : rVis.Right());
1136  rUserData += ";";
1137  rUserData += OUString::number( bBrowse ? SAL_MIN_INT32 : rVis.Bottom());
1138  rUserData += ";";
1139  rUserData += OUString::number(
1140  static_cast<sal_uInt16>(m_pWrtShell->GetViewOptions()->GetZoomType()));//eZoom;
1141  rUserData += ";";
1142  rUserData += FrameTypeFlags::NONE == m_pWrtShell->GetSelFrameType() ? OUStringLiteral(u"0") : OUStringLiteral(u"1");
1143 }
1144 
1145 // Set CursorPos
1146 
1147 static bool lcl_IsOwnDocument( SwView& rView )
1148 {
1149  uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
1150  rView.GetDocShell()->GetModel(), uno::UNO_QUERY_THROW);
1151  uno::Reference<document::XDocumentProperties> xDocProps
1152  = xDPS->getDocumentProperties();
1153  OUString Created = xDocProps->getAuthor();
1154  OUString Changed = xDocProps->getModifiedBy();
1155  OUString FullName = SW_MOD()->GetUserOptions().GetFullName();
1156  return (!FullName.isEmpty() &&
1157  (!Changed.isEmpty() && Changed == FullName )) ||
1158  (Changed.isEmpty() && !Created.isEmpty() && Created == FullName );
1159 }
1160 
1161 void SwView::ReadUserData( const OUString &rUserData, bool bBrowse )
1162 {
1163  if ( !(rUserData.indexOf(';')>=0 && // more than one token
1164  // For document without layout only in the onlinelayout or
1165  // while forward/backward
1166  (!m_pWrtShell->IsNewLayout() || m_pWrtShell->GetViewOptions()->getBrowseMode() || bBrowse)) )
1167  return;
1168 
1169  bool bIsOwnDocument = lcl_IsOwnDocument( *this );
1170 
1171  CurrShell aCurr(m_pWrtShell.get());
1172 
1173  sal_Int32 nPos = 0;
1174 
1175  // No it is *not* a good idea to call GetToken within Point constr. immediately,
1176  // because which parameter is evaluated first?
1177  long nX = rUserData.getToken( 0, ';', nPos ).toInt32(),
1178  nY = rUserData.getToken( 0, ';', nPos ).toInt32();
1179  Point aCursorPos( nX, nY );
1180 
1181  sal_uInt16 nZoomFactor =
1182  static_cast< sal_uInt16 >( rUserData.getToken(0, ';', nPos ).toInt32() );
1183 
1184  long nLeft = rUserData.getToken(0, ';', nPos ).toInt32(),
1185  nTop = rUserData.getToken(0, ';', nPos ).toInt32(),
1186  nRight = rUserData.getToken(0, ';', nPos ).toInt32(),
1187  nBottom= rUserData.getToken(0, ';', nPos ).toInt32();
1188 
1189  const long nAdd = m_pWrtShell->GetViewOptions()->getBrowseMode() ? DOCUMENTBORDER : DOCUMENTBORDER*2;
1190  if ( nBottom > (m_pWrtShell->GetDocSize().Height()+nAdd) )
1191  return;
1192 
1193  m_pWrtShell->EnableSmooth( false );
1194 
1195  const tools::Rectangle aVis( nLeft, nTop, nRight, nBottom );
1196 
1197  sal_Int32 nOff = 0;
1198  SvxZoomType eZoom;
1199  if( !m_pWrtShell->GetViewOptions()->getBrowseMode() )
1200  eZoom = static_cast<SvxZoomType>(static_cast<sal_uInt16>(rUserData.getToken(nOff, ';', nPos ).toInt32()));
1201  else
1202  {
1203  eZoom = SvxZoomType::PERCENT;
1204  ++nOff;
1205  }
1206 
1207  bool bSelectObj = (0 != rUserData.getToken( nOff, ';', nPos ).toInt32())
1208  && m_pWrtShell->IsObjSelectable( aCursorPos );
1209 
1210  // restore editing position
1211  m_pViewImpl->SetRestorePosition(aCursorPos, bSelectObj);
1212  // set flag value to avoid macro execution.
1213  bool bSavedFlagValue = m_pWrtShell->IsMacroExecAllowed();
1214  m_pWrtShell->SetMacroExecAllowed( false );
1215 // os: changed: The user data has to be read if the view is switched back from page preview
1216 // go to the last editing position when opening own files
1217  if(m_bOldShellWasPagePreview || bIsOwnDocument)
1218  {
1219  m_pWrtShell->SwCursorShell::SetCursor( aCursorPos, !bSelectObj );
1220  if( bSelectObj )
1221  {
1222  m_pWrtShell->SelectObj( aCursorPos );
1223  m_pWrtShell->EnterSelFrameMode( &aCursorPos );
1224  }
1225  }
1226 
1227  // reset flag value
1228  m_pWrtShell->SetMacroExecAllowed( bSavedFlagValue );
1229 
1230  // set visible area before applying
1231  // information from print preview. Otherwise, the applied information
1232  // is lost.
1233 // os: changed: The user data has to be read if the view is switched back from page preview
1234 // go to the last editing position when opening own files
1235  if(m_bOldShellWasPagePreview || bIsOwnDocument )
1236  {
1237  if ( bBrowse )
1238  SetVisArea( aVis.TopLeft() );
1239  else
1240  SetVisArea( aVis );
1241  }
1242 
1243  //apply information from print preview - if available
1244  if( !m_sNewCursorPos.isEmpty() )
1245  {
1246  sal_Int32 nIdx{ 0 };
1247  const long nXTmp = m_sNewCursorPos.getToken( 0, ';', nIdx ).toInt32();
1248  const long nYTmp = m_sNewCursorPos.getToken( 0, ';', nIdx ).toInt32();
1249  Point aCursorPos2( nXTmp, nYTmp );
1250  bSelectObj = m_pWrtShell->IsObjSelectable( aCursorPos2 );
1251 
1252  m_pWrtShell->SwCursorShell::SetCursor( aCursorPos2 );
1253  if( bSelectObj )
1254  {
1255  m_pWrtShell->SelectObj( aCursorPos2 );
1256  m_pWrtShell->EnterSelFrameMode( &aCursorPos2 );
1257  }
1258  m_pWrtShell->MakeSelVisible();
1259  m_sNewCursorPos.clear();
1260  }
1261  else if(USHRT_MAX != m_nNewPage)
1262  {
1263  m_pWrtShell->GotoPage(m_nNewPage, true);
1265  }
1266 
1267  SelectShell();
1268 
1269  m_pWrtShell->StartAction();
1270  const SwViewOption* pVOpt = m_pWrtShell->GetViewOptions();
1271  if( pVOpt->GetZoom() != nZoomFactor || pVOpt->GetZoomType() != eZoom )
1272  SetZoom( eZoom, nZoomFactor);
1273 
1274  m_pWrtShell->LockView( true );
1275  m_pWrtShell->EndAction();
1276  m_pWrtShell->LockView( false );
1277  m_pWrtShell->EnableSmooth( true );
1278 }
1279 
1280 void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >& rSequence )
1281 {
1282  if(GetDocShell()->IsPreview()||m_bIsPreviewDoubleClick)
1283  return;
1284  bool bIsOwnDocument = lcl_IsOwnDocument( *this );
1285  if (!rSequence.hasElements())
1286  return;
1287 
1288  CurrShell aCurr(m_pWrtShell.get());
1289  const SwRect& rRect = m_pWrtShell->GetCharRect();
1290  const tools::Rectangle &rVis = GetVisArea();
1291  const SwViewOption* pVOpt = m_pWrtShell->GetViewOptions();
1292 
1293  sal_Int64 nX = rRect.Left(), nY = rRect.Top(), nLeft = rVis.Left(), nTop = rVis.Top();
1294  sal_Int64 nRight = nLeft;
1295  sal_Int64 nBottom = LONG_MIN;
1296  sal_Int16 nZoomType = static_cast< sal_Int16 >(pVOpt->GetZoomType());
1297  sal_Int16 nZoomFactor = static_cast < sal_Int16 > (pVOpt->GetZoom());
1298  bool bViewLayoutBookMode = pVOpt->IsViewLayoutBookMode();
1299  sal_Int16 nViewLayoutColumns = pVOpt->GetViewLayoutColumns();
1300 
1301  bool bSelectedFrame = ( m_pWrtShell->GetSelFrameType() != FrameTypeFlags::NONE ),
1302  bGotVisibleLeft = false,
1303  bGotVisibleTop = false, bGotVisibleRight = false,
1304  bGotVisibleBottom = false, bGotZoomType = false,
1305  bGotZoomFactor = false, bGotIsSelectedFrame = false,
1306  bGotViewLayoutColumns = false, bGotViewLayoutBookMode = false,
1307  bBrowseMode = false, bGotBrowseMode = false;
1308 
1309  for (const beans::PropertyValue& rValue : rSequence)
1310  {
1311  if ( rValue.Name == "ViewLeft" )
1312  {
1313  rValue.Value >>= nX;
1314  nX = convertMm100ToTwip( nX );
1315  }
1316  else if ( rValue.Name == "ViewTop" )
1317  {
1318  rValue.Value >>= nY;
1319  nY = convertMm100ToTwip( nY );
1320  }
1321  else if ( rValue.Name == "VisibleLeft" )
1322  {
1323  rValue.Value >>= nLeft;
1324  nLeft = convertMm100ToTwip( nLeft );
1325  bGotVisibleLeft = true;
1326  }
1327  else if ( rValue.Name == "VisibleTop" )
1328  {
1329  rValue.Value >>= nTop;
1330  nTop = convertMm100ToTwip( nTop );
1331  bGotVisibleTop = true;
1332  }
1333  else if ( rValue.Name == "VisibleRight" )
1334  {
1335  rValue.Value >>= nRight;
1336  nRight = convertMm100ToTwip( nRight );
1337  bGotVisibleRight = true;
1338  }
1339  else if ( rValue.Name == "VisibleBottom" )
1340  {
1341  rValue.Value >>= nBottom;
1342  nBottom = convertMm100ToTwip( nBottom );
1343  bGotVisibleBottom = true;
1344  }
1345  else if ( rValue.Name == "ZoomType" )
1346  {
1347  rValue.Value >>= nZoomType;
1348  bGotZoomType = true;
1349  }
1350  else if ( rValue.Name == "ZoomFactor" )
1351  {
1352  rValue.Value >>= nZoomFactor;
1353  bGotZoomFactor = true;
1354  }
1355  else if ( rValue.Name == "ViewLayoutColumns" )
1356  {
1357  rValue.Value >>= nViewLayoutColumns;
1358  bGotViewLayoutColumns = true;
1359  }
1360  else if ( rValue.Name == "ViewLayoutBookMode" )
1361  {
1362  bViewLayoutBookMode = *o3tl::doAccess<bool>(rValue.Value);
1363  bGotViewLayoutBookMode = true;
1364  }
1365  else if ( rValue.Name == "IsSelectedFrame" )
1366  {
1367  rValue.Value >>= bSelectedFrame;
1368  bGotIsSelectedFrame = true;
1369  }
1370  else if (rValue.Name == "ShowOnlineLayout")
1371  {
1372  rValue.Value >>= bBrowseMode;
1373  bGotBrowseMode = true;
1374  }
1375  // Fallback to common SdrModel processing
1376  else
1378  }
1379  if (bGotBrowseMode)
1380  {
1381  // delegate further
1382  GetViewImpl()->GetUNOObject_Impl()->getViewSettings()->setPropertyValue("ShowOnlineLayout", uno::Any(bBrowseMode));
1383  }
1384 
1385  SelectShell();
1386 
1387  if (!bGotVisibleBottom)
1388  return;
1389 
1390  Point aCursorPos( nX, nY );
1391  const long nAdd = m_pWrtShell->GetViewOptions()->getBrowseMode() ? DOCUMENTBORDER : DOCUMENTBORDER*2;
1392  if (nBottom > (m_pWrtShell->GetDocSize().Height()+nAdd) )
1393  return;
1394 
1395  m_pWrtShell->EnableSmooth( false );
1396  const tools::Rectangle aVis( nLeft, nTop, nRight, nBottom );
1397 
1398  SvxZoomType eZoom;
1399  if ( !m_pWrtShell->GetViewOptions()->getBrowseMode() )
1400  eZoom = static_cast < SvxZoomType > ( nZoomType );
1401  else
1402  {
1403  eZoom = SvxZoomType::PERCENT;
1404  }
1405  if (bGotIsSelectedFrame)
1406  {
1407  bool bSelectObj = bSelectedFrame && m_pWrtShell->IsObjSelectable( aCursorPos );
1408 
1409  // set flag value to avoid macro execution.
1410  bool bSavedFlagValue = m_pWrtShell->IsMacroExecAllowed();
1411  m_pWrtShell->SetMacroExecAllowed( false );
1412 // os: changed: The user data has to be read if the view is switched back from page preview
1413 // go to the last editing position when opening own files
1414  m_pViewImpl->SetRestorePosition(aCursorPos, bSelectObj);
1415  if(m_bOldShellWasPagePreview|| bIsOwnDocument)
1416  {
1417  m_pWrtShell->SwCursorShell::SetCursor( aCursorPos, !bSelectObj );
1418 
1419  // Update the shell to toggle Header/Footer edit if needed
1420  bool bInHeader = true;
1421  if ( m_pWrtShell->IsInHeaderFooter( &bInHeader ) )
1422  {
1423  if ( !bInHeader )
1424  {
1425  m_pWrtShell->SetShowHeaderFooterSeparator( FrameControlType::Footer, true );
1426  m_pWrtShell->SetShowHeaderFooterSeparator( FrameControlType::Header, false );
1427  }
1428  else
1429  {
1430  m_pWrtShell->SetShowHeaderFooterSeparator( FrameControlType::Header, true );
1431  m_pWrtShell->SetShowHeaderFooterSeparator( FrameControlType::Footer, false );
1432  }
1433 
1434  // Force repaint
1435  m_pWrtShell->GetWin()->Invalidate();
1436  }
1437  if ( m_pWrtShell->IsInHeaderFooter() != m_pWrtShell->IsHeaderFooterEdit() )
1438  m_pWrtShell->ToggleHeaderFooterEdit();
1439 
1440  if( bSelectObj )
1441  {
1442  m_pWrtShell->SelectObj( aCursorPos );
1443  m_pWrtShell->EnterSelFrameMode( &aCursorPos );
1444  }
1445  }
1446 
1447  // reset flag value
1448  m_pWrtShell->SetMacroExecAllowed( bSavedFlagValue );
1449  }
1450 
1451  // Set ViewLayoutSettings
1452  const bool bSetViewLayoutSettings = bGotViewLayoutColumns && bGotViewLayoutBookMode &&
1453  ( pVOpt->GetViewLayoutColumns() != nViewLayoutColumns || pVOpt->IsViewLayoutBookMode() != bViewLayoutBookMode );
1454 
1455  const bool bSetViewSettings = bGotZoomType && bGotZoomFactor &&
1456  ( pVOpt->GetZoom() != nZoomFactor || pVOpt->GetZoomType() != eZoom );
1457 
1458  // In case we have a 'fixed' view layout of 2 or more columns,
1459  // we have to apply the view options *before* starting the action.
1460  // Otherwise the SetZoom function cannot work correctly, because
1461  // the view layout hasn't been calculated.
1462  const bool bZoomNeedsViewLayout = bSetViewLayoutSettings &&
1463  1 < nViewLayoutColumns &&
1464  bSetViewSettings &&
1465  eZoom != SvxZoomType::PERCENT;
1466 
1467  if ( !bZoomNeedsViewLayout )
1468  m_pWrtShell->StartAction();
1469 
1470  if ( bSetViewLayoutSettings )
1471  SetViewLayout( nViewLayoutColumns, bViewLayoutBookMode, true );
1472 
1473  if ( bZoomNeedsViewLayout )
1474  m_pWrtShell->StartAction();
1475 
1476  if ( bSetViewSettings )
1477  SetZoom( eZoom, nZoomFactor, true );
1478 
1479 // os: changed: The user data has to be read if the view is switched back from page preview
1480 // go to the last editing position when opening own files
1481  if(m_bOldShellWasPagePreview||bIsOwnDocument)
1482  {
1483  if ( bGotVisibleLeft && bGotVisibleTop )
1484  {
1485  Point aTopLeft(aVis.TopLeft());
1486  // make sure the document is still centered
1487  const SwTwips lBorder = IsDocumentBorder() ? DOCUMENTBORDER : 2 * DOCUMENTBORDER;
1488  SwTwips nEditWidth = GetEditWin().GetOutputSize().Width();
1489  if(nEditWidth > (m_aDocSz.Width() + lBorder ))
1490  aTopLeft.setX( ( m_aDocSz.Width() + lBorder - nEditWidth ) / 2 );
1491  else
1492  {
1493  //check if the values are possible
1495  if( aTopLeft.X() > nXMax )
1496  aTopLeft.setX( nXMax < 0 ? 0 : nXMax );
1497  }
1498  SetVisArea( aTopLeft );
1499  }
1500  else if (bGotVisibleLeft && bGotVisibleTop && bGotVisibleRight && bGotVisibleBottom )
1501  SetVisArea( aVis );
1502  }
1503 
1504  m_pWrtShell->LockView( true );
1505  m_pWrtShell->EndAction();
1506  m_pWrtShell->LockView( false );
1507  m_pWrtShell->EnableSmooth( true );
1508 
1509 }
1510 
1511 void SwView::WriteUserDataSequence ( uno::Sequence < beans::PropertyValue >& rSequence )
1512 {
1513  const SwRect& rRect = m_pWrtShell->GetCharRect();
1514  const tools::Rectangle& rVis = GetVisArea();
1515 
1516  std::vector<beans::PropertyValue> aVector;
1517 
1518  sal_uInt16 nViewID( GetViewFrame()->GetCurViewId());
1519  aVector.push_back(comphelper::makePropertyValue("ViewId", "view" + OUString::number(nViewID)));
1520 
1521  aVector.push_back(comphelper::makePropertyValue("ViewLeft", convertTwipToMm100 ( rRect.Left() )));
1522 
1523  aVector.push_back(comphelper::makePropertyValue("ViewTop", convertTwipToMm100 ( rRect.Top() )));
1524 
1525  auto visibleLeft = convertTwipToMm100 ( rVis.Left() );
1526  aVector.push_back(comphelper::makePropertyValue("VisibleLeft", visibleLeft));
1527 
1528  auto visibleTop = convertTwipToMm100 ( rVis.Top() );
1529  aVector.push_back(comphelper::makePropertyValue("VisibleTop", visibleTop));
1530 
1531  auto visibleRight = rVis.IsWidthEmpty() ? visibleLeft : convertTwipToMm100 ( rVis.Right() );
1532  aVector.push_back(comphelper::makePropertyValue("VisibleRight", visibleRight));
1533 
1534  auto visibleBottom = rVis.IsHeightEmpty() ? visibleTop : convertTwipToMm100 ( rVis.Bottom() );
1535  aVector.push_back(comphelper::makePropertyValue("VisibleBottom", visibleBottom));
1536 
1537  const sal_Int16 nZoomType = static_cast< sal_Int16 >(m_pWrtShell->GetViewOptions()->GetZoomType());
1538  aVector.push_back(comphelper::makePropertyValue("ZoomType", nZoomType));
1539 
1540  const sal_Int16 nViewLayoutColumns = static_cast< sal_Int16 >(m_pWrtShell->GetViewOptions()->GetViewLayoutColumns());
1541  aVector.push_back(comphelper::makePropertyValue("ViewLayoutColumns", nViewLayoutColumns));
1542 
1543  aVector.push_back(comphelper::makePropertyValue("ViewLayoutBookMode", m_pWrtShell->GetViewOptions()->IsViewLayoutBookMode()));
1544 
1545  aVector.push_back(comphelper::makePropertyValue("ZoomFactor", static_cast < sal_Int16 > (m_pWrtShell->GetViewOptions()->GetZoom())));
1546 
1547  aVector.push_back(comphelper::makePropertyValue("IsSelectedFrame", FrameTypeFlags::NONE != m_pWrtShell->GetSelFrameType()));
1548 
1549  rSequence = comphelper::containerToSequence(aVector);
1550 
1551  // Common SdrModel processing
1553 }
1554 
1555 void SwView::ShowCursor( bool bOn )
1556 {
1557  //don't scroll the cursor into the visible area
1558  bool bUnlockView = !m_pWrtShell->IsViewLocked();
1559  m_pWrtShell->LockView( true ); //lock visible section
1560 
1561  if( !bOn )
1562  m_pWrtShell->HideCursor();
1563  else if( !m_pWrtShell->IsFrameSelected() && !m_pWrtShell->IsObjSelected() )
1564  m_pWrtShell->ShowCursor();
1565 
1566  if( bUnlockView )
1567  m_pWrtShell->LockView( false );
1568 }
1569 
1571 {
1572  if ( !GetViewFrame()->GetFrame().IsInPlace() )
1573  {
1574  SwWrtShell &rSh = GetWrtShell();
1575  const SelectionType nSel = rSh.GetSelectionType();
1576  if ( nSel & SelectionType::Ole )
1577  rSh.LaunchOLEObj( nVerb );
1578  }
1579  return ERRCODE_NONE;
1580 }
1581 
1582 // only return true for a text selection
1583 
1584 bool SwView::HasSelection( bool bText ) const
1585 {
1586  return bText ? GetWrtShell().SwCursorShell::HasSelection()
1587  : GetWrtShell().HasSelection();
1588 }
1589 
1590 OUString SwView::GetSelectionText( bool bCompleteWrds )
1591 {
1592  return GetSelectionTextParam( bCompleteWrds, true );
1593 }
1594 
1595 OUString SwView::GetSelectionTextParam( bool bCompleteWrds, bool bEraseTrail )
1596 {
1597  OUString sReturn;
1598  if( bCompleteWrds && !GetWrtShell().HasSelection() )
1599  GetWrtShell().SelWrd();
1600 
1601  GetWrtShell().GetSelectedText( sReturn );
1602  if( bEraseTrail )
1603  sReturn = comphelper::string::stripEnd(sReturn, ' ');
1604  return sReturn;
1605 }
1606 
1608 {
1609  if(!m_pGlosHdl)
1610  m_pGlosHdl.reset(new SwGlossaryHdl(GetViewFrame(), m_pWrtShell.get()));
1611  return m_pGlosHdl.get();
1612 }
1613 
1614 void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
1615 {
1616  bool bCallBase = true;
1617  if(dynamic_cast<const FmDesignModeChangedHint*>(&rHint))
1618  {
1619  bool bDesignMode = static_cast<const FmDesignModeChangedHint&>(rHint).GetDesignMode();
1620  if (!bDesignMode && GetDrawFuncPtr())
1621  {
1623  SetDrawFuncPtr(nullptr);
1624  LeaveDrawCreate();
1625  AttrChangedNotify(nullptr);
1626  }
1627  }
1628  else
1629  {
1630  SfxHintId nId = rHint.GetId();
1631  switch ( nId )
1632  {
1633  // sub shells will be destroyed by the
1634  // dispatcher, if the view frame is dying. Thus, reset member <pShell>.
1635  case SfxHintId::Dying:
1636  {
1637  if ( &rBC == GetViewFrame() )
1638  {
1639  ResetSubShell();
1640  }
1641  }
1642  break;
1643  case SfxHintId::ModeChanged:
1644  {
1645  // Modal mode change-over?
1646  bool bModal = GetDocShell()->IsInModalMode();
1647  m_pHRuler->SetActive( !bModal );
1648  m_pVRuler->SetActive( !bModal );
1649  }
1650 
1651  [[fallthrough]];
1652 
1653  case SfxHintId::TitleChanged:
1654  if ( GetDocShell()->IsReadOnly() != GetWrtShell().GetViewOptions()->IsReadonly() )
1655  {
1656  SwWrtShell &rSh = GetWrtShell();
1658 
1659  if ( rSh.GetViewOptions()->IsViewVRuler() )
1660  CreateVRuler();
1661  else
1662  KillVRuler();
1663  if ( rSh.GetViewOptions()->IsViewHRuler() )
1664  CreateTab();
1665  else
1666  KillTab();
1667  bool bReadonly = GetDocShell()->IsReadOnly();
1668  // if document is to be opened in alive-mode then this has to be
1669  // regarded while switching from readonly-mode to edit-mode
1670  if( !bReadonly )
1671  {
1673  if (pDrawDoc)
1674  {
1675  if( !pDrawDoc->GetOpenInDesignMode() )
1676  break;// don't touch the design mode
1677  }
1678  }
1679  SfxBoolItem aItem( SID_FM_DESIGN_MODE, !bReadonly);
1680  GetDispatcher().ExecuteList(SID_FM_DESIGN_MODE,
1681  SfxCallMode::ASYNCHRON, { &aItem });
1682  }
1683  break;
1684 
1685  case SfxHintId::SwDrawViewsCreated:
1686  {
1687  bCallBase = false;
1688  if ( GetFormShell() )
1689  {
1690  GetFormShell()->SetView(dynamic_cast<FmFormView*>(GetWrtShell().GetDrawView()));
1691  SfxBoolItem aItem( SID_FM_DESIGN_MODE, !GetDocShell()->IsReadOnly());
1692  GetDispatcher().ExecuteList(SID_FM_DESIGN_MODE,
1693  SfxCallMode::SYNCHRON, { &aItem });
1694  }
1695  }
1696  break;
1697  case SfxHintId::RedlineChanged:
1698  {
1699  static sal_uInt16 const aSlotRedLine[] = {
1706  0
1707  };
1708  GetViewFrame()->GetBindings().Invalidate(aSlotRedLine);
1709  }
1710  break;
1711 
1712  default: break;
1713  }
1714  }
1715 
1716  if ( bCallBase )
1717  SfxViewShell::Notify(rBC, rHint);
1718 }
1719 
1720 #if defined(_WIN32) || defined UNX
1721 
1723 {
1724  uno::Reference< XScannerManager2 > xScanMgr = SW_MOD()->GetScannerManager();
1725  if( xScanMgr.is() )
1726  {
1727  const ScannerContext aContext( xScanMgr->getAvailableScanners().getConstArray()[ 0 ] );
1728  const ScanError eError = xScanMgr->getError( aContext );
1729 
1730  if( ScanError_ScanErrorNone == eError )
1731  {
1732  const uno::Reference< awt::XBitmap > xBitmap( xScanMgr->getBitmap( aContext ) );
1733 
1734  if( xBitmap.is() )
1735  {
1736  const BitmapEx aScanBmp( VCLUnoHelper::GetBitmap( xBitmap ) );
1737 
1738  if( !!aScanBmp )
1739  {
1740  Graphic aGrf(aScanBmp);
1741  m_pWrtShell->Insert( OUString(), OUString(), aGrf );
1742  }
1743  }
1744  }
1745  }
1746  SfxBindings& rBind = GetViewFrame()->GetBindings();
1747  rBind.Invalidate( SID_TWAIN_SELECT );
1748  rBind.Invalidate( SID_TWAIN_TRANSFER );
1749 }
1750 #endif
1751 
1753 {
1754  if(m_aTimer.IsActive())
1755  {
1756  m_aTimer.Stop();
1758  {
1759  GetViewFrame()->GetBindings().LEAVEREGISTRATIONS();
1761  }
1762  SelectShell();
1763  m_bAttrChgNotified = false;
1764  }
1765 }
1766 
1767 bool SwView::PrepareClose( bool bUI )
1768 {
1769  SfxViewFrame* pVFrame = GetViewFrame();
1770  pVFrame->SetChildWindow( SwInputChild::GetChildWindowId(), false );
1771  if( pVFrame->GetDispatcher()->IsLocked() )
1772  pVFrame->GetDispatcher()->Lock(false);
1773 
1774  if ( m_pFormShell && !m_pFormShell->PrepareClose( bUI ) )
1775  {
1776  return false;
1777  }
1778  return SfxViewShell::PrepareClose( bUI );
1779 }
1780 
1781 // status methods for clipboard.
1782 // Status changes now notified from the clipboard.
1784 {
1786  if( m_nLastPasteDestination != nPasteDestination )
1787  {
1788  TransferableDataHelper aDataHelper(
1790  &GetEditWin()) );
1791  if( aDataHelper.GetXTransferable().is() )
1792  {
1795  *m_pWrtShell, aDataHelper );
1796  }
1797  else
1799 
1800  if( static_cast<SotExchangeDest>(0xFFFF) == m_nLastPasteDestination ) // the init value
1801  m_pViewImpl->AddClipboardListener();
1802  m_nLastPasteDestination = nPasteDestination;
1803  }
1804  return m_bPasteState;
1805 }
1806 
1808 {
1810  return false;
1811 
1813  if( m_nLastPasteDestination != nPasteDestination )
1814  {
1815  TransferableDataHelper aDataHelper(
1817  &GetEditWin()) );
1818  if( aDataHelper.GetXTransferable().is() )
1819  {
1822  *m_pWrtShell, aDataHelper );
1823  }
1824  else
1826 
1827  if( static_cast<SotExchangeDest>(0xFFFF) == m_nLastPasteDestination ) // the init value
1828  m_pViewImpl->AddClipboardListener();
1829  }
1830  return m_bPasteSpecialState;
1831 }
1832 
1833 bool SwView::IsPasteSpreadsheet(bool bHasOwnTableCopied)
1834 {
1835  TransferableDataHelper aDataHelper(
1837  &GetEditWin()) );
1838  if( aDataHelper.GetXTransferable().is() )
1839  {
1840  if (bHasOwnTableCopied && SwTransferable::IsPasteOwnFormat( aDataHelper ))
1841  return true;
1842  return aDataHelper.HasFormat( SotClipboardFormatId::SYLK ) || aDataHelper.HasFormat( SotClipboardFormatId::SYLK_BIGCAPS );
1843  }
1844  return false;
1845 }
1846 
1848 {
1850 }
1851 
1852 // Printing
1853 
1855 {
1856  SwXTextView *const pTempImpl = GetViewImpl()->GetUNOObject_Impl();
1857  return pTempImpl->BuildTmpSelectionDoc();
1858 }
1859 
1861 {
1862  GetViewImpl()->AddTransferable(rTransferable);
1863 }
1864 
1865 namespace sw {
1866 
1867 void InitPrintOptionsFromApplication(SwPrintData & o_rData, bool const bWeb)
1868 {
1869  o_rData = *SW_MOD()->GetPrtOptions(bWeb);
1870 }
1871 
1872 } // namespace sw
1873 
1874 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
void SetOptions(InputContextFlags nOptions)
OString stripEnd(const OString &rIn, char c)
Point TopLeft() const
SfxViewFrame * GetViewFrame() const
long Width() const
SfxObjectShellLock CreateTmpSelectionDoc()
Definition: view.cxx:1854
void StopShellTimer()
Definition: view.cxx:1752
static bool IsPasteOwnFormat(const TransferableDataHelper &)
Definition: swdtflvr.cxx:3241
static void ShowDBObj(SwView const &rView, const SwDBData &rData)
Definition: swmodul1.cxx:366
friend class SwView_Impl
Definition: view.hxx:148
void SetTopToolbar(SelectionType nSelType, ToolbarId eBarId)
Definition: barcfg.cxx:82
#define FN_REDLINE_ACCEPT_ALL
Definition: cmdid.h:143
long GetVisibleSize() const
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
#define FN_UPDATE_TOX
Definition: cmdid.h:502
SvxRulerSupportFlags
FieldUnit
SfxHintId
std::unique_ptr< SwFormatClipboard > m_pFormatClipboard
Definition: view.hxx:206
SwXTextView * GetUNOObject_Impl()
Definition: uivwimp.cxx:94
#define FN_REDLINE_REJECT_ALL
Definition: cmdid.h:144
#define FN_EDIT_REGION
Definition: cmdid.h:108
bool IsHeightEmpty() const
virtual void ApplyViewOptions(const SwViewOption &rOpt)
Definition: viewsh.cxx:2112
bool IsPasteSpecialAllowed()
Definition: view.cxx:1807
void SetActive(bool bOn=true)
std::unique_ptr< SwViewGlueDocShell > m_xGlueDocShell
Definition: view.hxx:182
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false)
SfxChildWindow * GetChildWindow(sal_uInt16)
FieldUnit GetVScrollMetric() const
Definition: usrpref.hxx:225
void SetReadonly(bool bSet)
Definition: viewopt.hxx:446
virtual void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &) override
Definition: view.cxx:1511
SdrView * GetDrawView()
Definition: vnew.cxx:375
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
SAL_DLLPRIVATE void CheckReadonlyState()
Definition: view.cxx:558
void SetDesignMode(bool bOn=true)
constexpr WinBits WB_EXTRAFIELD
void InitPrintOptionsFromApplication(SwPrintData &o_rData, bool const bWeb)
Definition: view.cxx:1867
#define FN_DELETE_SENT
Definition: cmdid.h:659
SfxViewFrame * GetFrame() const
#define FN_SET_SUPER_SCRIPT
Definition: cmdid.h:305
void SetZoom(sal_uInt16 n)
Definition: viewopt.hxx:488
const char aData[]
Definition: ww8scan.hxx:47
TABS
#define FN_DELETE_BACK_SENT
Definition: cmdid.h:660
virtual ~SwView() override
Definition: view.cxx:1058
std::string GetValue
std::unique_ptr< SwPostItMgr > m_pPostItMgr
Definition: view.hxx:208
void AddTransferable(SwTransferable &rTransferable)
Definition: view.cxx:1860
std::unique_ptr< SwWrtShell > m_pWrtShell
Definition: view.hxx:181
void UpdateFontList()
Definition: docshini.cxx:410
constexpr auto WB_STDRULER
void SetViewLayout(sal_uInt16 nColumns, bool bBookMode, bool bViewOnly=false)
Definition: viewmdi.cxx:220
bool IsPasteSpreadsheet(bool bHasOwnTableCopied)
Definition: view.cxx:1833
void Pop(SfxShell &rShell, SfxDispatcherPopFlags nMode=SfxDispatcherPopFlags::NONE)
virtual ErrCode DoVerb(long nVerb) override
Definition: view.cxx:1570
View of a document.
Definition: pview.hxx:161
VclPtr< SvxRuler > m_pHRuler
Definition: view.hxx:198
void Create(SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16 nVersionAbusedAsSize)
Definition: legacyitem.cxx:32
void SetDisableFlags(SfxDisableFlags nFlags)
void ImpSetVerb(SelectionType nSelType)
Definition: view.cxx:129
SfxDispatcher * GetDispatcher()
void GetSelectedText(OUString &rBuf, ParaBreakType nHndlParaBreak=ParaBreakType::ToBlank)
Query text within selection.
Definition: edglss.cxx:263
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getViewSettings() override
Definition: unotxvw.cxx:511
bool m_bAttrChgNotified
Definition: view.hxx:227
static bool IsPaste(const SwWrtShell &, const TransferableDataHelper &)
Definition: swdtflvr.cxx:1314
SAL_DLLPRIVATE void CheckReadonlySelection()
Definition: view.cxx:646
Reference< XFrame > xFrame
bool m_bOldShellWasPagePreview
Definition: view.hxx:227
Definition: doc.hxx:184
void SetViewLayoutColumns(sal_uInt16 nNew)
Definition: viewopt.hxx:464
sal_Int16 nId
void SetSlotFilter(SfxSlotFilterState nEnable=SfxSlotFilterState::DISABLED, o3tl::span< sal_uInt16 const > pSIDs=o3tl::span< sal_uInt16 const >())
static bool lcl_IsOwnDocument(SwView &rView)
Definition: view.cxx:1147
#define FN_DELETE_WHOLE_LINE
Definition: cmdid.h:667
Size m_aDocSz
Definition: view.hxx:177
virtual void WriteUserData(OUString &, bool bBrowse=false) override
Definition: view.cxx:1116
void RemoveChildEventListener(const Link< VclWindowEvent &, void > &rEventListener)
long SwTwips
Definition: swtypes.hxx:49
SwEditWin & GetEditWin()
Definition: view.hxx:401
static std::unique_ptr< SearchAttrItemList > s_xSearchList
Definition: view.hxx:161
bool IsPasteAllowed()
Definition: view.cxx:1783
static std::unique_ptr< SearchAttrItemList > s_xReplaceList
Definition: view.hxx:162
SotExchangeDest
WinBits const WB_VSCROLL
Dialog to specify the properties of date form field.
#define FN_INSERT_COLUMN_BREAK
Definition: cmdid.h:196
css::uno::Reference< css::frame::XModel > GetModel() const
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
const SwFrameFormat * m_pLastTableFormat
Definition: view.hxx:204
void Invalidate(sal_uInt16 nId)
bool IsShowHiddenPara() const
Definition: viewopt.hxx:379
static void notifyOtherViews(SfxViewShell *pThisView, int nType, const OString &rKey, const OString &rPayload)
#define FN_INSERT_LINEBREAK
Definition: cmdid.h:208
void ResetSubShell()
Definition: view.hxx:567
virtual SfxObjectShell * GetObjectShell() override
void AddTransferable(SwTransferable &rTransferable)
Definition: uivwimp.cxx:221
bool HasFormat(SotClipboardFormatId nFormat) const
#define FN_PASTE_NESTED_TABLE
Definition: cmdid.h:295
SwView & m_rView
Definition: view.hxx:137
SfxHintId GetId() const
SwView_Impl * GetViewImpl()
Definition: view.hxx:333
void SetVisArea(const tools::Rectangle &, bool bUpdateScrollbar=true)
Definition: viewport.cxx:195
FieldUnit GetHScrollMetric() const
Definition: usrpref.hxx:217
SwWrtShell & GetWrtShell() const
Definition: view.hxx:398
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:155
SvxZoomType GetZoomType() const
Definition: viewopt.hxx:528
bool m_bAttrChgNotifiedWithRegistrations
Definition: view.hxx:227
bool IsActive() const
#define FN_DELETE_BACK_WORD
Definition: cmdid.h:662
void SetDrawFuncPtr(std::unique_ptr< SwDrawBase > pFuncPtr)
Definition: viewdraw.cxx:632
bool IsEmpty() const
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
const OUStringLiteral IsReadOnly(u"IsReadOnly")
css::uno::Any const & rValue
#define FN_CALCULATE
Definition: cmdid.h:490
virtual void set(DocumentSettingId id, bool value)=0
Set the specified document setting.
bool IsFieldName() const
Definition: viewopt.hxx:267
vcl::Window & GetWindow() const
#define FN_DELETE_WORD
Definition: cmdid.h:661
SelectionType m_nSelectionType
Definition: view.hxx:210
static BitmapEx GetBitmap(const css::uno::Reference< css::awt::XBitmap > &rxBitmap)
long Right() const
void InvalidateBorder()
SfxShell * GetShell(sal_uInt16 nIdx) const
void Top(const long nTop)
Definition: swrect.hxx:204
virtual void SelectShell()
Definition: view.cxx:240
bool m_bVScrollbarEnabled
Definition: view.hxx:193
bool IsVisible(bool bReal) const
Definition: scroll.hxx:39
#define FN_INSERT_BOOKMARK
Definition: cmdid.h:193
bool getBrowseMode() const
Definition: viewopt.hxx:454
void PrtOLENotify(bool bAll)
Definition: docdesc.cxx:689
bool bDocSzUpdated
Definition: view.cxx:113
static bool IsFuzzing()
SfxFrame & GetFrame() const
void setBrowseMode(bool bSet)
Definition: viewopt.hxx:455
static TransferableDataHelper CreateFromSystemClipboard(vcl::Window *pWindow)
bool m_bPasteState
Definition: view.hxx:227
bool IsViewVScrollBar() const
Definition: viewopt.hxx:501
SwDoc * GetDoc() const
Definition: viewsh.hxx:281
virtual void ShowCursor(bool bOn=true) override
Definition: view.cxx:1555
long Top() const
static bool s_bJustOpened
Definition: view.hxx:159
const IDocumentMarkAccess * getIDocumentMarkAccess() const
Provides access to the document bookmark interface.
Definition: viewsh.cxx:2588
FmFormShell * m_pFormShell
Definition: view.hxx:185
SfxObjectCreateMode GetCreateMode() const
static SotExchangeDest GetSotDestination(const SwWrtShell &rSh)
Definition: swdtflvr.cxx:1969
ShellMode
Definition: view.hxx:85
void DocSzChgd(const Size &rNewSize)
Definition: viewport.cxx:151
virtual void Deactivate()
Definition: drawbase.cxx:439
bool IsViewHRuler(bool bDirect=false) const
Definition: viewopt.hxx:574
VclPtr< SwEditWin > m_pEditWin
Definition: view.hxx:180
#define FN_DELETE_PARA
Definition: cmdid.h:665
void CreateVRuler()
Definition: viewmdi.cxx:598
SotExchangeDest m_nLastPasteDestination
Definition: view.hxx:217
#define FN_SHRINK_FONT_SIZE
Definition: cmdid.h:303
void SetView(FmFormView *pView)
void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &rValues)
SfxItemPool & GetPool() const
virtual OUString GetSelectionText(bool bCompleteWords=false) override
Definition: view.cxx:1590
void KillVRuler()
Definition: viewmdi.cxx:607
SfxDispatcher & GetDispatcher()
Definition: view.cxx:124
IMPL_LINK_NOARG(SwView, FormControlActivated, LinkParamNone *, void)
Definition: view.cxx:188
void SetDebugName(const char *pDebugName)
#define SAL_N_ELEMENTS(arr)
virtual void ReadUserData(const OUString &, bool bBrowse=false) override
Definition: view.cxx:1161
#define FN_TABLE_PASTE_ROW_BEFORE
Definition: cmdid.h:296
void LaunchOLEObj(long nVerb=0)
Definition: wrtsh1.cxx:610
SwDoc * GetDoc()
returns Doc. But be careful!
Definition: docsh.hxx:203
SwView(SfxViewFrame *pFrame, SfxViewShell *)
Definition: view.cxx:701
#define FN_REDLINE_ACCEPT_DIRECT
Definition: cmdid.h:137
virtual tools::Rectangle GetVisArea(sal_uInt16 nAspect) const override
Definition: docsh.cxx:915
virtual void ClearFieldActivation()=0
void SetView(SwView *pVw)
Set View for actions via Shell.
Definition: docsh.cxx:1149
#define SWVIEWFLAGS
Definition: view.cxx:109
virtual FmFormShell * GetFormShell() override
Definition: view.hxx:563
#define FN_SET_SUB_SCRIPT
Definition: cmdid.h:306
Style of a layout element.
Definition: frmfmt.hxx:57
std::unique_ptr< SwGlossaryHdl > m_pGlosHdl
Definition: view.hxx:201
void SetZoomType(SvxZoomType eZoom_)
Definition: viewopt.hxx:554
bool IsCursorInProtectedArea() const
Definition: viewopt.hxx:391
bool HasSelection() const
Definition: wrtsh.hxx:141
#define SW_MOD()
Definition: swmodule.hxx:255
bool m_bIsPreviewDoubleClick
Definition: view.hxx:227
OUString m_sNewCursorPos
Definition: view.hxx:165
bool SelWrd(const Point *=nullptr)
Definition: select.cxx:72
void SetInputContext(const InputContext &rInputContext)
#define FN_DELETE_LINE
Definition: cmdid.h:663
void SetWindow(vcl::Window *pViewPort)
int i
VclPtr< vcl::Window > m_pScrollFill
Definition: view.hxx:195
bool IsViewLayoutBookMode() const
Definition: viewopt.hxx:461
void SetOnlineSpell(bool b)
Definition: viewopt.cxx:322
void GetOptions(SvtLinguOptions &rOptions) const
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Definition: edtwin.hxx:58
css::uno::Reference< css::datatransfer::XTransferable > GetXTransferable() const
virtual void ReadUserDataSequence(const css::uno::Sequence< css::beans::PropertyValue > &) override
Definition: view.cxx:1280
void SetAuto(bool bSet)
Definition: scroll.cxx:90
SwViewGlueDocShell(SwView &rView, SwDocShell &rDocSh)
Definition: view.cxx:1041
SfxBindings & GetBindings()
bool GetOpenInDesignMode() const
Size GetOutputSize() const
bool IsPreview() const
#define FN_REDLINE_PREV_CHANGE
Definition: cmdid.h:142
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
bool IsViewVRuler(bool bDirect=false) const
Definition: viewopt.hxx:588
#define FN_INSERT_BREAK_DLG
Definition: cmdid.h:195
#define SAL_MIN_INT32
void ShowUIElement(const OUString &sElementURL) const
Definition: view.cxx:228
const SfxItemSet * GetItemSet(const SfxPoolItem &rAttr)
Returns the item set associated with a character/inet/auto style.
Definition: atrstck.cxx:133
float u
long Bottom() const
static bool IsPasteSpecial(const SwWrtShell &rWrtShell, const TransferableDataHelper &)
Definition: swdtflvr.cxx:3232
bool IsActiveControl() const
void ShowVScrollbar(bool bShow)
Definition: viewmdi.cxx:670
#define FN_JAVAEDIT
Definition: cmdid.h:271
SfxDisableFlags GetDisableFlags() const
void Lock(bool bLock)
virtual void SetReadonlyOption(bool bSet) override
Definition: wrtsh1.cxx:1800
void NotifySelChanged()
Definition: unotxvw.cxx:678
Shell * m_pShell
void SetName(const OUString &rName)
virtual bool PrepareClose(bool bUI=true) override
Definition: view.cxx:1767
SfxItemState QueryState(sal_uInt16 nSID, const SfxPoolItem *&rpState)
void LeaveDrawCreate()
Definition: view.hxx:523
void RequestDoubleBuffering(bool bRequest)
SwDrawBase * GetDrawFuncPtr() const
Definition: view.hxx:511
void CreateTab()
Definition: viewmdi.cxx:556
#define ASPECT_CONTENT
void SetTimeout(sal_uInt64 nTimeoutMs)
VclPtr< SvxRuler > m_pVRuler
Definition: view.hxx:198
InputContextFlags GetOptions() const
SfxViewShell * GetViewShell() const
#define FN_SELECT_PARA
Definition: cmdid.h:118
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:405
const Size & GetMargin() const
SwDocShell * GetDocShell()
Definition: view.cxx:1108
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
bool IsReadOnly() const
OUString m_sSwViewData
Definition: view.hxx:165
#define SFX_OBJECTBAR_OBJECT
void ShowHScrollbar(bool bShow)
Definition: viewmdi.cxx:658
Point PixelToLogic(const Point &rDevicePt) const
SelectionType
Definition: wrtsh.hxx:58
static int lcl_CmpIds(const void *pFirst, const void *pSecond)
Definition: view.cxx:481
WinBits const WB_SIZEABLE
#define FN_DELETE_BACK_LINE
Definition: cmdid.h:664
void Left(const long nLeft)
Definition: swrect.hxx:195
void SetVerbs(const css::uno::Sequence< css::embed::VerbDescriptor > &aVerbs)
void SetZoom(SvxZoomType eZoomType, short nFactor=100, bool bViewOnly=false)
Definition: viewmdi.cxx:72
void SetViewLayoutBookMode(bool bNew)
Definition: viewopt.hxx:462
sal_uInt16 m_nNewPage
Definition: view.hxx:169
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:399
VclPtr< SwScrollbar > m_pVScrollbar
Definition: view.hxx:189
SfxDispatcher * GetDispatcher()
Timer m_aTimer
Definition: view.hxx:164
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
constexpr sal_Int64 convertTwipToMm100(sal_Int64 n)
SfxItemState
virtual bool IsTextEdit() const final override
void Stop()
long GetRangeMax() const
#define SAL_WARN_IF(condition, area, stream)
#define ERRCODE_NONE
std::unique_ptr< SwView_Impl > m_pViewImpl
Definition: view.hxx:187
WinBits const WB_BORDER
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
#define FN_DELETE_BACK_PARA
Definition: cmdid.h:666
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:423
static bool s_bFound
Definition: view.hxx:158
void GotFocus() const
Definition: view.cxx:154
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:254
#define FN_REDLINE_NEXT_CHANGE
Definition: cmdid.h:141
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
virtual SAL_DLLPRIVATE void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: view.cxx:1614
#define SAL_INFO(area, stream)
bool m_bPasteSpecialState
Definition: view.hxx:227
void NotifyDBChanged()
Definition: unotxvw.cxx:705
void UpdatePointer(const Point &, sal_uInt16 nButtons=0)
Definition: edtwin.cxx:334
This class acts as data container and execution class for the format paintbrush feature in writer...
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:176
bool PrepareClose(bool bUI=true)
#define FN_BACKSPACE
Definition: cmdid.h:658
static VclPtr< reference_type > Create(Arg &&...arg)
void SetChildWindow(sal_uInt16 nId, bool bVisible, bool bSetFocus=true)
#define FN_TABLE_PASTE_COL_BEFORE
Definition: cmdid.h:297
OUString GetSelectionTextParam(bool bCompleteWords, bool bEraseTrail)
Definition: view.cxx:1595
VclPtr< SwScrollbar > m_pHScrollbar
Definition: view.hxx:189
void Push(SfxShell &rShell)
void NotifyDBChanged()
Definition: view.cxx:1847
sal_uInt16 GetZoom() const
Definition: viewopt.hxx:487
bool IsInModalMode() const
void Execute(SfxRequest &)
Definition: view2.cxx:530
ToolbarId
void SetInvokeHandler(const Link< Timer *, void > &rLink)
bool IsDocumentBorder()
Definition: viewport.cxx:51
bool IsWidthEmpty() const
SfxObjectShellLock BuildTmpSelectionDoc()
Definition: unotxvw.cxx:643
long Left() const
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
constexpr sal_Int64 convertMm100ToTwip(sal_Int64 n)
SwGlossaryHdl * GetGlosHdl()
Definition: view.cxx:1607
#define FN_GROW_FONT_SIZE
Definition: cmdid.h:302
SvxSearchCmd
#define FN_TXTATR_INET
Definition: cmdid.h:730
const tools::Rectangle & GetVisArea() const
Definition: view.hxx:411
bool IsEnableSetModified() const
bool IsLocked() const
#define FN_SHIFT_BACKSPACE
Definition: cmdid.h:673
static SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
void ScannerEventHdl()
Definition: view.cxx:1722
SfxShell * m_pShell
Definition: view.hxx:184
void InvalidateAll(bool bWithMsg)
bool g_bNoInterrupt
Definition: swmodule.cxx:114
virtual void SetCurrentViewShell(SwViewShell *pNew)=0
!!!The old layout must be deleted!!!
#define SAL_WARN(area, stream)
bool m_bInDtor
Definition: view.hxx:227
void SetControlActivationHandler(const Link< LinkParamNone *, void > &_rHdl)
const SwView * GetView() const
Definition: docsh.hxx:220
Point OutputToScreenPixel(const Point &rPos) const
SvxZoomType
SfxDisableFlags
bool IsShowHiddenChar(bool bHard=false) const
Definition: viewopt.hxx:303
bool IsShowHiddenField() const
Definition: viewopt.hxx:310
void EnableSetModified(bool bEnable=true)
virtual SdrView * GetDrawView() const override
Definition: viewdraw.cxx:612
void KillTab()
Definition: viewmdi.cxx:564
#define DOCUMENTBORDER
Definition: swtypes.hxx:82
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1398
SAL_DLLPRIVATE void CreateScrollbar(bool bHori)
Definition: viewmdi.cxx:296
static SvxSearchItem * s_pSrchItem
Definition: view.hxx:152
bool IsViewHScrollBar() const
Definition: viewopt.hxx:509
#define FN_REDLINE_REJECT_DIRECT
Definition: cmdid.h:138
bool m_bHScrollbarEnabled
Definition: view.hxx:192
bool m_bVerbsActive
Definition: view.hxx:227
void ReadUserDataSequenceValue(const css::beans::PropertyValue *pValue)
ToolbarId GetObjectBarId(sal_uInt16 nPos) const
sal_uInt16 GetViewLayoutColumns() const
Definition: viewopt.hxx:463
static bool s_bExtra
Definition: view.hxx:157
virtual bool HasSelection(bool bText=true) const override
Definition: view.cxx:1584
void ForgetActiveControl()
void AddChildEventListener(const Link< VclWindowEvent &, void > &rEventListener)
#define FN_POSTIT
Definition: cmdid.h:212
virtual bool PrepareClose(bool bUI=true)
Definition: view.hxx:144
bool m_bInitOnceCompleted
Definition: view.hxx:248
void SetNewWindowAllowed(bool bSet)
sal_uInt16 nPos
#define FN_FORMAT_DROPCAPS
Definition: cmdid.h:316