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