LibreOffice Module sw (master)  1
viewmdi.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 <sfx2/dispatch.hxx>
21 #include <sfx2/viewfrm.hxx>
22 #include <svx/ruler.hxx>
23 #include <editeng/lrspitem.hxx>
24 #include <svl/srchitem.hxx>
25 #include <svl/stritem.hxx>
26 #include <sfx2/request.hxx>
27 #include <swmodule.hxx>
28 #include <view.hxx>
29 #include <wrtsh.hxx>
30 #include <viewopt.hxx>
31 #include <frmatr.hxx>
32 #include <edtwin.hxx>
33 #include <pagedesc.hxx>
34 #include <IMark.hxx>
35 #include <fldbas.hxx>
36 #include <workctrl.hxx>
37 #include <usrpref.hxx>
38 #include <scroll.hxx>
39 #include <wview.hxx>
40 
41 #include <cmdid.h>
42 
43 #include <PostItMgr.hxx>
44 #include <AnnotationWin.hxx>
45 
46 #include <svx/srchdlg.hxx>
47 #include <svx/svdview.hxx>
48 
49 #include <vcl/uitest/logger.hxx>
51 
52 sal_uInt16 SwView::m_nMoveType = NID_PGE;
53 sal_Int32 SwView::m_nActMark = 0;
54 
55 using namespace ::com::sun::star::uno;
56 
57 namespace {
58 
59 void collectUIInformation(const OUString& aFactor)
60 {
61  EventDescription aDescription;
62  aDescription.aID = "writer_edit";
63  aDescription.aParameters = {{"ZOOM", aFactor}};
64  aDescription.aAction = "SET";
65  aDescription.aKeyWord = "SwEditWinUIObject";
66  aDescription.aParent = "MainWindow";
67  UITestLogger::getInstance().logEvent(aDescription);
68 }
69 
70 }
71 
72 void SwView::SetZoom( SvxZoomType eZoomType, short nFactor, bool bViewOnly )
73 {
74  bool const bCursorIsVisible(m_pWrtShell->IsCursorVisible());
75  SetZoom_( GetEditWin().GetOutputSizePixel(), eZoomType, nFactor, bViewOnly );
76  // fdo#40465 force the cursor to stay in view whilst zooming
77  if (bCursorIsVisible)
78  m_pWrtShell->ShowCursor();
79 
80  Invalidate(SID_ZOOM_IN);
81  Invalidate(SID_ZOOM_OUT);
82 
83  collectUIInformation(OUString::number(nFactor));
84 }
85 
86 void SwView::SetZoom_( const Size &rEditSize, SvxZoomType eZoomType,
87  short nFactor, bool bViewOnly )
88 {
89  bool bUnLockView = !m_pWrtShell->IsViewLocked();
90  m_pWrtShell->LockView( true );
91  m_pWrtShell->LockPaint();
92 
93  { // start of SwActContext scope
94  SwActContext aActContext(m_pWrtShell.get());
95 
96  long nFac = nFactor;
97 
98  const bool bWeb = dynamic_cast< const SwWebView *>( this ) != nullptr;
99  SwMasterUsrPref *pUsrPref = const_cast<SwMasterUsrPref*>(SW_MOD()->GetUsrPref(bWeb));
100 
101  const SwPageDesc &rDesc = m_pWrtShell->GetPageDesc( m_pWrtShell->GetCurPageDesc() );
102  const SvxLRSpaceItem &rLRSpace = rDesc.GetMaster().GetLRSpace();
103  const SwViewOption *pOpt = m_pWrtShell->GetViewOptions();
104  long lLeftMargin = 0;
105 
106  if( eZoomType != SvxZoomType::PERCENT )
107  {
108  const bool bAutomaticViewLayout = 0 == pOpt->GetViewLayoutColumns();
109 
110  const SwRect aPageRect( m_pWrtShell->GetAnyCurRect( CurRectType::PageCalc ) );
111  const SwRect aRootRect( m_pWrtShell->GetAnyCurRect( CurRectType::PagesArea ) );
112  Size aPageSize( aPageRect.SSize() );
113  Size aRootSize( aRootRect.SSize() );
114 
115  //mod #i6193# added sidebar width
116  SwPostItMgr* pPostItMgr = GetPostItMgr();
117  if (pPostItMgr->HasNotes() && pPostItMgr->ShowNotes())
118  aPageSize.AdjustWidth(pPostItMgr->GetSidebarWidth() + pPostItMgr->GetSidebarBorderWidth() );
119 
120  const MapMode aTmpMap( MapUnit::MapTwip );
121  const Size aWindowSize( GetEditWin().PixelToLogic( rEditSize, aTmpMap ) );
122 
123  if( UseOnPage::Mirror == rDesc.GetUseOn() ) // mirrored pages
124  {
125  const SvxLRSpaceItem &rLeftLRSpace = rDesc.GetLeft().GetLRSpace();
126  aPageSize.AdjustWidth(std::abs( rLeftLRSpace.GetLeft() - rLRSpace.GetLeft() ) );
127  }
128 
129  if( SvxZoomType::OPTIMAL == eZoomType )
130  {
131  if (!pPostItMgr->HasNotes() || !pPostItMgr->ShowNotes())
132  aPageSize.AdjustWidth( -( rLRSpace.GetLeft() + rLRSpace.GetRight() + nLeftOfst * 2 ) );
133  lLeftMargin = rLRSpace.GetLeft() + DOCUMENTBORDER + nLeftOfst;
134  nFac = aWindowSize.Width() * 100 / aPageSize.Width();
135  }
136  else if(SvxZoomType::WHOLEPAGE == eZoomType || SvxZoomType::PAGEWIDTH == eZoomType )
137  {
138  const long nOf = DOCUMENTBORDER * 2;
139  long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width();
140  nTmpWidth += nOf;
141  aPageSize.AdjustHeight(nOf );
142  nFac = aWindowSize.Width() * 100 / nTmpWidth;
143 
144  if ( SvxZoomType::WHOLEPAGE == eZoomType )
145  {
146  long nVisPercent = aWindowSize.Height() * 100 / aPageSize.Height();
147  nFac = std::min( nFac, nVisPercent );
148  }
149  }
150  else
151  {
152  const long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width();
153  nFac = aWindowSize.Width() * 100 / nTmpWidth;
154  }
155  }
156 
157  nFac = std::max( long( MINZOOM ), nFac );
158  const sal_uInt16 nZoomFac = static_cast<sal_uInt16>(nFac);
159 
160  SwViewOption aOpt( *pOpt );
161  if ( !GetViewFrame()->GetFrame().IsInPlace() )
162  {
163  //Update MasterUsrPrefs and after that update the ViewOptions of the current View.
164  if ( !bViewOnly &&
165  (nZoomFac != pUsrPref->GetZoom() ||
166  eZoomType != pUsrPref->GetZoomType()) )
167  {
168  pUsrPref->SetZoom(nZoomFac);
169  pUsrPref->SetZoomType(eZoomType);
170  SW_MOD()->ApplyUsrPref(*pUsrPref, nullptr);
171  pUsrPref->SetModified();
172  }
173  if ( pOpt->GetZoom() != nZoomFac )
174  {
175  aOpt.SetZoom(nZoomFac);
176  aOpt.SetReadonly(pOpt->IsReadonly());
177  m_pWrtShell->ApplyViewOptions( aOpt );
178  }
179  if ( eZoomType != SvxZoomType::PERCENT )
180  {
181  Point aPos;
182 
183  if ( eZoomType == SvxZoomType::WHOLEPAGE )
184  aPos.setY( m_pWrtShell->GetAnyCurRect(CurRectType::Page).Top() - DOCUMENTBORDER );
185  else
186  {
187  // Make sure that the cursor is in the visible range, so that
188  // the scrolling will be performed only once.
189  aPos.setX( lLeftMargin );
190  const SwRect &rCharRect = m_pWrtShell->GetCharRect();
191  if ( rCharRect.Top() > GetVisArea().Bottom() ||
192  rCharRect.Bottom() < aPos.Y() )
193  aPos.setY( rCharRect.Top() - rCharRect.Height() );
194  else
195  aPos.setY( GetVisArea().Top() );
196  }
197  SetVisArea( aPos );
198  }
199  // Compromise solution - Under certain circumstances SetZoom is called
200  // in CalcVisAreas again and thus be set wrong values.
201  const_cast<SwViewOption*>(m_pWrtShell->GetViewOptions())->SetZoomType( eZoomType );
202  CalcVisArea( rEditSize ); // for the recalculation of the viewable area
203  }
204  else if ( nZoomFac != pOpt->GetZoom() )
205  {
206  aOpt.SetZoom( nZoomFac );
207  m_pWrtShell->ApplyViewOptions( aOpt );
208  }
209 
210  const Fraction aFrac( nFac, 100 );
211  m_pVRuler->SetZoom( aFrac );
213  m_pHRuler->SetZoom( aFrac );
215  const_cast<SwViewOption*>(m_pWrtShell->GetViewOptions())->SetZoomType( eZoomType );
216  } // end of SwActContext scope
217 
218  m_pWrtShell->UnlockPaint();
219  if( bUnLockView )
220  m_pWrtShell->LockView( false );
221 }
222 
223 void SwView::SetViewLayout( sal_uInt16 nColumns, bool bBookMode, bool bViewOnly )
224 {
225  const bool bUnLockView = !m_pWrtShell->IsViewLocked();
226  m_pWrtShell->LockView( true );
227  m_pWrtShell->LockPaint();
228 
229  {
230 
231  SwActContext aActContext(m_pWrtShell.get());
232 
233  if ( !GetViewFrame()->GetFrame().IsInPlace() && !bViewOnly )
234  {
235  const bool bWeb = dynamic_cast< const SwWebView *>( this ) != nullptr;
236  SwMasterUsrPref *pUsrPref = const_cast<SwMasterUsrPref*>(SW_MOD()->GetUsrPref(bWeb));
237 
238  // Update MasterUsrPrefs and after that update the ViewOptions of the current View.
239  if ( nColumns != pUsrPref->GetViewLayoutColumns() ||
240  bBookMode != pUsrPref->IsViewLayoutBookMode() )
241  {
242  pUsrPref->SetViewLayoutColumns(nColumns);
243  pUsrPref->SetViewLayoutBookMode(bBookMode);
244  SW_MOD()->ApplyUsrPref(*pUsrPref, nullptr);
245  pUsrPref->SetModified();
246  }
247  }
248 
249  const SwViewOption *pOpt = m_pWrtShell->GetViewOptions();
250 
251  if ( nColumns != pOpt->GetViewLayoutColumns() ||
252  bBookMode != pOpt->IsViewLayoutBookMode() )
253  {
254  SwViewOption aOpt( *pOpt );
255  aOpt.SetViewLayoutColumns( nColumns );
256  aOpt.SetViewLayoutBookMode( bBookMode );
257  m_pWrtShell->ApplyViewOptions( aOpt );
258  }
259 
262 
263  }
264 
265  m_pWrtShell->UnlockPaint();
266  if( bUnLockView )
267  m_pWrtShell->LockView( false );
268 
269  SfxBindings& rBnd = GetViewFrame()->GetBindings();
270  rBnd.Invalidate( SID_ATTR_VIEWLAYOUT );
271  rBnd.Invalidate( SID_ATTR_ZOOMSLIDER);
272 }
273 
274 // Scrollbar - Handler
275 
276 IMPL_LINK( SwView, WindowChildEventListener, VclWindowEvent&, rEvent, void )
277 {
278  OSL_ENSURE( rEvent.GetWindow(), "Window???" );
279  vcl::Window* pChildWin = static_cast< vcl::Window* >( rEvent.GetData() );
280 
281  switch ( rEvent.GetId() )
282  {
283  case VclEventId::WindowHide:
284  if( pChildWin == m_pHScrollbar )
285  ShowHScrollbar( false );
286  else if( pChildWin == m_pVScrollbar )
287  ShowVScrollbar( false );
288  break;
289  case VclEventId::WindowShow:
290  if( pChildWin == m_pHScrollbar )
291  ShowHScrollbar( true );
292  else if( pChildWin == m_pVScrollbar )
293  ShowVScrollbar( true );
294  break;
295  default: break;
296  }
297 }
298 
299 void SwView::CreateScrollbar( bool bHori )
300 {
301  vcl::Window *pMDI = &GetViewFrame()->GetWindow();
302  VclPtr<SwScrollbar>& ppScrollbar = bHori ? m_pHScrollbar : m_pVScrollbar;
303 
304  assert(!ppScrollbar); //check beforehand!
305 
306  ppScrollbar = VclPtr<SwScrollbar>::Create( pMDI, bHori );
308  if(bHori)
309  ppScrollbar->SetScrollHdl( LINK( this, SwView, EndScrollHdl ));
310  else
311  ppScrollbar->SetScrollHdl( LINK( this, SwView, ScrollHdl ));
312  ppScrollbar->SetEndScrollHdl( LINK( this, SwView, EndScrollHdl ));
313 
314  ppScrollbar->EnableDrag();
315 
316  if(GetWindow())
318 
319  if (!m_bShowAtResize)
320  ppScrollbar->ExtendedShow();
321 }
322 
323 IMPL_LINK( SwView, MoveNavigationHdl, void*, p, void )
324 {
325  bool* pbNext = static_cast<bool*>(p);
326  if ( !pbNext )
327  return;
328  const bool bNext = *pbNext;
329  SwWrtShell& rSh = GetWrtShell();
330  if ( NID_SRCH_REP != m_nMoveType)
331  {
332  if ( rSh.GetDrawView()->IsTextEdit() )
333  rSh.EndTextEdit();
334  if ( IsDrawMode() )
335  LeaveDrawCreate();
336  }
337  if ( NID_POSTIT != m_nMoveType && m_pPostItMgr )
338  {
339  sw::annotation::SwAnnotationWin* pActiveSidebarWin = m_pPostItMgr->GetActiveSidebarWin();
340  if (pActiveSidebarWin)
341  pActiveSidebarWin->SwitchToFieldPos();
342  }
343  switch( m_nMoveType )
344  {
345  case NID_PGE:
346  if ( bNext )
347  {
348  if ( USHRT_MAX == rSh.GetNextPrevPageNum( true ) )
349  {
350  rSh.GotoPage( 1, true );
351  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::EndWrapped );
352  }
353  else
354  {
355  PhyPageDown();
356  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty );
357  }
358  }
359  else
360  {
361  if ( USHRT_MAX == rSh.GetNextPrevPageNum( false ) )
362  {
363  rSh.GotoPage( rSh.GetPageCnt(), true );
364  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::StartWrapped );
365  }
366  else
367  {
368  PhyPageUp();
369  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty );
370  }
371  }
372  break;
373  case NID_TBL :
374  rSh.EnterStdMode();
375  if(bNext)
377  else
379  break;
380  case NID_FRM :
381  case NID_GRF:
382  case NID_OLE:
383  {
385  if(m_nMoveType == NID_GRF)
386  eType = GotoObjFlags::FlyGrf;
387  else if(m_nMoveType == NID_OLE)
388  eType = GotoObjFlags::FlyOLE;
389  bool bSuccess = bNext ?
390  rSh.GotoNextFly(eType) :
391  rSh.GotoPrevFly(eType);
392  if(bSuccess)
393  {
394  rSh.HideCursor();
395  rSh.EnterSelFrameMode();
396  }
397  }
398  break;
399  case NID_CTRL:
400  if (!rSh.GetView().IsDesignMode())
401  rSh.GetView().GetFormShell()->SetDesignMode(true);
402  [[fallthrough]];
403  case NID_DRW:
404  {
405  bool bSuccess = rSh.GotoObj(bNext,
406  m_nMoveType == NID_DRW ?
409  if(bSuccess)
410  {
411  rSh.HideCursor();
412  rSh.EnterSelFrameMode();
413  }
414  }
415  break;
416  case NID_REG :
417  rSh.EnterStdMode();
418  if(bNext)
420  else
422 
423  break;
424  case NID_BKM :
425  rSh.EnterStdMode();
426  GetViewFrame()->GetDispatcher()->Execute(bNext ?
429  break;
430  case NID_OUTL:
431  rSh.EnterStdMode();
432  bNext ? rSh.GotoNextOutline() : rSh.GotoPrevOutline();
433  break;
434  case NID_SEL :
436  break;
437  case NID_FTN:
438  {
439  bool bFrameTypeFootnote(rSh.GetFrameType(nullptr, false) & FrameTypeFlags::FOOTNOTE);
440 
441  if (bFrameTypeFootnote)
442  {
443  rSh.LockView(true);
444  rSh.GotoFootnoteAnchor();
445  }
446 
447  rSh.EnterStdMode();
448  bNext ?
449  rSh.GotoNextFootnoteAnchor() :
451 
452  if (bFrameTypeFootnote)
453  {
454  rSh.LockView(false);
455  rSh.GotoFootnoteText();
456  }
457  }
458  break;
459  case NID_MARK:
460  {
461  // unselect
462  rSh.MoveCursor();
463  rSh.EnterStdMode();
464 
465  // collect and sort navigator reminder names
466  IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess();
467  std::vector< OUString > vNavMarkNames;
468  for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getAllMarksBegin();
469  ppMark != pMarkAccess->getAllMarksEnd();
470  ++ppMark)
471  {
473  vNavMarkNames.push_back((*ppMark)->GetName());
474  }
475  std::sort(vNavMarkNames.begin(), vNavMarkNames.end());
476 
477  // move
478  if(!vNavMarkNames.empty())
479  {
480  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty );
481 
482  if(bNext)
483  {
484  m_nActMark++;
485  if (m_nActMark >= MAX_MARKS || m_nActMark >= static_cast<sal_Int32>(vNavMarkNames.size()))
486  {
487  m_nActMark = 0;
488  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::ReminderEndWrapped );
489  }
490  }
491  else
492  {
493  m_nActMark--;
494  if (m_nActMark < 0 || m_nActMark >= static_cast<sal_Int32>(vNavMarkNames.size()))
495  {
496  m_nActMark = vNavMarkNames.size()-1;
497  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::ReminderStartWrapped );
498  }
499  }
500  rSh.GotoMark(vNavMarkNames[m_nActMark]);
501  }
502  else
503  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::NavElementNotFound );
504  }
505  break;
506 
507  case NID_POSTIT:
508  {
509  if ( m_pPostItMgr->HasNotes() )
510  {
511  rSh.EnterStdMode();
512  sw::annotation::SwAnnotationWin* pPostIt = GetPostItMgr()->GetActiveSidebarWin();
513  if (pPostIt)
514  GetPostItMgr()->SetActiveSidebarWin(nullptr);
515  SwFieldType* pFieldType = rSh.GetFieldType(0, SwFieldIds::Postit);
516  if ( !rSh.MoveFieldType( pFieldType, bNext ) )
517  {
518  bNext ? (*(m_pPostItMgr->begin()))->mpPostIt->GotoPos() :
519  (*(m_pPostItMgr->end()-1))->mpPostIt->GotoPos();
520  SvxSearchDialogWrapper::SetSearchLabel( bNext ? SearchLabel::EndWrapped : SearchLabel::StartWrapped );
521  }
522  else
523  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty );
524  GetViewFrame()->GetDispatcher()->Execute(FN_POSTIT);
525  }
526  else
527  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::NavElementNotFound );
528  }
529  break;
530 
531  case NID_SRCH_REP:
532  if(s_pSrchItem)
533  {
534  bool bBackward = s_pSrchItem->GetBackward();
535  if (rSh.HasSelection() && bNext != rSh.IsCursorPtAtEnd())
536  rSh.SwapPam();
537  s_pSrchItem->SetBackward(!bNext);
538  SfxRequest aReq(FN_REPEAT_SEARCH, SfxCallMode::SLOT, GetPool());
539  ExecSearch(aReq);
540  s_pSrchItem->SetBackward(bBackward);
541  }
542  break;
543  case NID_INDEX_ENTRY:
544  rSh.GotoNxtPrvTOXMark(bNext);
545  break;
546 
547  case NID_TABLE_FORMULA:
548  rSh.GotoNxtPrvTableFormula( bNext );
549  break;
550 
552  rSh.GotoNxtPrvTableFormula( bNext, true );
553  break;
554  }
555  m_pEditWin->GrabFocus();
556  delete pbNext;
557 }
558 
560 {
562 
563  m_pHRuler->Show();
565 }
566 
568 {
569  m_pHRuler->Hide();
571 }
572 
574 {
575  if(m_pHRuler->GetUnit() != eUnit )
576  {
577  m_pHRuler->SetUnit( eUnit );
578  m_pHRuler->Invalidate();
579  }
580 }
581 
583 {
584  if(m_pVRuler->GetUnit() != eUnit)
585  {
586  m_pVRuler->SetUnit( eUnit );
587  m_pVRuler->Invalidate();
588  }
589 }
590 
591 void SwView::GetVRulerMetric(FieldUnit& eToFill) const
592 {
593  eToFill = m_pVRuler->GetUnit();
594 }
595 
596 void SwView::GetHRulerMetric(FieldUnit& eToFill) const
597 {
598  eToFill = m_pHRuler->GetUnit();
599 }
600 
602 {
603  m_pHRuler->SetBorderPos( m_pVRuler->GetSizePixel().Width()-1 );
604 
606  m_pVRuler->Show();
608 }
609 
611 {
612  m_pVRuler->Hide();
613  m_pHRuler->SetBorderPos();
615 }
616 
617 IMPL_LINK( SwView, ExecRulerClick, Ruler *, pRuler, void )
618 {
619  OUString sDefPage;
620  sal_uInt16 nDefDlg = SID_PARA_DLG;
621  switch( pRuler->GetClickType() )
622  {
623  case RulerType::DontKnow:
624  case RulerType::Outside:
625  sDefPage="labelTP_BORDER";
626  break;
627  case RulerType::Indent:
628  sDefPage="labelTP_PARA_STD";
629  break;
630  case RulerType::Margin1:
631  case RulerType::Margin2:
632  nDefDlg= FN_FORMAT_PAGE_DLG;
633  sDefPage = "page";
634  break;
635  default:
636  sDefPage = "labelTP_TABULATOR";
637 
638  }
639 
640  SfxStringItem aDefPage(nDefDlg, sDefPage);
641  GetViewFrame()->GetDispatcher()->ExecuteList(nDefDlg,
642  SfxCallMode::SYNCHRON|SfxCallMode::RECORD,
643  { &aDefPage });
644 }
645 
647 {
648  return m_nMoveType;
649 }
650 
651 void SwView::SetMoveType(sal_uInt16 nSet)
652 {
653  m_nMoveType = nSet;
654 }
655 
656 void SwView::SetActMark(sal_Int32 nSet)
657 {
658  m_nActMark = nSet;
659 }
660 
661 void SwView::ShowHScrollbar(bool bShow)
662 {
663  assert(m_pHScrollbar && "Scrollbar invalid");
664  m_pHScrollbar->ExtendedShow(bShow);
665 }
666 
668 {
669  assert(m_pHScrollbar && "Scrollbar invalid");
670  return m_pHScrollbar->IsVisible( false ) || m_pHScrollbar->IsAuto();
671 }
672 
673 void SwView::ShowVScrollbar(bool bShow)
674 {
675  assert(m_pVScrollbar && "Scrollbar invalid");
676  m_pVScrollbar->ExtendedShow(bShow);
677 }
678 
680 {
681  assert(m_pVScrollbar && "Scrollbar invalid");
682  return m_pVScrollbar->IsVisible( false );
683 }
684 
685 void SwView::EnableHScrollbar(bool bEnable)
686 {
687  if (m_bHScrollbarEnabled != bEnable)
688  {
689  m_bHScrollbarEnabled = bEnable;
691  }
692 }
693 
694 void SwView::EnableVScrollbar(bool bEnable)
695 {
696  if (m_bVScrollbarEnabled != bEnable)
697  {
698  m_bVScrollbarEnabled = bEnable;
700  }
701 }
702 
703 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwFieldType * GetFieldType(size_t nField, SwFieldIds nResId=SwFieldIds::Unknown) const
get field types with a ResId, if 0 get all
Definition: edfld.cxx:64
long GetLeft() const
SfxViewFrame * GetViewFrame() const
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:240
long Width() const
#define MINZOOM
Definition: view.hxx:80
FieldUnit
#define NID_GRF
Definition: workctrl.hxx:38
void SetActive(bool bOn=true)
void GetHRulerMetric(FieldUnit &rToFill) const
Definition: viewmdi.cxx:596
void SetReadonly(bool bSet)
Definition: viewopt.hxx:453
#define NID_POSTIT
Definition: workctrl.hxx:44
static sal_uInt16 GetMoveType()
Definition: viewmdi.cxx:646
SdrView * GetDrawView()
Definition: vnew.cxx:375
SwFrameFormat & GetLeft()
Definition: pagedesc.hxx:218
SfxViewFrame * GetFrame() const
void SetZoom(sal_uInt16 n)
Definition: viewopt.hxx:495
#define NID_BKM
Definition: workctrl.hxx:37
bool GotoPrevTable(SwPaM &rCurrentCursor, SwMoveFnCollection const &fnPosTable, bool bInReadOnly)
Definition: trvltbl.cxx:480
sal_uInt16 GetNextPrevPageNum(bool bNext=true)
Definition: crsrsh.cxx:1251
bool GotoNextFootnoteAnchor()
Definition: trvlfnfl.cxx:333
#define NID_MARK
Definition: workctrl.hxx:43
std::unique_ptr< SwWrtShell > m_pWrtShell
Definition: view.hxx:181
void SetViewLayout(sal_uInt16 nColumns, bool bBookMode, bool bViewOnly=false)
Definition: viewmdi.cxx:223
long Height() const
void ChangeTabMetric(FieldUnit eUnit)
Definition: viewmdi.cxx:573
bool MoveFieldType(const SwFieldType *pFieldType, const bool bNext, const SwFieldIds nResType=SwFieldIds::Unknown, const bool bAddSetExpressionFieldsToInputFields=true)
Definition: crstrvl.cxx:691
#define NID_SEL
Definition: workctrl.hxx:41
VclPtr< SvxRuler > m_pHRuler
Definition: view.hxx:198
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
static SW_DLLPUBLIC MarkType GetType(const ::sw::mark::IMark &rMark)
Returns the MarkType used to create the mark.
Definition: docbm.cxx:474
Provides access to the marks of a document.
void SetViewLayoutColumns(sal_uInt16 nNew)
Definition: viewopt.hxx:471
#define NID_TABLE_FORMULA
Definition: workctrl.hxx:47
void Height(long nNew)
Definition: swrect.hxx:191
#define NID_OUTL
Definition: workctrl.hxx:40
bool GotoFootnoteAnchor()
jump from footnote to anchor
Definition: trvlfnfl.cxx:162
void EnterStdMode()
Definition: select.cxx:550
SwEditWin & GetEditWin()
Definition: view.hxx:401
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
void Invalidate(sal_uInt16 nId)
bool GotoNxtPrvTableFormula(bool bNext=true, bool bOnlyErrors=false)
Jump to next/previous table formula Optionally it is possible to also jump to broken formulas...
Definition: crstrvl.cxx:386
bool GotoNextFly(GotoObjFlags eType=GotoObjFlags::FlyAny)
Independent selecting of flys.
Definition: fesh.hxx:413
UseOnPage GetUseOn() const
Definition: pagedesc.hxx:332
void SetVisArea(const tools::Rectangle &, bool bUpdateScrollbar=true)
Definition: viewport.cxx:195
#define NID_SRCH_REP
Definition: workctrl.hxx:45
SvxZoomType GetZoomType() const
Definition: viewopt.hxx:535
void SwapPam()
Definition: crsrsh.cxx:974
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
static UITestLogger & getInstance()
void logEvent(const EventDescription &rDescription)
bool IsAuto() const
Definition: scroll.hxx:49
vcl::Window & GetWindow() const
bool IsReadonly() const
Definition: viewopt.hxx:452
const SwView & GetView() const
Definition: wrtsh.hxx:428
void InvalidateBorder()
void Top(const long nTop)
Definition: swrect.hxx:204
bool m_bVScrollbarEnabled
Definition: view.hxx:193
bool IsVisible(bool bReal) const
Definition: scroll.hxx:39
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
bool GotoFootnoteText()
jump from content to footnote
Definition: trvlfnfl.cxx:83
SfxFrame & GetFrame() const
const IDocumentMarkAccess * getIDocumentMarkAccess() const
Provides access to the document bookmark interface.
Definition: viewsh.cxx:2606
SAL_DLLPRIVATE void SetZoom_(const Size &rEditSz, SvxZoomType eZoomType, short nFactor, bool bViewOnly)
Definition: viewmdi.cxx:86
void CreateVRuler()
Definition: viewmdi.cxx:601
void KillVRuler()
Definition: viewmdi.cxx:610
#define FN_NEXT_BOOKMARK
Definition: cmdid.h:113
DocumentType eType
GotoObjFlags
values can be combined via logical or
Definition: fesh.hxx:86
virtual const_iterator_t getAllMarksBegin() const =0
returns a STL-like random access iterator to the begin of the sequence of marks.
virtual bool IsDesignMode() const
Class for automated call of Start- and EndAction().
Definition: editsh.hxx:1018
virtual FmFormShell * GetFormShell() override
Definition: view.hxx:563
void SetZoomType(SvxZoomType eZoom_)
Definition: viewopt.hxx:561
bool HasSelection() const
Definition: wrtsh.hxx:141
#define SW_MOD()
Definition: swmodule.hxx:255
virtual const_iterator_t getAllMarksEnd() const =0
returns a STL-like random access iterator to the end of the sequence of marks.
#define NID_INDEX_ENTRY
Definition: workctrl.hxx:46
sal_uInt16 GetPageCnt()
Definition: crsrsh.cxx:1289
bool IsViewLayoutBookMode() const
Definition: viewopt.hxx:468
static sal_Int32 m_nActMark
Definition: view.hxx:155
const long nLeftOfst
Definition: view.hxx:76
bool GoNextPrevCursorSetSearchLabel(const bool bNext)
Definition: crsrsh.cxx:1392
SfxBindings & GetBindings()
long Bottom() const
#define NID_REG
Definition: workctrl.hxx:36
#define NID_TABLE_FORMULA_ERROR
Definition: workctrl.hxx:48
void ShowVScrollbar(bool bShow)
Definition: viewmdi.cxx:673
bool GotoPrevOutline()
jump to previous node with outline num.
Definition: crstrvl.cxx:1069
bool IsHScrollbarVisible() const
Definition: viewmdi.cxx:667
#define NID_FTN
Definition: workctrl.hxx:42
static void SetMoveType(sal_uInt16 nSet)
Definition: viewmdi.cxx:651
IMPL_LINK(SwView, WindowChildEventListener, VclWindowEvent &, rEvent, void)
Definition: viewmdi.cxx:276
void EnableHScrollbar(bool bEnable)
Definition: viewmdi.cxx:685
void CreateTab()
Definition: viewmdi.cxx:559
VclPtr< SvxRuler > m_pVRuler
Definition: view.hxx:198
static void SetSearchLabel(const SearchLabel &rSL)
SAL_DLLPRIVATE void CalcVisArea(const Size &rPixelSz)
Definition: viewport.cxx:764
#define NID_DRW
Definition: workctrl.hxx:34
void SetEndScrollHdl(const Link< ScrollBar *, void > &rLink)
void ShowHScrollbar(bool bShow)
Definition: viewmdi.cxx:661
bool GotoPrevFootnoteAnchor()
Definition: trvlfnfl.cxx:338
Rect of current page.
bool GotoObj(bool bNext, GotoObjFlags eType=GotoObjFlags::DrawAny)
Definition: feshview.cxx:1649
void EnableVScrollbar(bool bEnable)
Definition: viewmdi.cxx:694
void SetDesignMode(bool _bDesignMode)
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:217
#define NID_OLE
Definition: workctrl.hxx:39
void GotoMark(const ::sw::mark::IMark *const pMark)
Definition: wrtsh3.cxx:133
bool GotoNextRegion(SwPaM &rCurrentCursor, SwMoveFnCollection const &fnPosRegion, bool bInReadOnly)
Definition: trvlreg.cxx:106
void SetZoom(SvxZoomType eZoomType, short nFactor=100, bool bViewOnly=false)
Definition: viewmdi.cxx:72
void Bottom(const long nBottom)
Definition: swrect.hxx:209
#define NID_PGE
Definition: workctrl.hxx:33
bool MoveRegion(SwWhichRegion, SwMoveFnCollection const &)
Definition: trvlreg.cxx:236
void SetViewLayoutBookMode(bool bNew)
Definition: viewopt.hxx:469
#define NID_CTRL
Definition: workctrl.hxx:35
VclPtr< SwScrollbar > m_pVScrollbar
Definition: view.hxx:189
virtual bool IsTextEdit() const final override
bool GotoPrevFly(GotoObjFlags eType=GotoObjFlags::FlyAny)
Definition: fesh.hxx:415
#define NID_TBL
Definition: workctrl.hxx:31
Rect covering the pages area.
SwMoveFnCollection const & fnTableStart
Definition: paminit.cxx:52
void MoveCursor(bool bWithSelect=false)
Definition: move.cxx:70
bool IsInPlace() const
bool m_bShowAtResize
Definition: view.hxx:227
bool IsVScrollbarVisible() const
Definition: viewmdi.cxx:679
void LockView(bool b)
Definition: viewsh.hxx:462
bool MoveTable(SwWhichTable, SwMoveFnCollection const &)
Definition: trvltbl.cxx:681
bool IsCursorPtAtEnd() const
Definition: crsrsh.hxx:894
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:254
virtual void Invalidate(sal_uInt16 nId=0)
... page will be formatted if required.
void SetScrollHdl(const Link< ScrollBar *, void > &rLink)
static VclPtr< reference_type > Create(Arg &&...arg)
void ChangeVRulerMetric(FieldUnit eUnit)
Definition: viewmdi.cxx:582
VclPtr< SwScrollbar > m_pHScrollbar
Definition: view.hxx:189
SwPostItMgr * GetPostItMgr()
Definition: view.hxx:621
sal_uInt16 GetZoom() const
Definition: viewopt.hxx:494
void EndTextEdit()
Deletes object if required.
Definition: feshview.cxx:1217
void * p
static sal_uInt16 m_nMoveType
Definition: view.hxx:154
#define FN_FORMAT_PAGE_DLG
Definition: cmdid.h:315
vcl::Window * GetWindow() const
void GetVRulerMetric(FieldUnit &rToFill) const
Definition: viewmdi.cxx:591
void EnableDrag()
long GetRight() const
const tools::Rectangle & GetVisArea() const
Definition: view.hxx:411
bool GotoPrevRegion(SwPaM &rCurrentCursor, SwMoveFnCollection const &fnPosRegion, bool bInReadOnly)
Definition: trvlreg.cxx:31
bool IsActive() const
#define FN_REPEAT_SEARCH
Definition: cmdid.h:103
bool GotoPage(sal_uInt16 nPage, bool bRecord)
Definition: move.cxx:569
bool GotoNxtPrvTOXMark(bool bNext=true)
jump to next/previous index marker
Definition: crstrvl.cxx:505
SAL_DLLPRIVATE bool UpdateScrollbars()
Definition: viewport.cxx:1150
bool GotoNextTable(SwPaM &rCurrentCursor, SwMoveFnCollection const &fnPosTable, bool bInReadOnly)
Definition: trvltbl.cxx:560
void SetModified()
Definition: usrpref.hxx:157
void EnterSelFrameMode(const Point *pStartDrag=nullptr)
Definition: select.cxx:701
SvxZoomType
void ForceUpdate()
void KillTab()
Definition: viewmdi.cxx:567
std::map< OUString, OUString > aParameters
void ExtendedShow(bool bVisible=true)
Definition: scroll.cxx:74
#define DOCUMENTBORDER
Definition: swtypes.hxx:82
#define FN_PREV_BOOKMARK
Definition: cmdid.h:114
SAL_DLLPRIVATE void CreateScrollbar(bool bHori)
Definition: viewmdi.cxx:299
bool m_bHScrollbarEnabled
Definition: view.hxx:192
#define MAX_MARKS
Definition: view.hxx:83
#define NID_FRM
Definition: workctrl.hxx:32
FrameTypeFlags GetFrameType(const Point *pPt, bool bStopAtFly) const
For return values see above FrameType.
Definition: fews.cxx:236
sal_uInt16 GetViewLayoutColumns() const
Definition: viewopt.hxx:470
#define FN_POSTIT
Definition: cmdid.h:213
void HideCursor()
Definition: crsrsh.cxx:2404
Definition: view.hxx:144
static void SetActMark(sal_Int32 nSet)
Definition: viewmdi.cxx:656
bool GotoNextOutline()
jump to next node with outline num.
Definition: crstrvl.cxx:1003
const SvxLRSpaceItem & GetLRSpace(bool=true) const
Definition: frmatr.hxx:74
SwMoveFnCollection const & fnRegionStart
Definition: paminit.cxx:55