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(nullptr);
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(nullptr);
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(nullptr);
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, LinkParamNone*, 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  SID_ULINE_VAL_SINGLE, SID_ULINE_VAL_DOUBLE, SID_ULINE_VAL_DOTTED,
617  SID_ATTR_CHAR_CONTOUR, SID_ATTR_CHAR_SHADOWED,
618  SID_ATTR_CHAR_AUTOKERN, SID_ATTR_CHAR_ESCAPEMENT, FN_SET_SUPER_SCRIPT,
619  FN_SET_SUB_SCRIPT, SID_ATTR_CHAR_CASEMAP, SID_ATTR_CHAR_LANGUAGE,
620  SID_ATTR_CHAR_KERNING, SID_CHAR_DLG, SID_ATTR_CHAR_WORDLINEMODE,
622  FN_FORMAT_DROPCAPS, SID_ATTR_PARA_ADJUST, SID_ATTR_PARA_LINESPACE,
623  SID_ATTR_PARA_SPLIT, SID_ATTR_PARA_KEEP, SID_ATTR_PARA_WIDOWS,
624  SID_ATTR_PARA_ORPHANS,
625  SID_ATTR_PARA_MODEL, SID_PARA_DLG,
626  FN_SELECT_PARA, SID_DEC_INDENT,
627  SID_INC_INDENT
628  };
629  static bool bFirst = true;
630  if ( bFirst )
631  {
632  qsort( static_cast<void*>(aROIds), SAL_N_ELEMENTS(aROIds), sizeof(sal_uInt16), lcl_CmpIds );
633  bFirst = false;
634  }
635  if ( SfxItemState::DISABLED == eStateRO )
636  {
637  rDis.SetSlotFilter( SfxSlotFilterState::ENABLED_READONLY, aROIds );
638  bChgd = true;
639  }
640  }
641  else if( m_pWrtShell->IsAllProtect() )
642  {
643  if ( SfxItemState::DISABLED == eStateProtAll )
644  {
645  static sal_uInt16 aAllProtIds[] = { SID_SAVEDOC, FN_EDIT_REGION };
646  static bool bAllProtFirst = true;
647  if ( bAllProtFirst )
648  {
649  qsort( static_cast<void*>(aAllProtIds), SAL_N_ELEMENTS(aAllProtIds), sizeof(sal_uInt16), lcl_CmpIds );
650  bAllProtFirst = false;
651  }
652  rDis.SetSlotFilter( SfxSlotFilterState::ENABLED_READONLY, aAllProtIds );
653  bChgd = true;
654  }
655  }
656  else if ( SfxItemState::DISABLED != eStateRO ||
657  SfxItemState::DISABLED != eStateProtAll )
658  {
659  bChgd = true;
660  rDis.SetSlotFilter();
661  }
662  if ( bChgd )
664 }
665 
667 {
668  SfxDisableFlags nDisableFlags = SfxDisableFlags::NONE;
669  SfxDispatcher &rDis = GetDispatcher();
670 
671  if( m_pWrtShell->HasReadonlySel() &&
672  ( !m_pWrtShell->GetDrawView() ||
673  !m_pWrtShell->GetDrawView()->GetMarkedObjectList().GetMarkCount() ))
674  nDisableFlags |= SfxDisableFlags::SwOnProtectedCursor;
675 
676  if( (SfxDisableFlags::SwOnProtectedCursor & nDisableFlags ) !=
677  (SfxDisableFlags::SwOnProtectedCursor & rDis.GetDisableFlags() ) )
678  {
679  // Additionally move at the Window the InputContext, so that
680  // in japanese / chinese versions the external input will be
681  // turned on or off. This but only if the correct shell is on
682  // the stack.
683  switch( m_pViewImpl->GetShellMode() )
684  {
685  case ShellMode::Text:
686  case ShellMode::ListText:
689  {
690 // Temporary solution!!! Should set the font of the current insertion point
691 // at each cursor movement, so outside of this "if". But TH does not
692 // evaluates the font at this time and the "purchase" appears to me
693 // as too expensive.
694 // Moreover, we don't have a font, but only attributes from which the
695 // text formatting and the correct font will be build together.
696 
697  InputContext aCntxt( GetEditWin().GetInputContext() );
698  aCntxt.SetOptions( SfxDisableFlags::SwOnProtectedCursor & nDisableFlags
699  ? (aCntxt.GetOptions() & ~
700  InputContextFlags( InputContextFlags::Text |
701  InputContextFlags::ExtText ))
702  : (aCntxt.GetOptions() |
703  ( InputContextFlags::Text |
704  InputContextFlags::ExtText )) );
705  GetEditWin().SetInputContext( aCntxt );
706  }
707  break;
708  default:
709  ;
710  }
711 
712  }
713 
714  if( nDisableFlags != rDis.GetDisableFlags() )
715  {
716  rDis.SetDisableFlags( nDisableFlags );
718  }
719 }
720 
722  : SfxViewShell( _pFrame, SWVIEWFLAGS ),
723  m_nNewPage(USHRT_MAX),
724  m_nOldPageNum(0),
725  m_pNumRuleNodeFromDoc(nullptr),
726  m_pEditWin( VclPtr<SwEditWin>::Create( &_pFrame->GetWindow(), *this ) ),
727  m_pShell(nullptr),
728  m_pFormShell(nullptr),
729  m_pHScrollbar(nullptr),
730  m_pVScrollbar(nullptr),
731  m_pScrollFill(VclPtr<ScrollBarBox>::Create( &_pFrame->GetWindow(), WB_SIZEABLE )),
732  m_pVRuler(VclPtr<SvxRuler>::Create(&GetViewFrame()->GetWindow(), m_pEditWin,
735  GetViewFrame()->GetBindings(),
737  m_pLastTableFormat(nullptr),
738  m_pFormatClipboard(new SwFormatClipboard()),
739  m_nSelectionType( SelectionType::All ),
740  m_nPageCnt(0),
741  m_nDrawSfxId( USHRT_MAX ),
742  m_nFormSfxId( USHRT_MAX ),
743  m_nLastPasteDestination( static_cast<SotExchangeDest>(0xFFFF) ),
744  m_nLeftBorderDistance( 0 ),
745  m_nRightBorderDistance( 0 ),
746  m_eLastSearchCommand( static_cast<SvxSearchCmd>(0xFFFF) ),
747  m_bWheelScrollInProgress(false),
748  m_bCenterCursor(false),
749  m_bTopCursor(false),
750  m_bTabColFromDoc(false),
751  m_bTabRowFromDoc(false),
752  m_bSetTabColFromDoc(false),
753  m_bSetTabRowFromDoc(false),
754  m_bAttrChgNotified(false),
755  m_bAttrChgNotifiedWithRegistrations(false),
756  m_bVerbsActive(false),
757  m_bDrawRotate(false),
758  m_bDrawSelMode(true),
759  m_bShowAtResize(true),
760  m_bInOuterResizePixel(false),
761  m_bInInnerResizePixel(false),
762  m_bPasteState(false),
763  m_bPasteSpecialState(false),
764  m_bInMailMerge(false),
765  m_bInDtor(false),
766  m_bOldShellWasPagePreview(false),
767  m_bIsPreviewDoubleClick(false),
768  m_bMakeSelectionVisible(false),
769  m_nLOKPageUpDownOffset(0)
770 {
771  static bool bRequestDoubleBuffering = getenv("VCL_DOUBLEBUFFERING_ENABLE");
772  if (bRequestDoubleBuffering)
774 
775  // According to discussion with MBA and further
776  // investigations, no old SfxViewShell will be set as parameter <pOldSh>,
777  // if function "New Window" is performed to open an additional view beside
778  // an already existing one.
779  // If the view is switch from one to another, the 'old' view is given by
780  // parameter <pOldSh>.
781 
782  bDocSzUpdated = true;
783 
784  CreateScrollbar( true );
785  CreateScrollbar( false );
786 
787  m_pViewImpl.reset(new SwView_Impl(this));
788  SetName("View");
790 
791  m_aTimer.SetTimeout( 120 );
792 
793  SwDocShell& rDocSh = dynamic_cast<SwDocShell&>(*_pFrame->GetObjectShell());
794  bool bOldModifyFlag = rDocSh.IsEnableSetModified();
795  if (bOldModifyFlag)
796  rDocSh.EnableSetModified( false );
797  // HACK: SwDocShell has some cached font info, VCL informs about font updates,
798  // but loading of docs with embedded fonts happens after SwDocShell is created
799  // but before SwEditWin (which handles the VCL event) is created. So update
800  // manually.
802  rDocSh.UpdateFontList();
803  bool bWebDShell = dynamic_cast<const SwWebDocShell*>(&rDocSh) != nullptr;
804 
805  const SwMasterUsrPref *pUsrPref = SW_MOD()->GetUsrPref(bWebDShell);
806  SwViewOption aUsrPref( *pUsrPref);
807 
809  SvtLinguOptions aLinguOpt;
810  SvtLinguConfig().GetOptions( aLinguOpt );
811  aUsrPref.SetOnlineSpell( aLinguOpt.bIsSpellAuto );
812 
813  bool bOldShellWasSrcView = false;
814 
815  // determine if there is an existing view for
816  // document
817  SfxViewShell* pExistingSh = nullptr;
818  if ( pOldSh )
819  {
820  pExistingSh = pOldSh;
821  // determine type of existing view
822  if (SwPagePreview* pPagePreview = dynamic_cast<SwPagePreview *>(pExistingSh))
823  {
824  m_sSwViewData = pPagePreview->GetPrevSwViewData();
825  m_sNewCursorPos = pPagePreview->GetNewCursorPos();
826  m_nNewPage = pPagePreview->GetNewPage();
829  }
830  else if (dynamic_cast<const SwSrcView *>(pExistingSh) != nullptr)
831  bOldShellWasSrcView = true;
832  }
833 
834  SAL_INFO( "sw.ui", "before create WrtShell" );
835  if (SwView *pView = dynamic_cast<SwView*>(pExistingSh))
836  {
837  m_pWrtShell.reset(new SwWrtShell(*pView->m_pWrtShell, m_pEditWin, *this));
838  }
839  else if (SwWrtShell *pWrtShell = dynamic_cast<SwWrtShell*>(rDocSh.GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell()))
840  {
841  m_pWrtShell.reset(new SwWrtShell(*pWrtShell, m_pEditWin, *this));
842  }
843  else
844  {
845  SwDoc& rDoc = *rDocSh.GetDoc();
846 
847  if( !bOldShellWasSrcView && bWebDShell && !m_bOldShellWasPagePreview )
848  aUsrPref.setBrowseMode( true );
849  else
851 
852  //For the BrowseMode we do not assume a factor.
853  if( aUsrPref.getBrowseMode() && aUsrPref.GetZoomType() != SvxZoomType::PERCENT )
854  {
855  aUsrPref.SetZoomType( SvxZoomType::PERCENT );
856  aUsrPref.SetZoom( 100 );
857  }
858  if (rDocSh.IsPreview())
859  {
860  aUsrPref.SetZoomType( SvxZoomType::WHOLEPAGE );
861  aUsrPref.SetViewLayoutBookMode( false );
862  aUsrPref.SetViewLayoutColumns( 1 );
863  }
864  m_pWrtShell.reset(new SwWrtShell(rDoc, m_pEditWin, *this, &aUsrPref));
865  // creating an SwView from a SwPagePreview needs to
866  // add the SwViewShell to the ring of the other SwViewShell(s)
868  {
869  SwViewShell& rPreviewViewShell = *static_cast<SwPagePreview*>(pExistingSh)->GetViewShell();
870  m_pWrtShell->MoveTo(&rPreviewViewShell);
871  // to update the field command et.al. if necessary
872  const SwViewOption* pPreviewOpt = rPreviewViewShell.GetViewOptions();
873  if( pPreviewOpt->IsFieldName() != aUsrPref.IsFieldName() ||
874  pPreviewOpt->IsShowHiddenField() != aUsrPref.IsShowHiddenField() ||
875  pPreviewOpt->IsShowHiddenPara() != aUsrPref.IsShowHiddenPara() ||
876  pPreviewOpt->IsShowHiddenChar() != aUsrPref.IsShowHiddenChar() )
877  rPreviewViewShell.ApplyViewOptions(aUsrPref);
878  // reset design mode at draw view for form
879  // shell, if needed.
880  if ( static_cast<SwPagePreview*>(pExistingSh)->ResetFormDesignMode() &&
881  m_pWrtShell->HasDrawView() )
882  {
883  SdrView* pDrawView = m_pWrtShell->GetDrawView();
884  pDrawView->SetDesignMode( static_cast<SwPagePreview*>(pExistingSh)->FormDesignModeToReset() );
885  }
886  }
887  }
888  SAL_INFO( "sw.ui", "after create WrtShell" );
890  SvxRulerSupportFlags::TABS |
891  SvxRulerSupportFlags::PARAGRAPH_MARGINS |
892  SvxRulerSupportFlags::BORDERS |
893  SvxRulerSupportFlags::NEGATIVE_MARGINS|
894  SvxRulerSupportFlags::REDUCED_METRIC,
897 
898  // assure that modified state of document
899  // isn't reset, if document is already modified.
900  const bool bIsDocModified = m_pWrtShell->GetDoc()->getIDocumentState().IsModified();
901 
902  // Thus among other things, the HRuler is not displayed in the read-only case.
903  aUsrPref.SetReadonly( m_pWrtShell->GetViewOptions()->IsReadonly() );
904 
905  // no margin for OLE!
906  Size aBrwsBorder;
907  if( SfxObjectCreateMode::EMBEDDED != rDocSh.GetCreateMode() )
908  aBrwsBorder = GetMargin();
909 
910  m_pWrtShell->SetBrowseBorder( aBrwsBorder );
911 
912  // In CTOR no shell changes may take place, which must be temporarily stored
913  // with the timer. Otherwise, the SFX removes them from the stack!
914  bool bOld = g_bNoInterrupt;
915  g_bNoInterrupt = true;
916 
917  m_pHRuler->SetActive();
918  m_pVRuler->SetActive();
919 
920  SfxViewFrame* pViewFrame = GetViewFrame();
921 
922  StartListening(*pViewFrame, DuplicateHandling::Prevent);
923  StartListening(rDocSh, DuplicateHandling::Prevent);
924 
925  // Set Zoom-factor from HRuler
926  Fraction aZoomFract( aUsrPref.GetZoom(), 100 );
927  m_pHRuler->SetZoom( aZoomFract );
928  m_pVRuler->SetZoom( aZoomFract );
929  m_pHRuler->SetDoubleClickHdl(LINK( this, SwView, ExecRulerClick ));
930  FieldUnit eMetric = pUsrPref->GetHScrollMetric();
931  m_pHRuler->SetUnit( eMetric );
932 
933  eMetric = pUsrPref->GetVScrollMetric();
934  m_pVRuler->SetUnit( eMetric );
935 
936  m_pHRuler->SetCharWidth( 371 ); // default character width
937  m_pVRuler->SetLineHeight( 551 ); // default line height
938 
939  // Set DocShell
940  m_xGlueDocShell.reset(new SwViewGlueDocShell(*this, rDocSh));
941  m_pPostItMgr.reset(new SwPostItMgr(this));
942 
943  // Check and process the DocSize. Via the handler, the shell could not
944  // be found, because the shell is not known in the SFX management
945  // within the CTOR phase.
946  DocSzChgd( m_pWrtShell->GetDocSize() );
947 
948  // Set AttrChangedNotify link
949  m_pWrtShell->SetChgLnk(LINK(this, SwView, AttrChangedNotify));
950 
951  if (rDocSh.GetCreateMode() == SfxObjectCreateMode::EMBEDDED &&
952  !rDocSh.GetVisArea(ASPECT_CONTENT).IsEmpty())
953  SetVisArea(rDocSh.GetVisArea(ASPECT_CONTENT),false);
954 
955  SAL_WARN_IF(
957  "sw.ui", "/org.openoffice.Office.Common/Undo/Steps <= 0");
959  {
960  m_pWrtShell->DoUndo();
961  }
962 
963  const bool bBrowse = m_pWrtShell->GetViewOptions()->getBrowseMode();
964  // Disable "multiple window"
965  SetNewWindowAllowed(!bBrowse);
966  // End of disabled multiple window
967 
970  m_pHScrollbar->SetAuto(bBrowse);
971  if( aUsrPref.IsViewHRuler() )
972  CreateTab();
973  if( aUsrPref.IsViewVRuler() )
974  CreateVRuler();
975 
976  m_pWrtShell->SetUIOptions( aUsrPref );
977  m_pWrtShell->SetReadOnlyAvailable( aUsrPref.IsCursorInProtectedArea() );
978  m_pWrtShell->ApplyAccessibilityOptions(SW_MOD()->GetAccessibilityOptions());
979 
980  if( m_pWrtShell->GetDoc()->getIDocumentState().IsUpdateExpField() )
981  {
982  if (m_pWrtShell->GetDoc()->GetDocumentFieldsManager().containsUpdatableFields())
983  {
985  m_pWrtShell->StartAction();
986  m_pWrtShell->CalcLayout();
987  m_pWrtShell->GetDoc()->getIDocumentFieldsAccess().UpdateFields(false);
988  m_pWrtShell->EndAction();
989  }
990  m_pWrtShell->GetDoc()->getIDocumentState().SetUpdateExpFieldStat( false );
991  }
992 
993  // Update all tables if necessary:
994  if( m_pWrtShell->GetDoc()->IsUpdateTOX() )
995  {
996  SfxRequest aSfxRequest( FN_UPDATE_TOX, SfxCallMode::SLOT, GetPool() );
997  Execute( aSfxRequest );
998  m_pWrtShell->GetDoc()->SetUpdateTOX( false ); // reset again
999  m_pWrtShell->SttEndDoc(true);
1000  }
1001 
1002  // No ResetModified, if there is already a view to this doc.
1003  SfxViewFrame* pVFrame = GetViewFrame();
1004  SfxViewFrame* pFirst = SfxViewFrame::GetFirst(&rDocSh);
1005  // Currently(360) the view is registered firstly after the CTOR,
1006  // the following expression is also working if this changes.
1007  // If the modification cannot be canceled by undo, then do NOT set
1008  // the modify back.
1009  // no reset of modified state, if document
1010  // was already modified.
1011  if (!m_pWrtShell->GetDoc()->GetIDocumentUndoRedo().IsUndoNoResetModified() &&
1012  ( !pFirst || pFirst == pVFrame ) &&
1013  !bIsDocModified )
1014  {
1015  m_pWrtShell->ResetModified();
1016  }
1017 
1018  g_bNoInterrupt = bOld;
1019 
1020  // If a new GlobalDoc will be created, the navigator will also be generated.
1021  if( dynamic_cast<const SwGlobalDocShell*>(&rDocSh) != nullptr &&
1022  !pVFrame->GetChildWindow( SID_NAVIGATOR ))
1023  {
1024  SfxBoolItem aNavi(SID_NAVIGATOR, true);
1025  GetDispatcher().ExecuteList(SID_NAVIGATOR, SfxCallMode::ASYNCHRON, { &aNavi });
1026  }
1027 
1028  uno::Reference< frame::XFrame > xFrame = pVFrame->GetFrame().GetFrameInterface();
1029 
1030  uno::Reference< frame::XFrame > xBeamerFrame = xFrame->findFrame(
1031  "_beamer", frame::FrameSearchFlag::CHILDREN);
1032  if(xBeamerFrame.is())
1033  {
1034  SwDBData aData = m_pWrtShell->GetDBData();
1035  SwModule::ShowDBObj( *this, aData );
1036  }
1037 
1038  // has anybody calls the attrchanged handler in the constructor?
1040  {
1041  GetViewFrame()->GetBindings().LEAVEREGISTRATIONS();
1042  if( m_aTimer.IsActive() )
1043  m_aTimer.Stop();
1044  }
1045 
1046  m_aTimer.SetInvokeHandler(LINK(this, SwView, TimeoutHdl));
1047  m_aTimer.SetDebugName( "sw::SwView m_aTimer" );
1049  if (bOldModifyFlag)
1050  rDocSh.EnableSetModified();
1051  InvalidateBorder();
1052 
1053  if( !m_pHScrollbar->IsVisible( true ) )
1054  ShowHScrollbar( false );
1055  if( !m_pVScrollbar->IsVisible( true ) )
1056  ShowVScrollbar( false );
1057 
1058  GetViewFrame()->GetWindow().AddChildEventListener( LINK( this, SwView, WindowChildEventListener ) );
1059 }
1060 
1062  : m_rView(rView)
1063 {
1064  // Set DocShell
1065  rDocSh.SetView(&m_rView);
1066  SW_MOD()->SetView(&m_rView);
1067 }
1068 
1070 {
1071  SwDocShell* pDocSh = m_rView.GetDocShell();
1072  if (pDocSh && pDocSh->GetView() == &m_rView)
1073  pDocSh->SetView(nullptr);
1074  if (SW_MOD()->GetView() == &m_rView)
1075  SW_MOD()->SetView(nullptr);
1076 }
1077 
1079 {
1080  // Notify other LOK views that we are going away.
1081  SfxLokHelper::notifyOtherViews(this, LOK_CALLBACK_VIEW_CURSOR_VISIBLE, "visible", "false");
1082  SfxLokHelper::notifyOtherViews(this, LOK_CALLBACK_TEXT_VIEW_SELECTION, "selection", "");
1083  SfxLokHelper::notifyOtherViews(this, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", "EMPTY");
1084 
1085  // Need to remove activated field's button before disposing EditWin.
1087 
1088  GetViewFrame()->GetWindow().RemoveChildEventListener( LINK( this, SwView, WindowChildEventListener ) );
1089  m_pPostItMgr.reset();
1090 
1091  m_bInDtor = true;
1092  m_pEditWin->Hide(); // prevent problems with painting
1093 
1094  // Set pointer in SwDocShell to the view again
1095  m_xGlueDocShell.reset();
1096 
1098  GetViewFrame()->GetBindings().LEAVEREGISTRATIONS();
1099 
1100  // the last view must end the text edit
1101  SdrView *pSdrView = m_pWrtShell ? m_pWrtShell->GetDrawView() : nullptr;
1102  if( pSdrView && pSdrView->IsTextEdit() )
1103  pSdrView->SdrEndTextEdit( true );
1104 
1105  SetWindow( nullptr );
1106 
1107  m_pViewImpl->Invalidate();
1108  EndListening(*GetViewFrame());
1109  EndListening(*GetDocShell());
1111  m_pWrtShell.reset(); // reset here so that it is not accessible by the following dtors.
1116  m_pGlosHdl.reset();
1117  m_pViewImpl.reset();
1118 
1119  // If this was enabled in the ctor for the frame, then disable it here.
1120  static bool bRequestDoubleBuffering = getenv("VCL_DOUBLEBUFFERING_ENABLE");
1121  if (bRequestDoubleBuffering)
1124 
1125  m_pFormatClipboard.reset();
1126 }
1127 
1129 {
1130  SfxObjectShell* pDocShell = GetViewFrame()->GetObjectShell();
1131  return dynamic_cast<SwDocShell*>( pDocShell );
1132 }
1133 
1134 // Remember CursorPos
1135 
1136 void SwView::WriteUserData( OUString &rUserData, bool bBrowse )
1137 {
1138  // The browse flag will be passed from Sfx when documents are browsed
1139  // (not to be confused with the BrowseMode).
1140  // Then that stored data are not persistent!
1141 
1142  const SwRect& rRect = m_pWrtShell->GetCharRect();
1143  const tools::Rectangle& rVis = GetVisArea();
1144 
1145  rUserData = OUString::number( rRect.Left() );
1146  rUserData += ";";
1147  rUserData += OUString::number( rRect.Top() );
1148  rUserData += ";";
1149  rUserData += OUString::number( m_pWrtShell->GetViewOptions()->GetZoom() );
1150  rUserData += ";";
1151  rUserData += OUString::number( rVis.Left() );
1152  rUserData += ";";
1153  rUserData += OUString::number( rVis.Top() );
1154  rUserData += ";";
1155  rUserData += OUString::number( bBrowse ? SAL_MIN_INT32 : rVis.Right());
1156  rUserData += ";";
1157  rUserData += OUString::number( bBrowse ? SAL_MIN_INT32 : rVis.Bottom());
1158  rUserData += ";";
1159  rUserData += OUString::number(
1160  static_cast<sal_uInt16>(m_pWrtShell->GetViewOptions()->GetZoomType()));//eZoom;
1161  rUserData += ";";
1162  rUserData += FrameTypeFlags::NONE == m_pWrtShell->GetSelFrameType() ? OUStringLiteral("0") : OUStringLiteral("1");
1163 }
1164 
1165 // Set CursorPos
1166 
1167 static bool lcl_IsOwnDocument( SwView& rView )
1168 {
1169  uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
1170  rView.GetDocShell()->GetModel(), uno::UNO_QUERY_THROW);
1171  uno::Reference<document::XDocumentProperties> xDocProps
1172  = xDPS->getDocumentProperties();
1173  OUString Created = xDocProps->getAuthor();
1174  OUString Changed = xDocProps->getModifiedBy();
1175  OUString FullName = SW_MOD()->GetUserOptions().GetFullName();
1176  return (!FullName.isEmpty() &&
1177  (!Changed.isEmpty() && Changed == FullName )) ||
1178  (Changed.isEmpty() && !Created.isEmpty() && Created == FullName );
1179 }
1180 
1181 void SwView::ReadUserData( const OUString &rUserData, bool bBrowse )
1182 {
1183  if ( rUserData.indexOf(';')>=0 && // more than one token
1184  // For document without layout only in the onlinelayout or
1185  // while forward/backward
1186  (!m_pWrtShell->IsNewLayout() || m_pWrtShell->GetViewOptions()->getBrowseMode() || bBrowse) )
1187  {
1188  bool bIsOwnDocument = lcl_IsOwnDocument( *this );
1189 
1190  SET_CURR_SHELL(m_pWrtShell.get());
1191 
1192  sal_Int32 nPos = 0;
1193 
1194  // No it is *not* a good idea to call GetToken within Point constr. immediately,
1195  // because which parameter is evaluated first?
1196  long nX = rUserData.getToken( 0, ';', nPos ).toInt32(),
1197  nY = rUserData.getToken( 0, ';', nPos ).toInt32();
1198  Point aCursorPos( nX, nY );
1199 
1200  sal_uInt16 nZoomFactor =
1201  static_cast< sal_uInt16 >( rUserData.getToken(0, ';', nPos ).toInt32() );
1202 
1203  long nLeft = rUserData.getToken(0, ';', nPos ).toInt32(),
1204  nTop = rUserData.getToken(0, ';', nPos ).toInt32(),
1205  nRight = rUserData.getToken(0, ';', nPos ).toInt32(),
1206  nBottom= rUserData.getToken(0, ';', nPos ).toInt32();
1207 
1208  const long nAdd = m_pWrtShell->GetViewOptions()->getBrowseMode() ? DOCUMENTBORDER : DOCUMENTBORDER*2;
1209  if ( nBottom <= (m_pWrtShell->GetDocSize().Height()+nAdd) )
1210  {
1211  m_pWrtShell->EnableSmooth( false );
1212 
1213  const tools::Rectangle aVis( nLeft, nTop, nRight, nBottom );
1214 
1215  sal_Int32 nOff = 0;
1216  SvxZoomType eZoom;
1217  if( !m_pWrtShell->GetViewOptions()->getBrowseMode() )
1218  eZoom = static_cast<SvxZoomType>(static_cast<sal_uInt16>(rUserData.getToken(nOff, ';', nPos ).toInt32()));
1219  else
1220  {
1221  eZoom = SvxZoomType::PERCENT;
1222  ++nOff;
1223  }
1224 
1225  bool bSelectObj = (0 != rUserData.getToken( nOff, ';', nPos ).toInt32())
1226  && m_pWrtShell->IsObjSelectable( aCursorPos );
1227 
1228  // restore editing position
1229  m_pViewImpl->SetRestorePosition(aCursorPos, bSelectObj);
1230  // set flag value to avoid macro execution.
1231  bool bSavedFlagValue = m_pWrtShell->IsMacroExecAllowed();
1232  m_pWrtShell->SetMacroExecAllowed( false );
1233 // os: changed: The user data has to be read if the view is switched back from page preview
1234 // go to the last editing position when opening own files
1235  if(m_bOldShellWasPagePreview || bIsOwnDocument)
1236  {
1237  m_pWrtShell->SwCursorShell::SetCursor( aCursorPos, !bSelectObj );
1238  if( bSelectObj )
1239  {
1240  m_pWrtShell->SelectObj( aCursorPos );
1241  m_pWrtShell->EnterSelFrameMode( &aCursorPos );
1242  }
1243  }
1244 
1245  // reset flag value
1246  m_pWrtShell->SetMacroExecAllowed( bSavedFlagValue );
1247 
1248  // set visible area before applying
1249  // information from print preview. Otherwise, the applied information
1250  // is lost.
1251 // os: changed: The user data has to be read if the view is switched back from page preview
1252 // go to the last editing position when opening own files
1253  if(m_bOldShellWasPagePreview || bIsOwnDocument )
1254  {
1255  if ( bBrowse )
1256  SetVisArea( aVis.TopLeft() );
1257  else
1258  SetVisArea( aVis );
1259  }
1260 
1261  //apply information from print preview - if available
1262  if( !m_sNewCursorPos.isEmpty() )
1263  {
1264  sal_Int32 nIdx{ 0 };
1265  const long nXTmp = m_sNewCursorPos.getToken( 0, ';', nIdx ).toInt32();
1266  const long nYTmp = m_sNewCursorPos.getToken( 0, ';', nIdx ).toInt32();
1267  Point aCursorPos2( nXTmp, nYTmp );
1268  bSelectObj = m_pWrtShell->IsObjSelectable( aCursorPos2 );
1269 
1270  m_pWrtShell->SwCursorShell::SetCursor( aCursorPos2 );
1271  if( bSelectObj )
1272  {
1273  m_pWrtShell->SelectObj( aCursorPos2 );
1274  m_pWrtShell->EnterSelFrameMode( &aCursorPos2 );
1275  }
1276  m_pWrtShell->MakeSelVisible();
1277  m_sNewCursorPos.clear();
1278  }
1279  else if(USHRT_MAX != m_nNewPage)
1280  {
1281  m_pWrtShell->GotoPage(m_nNewPage, true);
1283  }
1284 
1285  SelectShell();
1286 
1287  m_pWrtShell->StartAction();
1288  const SwViewOption* pVOpt = m_pWrtShell->GetViewOptions();
1289  if( pVOpt->GetZoom() != nZoomFactor || pVOpt->GetZoomType() != eZoom )
1290  SetZoom( eZoom, nZoomFactor);
1291 
1292  m_pWrtShell->LockView( true );
1293  m_pWrtShell->EndAction();
1294  m_pWrtShell->LockView( false );
1295  m_pWrtShell->EnableSmooth( true );
1296  }
1297  }
1298 }
1299 
1300 void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >& rSequence )
1301 {
1302  if(GetDocShell()->IsPreview()||m_bIsPreviewDoubleClick)
1303  return;
1304  bool bIsOwnDocument = lcl_IsOwnDocument( *this );
1305  if (!rSequence.hasElements())
1306  return;
1307 
1308  SET_CURR_SHELL(m_pWrtShell.get());
1309  const SwRect& rRect = m_pWrtShell->GetCharRect();
1310  const tools::Rectangle &rVis = GetVisArea();
1311  const SwViewOption* pVOpt = m_pWrtShell->GetViewOptions();
1312 
1313  sal_Int64 nX = rRect.Left(), nY = rRect.Top(), nLeft = rVis.Left(), nTop = rVis.Top();
1314  sal_Int64 nRight = LONG_MIN;
1315  sal_Int64 nBottom = LONG_MIN;
1316  sal_Int16 nZoomType = static_cast< sal_Int16 >(pVOpt->GetZoomType());
1317  sal_Int16 nZoomFactor = static_cast < sal_Int16 > (pVOpt->GetZoom());
1318  bool bViewLayoutBookMode = pVOpt->IsViewLayoutBookMode();
1319  sal_Int16 nViewLayoutColumns = pVOpt->GetViewLayoutColumns();
1320 
1321  bool bSelectedFrame = ( m_pWrtShell->GetSelFrameType() != FrameTypeFlags::NONE ),
1322  bGotVisibleLeft = false,
1323  bGotVisibleTop = false, bGotVisibleRight = false,
1324  bGotVisibleBottom = false, bGotZoomType = false,
1325  bGotZoomFactor = false, bGotIsSelectedFrame = false,
1326  bGotViewLayoutColumns = false, bGotViewLayoutBookMode = false,
1327  bBrowseMode = false, bGotBrowseMode = false;
1328 
1329  for (const beans::PropertyValue& rValue : rSequence)
1330  {
1331  if ( rValue.Name == "ViewLeft" )
1332  {
1333  rValue.Value >>= nX;
1334  nX = convertMm100ToTwip( nX );
1335  }
1336  else if ( rValue.Name == "ViewTop" )
1337  {
1338  rValue.Value >>= nY;
1339  nY = convertMm100ToTwip( nY );
1340  }
1341  else if ( rValue.Name == "VisibleLeft" )
1342  {
1343  rValue.Value >>= nLeft;
1344  nLeft = convertMm100ToTwip( nLeft );
1345  bGotVisibleLeft = true;
1346  }
1347  else if ( rValue.Name == "VisibleTop" )
1348  {
1349  rValue.Value >>= nTop;
1350  nTop = convertMm100ToTwip( nTop );
1351  bGotVisibleTop = true;
1352  }
1353  else if ( rValue.Name == "VisibleRight" )
1354  {
1355  rValue.Value >>= nRight;
1356  nRight = convertMm100ToTwip( nRight );
1357  bGotVisibleRight = true;
1358  }
1359  else if ( rValue.Name == "VisibleBottom" )
1360  {
1361  rValue.Value >>= nBottom;
1362  nBottom = convertMm100ToTwip( nBottom );
1363  bGotVisibleBottom = true;
1364  }
1365  else if ( rValue.Name == "ZoomType" )
1366  {
1367  rValue.Value >>= nZoomType;
1368  bGotZoomType = true;
1369  }
1370  else if ( rValue.Name == "ZoomFactor" )
1371  {
1372  rValue.Value >>= nZoomFactor;
1373  bGotZoomFactor = true;
1374  }
1375  else if ( rValue.Name == "ViewLayoutColumns" )
1376  {
1377  rValue.Value >>= nViewLayoutColumns;
1378  bGotViewLayoutColumns = true;
1379  }
1380  else if ( rValue.Name == "ViewLayoutBookMode" )
1381  {
1382  bViewLayoutBookMode = *o3tl::doAccess<bool>(rValue.Value);
1383  bGotViewLayoutBookMode = true;
1384  }
1385  else if ( rValue.Name == "IsSelectedFrame" )
1386  {
1387  rValue.Value >>= bSelectedFrame;
1388  bGotIsSelectedFrame = true;
1389  }
1390  else if (rValue.Name == "ShowOnlineLayout")
1391  {
1392  rValue.Value >>= bBrowseMode;
1393  bGotBrowseMode = true;
1394  }
1395  // Fallback to common SdrModel processing
1396  else
1398  }
1399  if (bGotBrowseMode)
1400  {
1401  // delegate further
1402  GetViewImpl()->GetUNOObject_Impl()->getViewSettings()->setPropertyValue("ShowOnlineLayout", uno::Any(bBrowseMode));
1403  }
1404  if (bGotVisibleBottom)
1405  {
1406  Point aCursorPos( nX, nY );
1407  const long nAdd = m_pWrtShell->GetViewOptions()->getBrowseMode() ? DOCUMENTBORDER : DOCUMENTBORDER*2;
1408  if (nBottom <= (m_pWrtShell->GetDocSize().Height()+nAdd) )
1409  {
1410  m_pWrtShell->EnableSmooth( false );
1411  const tools::Rectangle aVis( nLeft, nTop, nRight, nBottom );
1412 
1413  SvxZoomType eZoom;
1414  if ( !m_pWrtShell->GetViewOptions()->getBrowseMode() )
1415  eZoom = static_cast < SvxZoomType > ( nZoomType );
1416  else
1417  {
1418  eZoom = SvxZoomType::PERCENT;
1419  }
1420  if (bGotIsSelectedFrame)
1421  {
1422  bool bSelectObj = bSelectedFrame && m_pWrtShell->IsObjSelectable( aCursorPos );
1423 
1424  // set flag value to avoid macro execution.
1425  bool bSavedFlagValue = m_pWrtShell->IsMacroExecAllowed();
1426  m_pWrtShell->SetMacroExecAllowed( false );
1427 // os: changed: The user data has to be read if the view is switched back from page preview
1428 // go to the last editing position when opening own files
1429  m_pViewImpl->SetRestorePosition(aCursorPos, bSelectObj);
1430  if(m_bOldShellWasPagePreview|| bIsOwnDocument)
1431  {
1432  m_pWrtShell->SwCursorShell::SetCursor( aCursorPos, !bSelectObj );
1433 
1434  // Update the shell to toggle Header/Footer edit if needed
1435  bool bInHeader = true;
1436  if ( m_pWrtShell->IsInHeaderFooter( &bInHeader ) )
1437  {
1438  if ( !bInHeader )
1439  {
1440  m_pWrtShell->SetShowHeaderFooterSeparator( Footer, true );
1441  m_pWrtShell->SetShowHeaderFooterSeparator( Header, false );
1442  }
1443  else
1444  {
1445  m_pWrtShell->SetShowHeaderFooterSeparator( Header, true );
1446  m_pWrtShell->SetShowHeaderFooterSeparator( Footer, false );
1447  }
1448 
1449  // Force repaint
1450  m_pWrtShell->GetWin()->Invalidate();
1451  }
1452  if ( m_pWrtShell->IsInHeaderFooter() != m_pWrtShell->IsHeaderFooterEdit() )
1453  m_pWrtShell->ToggleHeaderFooterEdit();
1454 
1455  if( bSelectObj )
1456  {
1457  m_pWrtShell->SelectObj( aCursorPos );
1458  m_pWrtShell->EnterSelFrameMode( &aCursorPos );
1459  }
1460  }
1461 
1462  // reset flag value
1463  m_pWrtShell->SetMacroExecAllowed( bSavedFlagValue );
1464  }
1465  SelectShell();
1466 
1467  // Set ViewLayoutSettings
1468  const bool bSetViewLayoutSettings = bGotViewLayoutColumns && bGotViewLayoutBookMode &&
1469  ( pVOpt->GetViewLayoutColumns() != nViewLayoutColumns || pVOpt->IsViewLayoutBookMode() != bViewLayoutBookMode );
1470 
1471  const bool bSetViewSettings = bGotZoomType && bGotZoomFactor &&
1472  ( pVOpt->GetZoom() != nZoomFactor || pVOpt->GetZoomType() != eZoom );
1473 
1474  // In case we have a 'fixed' view layout of 2 or more columns,
1475  // we have to apply the view options *before* starting the action.
1476  // Otherwise the SetZoom function cannot work correctly, because
1477  // the view layout hasn't been calculated.
1478  const bool bZoomNeedsViewLayout = bSetViewLayoutSettings &&
1479  1 < nViewLayoutColumns &&
1480  bSetViewSettings &&
1481  eZoom != SvxZoomType::PERCENT;
1482 
1483  if ( !bZoomNeedsViewLayout )
1484  m_pWrtShell->StartAction();
1485 
1486  if ( bSetViewLayoutSettings )
1487  SetViewLayout( nViewLayoutColumns, bViewLayoutBookMode, true );
1488 
1489  if ( bZoomNeedsViewLayout )
1490  m_pWrtShell->StartAction();
1491 
1492  if ( bSetViewSettings )
1493  SetZoom( eZoom, nZoomFactor, true );
1494 
1495 // os: changed: The user data has to be read if the view is switched back from page preview
1496 // go to the last editing position when opening own files
1497  if(m_bOldShellWasPagePreview||bIsOwnDocument)
1498  {
1499  if ( bGotVisibleLeft && bGotVisibleTop )
1500  {
1501  Point aTopLeft(aVis.TopLeft());
1502  // make sure the document is still centered
1503  const SwTwips lBorder = IsDocumentBorder() ? DOCUMENTBORDER : 2 * DOCUMENTBORDER;
1504  SwTwips nEditWidth = GetEditWin().GetOutputSize().Width();
1505  if(nEditWidth > (m_aDocSz.Width() + lBorder ))
1506  aTopLeft.setX( ( m_aDocSz.Width() + lBorder - nEditWidth ) / 2 );
1507  else
1508  {
1509  //check if the values are possible
1511  if( aTopLeft.X() > nXMax )
1512  aTopLeft.setX( nXMax < 0 ? 0 : nXMax );
1513  }
1514  SetVisArea( aTopLeft );
1515  }
1516  else if (bGotVisibleLeft && bGotVisibleTop && bGotVisibleRight && bGotVisibleBottom )
1517  SetVisArea( aVis );
1518  }
1519 
1520  m_pWrtShell->LockView( true );
1521  m_pWrtShell->EndAction();
1522  m_pWrtShell->LockView( false );
1523  m_pWrtShell->EnableSmooth( true );
1524  }
1525  }
1526 
1527 }
1528 
1529 void SwView::WriteUserDataSequence ( uno::Sequence < beans::PropertyValue >& rSequence )
1530 {
1531  const SwRect& rRect = m_pWrtShell->GetCharRect();
1532  const tools::Rectangle& rVis = GetVisArea();
1533 
1534  std::vector<beans::PropertyValue> aVector;
1535 
1536  sal_uInt16 nViewID( GetViewFrame()->GetCurViewId());
1537  aVector.push_back(comphelper::makePropertyValue("ViewId", "view" + OUString::number(nViewID)));
1538 
1539  aVector.push_back(comphelper::makePropertyValue("ViewLeft", convertTwipToMm100 ( rRect.Left() )));
1540 
1541  aVector.push_back(comphelper::makePropertyValue("ViewTop", convertTwipToMm100 ( rRect.Top() )));
1542 
1543  auto visibleLeft = convertTwipToMm100 ( rVis.Left() );
1544  aVector.push_back(comphelper::makePropertyValue("VisibleLeft", visibleLeft));
1545 
1546  auto visibleTop = convertTwipToMm100 ( rVis.Top() );
1547  aVector.push_back(comphelper::makePropertyValue("VisibleTop", visibleTop));
1548 
1549  auto visibleRight = rVis.IsWidthEmpty() ? visibleLeft : convertTwipToMm100 ( rVis.Right() );
1550  aVector.push_back(comphelper::makePropertyValue("VisibleRight", visibleRight));
1551 
1552  auto visibleBottom = rVis.IsHeightEmpty() ? visibleTop : convertTwipToMm100 ( rVis.Bottom() );
1553  aVector.push_back(comphelper::makePropertyValue("VisibleBottom", visibleBottom));
1554 
1555  const sal_Int16 nZoomType = static_cast< sal_Int16 >(m_pWrtShell->GetViewOptions()->GetZoomType());
1556  aVector.push_back(comphelper::makePropertyValue("ZoomType", nZoomType));
1557 
1558  const sal_Int16 nViewLayoutColumns = static_cast< sal_Int16 >(m_pWrtShell->GetViewOptions()->GetViewLayoutColumns());
1559  aVector.push_back(comphelper::makePropertyValue("ViewLayoutColumns", nViewLayoutColumns));
1560 
1561  aVector.push_back(comphelper::makePropertyValue("ViewLayoutBookMode", m_pWrtShell->GetViewOptions()->IsViewLayoutBookMode()));
1562 
1563  aVector.push_back(comphelper::makePropertyValue("ZoomFactor", static_cast < sal_Int16 > (m_pWrtShell->GetViewOptions()->GetZoom())));
1564 
1565  aVector.push_back(comphelper::makePropertyValue("IsSelectedFrame", FrameTypeFlags::NONE != m_pWrtShell->GetSelFrameType()));
1566 
1567  rSequence = comphelper::containerToSequence(aVector);
1568 
1569  // Common SdrModel processing
1571 }
1572 
1573 void SwView::ShowCursor( bool bOn )
1574 {
1575  //don't scroll the cursor into the visible area
1576  bool bUnlockView = !m_pWrtShell->IsViewLocked();
1577  m_pWrtShell->LockView( true ); //lock visible section
1578 
1579  if( !bOn )
1580  m_pWrtShell->HideCursor();
1581  else if( !m_pWrtShell->IsFrameSelected() && !m_pWrtShell->IsObjSelected() )
1582  m_pWrtShell->ShowCursor();
1583 
1584  if( bUnlockView )
1585  m_pWrtShell->LockView( false );
1586 }
1587 
1589 {
1590  if ( !GetViewFrame()->GetFrame().IsInPlace() )
1591  {
1592  SwWrtShell &rSh = GetWrtShell();
1593  const SelectionType nSel = rSh.GetSelectionType();
1594  if ( nSel & SelectionType::Ole )
1595  rSh.LaunchOLEObj( nVerb );
1596  }
1597  return ERRCODE_NONE;
1598 }
1599 
1600 // only return true for a text selection
1601 
1602 bool SwView::HasSelection( bool bText ) const
1603 {
1604  return bText ? GetWrtShell().SwCursorShell::HasSelection()
1605  : GetWrtShell().HasSelection();
1606 }
1607 
1608 OUString SwView::GetSelectionText( bool bCompleteWrds )
1609 {
1610  return GetSelectionTextParam( bCompleteWrds, true );
1611 }
1612 
1613 OUString SwView::GetSelectionTextParam( bool bCompleteWrds, bool bEraseTrail )
1614 {
1615  OUString sReturn;
1616  if( bCompleteWrds && !GetWrtShell().HasSelection() )
1617  GetWrtShell().SelWrd();
1618 
1619  GetWrtShell().GetSelectedText( sReturn );
1620  if( bEraseTrail )
1621  sReturn = comphelper::string::stripEnd(sReturn, ' ');
1622  return sReturn;
1623 }
1624 
1626 {
1627  if(!m_pGlosHdl)
1628  m_pGlosHdl.reset(new SwGlossaryHdl(GetViewFrame(), m_pWrtShell.get()));
1629  return m_pGlosHdl.get();
1630 }
1631 
1632 void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
1633 {
1634  bool bCallBase = true;
1635  if(dynamic_cast<const FmDesignModeChangedHint*>(&rHint))
1636  {
1637  bool bDesignMode = static_cast<const FmDesignModeChangedHint&>(rHint).GetDesignMode();
1638  if (!bDesignMode && GetDrawFuncPtr())
1639  {
1641  SetDrawFuncPtr(nullptr);
1642  LeaveDrawCreate();
1643  AttrChangedNotify(nullptr);
1644  }
1645  }
1646  else
1647  {
1648  SfxHintId nId = rHint.GetId();
1649  switch ( nId )
1650  {
1651  // sub shells will be destroyed by the
1652  // dispatcher, if the view frame is dying. Thus, reset member <pShell>.
1653  case SfxHintId::Dying:
1654  {
1655  if ( &rBC == GetViewFrame() )
1656  {
1657  ResetSubShell();
1658  }
1659  }
1660  break;
1661  case SfxHintId::ModeChanged:
1662  {
1663  // Modal mode change-over?
1664  bool bModal = GetDocShell()->IsInModalMode();
1665  m_pHRuler->SetActive( !bModal );
1666  m_pVRuler->SetActive( !bModal );
1667  }
1668 
1669  [[fallthrough]];
1670 
1671  case SfxHintId::TitleChanged:
1672  if ( GetDocShell()->IsReadOnly() != GetWrtShell().GetViewOptions()->IsReadonly() )
1673  {
1674  SwWrtShell &rSh = GetWrtShell();
1676 
1677  if ( rSh.GetViewOptions()->IsViewVRuler() )
1678  CreateVRuler();
1679  else
1680  KillVRuler();
1681  if ( rSh.GetViewOptions()->IsViewHRuler() )
1682  CreateTab();
1683  else
1684  KillTab();
1685  bool bReadonly = GetDocShell()->IsReadOnly();
1686  // if document is to be opened in alive-mode then this has to be
1687  // regarded while switching from readonly-mode to edit-mode
1688  if( !bReadonly )
1689  {
1691  if (pDrawDoc)
1692  {
1693  if( !pDrawDoc->GetOpenInDesignMode() )
1694  break;// don't touch the design mode
1695  }
1696  }
1697  SfxBoolItem aItem( SID_FM_DESIGN_MODE, !bReadonly);
1698  GetDispatcher().ExecuteList(SID_FM_DESIGN_MODE,
1699  SfxCallMode::ASYNCHRON, { &aItem });
1700  }
1701  break;
1702 
1703  case SfxHintId::SwDrawViewsCreated:
1704  {
1705  bCallBase = false;
1706  if ( GetFormShell() )
1707  {
1708  GetFormShell()->SetView(dynamic_cast<FmFormView*>(GetWrtShell().GetDrawView()));
1709  SfxBoolItem aItem( SID_FM_DESIGN_MODE, !GetDocShell()->IsReadOnly());
1710  GetDispatcher().ExecuteList(SID_FM_DESIGN_MODE,
1711  SfxCallMode::SYNCHRON, { &aItem });
1712  }
1713  }
1714  break;
1715  case SfxHintId::RedlineChanged:
1716  {
1717  static sal_uInt16 const aSlotRedLine[] = {
1724  0
1725  };
1726  GetViewFrame()->GetBindings().Invalidate(aSlotRedLine);
1727  }
1728  break;
1729 
1730  default: break;
1731  }
1732  }
1733 
1734  if ( bCallBase )
1735  SfxViewShell::Notify(rBC, rHint);
1736 }
1737 
1738 #if defined(_WIN32) || defined UNX
1739 
1741 {
1742  uno::Reference< XScannerManager2 > xScanMgr = SW_MOD()->GetScannerManager();
1743  if( xScanMgr.is() )
1744  {
1745  const ScannerContext aContext( xScanMgr->getAvailableScanners().getConstArray()[ 0 ] );
1746  const ScanError eError = xScanMgr->getError( aContext );
1747 
1748  if( ScanError_ScanErrorNone == eError )
1749  {
1750  const uno::Reference< awt::XBitmap > xBitmap( xScanMgr->getBitmap( aContext ) );
1751 
1752  if( xBitmap.is() )
1753  {
1754  const BitmapEx aScanBmp( VCLUnoHelper::GetBitmap( xBitmap ) );
1755 
1756  if( !!aScanBmp )
1757  {
1758  Graphic aGrf(aScanBmp);
1759  m_pWrtShell->Insert( OUString(), OUString(), aGrf );
1760  }
1761  }
1762  }
1763  }
1764  SfxBindings& rBind = GetViewFrame()->GetBindings();
1765  rBind.Invalidate( SID_TWAIN_SELECT );
1766  rBind.Invalidate( SID_TWAIN_TRANSFER );
1767 }
1768 #endif
1769 
1771 {
1772  if(m_aTimer.IsActive())
1773  {
1774  m_aTimer.Stop();
1776  {
1777  GetViewFrame()->GetBindings().LEAVEREGISTRATIONS();
1779  }
1780  SelectShell();
1781  m_bAttrChgNotified = false;
1782  }
1783 }
1784 
1785 bool SwView::PrepareClose( bool bUI )
1786 {
1787  SfxViewFrame* pVFrame = GetViewFrame();
1788  pVFrame->SetChildWindow( SwInputChild::GetChildWindowId(), false );
1789  if( pVFrame->GetDispatcher()->IsLocked() )
1790  pVFrame->GetDispatcher()->Lock(false);
1791 
1792  if ( m_pFormShell && !m_pFormShell->PrepareClose( bUI ) )
1793  {
1794  return false;
1795  }
1796  return SfxViewShell::PrepareClose( bUI );
1797 }
1798 
1799 // status methods for clipboard.
1800 // Status changes now notified from the clipboard.
1802 {
1804  if( m_nLastPasteDestination != nPasteDestination )
1805  {
1806  TransferableDataHelper aDataHelper(
1808  &GetEditWin()) );
1809  if( aDataHelper.GetXTransferable().is() )
1810  {
1813  *m_pWrtShell, aDataHelper );
1814  }
1815  else
1817 
1818  if( static_cast<SotExchangeDest>(0xFFFF) == m_nLastPasteDestination ) // the init value
1819  m_pViewImpl->AddClipboardListener();
1820  m_nLastPasteDestination = nPasteDestination;
1821  }
1822  return m_bPasteState;
1823 }
1824 
1826 {
1828  return false;
1829 
1831  if( m_nLastPasteDestination != nPasteDestination )
1832  {
1833  TransferableDataHelper aDataHelper(
1835  &GetEditWin()) );
1836  if( aDataHelper.GetXTransferable().is() )
1837  {
1840  *m_pWrtShell, aDataHelper );
1841  }
1842  else
1844 
1845  if( static_cast<SotExchangeDest>(0xFFFF) == m_nLastPasteDestination ) // the init value
1846  m_pViewImpl->AddClipboardListener();
1847  }
1848  return m_bPasteSpecialState;
1849 }
1850 
1852 {
1854 }
1855 
1856 // Printing
1857 
1859 {
1860  SwXTextView *const pTempImpl = GetViewImpl()->GetUNOObject_Impl();
1861  return pTempImpl->BuildTmpSelectionDoc();
1862 }
1863 
1865 {
1866  GetViewImpl()->AddTransferable(rTransferable);
1867 }
1868 
1869 namespace sw {
1870 
1871 void InitPrintOptionsFromApplication(SwPrintData & o_rData, bool const bWeb)
1872 {
1873  o_rData = *SW_MOD()->GetPrtOptions(bWeb);
1874 }
1875 
1876 } // namespace sw
1877 
1878 /* 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:1858
void StopShellTimer()
Definition: view.cxx:1770
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:487
SvxRulerSupportFlags
FieldUnit
SfxHintId
std::unique_ptr< SwFormatClipboard > m_pFormatClipboard
Definition: view.hxx:208
SwXTextView * GetUNOObject_Impl()
Definition: uivwimp.cxx:99
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:2117
bool IsPasteSpecialAllowed()
Definition: view.cxx:1825
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:1529
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:578
void SetDesignMode(bool bOn=true)
void InitPrintOptionsFromApplication(SwPrintData &o_rData, bool const bWeb)
Definition: view.cxx:1871
#define FN_DELETE_SENT
Definition: cmdid.h:644
SfxViewFrame * GetFrame() const
#define FN_SET_SUPER_SCRIPT
Definition: cmdid.h:290
void SetZoom(sal_uInt16 n)
Definition: viewopt.hxx:467
TABS
#define FN_DELETE_BACK_SENT
Definition: cmdid.h:645
virtual ~SwView() override
Definition: view.cxx:1078
std::string GetValue
std::unique_ptr< SwPostItMgr > m_pPostItMgr
Definition: view.hxx:210
void AddTransferable(SwTransferable &rTransferable)
Definition: view.cxx:1864
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:1588
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:248
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getViewSettings() override
Definition: unotxvw.cxx:517
bool m_bAttrChgNotified
Definition: view.hxx:229
static bool IsPaste(const SwWrtShell &, const TransferableDataHelper &)
Definition: swdtflvr.cxx:1314
SAL_DLLPRIVATE void CheckReadonlySelection()
Definition: view.cxx:666
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:1167
#define FN_DELETE_WHOLE_LINE
Definition: cmdid.h:652
Size m_aDocSz
Definition: view.hxx:179
virtual void WriteUserData(OUString &, bool bBrowse=false) override
Definition: view.cxx:1136
void RemoveChildEventListener(const Link< VclWindowEvent &, void > &rEventListener)
long SwTwips
Definition: swtypes.hxx:49
SwEditWin & GetEditWin()
Definition: view.hxx:403
bool IsPasteAllowed()
Definition: view.cxx:1801
SotExchangeDest
WinBits const WB_VSCROLL
Dialog to specify the properties of date form field.
#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
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:226
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: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:647
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:90
#define FN_CALCULATE
Definition: cmdid.h:475
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:646
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:686
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:1573
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:2595
FmFormShell * m_pFormShell
Definition: view.hxx:187
SfxObjectCreateMode GetCreateMode() const
static SotExchangeDest GetSotDestination(const SwWrtShell &rSh)
Definition: swdtflvr.cxx:1920
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:650
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:1608
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:1181
void LaunchOLEObj(long nVerb=0)
Definition: wrtsh1.cxx:618
SwDoc * GetDoc()
returns Doc. But be careful!
Definition: docsh.hxx:203
SwView(SfxViewFrame *pFrame, SfxViewShell *)
Definition: view.cxx:721
#define FN_REDLINE_ACCEPT_DIRECT
Definition: cmdid.h:136
virtual tools::Rectangle GetVisArea(sal_uInt16 nAspect) const override
Definition: docsh.cxx:928
virtual void ClearFieldActivation()=0
void SetView(SwView *pVw)
Set View for actions via Shell.
Definition: docsh.cxx:1175
#define SWVIEWFLAGS
Definition: view.cxx:129
virtual FmFormShell * GetFormShell() override
Definition: view.hxx:565
#define FN_SET_SUB_SCRIPT
Definition: cmdid.h:291
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:77
void SetInputContext(const InputContext &rInputContext)
#define FN_DELETE_LINE
Definition: cmdid.h:648
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:1300
void SetAuto(bool bSet)
Definition: scroll.cxx:92
SwViewGlueDocShell(SwView &rView, SwDocShell &rDocSh)
Definition: view.cxx:1061
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:3183
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:1808
void NotifySelChanged()
Definition: unotxvw.cxx:684
GUIDCNamePair const aData
Shell * m_pShell
void SetName(const OUString &rName)
virtual bool PrepareClose(bool bUI=true) override
Definition: view.cxx:1785
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:404
const Size & GetMargin() const
SwDocShell * GetDocShell()
Definition: view.cxx:1128
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:649
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:651
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:1632
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:711
void UpdatePointer(const Point &, sal_uInt16 nButtons=0)
Definition: edtwin.cxx:352
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:643
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:1613
VclPtr< SwScrollbar > m_pHScrollbar
Definition: view.hxx:191
void Push(SfxShell &rShell)
void NotifyDBChanged()
Definition: view.cxx:1851
sal_uInt16 GetZoom() const
Definition: viewopt.hxx:466
bool IsInModalMode() const
void Execute(SfxRequest &)
Definition: view2.cxx:546
ToolbarId
void SetInvokeHandler(const Link< Timer *, void > &rLink)
bool IsDocumentBorder()
Definition: viewport.cxx:65
bool IsWidthEmpty() const
SfxObjectShellLock BuildTmpSelectionDoc()
Definition: unotxvw.cxx:649
long Left() const
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
SwGlossaryHdl * GetGlosHdl()
Definition: view.cxx:1625
#define FN_GROW_FONT_SIZE
Definition: cmdid.h:287
SvxSearchCmd
#define FN_TXTATR_INET
Definition: cmdid.h:712
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:658
static SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
void ScannerEventHdl()
Definition: view.cxx:1740
SfxShell * m_pShell
Definition: view.hxx:186
void InvalidateAll(bool bWithMsg)
bool g_bNoInterrupt
Definition: swmodule.cxx:137
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:1406
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:1602
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:301
void SetDebugName(const sal_Char *pDebugName)