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