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_eFormObjKind(OBJ_NONE),
724  m_nLastPasteDestination( static_cast<SotExchangeDest>(0xFFFF) ),
725  m_nLeftBorderDistance( 0 ),
726  m_nRightBorderDistance( 0 ),
727  m_eLastSearchCommand( static_cast<SvxSearchCmd>(0xFFFF) ),
728  m_bWheelScrollInProgress(false),
729  m_bCenterCursor(false),
730  m_bTopCursor(false),
731  m_bTabColFromDoc(false),
732  m_bTabRowFromDoc(false),
733  m_bSetTabColFromDoc(false),
734  m_bSetTabRowFromDoc(false),
735  m_bAttrChgNotified(false),
736  m_bAttrChgNotifiedWithRegistrations(false),
737  m_bVerbsActive(false),
738  m_bDrawRotate(false),
739  m_bDrawSelMode(true),
740  m_bShowAtResize(true),
741  m_bInOuterResizePixel(false),
742  m_bInInnerResizePixel(false),
743  m_bPasteState(false),
744  m_bPasteSpecialState(false),
745  m_bInMailMerge(false),
746  m_bInDtor(false),
747  m_bOldShellWasPagePreview(false),
748  m_bIsPreviewDoubleClick(false),
749  m_bMakeSelectionVisible(false),
750  m_nLOKPageUpDownOffset(0)
751 {
752  static bool bRequestDoubleBuffering = getenv("VCL_DOUBLEBUFFERING_ENABLE");
753  if (bRequestDoubleBuffering)
755 
756  // According to discussion with MBA and further
757  // investigations, no old SfxViewShell will be set as parameter <pOldSh>,
758  // if function "New Window" is performed to open an additional view beside
759  // an already existing one.
760  // If the view is switch from one to another, the 'old' view is given by
761  // parameter <pOldSh>.
762 
763  bDocSzUpdated = true;
764 
765  CreateScrollbar( true );
766  CreateScrollbar( false );
767 
768  m_pViewImpl.reset(new SwView_Impl(this));
769  SetName("View");
771 
772  m_aTimer.SetTimeout( 120 );
773 
774  SwDocShell& rDocSh = dynamic_cast<SwDocShell&>(*_pFrame->GetObjectShell());
775  bool bOldModifyFlag = rDocSh.IsEnableSetModified();
776  if (bOldModifyFlag)
777  rDocSh.EnableSetModified( false );
778  // HACK: SwDocShell has some cached font info, VCL informs about font updates,
779  // but loading of docs with embedded fonts happens after SwDocShell is created
780  // but before SwEditWin (which handles the VCL event) is created. So update
781  // manually.
783  rDocSh.UpdateFontList();
784  bool bWebDShell = dynamic_cast<const SwWebDocShell*>(&rDocSh) != nullptr;
785 
786  const SwMasterUsrPref *pUsrPref = SW_MOD()->GetUsrPref(bWebDShell);
787  SwViewOption aUsrPref( *pUsrPref);
788 
790  SvtLinguOptions aLinguOpt;
791  SvtLinguConfig().GetOptions( aLinguOpt );
792  aUsrPref.SetOnlineSpell( aLinguOpt.bIsSpellAuto );
793 
794  bool bOldShellWasSrcView = false;
795 
796  // determine if there is an existing view for
797  // document
798  SfxViewShell* pExistingSh = nullptr;
799  if ( pOldSh )
800  {
801  pExistingSh = pOldSh;
802  // determine type of existing view
803  if (SwPagePreview* pPagePreview = dynamic_cast<SwPagePreview *>(pExistingSh))
804  {
805  m_sSwViewData = pPagePreview->GetPrevSwViewData();
806  m_sNewCursorPos = pPagePreview->GetNewCursorPos();
807  m_nNewPage = pPagePreview->GetNewPage();
810  }
811  else if (dynamic_cast<const SwSrcView *>(pExistingSh) != nullptr)
812  bOldShellWasSrcView = true;
813  }
814 
815  SAL_INFO( "sw.ui", "before create WrtShell" );
816  if (SwView *pView = dynamic_cast<SwView*>(pExistingSh))
817  {
818  m_pWrtShell.reset(new SwWrtShell(*pView->m_pWrtShell, m_pEditWin, *this));
819  }
820  else if (SwWrtShell *pWrtShell = dynamic_cast<SwWrtShell*>(rDocSh.GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell()))
821  {
822  m_pWrtShell.reset(new SwWrtShell(*pWrtShell, m_pEditWin, *this));
823  }
824  else
825  {
826  SwDoc& rDoc = *rDocSh.GetDoc();
827 
828  if( !bOldShellWasSrcView && bWebDShell && !m_bOldShellWasPagePreview )
829  aUsrPref.setBrowseMode( true );
830  else
832 
833  //For the BrowseMode we do not assume a factor.
834  if( aUsrPref.getBrowseMode() && aUsrPref.GetZoomType() != SvxZoomType::PERCENT )
835  {
836  aUsrPref.SetZoomType( SvxZoomType::PERCENT );
837  aUsrPref.SetZoom( 100 );
838  }
839  if (rDocSh.IsPreview())
840  {
841  aUsrPref.SetZoomType( SvxZoomType::WHOLEPAGE );
842  aUsrPref.SetViewLayoutBookMode( false );
843  aUsrPref.SetViewLayoutColumns( 1 );
844  }
845  m_pWrtShell.reset(new SwWrtShell(rDoc, m_pEditWin, *this, &aUsrPref));
846  // creating an SwView from a SwPagePreview needs to
847  // add the SwViewShell to the ring of the other SwViewShell(s)
849  {
850  SwViewShell& rPreviewViewShell = *static_cast<SwPagePreview*>(pExistingSh)->GetViewShell();
851  m_pWrtShell->MoveTo(&rPreviewViewShell);
852  // to update the field command et.al. if necessary
853  const SwViewOption* pPreviewOpt = rPreviewViewShell.GetViewOptions();
854  if( pPreviewOpt->IsFieldName() != aUsrPref.IsFieldName() ||
855  pPreviewOpt->IsShowHiddenField() != aUsrPref.IsShowHiddenField() ||
856  pPreviewOpt->IsShowHiddenPara() != aUsrPref.IsShowHiddenPara() ||
857  pPreviewOpt->IsShowHiddenChar() != aUsrPref.IsShowHiddenChar() )
858  rPreviewViewShell.ApplyViewOptions(aUsrPref);
859  // reset design mode at draw view for form
860  // shell, if needed.
861  if ( static_cast<SwPagePreview*>(pExistingSh)->ResetFormDesignMode() &&
862  m_pWrtShell->HasDrawView() )
863  {
864  SdrView* pDrawView = m_pWrtShell->GetDrawView();
865  pDrawView->SetDesignMode( static_cast<SwPagePreview*>(pExistingSh)->FormDesignModeToReset() );
866  }
867  }
868  }
869  SAL_INFO( "sw.ui", "after create WrtShell" );
871  SvxRulerSupportFlags::TABS |
872  SvxRulerSupportFlags::PARAGRAPH_MARGINS |
873  SvxRulerSupportFlags::BORDERS |
874  SvxRulerSupportFlags::NEGATIVE_MARGINS|
875  SvxRulerSupportFlags::REDUCED_METRIC,
878 
879  // assure that modified state of document
880  // isn't reset, if document is already modified.
881  const bool bIsDocModified = m_pWrtShell->GetDoc()->getIDocumentState().IsModified();
882 
883  // Thus among other things, the HRuler is not displayed in the read-only case.
884  aUsrPref.SetReadonly( m_pWrtShell->GetViewOptions()->IsReadonly() );
885 
886  // no margin for OLE!
887  Size aBrwsBorder;
888  if( SfxObjectCreateMode::EMBEDDED != rDocSh.GetCreateMode() )
889  aBrwsBorder = GetMargin();
890 
891  m_pWrtShell->SetBrowseBorder( aBrwsBorder );
892 
893  // In CTOR no shell changes may take place, which must be temporarily stored
894  // with the timer. Otherwise, the SFX removes them from the stack!
895  bool bOld = g_bNoInterrupt;
896  g_bNoInterrupt = true;
897 
898  m_pHRuler->SetActive();
899  m_pVRuler->SetActive();
900 
901  SfxViewFrame* pViewFrame = GetViewFrame();
902 
903  StartListening(*pViewFrame, DuplicateHandling::Prevent);
904  StartListening(rDocSh, DuplicateHandling::Prevent);
905 
906  // Set Zoom-factor from HRuler
907  Fraction aZoomFract( aUsrPref.GetZoom(), 100 );
908  m_pHRuler->SetZoom( aZoomFract );
909  m_pVRuler->SetZoom( aZoomFract );
910  m_pHRuler->SetDoubleClickHdl(LINK( this, SwView, ExecRulerClick ));
911  FieldUnit eMetric = pUsrPref->GetHScrollMetric();
912  m_pHRuler->SetUnit( eMetric );
913 
914  eMetric = pUsrPref->GetVScrollMetric();
915  m_pVRuler->SetUnit( eMetric );
916 
917  m_pHRuler->SetCharWidth( 371 ); // default character width
918  m_pVRuler->SetLineHeight( 551 ); // default line height
919 
920  // Set DocShell
921  m_xGlueDocShell.reset(new SwViewGlueDocShell(*this, rDocSh));
922  m_pPostItMgr.reset(new SwPostItMgr(this));
923 
924  // Check and process the DocSize. Via the handler, the shell could not
925  // be found, because the shell is not known in the SFX management
926  // within the CTOR phase.
927  DocSzChgd( m_pWrtShell->GetDocSize() );
928 
929  // Set AttrChangedNotify link
930  m_pWrtShell->SetChgLnk(LINK(this, SwView, AttrChangedNotify));
931 
932  if (rDocSh.GetCreateMode() == SfxObjectCreateMode::EMBEDDED &&
933  !rDocSh.GetVisArea(ASPECT_CONTENT).IsEmpty())
934  SetVisArea(rDocSh.GetVisArea(ASPECT_CONTENT),false);
935 
936  SAL_WARN_IF(
938  "sw.ui", "/org.openoffice.Office.Common/Undo/Steps <= 0");
940  {
941  m_pWrtShell->DoUndo();
942  }
943 
944  const bool bBrowse = m_pWrtShell->GetViewOptions()->getBrowseMode();
945  // Disable "multiple window"
946  SetNewWindowAllowed(!bBrowse);
947  // End of disabled multiple window
948 
951  m_pHScrollbar->SetAuto(bBrowse);
952  if( aUsrPref.IsViewHRuler() )
953  CreateTab();
954  if( aUsrPref.IsViewVRuler() )
955  CreateVRuler();
956 
957  m_pWrtShell->SetUIOptions( aUsrPref );
958  m_pWrtShell->SetReadOnlyAvailable( aUsrPref.IsCursorInProtectedArea() );
959  m_pWrtShell->ApplyAccessibilityOptions(SW_MOD()->GetAccessibilityOptions());
960 
961  if( m_pWrtShell->GetDoc()->getIDocumentState().IsUpdateExpField() )
962  {
963  if (m_pWrtShell->GetDoc()->GetDocumentFieldsManager().containsUpdatableFields())
964  {
965  CurrShell aCurr(m_pWrtShell.get());
966  m_pWrtShell->StartAction();
967  m_pWrtShell->CalcLayout();
968  m_pWrtShell->GetDoc()->getIDocumentFieldsAccess().UpdateFields(false);
969  m_pWrtShell->EndAction();
970  }
971  m_pWrtShell->GetDoc()->getIDocumentState().SetUpdateExpFieldStat( false );
972  }
973 
974  // Update all tables if necessary:
975  if( m_pWrtShell->GetDoc()->IsUpdateTOX() )
976  {
977  SfxRequest aSfxRequest( FN_UPDATE_TOX, SfxCallMode::SLOT, GetPool() );
978  Execute( aSfxRequest );
979  m_pWrtShell->GetDoc()->SetUpdateTOX( false ); // reset again
980  m_pWrtShell->SttEndDoc(true);
981  }
982 
983  // No ResetModified, if there is already a view to this doc.
984  SfxViewFrame* pVFrame = GetViewFrame();
985  SfxViewFrame* pFirst = SfxViewFrame::GetFirst(&rDocSh);
986  // Currently(360) the view is registered firstly after the CTOR,
987  // the following expression is also working if this changes.
988  // If the modification cannot be canceled by undo, then do NOT set
989  // the modify back.
990  // no reset of modified state, if document
991  // was already modified.
992  if (!m_pWrtShell->GetDoc()->GetIDocumentUndoRedo().IsUndoNoResetModified() &&
993  ( !pFirst || pFirst == pVFrame ) &&
994  !bIsDocModified )
995  {
996  m_pWrtShell->ResetModified();
997  }
998 
999  g_bNoInterrupt = bOld;
1000 
1001  // If a new GlobalDoc will be created, the navigator will also be generated.
1002  if( dynamic_cast<const SwGlobalDocShell*>(&rDocSh) != nullptr &&
1003  !pVFrame->GetChildWindow( SID_NAVIGATOR ))
1004  {
1005  SfxBoolItem aNavi(SID_NAVIGATOR, true);
1006  GetDispatcher().ExecuteList(SID_NAVIGATOR, SfxCallMode::ASYNCHRON, { &aNavi });
1007  }
1008 
1009  uno::Reference< frame::XFrame > xFrame = pVFrame->GetFrame().GetFrameInterface();
1010 
1011  uno::Reference< frame::XFrame > xBeamerFrame = xFrame->findFrame(
1012  "_beamer", frame::FrameSearchFlag::CHILDREN);
1013  if(xBeamerFrame.is())
1014  {
1015  SwDBData aData = m_pWrtShell->GetDBData();
1016  SwModule::ShowDBObj( *this, aData );
1017  }
1018 
1019  // has anybody calls the attrchanged handler in the constructor?
1021  {
1022  GetViewFrame()->GetBindings().LEAVEREGISTRATIONS();
1023  if( m_aTimer.IsActive() )
1024  m_aTimer.Stop();
1025  }
1026 
1027  m_aTimer.SetInvokeHandler(LINK(this, SwView, TimeoutHdl));
1028  m_aTimer.SetDebugName( "sw::SwView m_aTimer" );
1030  if (bOldModifyFlag)
1031  rDocSh.EnableSetModified();
1032  InvalidateBorder();
1033 
1034  if( !m_pHScrollbar->IsVisible( true ) )
1035  ShowHScrollbar( false );
1036  if( !m_pVScrollbar->IsVisible( true ) )
1037  ShowVScrollbar( false );
1038 
1039  GetViewFrame()->GetWindow().AddChildEventListener( LINK( this, SwView, WindowChildEventListener ) );
1040 }
1041 
1043  : m_rView(rView)
1044 {
1045  // Set DocShell
1046  rDocSh.SetView(&m_rView);
1047  SW_MOD()->SetView(&m_rView);
1048 }
1049 
1051 {
1052  SwDocShell* pDocSh = m_rView.GetDocShell();
1053  if (pDocSh && pDocSh->GetView() == &m_rView)
1054  pDocSh->SetView(nullptr);
1055  if (SW_MOD()->GetView() == &m_rView)
1056  SW_MOD()->SetView(nullptr);
1057 }
1058 
1060 {
1061  // Notify other LOK views that we are going away.
1062  SfxLokHelper::notifyOtherViews(this, LOK_CALLBACK_VIEW_CURSOR_VISIBLE, "visible", "false");
1063  SfxLokHelper::notifyOtherViews(this, LOK_CALLBACK_TEXT_VIEW_SELECTION, "selection", "");
1064  SfxLokHelper::notifyOtherViews(this, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", "EMPTY");
1065 
1066  // Need to remove activated field's button before disposing EditWin.
1068 
1069  GetViewFrame()->GetWindow().RemoveChildEventListener( LINK( this, SwView, WindowChildEventListener ) );
1070  m_pPostItMgr.reset();
1071 
1072  m_bInDtor = true;
1073  m_pEditWin->Hide(); // prevent problems with painting
1074 
1075  // Set pointer in SwDocShell to the view again
1076  m_xGlueDocShell.reset();
1077 
1079  GetViewFrame()->GetBindings().LEAVEREGISTRATIONS();
1080 
1081  // the last view must end the text edit
1082  SdrView *pSdrView = m_pWrtShell ? m_pWrtShell->GetDrawView() : nullptr;
1083  if( pSdrView && pSdrView->IsTextEdit() )
1084  pSdrView->SdrEndTextEdit( true );
1085 
1086  SetWindow( nullptr );
1087 
1088  m_pViewImpl->Invalidate();
1089  EndListening(*GetViewFrame());
1090  EndListening(*GetDocShell());
1092  m_pWrtShell.reset(); // reset here so that it is not accessible by the following dtors.
1097  m_pGlosHdl.reset();
1098  m_pViewImpl.reset();
1099 
1100  // If this was enabled in the ctor for the frame, then disable it here.
1101  static bool bRequestDoubleBuffering = getenv("VCL_DOUBLEBUFFERING_ENABLE");
1102  if (bRequestDoubleBuffering)
1105 
1106  m_pFormatClipboard.reset();
1107 }
1108 
1110 {
1111  SfxObjectShell* pDocShell = GetViewFrame()->GetObjectShell();
1112  return dynamic_cast<SwDocShell*>( pDocShell );
1113 }
1114 
1115 // Remember CursorPos
1116 
1117 void SwView::WriteUserData( OUString &rUserData, bool bBrowse )
1118 {
1119  // The browse flag will be passed from Sfx when documents are browsed
1120  // (not to be confused with the BrowseMode).
1121  // Then that stored data are not persistent!
1122 
1123  const SwRect& rRect = m_pWrtShell->GetCharRect();
1124  const tools::Rectangle& rVis = GetVisArea();
1125 
1126  rUserData = OUString::number( rRect.Left() );
1127  rUserData += ";";
1128  rUserData += OUString::number( rRect.Top() );
1129  rUserData += ";";
1130  rUserData += OUString::number( m_pWrtShell->GetViewOptions()->GetZoom() );
1131  rUserData += ";";
1132  rUserData += OUString::number( rVis.Left() );
1133  rUserData += ";";
1134  rUserData += OUString::number( rVis.Top() );
1135  rUserData += ";";
1136  rUserData += OUString::number( bBrowse ? SAL_MIN_INT32 : rVis.Right());
1137  rUserData += ";";
1138  rUserData += OUString::number( bBrowse ? SAL_MIN_INT32 : rVis.Bottom());
1139  rUserData += ";";
1140  rUserData += OUString::number(
1141  static_cast<sal_uInt16>(m_pWrtShell->GetViewOptions()->GetZoomType()));//eZoom;
1142  rUserData += ";";
1143  rUserData += FrameTypeFlags::NONE == m_pWrtShell->GetSelFrameType() ? OUStringLiteral(u"0") : OUStringLiteral(u"1");
1144 }
1145 
1146 // Set CursorPos
1147 
1148 static bool lcl_IsOwnDocument( SwView& rView )
1149 {
1150  uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
1151  rView.GetDocShell()->GetModel(), uno::UNO_QUERY_THROW);
1152  uno::Reference<document::XDocumentProperties> xDocProps
1153  = xDPS->getDocumentProperties();
1154  OUString Created = xDocProps->getAuthor();
1155  OUString Changed = xDocProps->getModifiedBy();
1156  OUString FullName = SW_MOD()->GetUserOptions().GetFullName();
1157  return (!FullName.isEmpty() &&
1158  (!Changed.isEmpty() && Changed == FullName )) ||
1159  (Changed.isEmpty() && !Created.isEmpty() && Created == FullName );
1160 }
1161 
1162 void SwView::ReadUserData( const OUString &rUserData, bool bBrowse )
1163 {
1164  if ( !(rUserData.indexOf(';')>=0 && // more than one token
1165  // For document without layout only in the onlinelayout or
1166  // while forward/backward
1167  (!m_pWrtShell->IsNewLayout() || m_pWrtShell->GetViewOptions()->getBrowseMode() || bBrowse)) )
1168  return;
1169 
1170  bool bIsOwnDocument = lcl_IsOwnDocument( *this );
1171 
1172  CurrShell aCurr(m_pWrtShell.get());
1173 
1174  sal_Int32 nPos = 0;
1175 
1176  // No it is *not* a good idea to call GetToken within Point constr. immediately,
1177  // because which parameter is evaluated first?
1178  tools::Long nX = rUserData.getToken( 0, ';', nPos ).toInt32(),
1179  nY = rUserData.getToken( 0, ';', nPos ).toInt32();
1180  Point aCursorPos( nX, nY );
1181 
1182  sal_uInt16 nZoomFactor =
1183  static_cast< sal_uInt16 >( rUserData.getToken(0, ';', nPos ).toInt32() );
1184 
1185  tools::Long nLeft = rUserData.getToken(0, ';', nPos ).toInt32(),
1186  nTop = rUserData.getToken(0, ';', nPos ).toInt32(),
1187  nRight = rUserData.getToken(0, ';', nPos ).toInt32(),
1188  nBottom= rUserData.getToken(0, ';', nPos ).toInt32();
1189 
1190  const tools::Long nAdd = m_pWrtShell->GetViewOptions()->getBrowseMode() ? DOCUMENTBORDER : DOCUMENTBORDER*2;
1191  if ( nBottom > (m_pWrtShell->GetDocSize().Height()+nAdd) )
1192  return;
1193 
1194  m_pWrtShell->EnableSmooth( false );
1195 
1196  const tools::Rectangle aVis( nLeft, nTop, nRight, nBottom );
1197 
1198  sal_Int32 nOff = 0;
1199  SvxZoomType eZoom;
1200  if( !m_pWrtShell->GetViewOptions()->getBrowseMode() )
1201  eZoom = static_cast<SvxZoomType>(static_cast<sal_uInt16>(rUserData.getToken(nOff, ';', nPos ).toInt32()));
1202  else
1203  {
1204  eZoom = SvxZoomType::PERCENT;
1205  ++nOff;
1206  }
1207 
1208  bool bSelectObj = (0 != rUserData.getToken( nOff, ';', nPos ).toInt32())
1209  && m_pWrtShell->IsObjSelectable( aCursorPos );
1210 
1211  // restore editing position
1212  m_pViewImpl->SetRestorePosition(aCursorPos, bSelectObj);
1213  // set flag value to avoid macro execution.
1214  bool bSavedFlagValue = m_pWrtShell->IsMacroExecAllowed();
1215  m_pWrtShell->SetMacroExecAllowed( false );
1216 // os: changed: The user data has to be read if the view is switched back from page preview
1217 // go to the last editing position when opening own files
1218  if(m_bOldShellWasPagePreview || bIsOwnDocument)
1219  {
1220  m_pWrtShell->SwCursorShell::SetCursor( aCursorPos, !bSelectObj );
1221  if( bSelectObj )
1222  {
1223  m_pWrtShell->SelectObj( aCursorPos );
1224  m_pWrtShell->EnterSelFrameMode( &aCursorPos );
1225  }
1226  }
1227 
1228  // reset flag value
1229  m_pWrtShell->SetMacroExecAllowed( bSavedFlagValue );
1230 
1231  // set visible area before applying
1232  // information from print preview. Otherwise, the applied information
1233  // is lost.
1234 // os: changed: The user data has to be read if the view is switched back from page preview
1235 // go to the last editing position when opening own files
1236  if(m_bOldShellWasPagePreview || bIsOwnDocument )
1237  {
1238  if ( bBrowse )
1239  SetVisArea( aVis.TopLeft() );
1240  else
1241  SetVisArea( aVis );
1242  }
1243 
1244  //apply information from print preview - if available
1245  if( !m_sNewCursorPos.isEmpty() )
1246  {
1247  sal_Int32 nIdx{ 0 };
1248  const tools::Long nXTmp = m_sNewCursorPos.getToken( 0, ';', nIdx ).toInt32();
1249  const tools::Long nYTmp = m_sNewCursorPos.getToken( 0, ';', nIdx ).toInt32();
1250  Point aCursorPos2( nXTmp, nYTmp );
1251  bSelectObj = m_pWrtShell->IsObjSelectable( aCursorPos2 );
1252 
1253  m_pWrtShell->SwCursorShell::SetCursor( aCursorPos2 );
1254  if( bSelectObj )
1255  {
1256  m_pWrtShell->SelectObj( aCursorPos2 );
1257  m_pWrtShell->EnterSelFrameMode( &aCursorPos2 );
1258  }
1259  m_pWrtShell->MakeSelVisible();
1260  m_sNewCursorPos.clear();
1261  }
1262  else if(USHRT_MAX != m_nNewPage)
1263  {
1264  m_pWrtShell->GotoPage(m_nNewPage, true);
1266  }
1267 
1268  SelectShell();
1269 
1270  m_pWrtShell->StartAction();
1271  const SwViewOption* pVOpt = m_pWrtShell->GetViewOptions();
1272  if( pVOpt->GetZoom() != nZoomFactor || pVOpt->GetZoomType() != eZoom )
1273  SetZoom( eZoom, nZoomFactor);
1274 
1275  m_pWrtShell->LockView( true );
1276  m_pWrtShell->EndAction();
1277  m_pWrtShell->LockView( false );
1278  m_pWrtShell->EnableSmooth( true );
1279 }
1280 
1281 void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >& rSequence )
1282 {
1283  if(GetDocShell()->IsPreview()||m_bIsPreviewDoubleClick)
1284  return;
1285  bool bIsOwnDocument = lcl_IsOwnDocument( *this );
1286 
1287  CurrShell aCurr(m_pWrtShell.get());
1288  const SwRect& rRect = m_pWrtShell->GetCharRect();
1289  const tools::Rectangle &rVis = GetVisArea();
1290  const SwViewOption* pVOpt = m_pWrtShell->GetViewOptions();
1291 
1292  sal_Int64 nX = rRect.Left(), nY = rRect.Top(), nLeft = rVis.Left(), nTop = rVis.Top();
1293  sal_Int64 nRight = nLeft;
1294  sal_Int64 nBottom = LONG_MIN;
1295  sal_Int16 nZoomType = static_cast< sal_Int16 >(pVOpt->GetZoomType());
1296  sal_Int16 nZoomFactor = static_cast < sal_Int16 > (pVOpt->GetZoom());
1297  bool bViewLayoutBookMode = pVOpt->IsViewLayoutBookMode();
1298  sal_Int16 nViewLayoutColumns = pVOpt->GetViewLayoutColumns();
1299 
1300  bool bSelectedFrame = ( m_pWrtShell->GetSelFrameType() != FrameTypeFlags::NONE ),
1301  bGotVisibleLeft = false,
1302  bGotVisibleTop = false, bGotVisibleRight = false,
1303  bGotVisibleBottom = false, bGotZoomType = false,
1304  bGotZoomFactor = false, bGotIsSelectedFrame = false,
1305  bGotViewLayoutColumns = false, bGotViewLayoutBookMode = false,
1306  bBrowseMode = false, bGotBrowseMode = false;
1307 
1308  for (const beans::PropertyValue& rValue : rSequence)
1309  {
1310  if ( rValue.Name == "ViewLeft" )
1311  {
1312  rValue.Value >>= nX;
1313  nX = convertMm100ToTwip( nX );
1314  }
1315  else if ( rValue.Name == "ViewTop" )
1316  {
1317  rValue.Value >>= nY;
1318  nY = convertMm100ToTwip( nY );
1319  }
1320  else if ( rValue.Name == "VisibleLeft" )
1321  {
1322  rValue.Value >>= nLeft;
1323  nLeft = convertMm100ToTwip( nLeft );
1324  bGotVisibleLeft = true;
1325  }
1326  else if ( rValue.Name == "VisibleTop" )
1327  {
1328  rValue.Value >>= nTop;
1329  nTop = convertMm100ToTwip( nTop );
1330  bGotVisibleTop = true;
1331  }
1332  else if ( rValue.Name == "VisibleRight" )
1333  {
1334  rValue.Value >>= nRight;
1335  nRight = convertMm100ToTwip( nRight );
1336  bGotVisibleRight = true;
1337  }
1338  else if ( rValue.Name == "VisibleBottom" )
1339  {
1340  rValue.Value >>= nBottom;
1341  nBottom = convertMm100ToTwip( nBottom );
1342  bGotVisibleBottom = true;
1343  }
1344  else if ( rValue.Name == "ZoomType" )
1345  {
1346  rValue.Value >>= nZoomType;
1347  bGotZoomType = true;
1348  }
1349  else if ( rValue.Name == "ZoomFactor" )
1350  {
1351  rValue.Value >>= nZoomFactor;
1352  bGotZoomFactor = true;
1353  }
1354  else if ( rValue.Name == "ViewLayoutColumns" )
1355  {
1356  rValue.Value >>= nViewLayoutColumns;
1357  bGotViewLayoutColumns = true;
1358  }
1359  else if ( rValue.Name == "ViewLayoutBookMode" )
1360  {
1361  bViewLayoutBookMode = *o3tl::doAccess<bool>(rValue.Value);
1362  bGotViewLayoutBookMode = true;
1363  }
1364  else if ( rValue.Name == "IsSelectedFrame" )
1365  {
1366  rValue.Value >>= bSelectedFrame;
1367  bGotIsSelectedFrame = true;
1368  }
1369  else if (rValue.Name == "ShowOnlineLayout")
1370  {
1371  rValue.Value >>= bBrowseMode;
1372  bGotBrowseMode = true;
1373  }
1374  // Fallback to common SdrModel processing
1375  else
1377  }
1378  if (bGotBrowseMode)
1379  {
1380  // delegate further
1381  GetViewImpl()->GetUNOObject_Impl()->getViewSettings()->setPropertyValue("ShowOnlineLayout", uno::Any(bBrowseMode));
1382  }
1383 
1384  SelectShell();
1385 
1386  if (!bGotVisibleBottom)
1387  return;
1388 
1389  Point aCursorPos( nX, nY );
1390  const tools::Long nAdd = m_pWrtShell->GetViewOptions()->getBrowseMode() ? DOCUMENTBORDER : DOCUMENTBORDER*2;
1391  if (nBottom > (m_pWrtShell->GetDocSize().Height()+nAdd) )
1392  return;
1393 
1394  m_pWrtShell->EnableSmooth( false );
1395  const tools::Rectangle aVis( nLeft, nTop, nRight, nBottom );
1396 
1397  SvxZoomType eZoom;
1398  if ( !m_pWrtShell->GetViewOptions()->getBrowseMode() )
1399  eZoom = static_cast < SvxZoomType > ( nZoomType );
1400  else
1401  {
1402  eZoom = SvxZoomType::PERCENT;
1403  }
1404  if (bGotIsSelectedFrame)
1405  {
1406  bool bSelectObj = bSelectedFrame && m_pWrtShell->IsObjSelectable( aCursorPos );
1407 
1408  // set flag value to avoid macro execution.
1409  bool bSavedFlagValue = m_pWrtShell->IsMacroExecAllowed();
1410  m_pWrtShell->SetMacroExecAllowed( false );
1411 // os: changed: The user data has to be read if the view is switched back from page preview
1412 // go to the last editing position when opening own files
1413  m_pViewImpl->SetRestorePosition(aCursorPos, bSelectObj);
1414  if(m_bOldShellWasPagePreview|| bIsOwnDocument)
1415  {
1416  m_pWrtShell->SwCursorShell::SetCursor( aCursorPos, !bSelectObj );
1417 
1418  // Update the shell to toggle Header/Footer edit if needed
1419  bool bInHeader = true;
1420  if ( m_pWrtShell->IsInHeaderFooter( &bInHeader ) )
1421  {
1422  if ( !bInHeader )
1423  {
1424  m_pWrtShell->SetShowHeaderFooterSeparator( FrameControlType::Footer, true );
1425  m_pWrtShell->SetShowHeaderFooterSeparator( FrameControlType::Header, false );
1426  }
1427  else
1428  {
1429  m_pWrtShell->SetShowHeaderFooterSeparator( FrameControlType::Header, true );
1430  m_pWrtShell->SetShowHeaderFooterSeparator( FrameControlType::Footer, false );
1431  }
1432 
1433  // Force repaint
1434  m_pWrtShell->GetWin()->Invalidate();
1435  }
1436  if ( m_pWrtShell->IsInHeaderFooter() != m_pWrtShell->IsHeaderFooterEdit() )
1437  m_pWrtShell->ToggleHeaderFooterEdit();
1438 
1439  if( bSelectObj )
1440  {
1441  m_pWrtShell->SelectObj( aCursorPos );
1442  m_pWrtShell->EnterSelFrameMode( &aCursorPos );
1443  }
1444  }
1445 
1446  // reset flag value
1447  m_pWrtShell->SetMacroExecAllowed( bSavedFlagValue );
1448  }
1449 
1450  // Set ViewLayoutSettings
1451  const bool bSetViewLayoutSettings = bGotViewLayoutColumns && bGotViewLayoutBookMode &&
1452  ( pVOpt->GetViewLayoutColumns() != nViewLayoutColumns || pVOpt->IsViewLayoutBookMode() != bViewLayoutBookMode );
1453 
1454  const bool bSetViewSettings = bGotZoomType && bGotZoomFactor &&
1455  ( pVOpt->GetZoom() != nZoomFactor || pVOpt->GetZoomType() != eZoom );
1456 
1457  // In case we have a 'fixed' view layout of 2 or more columns,
1458  // we have to apply the view options *before* starting the action.
1459  // Otherwise the SetZoom function cannot work correctly, because
1460  // the view layout hasn't been calculated.
1461  const bool bZoomNeedsViewLayout = bSetViewLayoutSettings &&
1462  1 < nViewLayoutColumns &&
1463  bSetViewSettings &&
1464  eZoom != SvxZoomType::PERCENT;
1465 
1466  if ( !bZoomNeedsViewLayout )
1467  m_pWrtShell->StartAction();
1468 
1469  if ( bSetViewLayoutSettings )
1470  SetViewLayout( nViewLayoutColumns, bViewLayoutBookMode, true );
1471 
1472  if ( bZoomNeedsViewLayout )
1473  m_pWrtShell->StartAction();
1474 
1475  if ( bSetViewSettings )
1476  SetZoom( eZoom, nZoomFactor, true );
1477 
1478 // os: changed: The user data has to be read if the view is switched back from page preview
1479 // go to the last editing position when opening own files
1480  if(m_bOldShellWasPagePreview||bIsOwnDocument)
1481  {
1482  if ( bGotVisibleLeft && bGotVisibleTop )
1483  {
1484  Point aTopLeft(aVis.TopLeft());
1485  // make sure the document is still centered
1486  const SwTwips lBorder = IsDocumentBorder() ? DOCUMENTBORDER : 2 * DOCUMENTBORDER;
1487  SwTwips nEditWidth = GetEditWin().GetOutputSize().Width();
1488  if(nEditWidth > (m_aDocSz.Width() + lBorder ))
1489  aTopLeft.setX( ( m_aDocSz.Width() + lBorder - nEditWidth ) / 2 );
1490  else
1491  {
1492  //check if the values are possible
1494  if( aTopLeft.X() > nXMax )
1495  aTopLeft.setX( nXMax < 0 ? 0 : nXMax );
1496  }
1497  SetVisArea( aTopLeft );
1498  }
1499  else if (bGotVisibleLeft && bGotVisibleTop && bGotVisibleRight && bGotVisibleBottom )
1500  SetVisArea( aVis );
1501  }
1502 
1503  m_pWrtShell->LockView( true );
1504  m_pWrtShell->EndAction();
1505  m_pWrtShell->LockView( false );
1506  m_pWrtShell->EnableSmooth( true );
1507 
1508 }
1509 
1510 void SwView::WriteUserDataSequence ( uno::Sequence < beans::PropertyValue >& rSequence )
1511 {
1512  const SwRect& rRect = m_pWrtShell->GetCharRect();
1513  const tools::Rectangle& rVis = GetVisArea();
1514 
1515  std::vector<beans::PropertyValue> aVector;
1516 
1517  sal_uInt16 nViewID( GetViewFrame()->GetCurViewId());
1518  aVector.push_back(comphelper::makePropertyValue("ViewId", "view" + OUString::number(nViewID)));
1519 
1520  aVector.push_back(comphelper::makePropertyValue("ViewLeft", convertTwipToMm100 ( rRect.Left() )));
1521 
1522  aVector.push_back(comphelper::makePropertyValue("ViewTop", convertTwipToMm100 ( rRect.Top() )));
1523 
1524  auto visibleLeft = convertTwipToMm100 ( rVis.Left() );
1525  aVector.push_back(comphelper::makePropertyValue("VisibleLeft", visibleLeft));
1526 
1527  auto visibleTop = convertTwipToMm100 ( rVis.Top() );
1528  aVector.push_back(comphelper::makePropertyValue("VisibleTop", visibleTop));
1529 
1530  auto visibleRight = rVis.IsWidthEmpty() ? visibleLeft : convertTwipToMm100 ( rVis.Right() );
1531  aVector.push_back(comphelper::makePropertyValue("VisibleRight", visibleRight));
1532 
1533  auto visibleBottom = rVis.IsHeightEmpty() ? visibleTop : convertTwipToMm100 ( rVis.Bottom() );
1534  aVector.push_back(comphelper::makePropertyValue("VisibleBottom", visibleBottom));
1535 
1536  const sal_Int16 nZoomType = static_cast< sal_Int16 >(m_pWrtShell->GetViewOptions()->GetZoomType());
1537  aVector.push_back(comphelper::makePropertyValue("ZoomType", nZoomType));
1538 
1539  const sal_Int16 nViewLayoutColumns = static_cast< sal_Int16 >(m_pWrtShell->GetViewOptions()->GetViewLayoutColumns());
1540  aVector.push_back(comphelper::makePropertyValue("ViewLayoutColumns", nViewLayoutColumns));
1541 
1542  aVector.push_back(comphelper::makePropertyValue("ViewLayoutBookMode", m_pWrtShell->GetViewOptions()->IsViewLayoutBookMode()));
1543 
1544  aVector.push_back(comphelper::makePropertyValue("ZoomFactor", static_cast < sal_Int16 > (m_pWrtShell->GetViewOptions()->GetZoom())));
1545 
1546  aVector.push_back(comphelper::makePropertyValue("IsSelectedFrame", FrameTypeFlags::NONE != m_pWrtShell->GetSelFrameType()));
1547 
1548  rSequence = comphelper::containerToSequence(aVector);
1549 
1550  // Common SdrModel processing
1552 }
1553 
1554 void SwView::ShowCursor( bool bOn )
1555 {
1556  //don't scroll the cursor into the visible area
1557  bool bUnlockView = !m_pWrtShell->IsViewLocked();
1558  m_pWrtShell->LockView( true ); //lock visible section
1559 
1560  if( !bOn )
1561  m_pWrtShell->HideCursor();
1562  else if( !m_pWrtShell->IsFrameSelected() && !m_pWrtShell->IsObjSelected() )
1563  m_pWrtShell->ShowCursor();
1564 
1565  if( bUnlockView )
1566  m_pWrtShell->LockView( false );
1567 }
1568 
1570 {
1571  if ( !GetViewFrame()->GetFrame().IsInPlace() )
1572  {
1573  SwWrtShell &rSh = GetWrtShell();
1574  const SelectionType nSel = rSh.GetSelectionType();
1575  if ( nSel & SelectionType::Ole )
1576  rSh.LaunchOLEObj( nVerb );
1577  }
1578  return ERRCODE_NONE;
1579 }
1580 
1581 // only return true for a text selection
1582 
1583 bool SwView::HasSelection( bool bText ) const
1584 {
1585  return bText ? GetWrtShell().SwCursorShell::HasSelection()
1586  : GetWrtShell().HasSelection();
1587 }
1588 
1589 OUString SwView::GetSelectionText( bool bCompleteWrds )
1590 {
1591  return GetSelectionTextParam( bCompleteWrds, true );
1592 }
1593 
1594 OUString SwView::GetSelectionTextParam( bool bCompleteWrds, bool bEraseTrail )
1595 {
1596  OUString sReturn;
1597  if( bCompleteWrds && !GetWrtShell().HasSelection() )
1598  GetWrtShell().SelWrd();
1599 
1600  GetWrtShell().GetSelectedText( sReturn );
1601  if( bEraseTrail )
1602  sReturn = comphelper::string::stripEnd(sReturn, ' ');
1603  return sReturn;
1604 }
1605 
1607 {
1608  if(!m_pGlosHdl)
1609  m_pGlosHdl.reset(new SwGlossaryHdl(GetViewFrame(), m_pWrtShell.get()));
1610  return m_pGlosHdl.get();
1611 }
1612 
1613 void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
1614 {
1615  bool bCallBase = true;
1616  if(dynamic_cast<const FmDesignModeChangedHint*>(&rHint))
1617  {
1618  bool bDesignMode = static_cast<const FmDesignModeChangedHint&>(rHint).GetDesignMode();
1619  if (!bDesignMode && GetDrawFuncPtr())
1620  {
1622  SetDrawFuncPtr(nullptr);
1623  LeaveDrawCreate();
1624  AttrChangedNotify(nullptr);
1625  }
1626  }
1627  else
1628  {
1629  SfxHintId nId = rHint.GetId();
1630  switch ( nId )
1631  {
1632  // sub shells will be destroyed by the
1633  // dispatcher, if the view frame is dying. Thus, reset member <pShell>.
1634  case SfxHintId::Dying:
1635  {
1636  if ( &rBC == GetViewFrame() )
1637  {
1638  ResetSubShell();
1639  }
1640  }
1641  break;
1642  case SfxHintId::ModeChanged:
1643  {
1644  // Modal mode change-over?
1645  bool bModal = GetDocShell()->IsInModalMode();
1646  m_pHRuler->SetActive( !bModal );
1647  m_pVRuler->SetActive( !bModal );
1648  }
1649 
1650  [[fallthrough]];
1651 
1652  case SfxHintId::TitleChanged:
1653  if ( GetDocShell()->IsReadOnly() != GetWrtShell().GetViewOptions()->IsReadonly() )
1654  {
1655  SwWrtShell &rSh = GetWrtShell();
1657 
1658  if ( rSh.GetViewOptions()->IsViewVRuler() )
1659  CreateVRuler();
1660  else
1661  KillVRuler();
1662  if ( rSh.GetViewOptions()->IsViewHRuler() )
1663  CreateTab();
1664  else
1665  KillTab();
1666  bool bReadonly = GetDocShell()->IsReadOnly();
1667  // if document is to be opened in alive-mode then this has to be
1668  // regarded while switching from readonly-mode to edit-mode
1669  if( !bReadonly )
1670  {
1672  if (pDrawDoc)
1673  {
1674  if( !pDrawDoc->GetOpenInDesignMode() )
1675  break;// don't touch the design mode
1676  }
1677  }
1678  SfxBoolItem aItem( SID_FM_DESIGN_MODE, !bReadonly);
1679  GetDispatcher().ExecuteList(SID_FM_DESIGN_MODE,
1680  SfxCallMode::ASYNCHRON, { &aItem });
1681  }
1682  break;
1683 
1684  case SfxHintId::SwDrawViewsCreated:
1685  {
1686  bCallBase = false;
1687  if ( GetFormShell() )
1688  {
1689  GetFormShell()->SetView(dynamic_cast<FmFormView*>(GetWrtShell().GetDrawView()));
1690  SfxBoolItem aItem( SID_FM_DESIGN_MODE, !GetDocShell()->IsReadOnly());
1691  GetDispatcher().ExecuteList(SID_FM_DESIGN_MODE,
1692  SfxCallMode::SYNCHRON, { &aItem });
1693  }
1694  }
1695  break;
1696  case SfxHintId::RedlineChanged:
1697  {
1698  static sal_uInt16 const aSlotRedLine[] = {
1705  0
1706  };
1707  GetViewFrame()->GetBindings().Invalidate(aSlotRedLine);
1708  }
1709  break;
1710 
1711  default: break;
1712  }
1713  }
1714 
1715  if ( bCallBase )
1716  SfxViewShell::Notify(rBC, rHint);
1717 }
1718 
1719 #if defined(_WIN32) || defined UNX
1720 
1722 {
1723  uno::Reference< XScannerManager2 > xScanMgr = SW_MOD()->GetScannerManager();
1724  if( xScanMgr.is() )
1725  {
1726  const ScannerContext aContext( xScanMgr->getAvailableScanners().getConstArray()[ 0 ] );
1727  const ScanError eError = xScanMgr->getError( aContext );
1728 
1729  if( ScanError_ScanErrorNone == eError )
1730  {
1731  const uno::Reference< awt::XBitmap > xBitmap( xScanMgr->getBitmap( aContext ) );
1732 
1733  if( xBitmap.is() )
1734  {
1735  const BitmapEx aScanBmp( VCLUnoHelper::GetBitmap( xBitmap ) );
1736 
1737  if( !!aScanBmp )
1738  {
1739  Graphic aGrf(aScanBmp);
1740  m_pWrtShell->Insert( OUString(), OUString(), aGrf );
1741  }
1742  }
1743  }
1744  }
1745  SfxBindings& rBind = GetViewFrame()->GetBindings();
1746  rBind.Invalidate( SID_TWAIN_SELECT );
1747  rBind.Invalidate( SID_TWAIN_TRANSFER );
1748 }
1749 #endif
1750 
1752 {
1753  if(m_aTimer.IsActive())
1754  {
1755  m_aTimer.Stop();
1757  {
1758  GetViewFrame()->GetBindings().LEAVEREGISTRATIONS();
1760  }
1761  SelectShell();
1762  m_bAttrChgNotified = false;
1763  }
1764 }
1765 
1766 bool SwView::PrepareClose( bool bUI )
1767 {
1768  SfxViewFrame* pVFrame = GetViewFrame();
1769  pVFrame->SetChildWindow( SwInputChild::GetChildWindowId(), false );
1770  if( pVFrame->GetDispatcher()->IsLocked() )
1771  pVFrame->GetDispatcher()->Lock(false);
1772 
1773  if ( m_pFormShell && !m_pFormShell->PrepareClose( bUI ) )
1774  {
1775  return false;
1776  }
1777  return SfxViewShell::PrepareClose( bUI );
1778 }
1779 
1780 // status methods for clipboard.
1781 // Status changes now notified from the clipboard.
1783 {
1785  if( m_nLastPasteDestination != nPasteDestination )
1786  {
1787  TransferableDataHelper aDataHelper(
1789  &GetEditWin()) );
1790  if( aDataHelper.GetXTransferable().is() )
1791  {
1794  *m_pWrtShell, aDataHelper );
1795  }
1796  else
1798 
1799  if( static_cast<SotExchangeDest>(0xFFFF) == m_nLastPasteDestination ) // the init value
1800  m_pViewImpl->AddClipboardListener();
1801  m_nLastPasteDestination = nPasteDestination;
1802  }
1803  return m_bPasteState;
1804 }
1805 
1807 {
1809  return false;
1810 
1812  if( m_nLastPasteDestination != nPasteDestination )
1813  {
1814  TransferableDataHelper aDataHelper(
1816  &GetEditWin()) );
1817  if( aDataHelper.GetXTransferable().is() )
1818  {
1821  *m_pWrtShell, aDataHelper );
1822  }
1823  else
1825 
1826  if( static_cast<SotExchangeDest>(0xFFFF) == m_nLastPasteDestination ) // the init value
1827  m_pViewImpl->AddClipboardListener();
1828  }
1829  return m_bPasteSpecialState;
1830 }
1831 
1832 bool SwView::IsPasteSpreadsheet(bool bHasOwnTableCopied)
1833 {
1834  TransferableDataHelper aDataHelper(
1836  &GetEditWin()) );
1837  if( aDataHelper.GetXTransferable().is() )
1838  {
1839  if (bHasOwnTableCopied && SwTransferable::IsPasteOwnFormat( aDataHelper ))
1840  return true;
1841  return aDataHelper.HasFormat( SotClipboardFormatId::SYLK ) || aDataHelper.HasFormat( SotClipboardFormatId::SYLK_BIGCAPS );
1842  }
1843  return false;
1844 }
1845 
1847 {
1849 }
1850 
1851 // Printing
1852 
1854 {
1855  SwXTextView *const pTempImpl = GetViewImpl()->GetUNOObject_Impl();
1856  return pTempImpl->BuildTmpSelectionDoc();
1857 }
1858 
1860 {
1861  GetViewImpl()->AddTransferable(rTransferable);
1862 }
1863 
1864 namespace sw {
1865 
1866 void InitPrintOptionsFromApplication(SwPrintData & o_rData, bool const bWeb)
1867 {
1868  o_rData = *SW_MOD()->GetPrtOptions(bWeb);
1869 }
1870 
1871 } // namespace sw
1872 
1873 /* 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
SfxObjectShellLock CreateTmpSelectionDoc()
Definition: view.cxx:1853
void StopShellTimer()
Definition: view.cxx:1751
static bool IsPasteOwnFormat(const TransferableDataHelper &)
Definition: swdtflvr.cxx:3256
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
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
#define FN_UPDATE_TOX
Definition: cmdid.h:503
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
tools::Long GetRangeMax() const
#define FN_EDIT_REGION
Definition: cmdid.h:108
bool IsHeightEmpty() const
virtual void ApplyViewOptions(const SwViewOption &rOpt)
Definition: viewsh.cxx:2114
bool IsPasteSpecialAllowed()
Definition: view.cxx:1806
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:450
virtual void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &) override
Definition: view.cxx:1510
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:1866
#define FN_DELETE_SENT
Definition: cmdid.h:660
SfxViewFrame * GetFrame() const
#define FN_SET_SUPER_SCRIPT
Definition: cmdid.h:306
void SetZoom(sal_uInt16 n)
Definition: viewopt.hxx:492
const char aData[]
Definition: ww8scan.hxx:47
TABS
#define FN_DELETE_BACK_SENT
Definition: cmdid.h:661
virtual ~SwView() override
Definition: view.cxx:1059
std::string GetValue
std::unique_ptr< SwPostItMgr > m_pPostItMgr
Definition: view.hxx:208
void AddTransferable(SwTransferable &rTransferable)
Definition: view.cxx:1859
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:223
bool IsPasteSpreadsheet(bool bHasOwnTableCopied)
Definition: view.cxx:1832
void Pop(SfxShell &rShell, SfxDispatcherPopFlags nMode=SfxDispatcherPopFlags::NONE)
void Left(const tools::Long nLeft)
Definition: swrect.hxx:195
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:261
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getViewSettings() override
Definition: unotxvw.cxx:511
bool m_bAttrChgNotified
Definition: view.hxx:228
static bool IsPaste(const SwWrtShell &, const TransferableDataHelper &)
Definition: swdtflvr.cxx:1310
long Long
SAL_DLLPRIVATE void CheckReadonlySelection()
Definition: view.cxx:646
Reference< XFrame > xFrame
bool m_bOldShellWasPagePreview
Definition: view.hxx:228
Definition: doc.hxx:186
void SetViewLayoutColumns(sal_uInt16 nNew)
Definition: viewopt.hxx:468
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:1148
#define FN_DELETE_WHOLE_LINE
Definition: cmdid.h:668
Size m_aDocSz
Definition: view.hxx:177
virtual void WriteUserData(OUString &, bool bBrowse=false) override
Definition: view.cxx:1117
void RemoveChildEventListener(const Link< VclWindowEvent &, void > &rEventListener)
SwEditWin & GetEditWin()
Definition: view.hxx:402
static std::unique_ptr< SearchAttrItemList > s_xSearchList
Definition: view.hxx:161
bool IsPasteAllowed()
Definition: view.cxx:1782
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:197
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:383
#define FN_INSERT_LINEBREAK
Definition: cmdid.h:209
void ResetSubShell()
Definition: view.hxx:568
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:296
SwView & m_rView
Definition: view.hxx:137
SfxHintId GetId() const
SwView_Impl * GetViewImpl()
Definition: view.hxx:334
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:399
virtual ErrCode DoVerb(tools::Long nVerb) override
Definition: view.cxx:1569
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:155
SvxZoomType GetZoomType() const
Definition: viewopt.hxx:532
bool m_bAttrChgNotifiedWithRegistrations
Definition: view.hxx:228
bool IsActive() const
#define FN_DELETE_BACK_WORD
Definition: cmdid.h:663
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
css::uno::Any const & rValue
#define FN_CALCULATE
Definition: cmdid.h:491
virtual void set(DocumentSettingId id, bool value)=0
Set the specified document setting.
bool IsFieldName() const
Definition: viewopt.hxx:266
vcl::Window & GetWindow() const
#define FN_DELETE_WORD
Definition: cmdid.h:662
SelectionType m_nSelectionType
Definition: view.hxx:210
static BitmapEx GetBitmap(const css::uno::Reference< css::awt::XBitmap > &rxBitmap)
void InvalidateBorder()
SfxShell * GetShell(sal_uInt16 nIdx) const
virtual void SelectShell()
Definition: view.cxx:240
static void notifyOtherViews(const SfxViewShell *pThisView, int nType, const OString &rKey, const OString &rPayload)
tools::Long Left() const
bool m_bVScrollbarEnabled
Definition: view.hxx:193
bool IsVisible(bool bReal) const
Definition: scroll.hxx:39
#define FN_INSERT_BOOKMARK
Definition: cmdid.h:194
constexpr OUStringLiteral IsReadOnly(u"IsReadOnly")
bool getBrowseMode() const
Definition: viewopt.hxx:458
void PrtOLENotify(bool bAll)
Definition: docdesc.cxx:689
bool bDocSzUpdated
Definition: view.cxx:113
static bool IsFuzzing()
SfxFrame & GetFrame() const
tools::Long Bottom() const
void setBrowseMode(bool bSet)
Definition: viewopt.hxx:459
static TransferableDataHelper CreateFromSystemClipboard(vcl::Window *pWindow)
bool m_bPasteState
Definition: view.hxx:228
bool IsViewVScrollBar() const
Definition: viewopt.hxx:505
SwDoc * GetDoc() const
Definition: viewsh.hxx:281
virtual void ShowCursor(bool bOn=true) override
Definition: view.cxx:1554
static bool s_bJustOpened
Definition: view.hxx:159
const IDocumentMarkAccess * getIDocumentMarkAccess() const
Provides access to the document bookmark interface.
Definition: viewsh.cxx:2667
FmFormShell * m_pFormShell
Definition: view.hxx:185
SfxObjectCreateMode GetCreateMode() const
static SotExchangeDest GetSotDestination(const SwWrtShell &rSh)
Definition: swdtflvr.cxx:1966
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:578
VclPtr< SwEditWin > m_pEditWin
Definition: view.hxx:180
#define FN_DELETE_PARA
Definition: cmdid.h:666
void CreateVRuler()
Definition: viewmdi.cxx:601
SotExchangeDest m_nLastPasteDestination
Definition: view.hxx:218
#define FN_SHRINK_FONT_SIZE
Definition: cmdid.h:304
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:1589
void KillVRuler()
Definition: viewmdi.cxx:610
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:1162
#define FN_TABLE_PASTE_ROW_BEFORE
Definition: cmdid.h:297
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:564
#define FN_SET_SUB_SCRIPT
Definition: cmdid.h:307
Style of a layout element.
Definition: frmfmt.hxx:58
std::unique_ptr< SwGlossaryHdl > m_pGlosHdl
Definition: view.hxx:201
void SetZoomType(SvxZoomType eZoom_)
Definition: viewopt.hxx:558
bool IsCursorInProtectedArea() const
Definition: viewopt.hxx:395
bool HasSelection() const
Definition: wrtsh.hxx:141
#define SW_MOD()
Definition: swmodule.hxx:255
bool m_bIsPreviewDoubleClick
Definition: view.hxx:228
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:664
void SetWindow(vcl::Window *pViewPort)
int i
VclPtr< vcl::Window > m_pScrollFill
Definition: view.hxx:195
bool IsViewLayoutBookMode() const
Definition: viewopt.hxx:465
void SetOnlineSpell(bool b)
Definition: viewopt.cxx:330
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:1281
void SetAuto(bool bSet)
Definition: scroll.cxx:90
SwViewGlueDocShell(SwView &rView, SwDocShell &rDocSh)
Definition: view.cxx:1042
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:592
#define FN_INSERT_BREAK_DLG
Definition: cmdid.h:196
#define SAL_MIN_INT32
tools::Long Width() const
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
static bool IsPasteSpecial(const SwWrtShell &rWrtShell, const TransferableDataHelper &)
Definition: swdtflvr.cxx:3247
bool IsActiveControl() const
void ShowVScrollbar(bool bShow)
Definition: viewmdi.cxx:673
#define FN_JAVAEDIT
Definition: cmdid.h:272
SfxDisableFlags GetDisableFlags() const
void Lock(bool bLock)
virtual void SetReadonlyOption(bool bSet) override
Definition: wrtsh1.cxx:1797
void NotifySelChanged()
Definition: unotxvw.cxx:678
Shell * m_pShell
void SetName(const OUString &rName)
virtual bool PrepareClose(bool bUI=true) override
Definition: view.cxx:1766
SfxItemState QueryState(sal_uInt16 nSID, const SfxPoolItem *&rpState)
void LeaveDrawCreate()
Definition: view.hxx:524
void RequestDoubleBuffering(bool bRequest)
tools::Long Top() const
SwDrawBase * GetDrawFuncPtr() const
Definition: view.hxx:512
void CreateTab()
Definition: viewmdi.cxx:559
#define ASPECT_CONTENT
void SetTimeout(sal_uInt64 nTimeoutMs)
VclPtr< SvxRuler > m_pVRuler
Definition: view.hxx:198
InputContextFlags GetOptions() const
SfxViewShell * GetViewShell() const
tools::Long SwTwips
Definition: swtypes.hxx:49
#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:1109
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:661
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:665
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:466
sal_uInt16 m_nNewPage
Definition: view.hxx:169
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:400
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()
#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:667
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:1613
#define SAL_INFO(area, stream)
bool m_bPasteSpecialState
Definition: view.hxx:228
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:659
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:298
void Top(const tools::Long nTop)
Definition: swrect.hxx:204
OUString GetSelectionTextParam(bool bCompleteWords, bool bEraseTrail)
Definition: view.cxx:1594
VclPtr< SwScrollbar > m_pHScrollbar
Definition: view.hxx:189
void Push(SfxShell &rShell)
void NotifyDBChanged()
Definition: view.cxx:1846
sal_uInt16 GetZoom() const
Definition: viewopt.hxx:491
bool IsInModalMode() const
void Execute(SfxRequest &)
Definition: view2.cxx:533
ToolbarId
void SetInvokeHandler(const Link< Timer *, void > &rLink)
bool IsDocumentBorder()
Definition: viewport.cxx:51
bool IsWidthEmpty() const
SfxObjectShellLock BuildTmpSelectionDoc()
Definition: unotxvw.cxx:643
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
constexpr sal_Int64 convertMm100ToTwip(sal_Int64 n)
SwGlossaryHdl * GetGlosHdl()
Definition: view.cxx:1606
#define FN_GROW_FONT_SIZE
Definition: cmdid.h:303
SvxSearchCmd
#define FN_TXTATR_INET
Definition: cmdid.h:731
const tools::Rectangle & GetVisArea() const
Definition: view.hxx:412
bool IsEnableSetModified() const
bool IsLocked() const
tools::Long GetVisibleSize() const
#define FN_SHIFT_BACKSPACE
Definition: cmdid.h:674
static SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
void ScannerEventHdl()
Definition: view.cxx:1721
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:228
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:307
bool IsShowHiddenField() const
Definition: viewopt.hxx:314
void EnableSetModified(bool bEnable=true)
virtual SdrView * GetDrawView() const override
Definition: viewdraw.cxx:612
void KillTab()
Definition: viewmdi.cxx:567
#define DOCUMENTBORDER
Definition: swtypes.hxx:82
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1395
SAL_DLLPRIVATE void CreateScrollbar(bool bHori)
Definition: viewmdi.cxx:299
static SvxSearchItem * s_pSrchItem
Definition: view.hxx:152
OBJ_NONE
bool IsViewHScrollBar() const
Definition: viewopt.hxx:513
#define FN_REDLINE_REJECT_DIRECT
Definition: cmdid.h:138
bool m_bHScrollbarEnabled
Definition: view.hxx:192
bool m_bVerbsActive
Definition: view.hxx:228
void ReadUserDataSequenceValue(const css::beans::PropertyValue *pValue)
ToolbarId GetObjectBarId(sal_uInt16 nPos) const
sal_uInt16 GetViewLayoutColumns() const
Definition: viewopt.hxx:467
static bool s_bExtra
Definition: view.hxx:157
tools::Long Right() const
virtual bool HasSelection(bool bText=true) const override
Definition: view.cxx:1583
void ForgetActiveControl()
void AddChildEventListener(const Link< VclWindowEvent &, void > &rEventListener)
#define FN_POSTIT
Definition: cmdid.h:213
virtual bool PrepareClose(bool bUI=true)
Definition: view.hxx:144
bool m_bInitOnceCompleted
Definition: view.hxx:249
void SetNewWindowAllowed(bool bSet)
sal_uInt16 nPos
#define FN_FORMAT_DROPCAPS
Definition: cmdid.h:317
void LaunchOLEObj(tools::Long nVerb=0)
Definition: wrtsh1.cxx:607