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