LibreOffice Module sw (master)  1
viewsh.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 <com/sun/star/accessibility/XAccessible.hpp>
21 #include <sfx2/viewfrm.hxx>
22 #include <sfx2/progress.hxx>
23 #include <svx/srchdlg.hxx>
24 #include <sfx2/viewsh.hxx>
25 #include <sfx2/ipclient.hxx>
26 #include <sal/log.hxx>
27 #include <drawdoc.hxx>
28 #include <swwait.hxx>
29 #include <crsrsh.hxx>
30 #include <doc.hxx>
36 #include <IDocumentState.hxx>
37 #include <rootfrm.hxx>
38 #include <pagefrm.hxx>
39 #include <cntfrm.hxx>
40 #include <viewimp.hxx>
41 #include <frmtool.hxx>
42 #include <viewopt.hxx>
43 #include <dview.hxx>
44 #include <swregion.hxx>
45 #include <hints.hxx>
46 #include <docufld.hxx>
47 #include <txtfrm.hxx>
48 #include <layact.hxx>
49 #include <mdiexp.hxx>
50 #include <fntcache.hxx>
51 #include <ptqueue.hxx>
52 #include <docsh.hxx>
53 #include <pagedesc.hxx>
54 #include <ndole.hxx>
55 #include <ndindex.hxx>
56 #include <accmap.hxx>
57 #include <vcl/bitmapex.hxx>
59 #include <accessibilityoptions.hxx>
60 #include <strings.hrc>
61 #include <bitmaps.hlst>
62 #include <pagepreviewlayout.hxx>
63 #include <sortedobjs.hxx>
64 #include <anchoredobject.hxx>
66 
67 #include <unotxdoc.hxx>
68 #include <view.hxx>
69 #include <PostItMgr.hxx>
70 #include <unotools/configmgr.hxx>
71 #include <vcl/virdev.hxx>
72 #include <vcl/svapp.hxx>
73 #include <svx/sdrpaintwindow.hxx>
75 #include <svx/sdrpagewindow.hxx>
76 #include <svx/svdpagv.hxx>
77 #include <comphelper/lok.hxx>
78 #include <sfx2/lokhelper.hxx>
79 
80 #if !HAVE_FEATURE_DESKTOP
81 #include <vcl/sysdata.hxx>
82 #endif
83 
84 bool SwViewShell::mbLstAct = false;
87 
88 static bool bInSizeNotify = false;
89 
90 
91 using namespace ::com::sun::star;
92 
94 
95  //tdf#118621 - Optionally disable floating header/footer menu
96  if ( bShow )
98 
99  if ( eControl == FrameControlType::Header )
100  mbShowHeaderSeparator = bShow;
101  else
102  mbShowFooterSeparator = bShow;
103 }
104 
106 {
108  if ( !mbHeaderFooterEdit )
109  {
112  }
113 
114  // Avoid corner case
115  if ( ( GetViewOptions()->IsUseHeaderFooterMenu() ) &&
118  {
119  mbHeaderFooterEdit = false;
120  }
121 
122  // Repaint everything
123  GetWin()->Invalidate();
124 }
125 
126 void SwViewShell::setOutputToWindow(bool bOutputToWindow)
127 {
128  mbOutputToWindow = bOutputToWindow;
129 }
130 
132 {
133  return mbOutputToWindow;
134 }
135 
137 {
138  xmlTextWriterStartElement(pWriter, BAD_CAST("SwViewShell"));
139  xmlTextWriterEndElement(pWriter);
140 }
141 
142 static void
144 {
145  // Direct paint has been performed: the background of transparent child
146  // windows has been painted, so need to paint the child windows now.
147  if (rShell.GetWin())
148  {
149  vcl::Window& rWindow = *(rShell.GetWin());
150  const tools::Rectangle aRectanglePixel(rShell.GetOut()->LogicToPixel(rRect.SVRect()));
151  PaintTransparentChildren(rWindow, aRectanglePixel);
152  }
153 }
154 
155 // #i72754# 2nd set of Pre/PostPaints
156 // This time it uses the lock counter (mPrePostPaintRegions empty/non-empty) to allow only one activation
157 // and deactivation and mpPrePostOutDev to remember the OutDev from the BeginDrawLayers
158 // call. That way, all places where paint take place can be handled the same way, even
159 // when calling other paint methods. This is the case at the places where SW paints
160 // buffered into VDevs to avoid flicker. It is in general problematic and should be
161 // solved once using the BufferedOutput functionality of the DrawView.
162 
164 {
165  // forward PrePaint event from VCL Window to DrawingLayer
166  if(HasDrawView())
167  {
168  Imp()->GetDrawView()->PrePaint();
169  }
170 }
171 
173 {
174  if(mPrePostPaintRegions.empty())
175  {
176  mPrePostPaintRegions.push( rRegion );
177  // #i75172# ensure DrawView to use DrawingLayer bufferings
178  if ( !HasDrawView() )
179  MakeDrawView();
180 
181  // Prefer window; if not available, get mpOut (e.g. printer)
182  const bool bWindow = GetWin() && !comphelper::LibreOfficeKit::isActive() && !isOutputToWindow();
183  mpPrePostOutDev = bWindow ? GetWin(): GetOut();
184 
185  // #i74769# use SdrPaintWindow now direct
187  OSL_ENSURE(mpTargetPaintWindow, "BeginDrawLayers: Got no SdrPaintWindow (!)");
188 
189  // #i74769# if prerender, save OutDev and redirect to PreRenderDevice
191  {
194  }
195  else if (isOutputToWindow())
196  // In case mpOut is used without buffering and we're not printing, need to set clipping.
197  mpOut->SetClipRegion(rRegion);
198 
199  // remember original paint MapMode for wrapped FlyFrame paints
201  }
202  else
203  {
204  // region needs to be updated to the given one
205  if( mPrePostPaintRegions.top() != rRegion )
207  mPrePostPaintRegions.push( rRegion );
208  }
209 }
210 
211 void SwViewShell::DLPostPaint2(bool bPaintFormLayer)
212 {
213  OSL_ENSURE(!mPrePostPaintRegions.empty(), "SwViewShell::DLPostPaint2: Pre/PostPaint encapsulation broken (!)");
214 
215  if( mPrePostPaintRegions.size() > 1 )
216  {
217  vcl::Region current = std::move(mPrePostPaintRegions.top());
218  mPrePostPaintRegions.pop();
219  if( current != mPrePostPaintRegions.top())
221  return;
222  }
223  mPrePostPaintRegions.pop(); // clear
224  if(nullptr != mpTargetPaintWindow)
225  {
226  // #i74769# restore buffered OutDev
228  {
230  }
231 
232  // #i74769# use SdrPaintWindow now direct
233  Imp()->GetDrawView()->EndDrawLayers(*mpTargetPaintWindow, bPaintFormLayer);
234  mpTargetPaintWindow = nullptr;
235  }
236 }
237 // end of Pre/PostPaints
238 
239 void SwViewShell::ImplEndAction( const bool bIdleEnd )
240 {
241  // Nothing to do for the printer?
242  if ( !GetWin() || IsPreview() )
243  {
244  mbPaintWorks = true;
245  UISizeNotify();
246  // tdf#101464 print preview may generate events if another view shell
247  // performs layout...
248  if (IsPreview() && Imp()->IsAccessible())
249  {
251  }
252  return;
253  }
254 
255  mbInEndAction = true;
256  //will this put the EndAction of the last shell in the sequence?
257 
258  SwViewShell::mbLstAct = true;
259  for(SwViewShell& rShell : GetRingContainer())
260  {
261  if(&rShell != this && rShell.ActionPend())
262  {
263  SwViewShell::mbLstAct = false;
264  break;
265  }
266  }
267 
268  const bool bIsShellForCheckViewLayout = ( this == GetLayout()->GetCurrShell() );
269 
270  CurrShell aCurr( this );
271  if ( Imp()->HasDrawView() && !Imp()->GetDrawView()->areMarkHandlesHidden() )
272  Imp()->StartAction();
273 
274  if ( Imp()->GetRegion() && Imp()->GetRegion()->GetOrigin() != VisArea() )
275  Imp()->DelRegion();
276 
277  const bool bExtraData = ::IsExtraData( GetDoc() );
278 
279  if ( !bIdleEnd )
280  {
281  SwLayAction aAction( GetLayout(), Imp() );
282  aAction.SetComplete( false );
283  if ( mnLockPaint )
284  aAction.SetPaint( false );
285  aAction.Action(GetWin());
286  }
287 
288  if ( bIsShellForCheckViewLayout )
290 
291  //If we don't call Paints, we wait for the Paint of the system.
292  //Then the clipping is set correctly; e.g. shifting of a Draw object
293  if ( Imp()->GetRegion() ||
295  bExtraData )
296  {
297  if ( !mnLockPaint )
298  {
299  SolarMutexGuard aGuard;
300 
301  bool bPaintsFromSystem = maInvalidRect.HasArea();
303  if ( maInvalidRect.HasArea() )
304  {
305  if ( bPaintsFromSystem )
307 
309  bPaintsFromSystem = true;
310  }
311  mbPaintWorks = true;
312 
313  std::unique_ptr<SwRegionRects> pRegion = std::move(Imp()->m_pRegion);
314 
315  //JP 27.11.97: what hid the selection, must also Show it,
316  // else we get Paint errors!
317  // e.g. additional mode, page half visible vertically, in the
318  // middle a selection and with another cursor jump to left
319  // right border. Without ShowCursor the selection disappears.
320  bool bShowCursor = pRegion && dynamic_cast<const SwCursorShell*>(this) != nullptr;
321  if( bShowCursor )
322  static_cast<SwCursorShell*>(this)->HideCursors();
323 
324  if ( pRegion )
325  {
326  SwRootFrame* pCurrentLayout = GetLayout();
327 
328  //First Invert then Compress, never the other way round!
329  pRegion->Invert();
330 
331  pRegion->Compress();
332 
334  while ( !pRegion->empty() )
335  {
336  SwRect aRect( pRegion->back() );
337  pRegion->pop_back();
338 
339  bool bPaint = true;
340  if ( IsEndActionByVirDev() )
341  {
342  //create virtual device and set.
343  if ( !pVout )
345  MapMode aMapMode( GetOut()->GetMapMode() );
346  pVout->SetMapMode( aMapMode );
347 
348  bool bSizeOK = true;
349 
350  tools::Rectangle aTmp1( aRect.SVRect() );
351  aTmp1 = GetOut()->LogicToPixel( aTmp1 );
352  tools::Rectangle aTmp2( GetOut()->PixelToLogic( aTmp1 ) );
353  if ( aTmp2.Left() > aRect.Left() )
354  aTmp1.SetLeft( std::max( 0L, aTmp1.Left() - 1 ) );
355  if ( aTmp2.Top() > aRect.Top() )
356  aTmp1.SetTop( std::max( 0L, aTmp1.Top() - 1 ) );
357  aTmp1.AdjustRight(1 );
358  aTmp1.AdjustBottom(1 );
359  aTmp1 = GetOut()->PixelToLogic( aTmp1 );
360  aRect = SwRect( aTmp1 );
361 
362  const Size aTmp( pVout->GetOutputSize() );
363  if ( aTmp.Height() < aRect.Height() ||
364  aTmp.Width() < aRect.Width() )
365  {
366  bSizeOK = pVout->SetOutputSize( aRect.SSize() );
367  }
368  if ( bSizeOK )
369  {
370  bPaint = false;
371 
372  // --> OD 2007-07-26 #i79947#
373  // #i72754# start Pre/PostPaint encapsulation before mpOut is changed to the buffering VDev
374  const vcl::Region aRepaintRegion(aRect.SVRect());
375  DLPrePaint2(aRepaintRegion);
376  // <--
377 
378  OutputDevice *pOld = GetOut();
379  pVout->SetLineColor( pOld->GetLineColor() );
380  pVout->SetFillColor( pOld->GetFillColor() );
381  Point aOrigin( aRect.Pos() );
382  aOrigin.setX( -aOrigin.X() ); aOrigin.setY( -aOrigin.Y() );
383  aMapMode.SetOrigin( aOrigin );
384  pVout->SetMapMode( aMapMode );
385 
386  mpOut = pVout.get();
387  if ( bPaintsFromSystem )
388  PaintDesktop(*mpOut, aRect);
389  pCurrentLayout->PaintSwFrame( *mpOut, aRect );
390  pOld->DrawOutDev( aRect.Pos(), aRect.SSize(),
391  aRect.Pos(), aRect.SSize(), *pVout );
392  mpOut = pOld;
393 
394  // #i72754# end Pre/PostPaint encapsulation when mpOut is back and content is painted
395  DLPostPaint2(true);
396  }
397  }
398  if ( bPaint )
399  {
400  if (GetWin()->SupportsDoubleBuffering())
401  InvalidateWindows(aRect.SVRect());
402  else
403  {
404  // #i75172# begin DrawingLayer paint
405  // need to do begin/end DrawingLayer preparation for each single rectangle of the
406  // repaint region. I already tried to prepare only once for the whole Region. This
407  // seems to work (and does technically) but fails with transparent objects. Since the
408  // region given to BeginDarwLayers() defines the clip region for DrawingLayer paint,
409  // transparent objects in the single rectangles will indeed be painted multiple times.
410  DLPrePaint2(vcl::Region(aRect.SVRect()));
411 
412  if ( bPaintsFromSystem )
413  PaintDesktop(*GetOut(), aRect);
415  pCurrentLayout->PaintSwFrame( *mpOut, aRect );
416  else
417  pCurrentLayout->GetCurrShell()->InvalidateWindows(aRect.SVRect());
418 
419  // #i75172# end DrawingLayer paint
420  DLPostPaint2(true);
421  }
422  }
423 
424  lcl_PaintTransparentFormControls(*this, aRect); // i#107365
425  }
426  }
427  if( bShowCursor )
428  static_cast<SwCursorShell*>(this)->ShowCursors( true );
429  }
430  else
431  {
432  Imp()->DelRegion();
433  mbPaintWorks = true;
434  }
435  }
436  else
437  mbPaintWorks = true;
438 
439  mbInEndAction = false;
440  SwViewShell::mbLstAct = false;
441  Imp()->EndAction();
442 
443  //We artificially end the action here to enable the automatic scrollbars
444  //to adjust themselves correctly
445  //EndAction sends a Notify, and that must call Start-/EndAction to
446  //adjust the scrollbars correctly
447  --mnStartAction;
448  UISizeNotify();
449  ++mnStartAction;
450 
451  if( Imp()->IsAccessible() )
453 }
454 
456 {
457  mbPaintWorks = false;
458  Imp()->StartAction();
459 }
460 
462 {
463  if ( GetWin() && GetWin()->IsVisible() )
464  GetWin()->EnablePaint( false ); //Also cut off the controls.
465  Imp()->LockPaint();
466 }
467 
468 void SwViewShell::ImplUnlockPaint( bool bVirDev )
469 {
470  CurrShell aCurr( this );
471  if ( GetWin() && GetWin()->IsVisible() )
472  {
473  if ( (bInSizeNotify || bVirDev ) && VisArea().HasArea() )
474  {
475  //Refresh with virtual device to avoid flickering.
477  pVout->SetMapMode( mpOut->GetMapMode() );
478  Size aSize( VisArea().SSize() );
479  aSize.AdjustWidth(20 );
480  aSize.AdjustHeight(20 );
481  if( pVout->SetOutputSize( aSize ) )
482  {
483  GetWin()->EnablePaint( true );
484  GetWin()->Validate();
485 
486  Imp()->UnlockPaint();
487  pVout->SetLineColor( mpOut->GetLineColor() );
488  pVout->SetFillColor( mpOut->GetFillColor() );
489 
490  // #i72754# start Pre/PostPaint encapsulation before mpOut is changed to the buffering VDev
491  const vcl::Region aRepaintRegion(VisArea().SVRect());
492  DLPrePaint2(aRepaintRegion);
493 
494  OutputDevice *pOld = mpOut;
495  mpOut = pVout.get();
496  Paint(*mpOut, VisArea().SVRect());
497  mpOut = pOld;
498  mpOut->DrawOutDev( VisArea().Pos(), aSize,
499  VisArea().Pos(), aSize, *pVout );
500 
501  // #i72754# end Pre/PostPaint encapsulation when mpOut is back and content is painted
502  DLPostPaint2(true);
503 
504  lcl_PaintTransparentFormControls(*this, VisArea()); // fdo#63949
505  }
506  else
507  {
508  Imp()->UnlockPaint();
509  GetWin()->EnablePaint( true );
510  GetWin()->Invalidate( InvalidateFlags::Children );
511  }
512  pVout.disposeAndClear();
513  }
514  else
515  {
516  Imp()->UnlockPaint();
517  GetWin()->EnablePaint( true );
518  GetWin()->Invalidate( InvalidateFlags::Children );
519  }
520  }
521  else
522  Imp()->UnlockPaint();
523 }
524 
525 bool SwViewShell::AddPaintRect( const SwRect & rRect )
526 {
527  bool bRet = false;
528  for(SwViewShell& rSh : GetRingContainer())
529  {
530  if( rSh.Imp() )
531  {
532  if ( rSh.IsPreview() && rSh.GetWin() )
533  ::RepaintPagePreview( &rSh, rRect );
534  else
535  bRet |= rSh.Imp()->AddPaintRect( rRect );
536  }
537  }
538  return bRet;
539 }
540 
542 {
543  if ( Imp()->IsCalcLayoutProgress() )
544  return;
545 
546  for(SwViewShell& rSh : GetRingContainer())
547  {
548  if ( rSh.GetWin() )
549  {
550  if ( rSh.IsPreview() )
551  ::RepaintPagePreview( &rSh, rRect );
552  // In case of tiled rendering, invalidation is wanted even if
553  // the rectangle is outside the visual area.
554  else if ( rSh.VisArea().IsOver( rRect ) || comphelper::LibreOfficeKit::isActive() )
555  rSh.GetWin()->Invalidate( rRect.SVRect() );
556  }
557  }
558 }
559 
561 {
562  // when using the tiled rendering, consider the entire document as our
563  // visible area
565 }
566 
567 void SwViewShell::MakeVisible( const SwRect &rRect )
568 {
569  if ( !(!VisArea().IsInside( rRect ) || IsScrollMDI( this, rRect ) || GetCareDialog(*this)) )
570  return;
571 
572  if ( IsViewLocked() )
573  return;
574 
575  if( mpWin )
576  {
577  const SwFrame* pRoot = GetLayout();
578  int nLoopCnt = 3;
579  long nOldH;
580  do{
581  nOldH = pRoot->getFrameArea().Height();
582  StartAction();
583  ScrollMDI( this, rRect, USHRT_MAX, USHRT_MAX );
584  EndAction();
585  } while( nOldH != pRoot->getFrameArea().Height() && nLoopCnt-- );
586  }
587 #if OSL_DEBUG_LEVEL > 0
588  else
589  {
590  //MA: 04. Nov. 94, no one needs this, does one?
591  OSL_ENSURE( false, "Is MakeVisible still needed for printers?" );
592  }
593 
594 #endif
595 }
596 
598 {
599  if (!rVSh.mpSfxViewShell)
600  return nullptr;
601 #if HAVE_FEATURE_DESKTOP
602  const sal_uInt16 nId = SvxSearchDialogWrapper::GetChildWindowId();
603  SfxViewFrame* pVFrame = rVSh.mpSfxViewShell->GetViewFrame();
604  SfxChildWindow* pChWin = pVFrame->GetChildWindow( nId );
605  if (!pChWin)
606  return nullptr;
607  weld::DialogController* pController = pChWin->GetController().get();
608  if (!pController)
609  return nullptr;
610  weld::Window* pWin = pController->getDialog();
611  if (pWin && pWin->get_visible())
612  return pWin;
613 #endif
614  return nullptr;
615 }
616 
617 Point SwViewShell::GetPagePos( sal_uInt16 nPageNum ) const
618 {
619  return GetLayout()->GetPagePos( nPageNum );
620 }
621 
622 sal_uInt16 SwViewShell::GetNumPages() const
623 {
624  //It is possible that no layout exists when the method from
625  //root-Ctor is called.
626  return GetLayout() ? GetLayout()->GetPageNum() : 0;
627 }
628 
629 bool SwViewShell::IsDummyPage( sal_uInt16 nPageNum ) const
630 {
631  return GetLayout() && GetLayout()->IsDummyPage( nPageNum );
632 }
633 
640 void SwViewShell::UpdateFields(bool bCloseDB)
641 {
642  CurrShell aCurr( this );
643 
644  bool bCursor = dynamic_cast<const SwCursorShell*>( this ) != nullptr;
645  if ( bCursor )
646  static_cast<SwCursorShell*>(this)->StartAction();
647  else
648  StartAction();
649 
651 
652  if ( bCursor )
653  static_cast<SwCursorShell*>(this)->EndAction();
654  else
655  EndAction();
656 }
657 
660 {
661  CurrShell aCurr( this );
662  // Start-/EndAction handled in the SwDoc-Method!
663  GetDoc()->UpdateAllCharts();
664 }
665 
667 {
668  bool bRet = false;
669  SwNodeIndex aIdx( *GetDoc()->GetNodes().GetEndOfAutotext().
670  StartOfSectionNode(), 1 );
671  while (aIdx.GetNode().GetStartNode())
672  {
673  ++aIdx;
674  const SwOLENode *pNd = aIdx.GetNode().GetOLENode();
675  if( pNd && !pNd->GetChartTableName().isEmpty() )
676  {
677  bRet = true;
678  break;
679  }
680  }
681  return bRet;
682 }
683 
685 {
686  if( !mpOpt->IsIdle() || !GetWin() || HasDrawViewDrag() )
687  return;
688 
689  //No idle when printing is going on.
690  for(const SwViewShell& rSh : GetRingContainer())
691  {
692  if ( !rSh.GetWin() )
693  return;
694  }
695 
696  CurrShell aCurr( this );
697 
698 #ifdef DBG_UTIL
699  // If Test5 has been set, the IdleFormatter is disabled.
700  if( mpOpt->IsTest5() )
701  return;
702 #endif
703 
704  {
705  // Preserve top of the text frame cache.
706  SwSaveSetLRUOfst aSaveLRU;
707  // #125243# there are lots of stacktraces indicating that Imp() returns NULL
708  // this SwViewShell seems to be invalid - but it's not clear why
709  // this return is only a workaround!
710  OSL_ENSURE(Imp(), "SwViewShell already deleted?");
711  if(!Imp())
712  return;
713  SwLayIdle aIdle( GetLayout(), Imp() );
714  }
715 }
716 
718 {
719  bool bCursor = dynamic_cast<const SwCursorShell*>( &rSh) != nullptr;
720  if ( bCursor )
721  static_cast<SwCursorShell&>(rSh).StartAction();
722  else
723  rSh.StartAction();
724  rSh.GetLayout()->InvalidateAllContent( nInv );
725  if ( bCursor )
726  static_cast<SwCursorShell&>(rSh).EndAction();
727  else
728  rSh.EndAction();
729 
731 }
732 
738 {
739  const bool bIsCursorShell = dynamic_cast<const SwCursorShell*>( &_rSh) != nullptr;
740  if ( bIsCursorShell )
741  static_cast<SwCursorShell&>(_rSh).StartAction();
742  else
743  _rSh.StartAction();
744 
745  _rSh.GetLayout()->InvalidateAllObjPos();
746 
747  if ( bIsCursorShell )
748  static_cast<SwCursorShell&>(_rSh).EndAction();
749  else
750  _rSh.EndAction();
751 
753 }
754 
756 {
758  if( rIDSA.get(DocumentSettingId::PARA_SPACE_MAX) != bNew )
759  {
760  SwWait aWait( *GetDoc()->GetDocShell(), true );
763  lcl_InvalidateAllContent( *this, nInv );
764  }
765 }
766 
768 {
771  {
772  SwWait aWait( *GetDoc()->GetDocShell(), true );
775  lcl_InvalidateAllContent( *this, nInv );
776  }
777 }
778 
779 void SwViewShell::SetTabCompat( bool bNew )
780 {
782  if( rIDSA.get(DocumentSettingId::TAB_COMPAT) != bNew )
783  {
784  SwWait aWait( *GetDoc()->GetDocShell(), true );
785  rIDSA.set(DocumentSettingId::TAB_COMPAT, bNew );
787  lcl_InvalidateAllContent( *this, nInv );
788  }
789 }
790 
792 {
794  if ( rIDSA.get(DocumentSettingId::ADD_EXT_LEADING) != bNew )
795  {
796  SwWait aWait( *GetDoc()->GetDocShell(), true );
799  if ( pTmpDrawModel )
800  pTmpDrawModel->SetAddExtLeading( bNew );
802  lcl_InvalidateAllContent( *this, nInv );
803  }
804 }
805 
806 void SwViewShell::SetUseVirDev( bool bNewVirtual )
807 {
809  if ( rIDSA.get(DocumentSettingId::USE_VIRTUAL_DEVICE) != bNewVirtual )
810  {
811  SwWait aWait( *GetDoc()->GetDocShell(), true );
812  // this sets the flag at the document and calls PrtDataChanged
814  rIDDA.setReferenceDeviceType( bNewVirtual, true );
815  }
816 }
817 
822 void SwViewShell::SetAddParaSpacingToTableCells( bool _bAddParaSpacingToTableCells )
823 {
825  if ( rIDSA.get(DocumentSettingId::ADD_PARA_SPACING_TO_TABLE_CELLS) != _bAddParaSpacingToTableCells )
826  {
827  SwWait aWait( *GetDoc()->GetDocShell(), true );
828  rIDSA.set(DocumentSettingId::ADD_PARA_SPACING_TO_TABLE_CELLS, _bAddParaSpacingToTableCells );
830  lcl_InvalidateAllContent( *this, nInv );
831  }
832 }
833 
839 void SwViewShell::SetUseFormerLineSpacing( bool _bUseFormerLineSpacing )
840 {
842  if ( rIDSA.get(DocumentSettingId::OLD_LINE_SPACING) != _bUseFormerLineSpacing )
843  {
844  SwWait aWait( *GetDoc()->GetDocShell(), true );
845  rIDSA.set(DocumentSettingId::OLD_LINE_SPACING, _bUseFormerLineSpacing );
847  lcl_InvalidateAllContent( *this, nInv );
848  }
849 }
850 
856 void SwViewShell::SetUseFormerObjectPositioning( bool _bUseFormerObjPos )
857 {
859  if ( rIDSA.get(DocumentSettingId::USE_FORMER_OBJECT_POS) != _bUseFormerObjPos )
860  {
861  SwWait aWait( *GetDoc()->GetDocShell(), true );
862  rIDSA.set(DocumentSettingId::USE_FORMER_OBJECT_POS, _bUseFormerObjPos );
863  lcl_InvalidateAllObjPos( *this );
864  }
865 }
866 
867 // #i28701#
868 void SwViewShell::SetConsiderWrapOnObjPos( bool _bConsiderWrapOnObjPos )
869 {
871  if ( rIDSA.get(DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION) != _bConsiderWrapOnObjPos )
872  {
873  SwWait aWait( *GetDoc()->GetDocShell(), true );
874  rIDSA.set(DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION, _bConsiderWrapOnObjPos );
875  lcl_InvalidateAllObjPos( *this );
876  }
877 }
878 
879 void SwViewShell::SetUseFormerTextWrapping( bool _bUseFormerTextWrapping )
880 {
882  if ( rIDSA.get(DocumentSettingId::USE_FORMER_TEXT_WRAPPING) != _bUseFormerTextWrapping )
883  {
884  SwWait aWait( *GetDoc()->GetDocShell(), true );
885  rIDSA.set(DocumentSettingId::USE_FORMER_TEXT_WRAPPING, _bUseFormerTextWrapping );
887  lcl_InvalidateAllContent( *this, nInv );
888  }
889 }
890 
891 // #i45491#
892 void SwViewShell::SetDoNotJustifyLinesWithManualBreak( bool _bDoNotJustifyLinesWithManualBreak )
893 {
895  if ( rIDSA.get(DocumentSettingId::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK) != _bDoNotJustifyLinesWithManualBreak )
896  {
897  SwWait aWait( *GetDoc()->GetDocShell(), true );
898  rIDSA.set(DocumentSettingId::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK, _bDoNotJustifyLinesWithManualBreak );
900  lcl_InvalidateAllContent( *this, nInv );
901  }
902 }
903 
904 void SwViewShell::SetProtectForm( bool _bProtectForm )
905 {
907  rIDSA.set(DocumentSettingId::PROTECT_FORM, _bProtectForm );
908 }
909 
910 void SwViewShell::SetMsWordCompTrailingBlanks( bool _bMsWordCompTrailingBlanks )
911 {
913  if (rIDSA.get(DocumentSettingId::MS_WORD_COMP_TRAILING_BLANKS) != _bMsWordCompTrailingBlanks)
914  {
915  SwWait aWait(*GetDoc()->GetDocShell(), true);
916  rIDSA.set(DocumentSettingId::MS_WORD_COMP_TRAILING_BLANKS, _bMsWordCompTrailingBlanks);
918  lcl_InvalidateAllContent(*this, nInv);
919  }
920 }
921 
922 void SwViewShell::SetSubtractFlysAnchoredAtFlys(bool bSubtractFlysAnchoredAtFlys)
923 {
925  rIDSA.set(DocumentSettingId::SUBTRACT_FLYS, bSubtractFlysAnchoredAtFlys);
926 }
927 
928 void SwViewShell::SetEmptyDbFieldHidesPara(bool bEmptyDbFieldHidesPara)
929 {
931  if (rIDSA.get(DocumentSettingId::EMPTY_DB_FIELD_HIDES_PARA) == bEmptyDbFieldHidesPara)
932  return;
933 
934  SwWait aWait(*GetDoc()->GetDocShell(), true);
935  rIDSA.set(DocumentSettingId::EMPTY_DB_FIELD_HIDES_PARA, bEmptyDbFieldHidesPara);
936  StartAction();
938  for (auto const & pFieldType : *GetDoc()->getIDocumentFieldsAccess().GetFieldTypes())
939  {
940  if (pFieldType->Which() == SwFieldIds::Database)
941  {
942  pFieldType->ModifyNotification(nullptr, nullptr);
943  }
944  }
945  EndAction();
946 }
947 
949 {
950  SwWait aWait( *GetDoc()->GetDocShell(), true );
951 
952  // we go for safe: get rid of the old font information,
953  // when the printer resolution or zoom factor changes.
954  // Init() and Reformat() are the safest locations.
955  pFntCache->Flush( );
956 
957  if( GetLayout()->IsCallbackActionEnabled() )
958  {
959  StartAction();
961  EndAction();
962  }
963 }
964 
966 {
968  if ( pTmpDrawModel )
969  pTmpDrawModel->ReformatAllTextObjects();
970  Reformat();
971 }
972 
974 {
975  // extremely likely to be a Bad Idea to call this without StartAction
976  // (except the Page Preview apparently only has a non-subclassed ViewShell)
977  assert((typeid(*this) == typeid(SwViewShell)) || mnStartAction);
978 
979  CurrShell aCurr( this );
980  SwWait aWait( *GetDoc()->GetDocShell(), true );
981 
982  // Preserve top of the text frame cache.
983  SwSaveSetLRUOfst aSaveLRU;
984 
985  //switch on Progress when none is running yet.
986  const bool bEndProgress = SfxProgress::GetActiveProgress( GetDoc()->GetDocShell() ) == nullptr;
987  if ( bEndProgress )
988  {
989  long nEndPage = GetLayout()->GetPageNum();
990  nEndPage += nEndPage * 10 / 100;
991  ::StartProgress( STR_STATSTR_REFORMAT, 0, nEndPage, GetDoc()->GetDocShell() );
992  }
993 
994  SwLayAction aAction( GetLayout(), Imp() );
995  aAction.SetPaint( false );
996  aAction.SetStatBar( true );
997  aAction.SetCalcLayout( true );
998  aAction.SetReschedule( true );
1000  aAction.Action(GetOut());
1002 
1003  //the SetNewFieldLst() on the Doc was cut off and must be fetched again
1004  //(see flowfrm.cxx, txtfld.cxx)
1005  if ( aAction.IsExpFields() )
1006  {
1007  aAction.Reset();
1008  aAction.SetPaint( false );
1009  aAction.SetStatBar( true );
1010  aAction.SetReschedule( true );
1011 
1012  SwDocPosUpdate aMsgHint( 0 );
1014  GetDoc()->getIDocumentFieldsAccess().UpdateExpFields(nullptr, true);
1015 
1016  aAction.Action(GetOut());
1017  }
1018 
1019  if ( VisArea().HasArea() )
1021  if ( bEndProgress )
1022  ::EndProgress( GetDoc()->GetDocShell() );
1023 }
1024 
1026 {
1027  for(SwViewShell& rSh : GetRingContainer())
1028  {
1029  if ( rSh.Imp() )
1030  rSh.Imp()->SetFirstVisPageInvalid();
1031  }
1032 }
1033 
1035 {
1036  if ( !mpWin )
1037  mbDocSizeChgd = true;
1038  else if( ActionPend() || Imp()->IsCalcLayoutProgress() || mbPaintInProgress )
1039  {
1040  mbDocSizeChgd = true;
1041 
1042  if ( !Imp()->IsCalcLayoutProgress() && dynamic_cast<const SwCursorShell*>( this ) != nullptr )
1043  {
1044  const SwFrame *pCnt = static_cast<SwCursorShell*>(this)->GetCurrFrame( false );
1045  const SwPageFrame *pPage;
1046  if ( pCnt && nullptr != (pPage = pCnt->FindPageFrame()) )
1047  {
1048  const sal_uInt16 nVirtNum = pPage->GetVirtPageNum();
1049  const SvxNumberType& rNum = pPage->GetPageDesc()->GetNumType();
1050  OUString sDisplay = rNum.GetNumStr( nVirtNum );
1051  PageNumNotify( this, pCnt->GetPhyPageNum(), nVirtNum, sDisplay );
1052 
1054  {
1055  Size aDocSize = GetDocSize();
1056  std::stringstream ss;
1057  ss << aDocSize.Width() + 2 * DOCUMENTBORDER << ", " << aDocSize.Height() + 2 * DOCUMENTBORDER;
1058  OString sSize = ss.str().c_str();
1059 
1060  SwXTextDocument* pModel = comphelper::getUnoTunnelImplementation<SwXTextDocument>(GetSfxViewShell()->GetCurrentDocument());
1062  }
1063  }
1064  }
1065  }
1066  else
1067  {
1068  mbDocSizeChgd = false;
1069  ::SizeNotify( this, GetDocSize() );
1070  }
1071 }
1072 
1074 {
1075  OSL_ENSURE( GetWin(), "VisPortChgd without Window." );
1076 
1077  if ( rRect == VisArea() )
1078  return;
1079 
1080  // Is someone spuriously rescheduling again?
1081  SAL_WARN_IF(mbInEndAction, "sw.core", "Scrolling during EndAction");
1082 
1083  //First get the old visible page, so we don't have to look
1084  //for it afterwards.
1085  const SwFrame *pOldPage = Imp()->GetFirstVisPage(GetWin());
1086 
1087  const SwRect aPrevArea( VisArea() );
1088  const bool bFull = aPrevArea.IsEmpty();
1089  maVisArea = rRect;
1091 
1092  //When there a PaintRegion still exists and the VisArea has changed,
1093  //the PaintRegion is at least by now obsolete. The PaintRegion can
1094  //have been created by RootFrame::PaintSwFrame.
1095  if ( !mbInEndAction &&
1096  Imp()->GetRegion() && Imp()->GetRegion()->GetOrigin() != VisArea() )
1097  Imp()->DelRegion();
1098 
1099  CurrShell aCurr( this );
1100 
1101  bool bScrolled = false;
1102 
1103  SwPostItMgr* pPostItMgr = GetPostItMgr();
1104 
1105  if ( bFull )
1106  GetWin()->Invalidate();
1107  else
1108  {
1109  //Calculate amount to be scrolled.
1110  const long nXDiff = aPrevArea.Left() - VisArea().Left();
1111  const long nYDiff = aPrevArea.Top() - VisArea().Top();
1112 
1113  if( !nXDiff && !GetViewOptions()->getBrowseMode() &&
1114  (!Imp()->HasDrawView() || !Imp()->GetDrawView()->IsGridVisible() ) )
1115  {
1116  // If possible, don't scroll the application background
1117  // (PaintDesktop). Also limit the left and right side of
1118  // the scroll range to the pages.
1119  const SwPageFrame *pPage = static_cast<SwPageFrame*>(GetLayout()->Lower());
1120  if ( pPage->getFrameArea().Top() > pOldPage->getFrameArea().Top() )
1121  pPage = static_cast<const SwPageFrame*>(pOldPage);
1122  SwRect aBoth( VisArea() );
1123  aBoth.Union( aPrevArea );
1124  const SwTwips nBottom = aBoth.Bottom();
1125  SwTwips nMinLeft = SAL_MAX_INT32;
1126  SwTwips nMaxRight= 0;
1127 
1128  const bool bBookMode = GetViewOptions()->IsViewLayoutBookMode();
1129 
1130  while ( pPage && pPage->getFrameArea().Top() <= nBottom )
1131  {
1132  SwRect aPageRect( pPage->GetBoundRect(GetWin()) );
1133  if ( bBookMode )
1134  {
1135  const SwPageFrame& rFormatPage = pPage->GetFormatPage();
1136  aPageRect.SSize( rFormatPage.GetBoundRect(GetWin()).SSize() );
1137  }
1138 
1139  // #i9719# - consider new border and shadow width
1140  if ( aPageRect.IsOver( aBoth ) )
1141  {
1142  SwTwips nPageLeft = 0;
1143  SwTwips nPageRight = 0;
1144  const sw::sidebarwindows::SidebarPosition aSidebarPos = pPage->SidebarPosition();
1145 
1146  if( aSidebarPos != sw::sidebarwindows::SidebarPosition::NONE )
1147  {
1148  nPageLeft = aPageRect.Left();
1149  nPageRight = aPageRect.Right();
1150  }
1151 
1152  if( nPageLeft < nMinLeft )
1153  nMinLeft = nPageLeft;
1154  if( nPageRight > nMaxRight )
1155  nMaxRight = nPageRight;
1156  //match with the draw objects
1157  //take nOfst into account as the objects have been
1158  //selected and have handles attached.
1159  if ( pPage->GetSortedObjs() )
1160  {
1161  const long nOfst = GetOut()->PixelToLogic(
1162  Size(Imp()->GetDrawView()->GetMarkHdlSizePixel()/2,0)).Width();
1163  for (SwAnchoredObject* pObj : *pPage->GetSortedObjs())
1164  {
1165  // ignore objects that are not actually placed on the page
1166  if (pObj->IsFormatPossible())
1167  {
1168  const tools::Rectangle &rBound = pObj->GetObjRect().SVRect();
1169  if (rBound.Left() != FAR_AWAY) {
1170  // OD 03.03.2003 #107927# - use correct datatype
1171  const SwTwips nL = std::max( 0L, rBound.Left() - nOfst );
1172  if ( nL < nMinLeft )
1173  nMinLeft = nL;
1174  if( rBound.Right() + nOfst > nMaxRight )
1175  nMaxRight = rBound.Right() + nOfst;
1176  }
1177  }
1178  }
1179  }
1180  }
1181  pPage = static_cast<const SwPageFrame*>(pPage->GetNext());
1182  }
1183  tools::Rectangle aRect( aPrevArea.SVRect() );
1184  aRect.SetLeft( nMinLeft );
1185  aRect.SetRight( nMaxRight );
1186  if( VisArea().IsOver( aPrevArea ) && !mnLockPaint )
1187  {
1188  bScrolled = true;
1189  maVisArea.Pos() = aPrevArea.Pos();
1190  if ( SmoothScroll( nXDiff, nYDiff, &aRect ) )
1191  return;
1192  maVisArea.Pos() = rRect.Pos();
1193  }
1194  else
1195  GetWin()->Invalidate( aRect );
1196  }
1197  else if ( !mnLockPaint ) //will be released in Unlock
1198  {
1199  if( VisArea().IsOver( aPrevArea ) )
1200  {
1201  bScrolled = true;
1202  maVisArea.Pos() = aPrevArea.Pos();
1203  if ( SmoothScroll( nXDiff, nYDiff, nullptr ) )
1204  return;
1205  maVisArea.Pos() = rRect.Pos();
1206  }
1207  else
1208  GetWin()->Invalidate();
1209  }
1210  }
1211 
1212  // When tiled rendering, the map mode of the window is disabled, avoid
1213  // enabling it here.
1215  {
1216  Point aPt( VisArea().Pos() );
1217  aPt.setX( -aPt.X() ); aPt.setY( -aPt.Y() );
1218  MapMode aMapMode( GetWin()->GetMapMode() );
1219  aMapMode.SetOrigin( aPt );
1220  GetWin()->SetMapMode( aMapMode );
1221  }
1222 
1223  if ( HasDrawView() )
1224  {
1225  Imp()->GetDrawView()->VisAreaChanged( GetWin() );
1226  Imp()->GetDrawView()->SetActualWin( GetWin() );
1227  }
1228  GetWin()->PaintImmediately();
1229 
1230  if ( pPostItMgr ) // #i88070#
1231  {
1232  pPostItMgr->Rescale();
1233  pPostItMgr->CalcRects();
1234  pPostItMgr->LayoutPostIts();
1235  }
1236 
1237  if ( !bScrolled && pPostItMgr && pPostItMgr->HasNotes() && pPostItMgr->ShowNotes() )
1238  pPostItMgr->CorrectPositions();
1239 
1240  if( Imp()->IsAccessible() )
1241  Imp()->UpdateAccessible();
1242 }
1243 
1244 bool SwViewShell::SmoothScroll( long lXDiff, long lYDiff, const tools::Rectangle *pRect )
1245 {
1246 #if !defined(MACOSX) && !defined(ANDROID) && !defined(IOS)
1247  // #i98766# - disable smooth scrolling for Mac
1248 
1249  const sal_uLong nBitCnt = mpOut->GetBitCount();
1250  long lMult = 1, lMax = LONG_MAX;
1251  if ( nBitCnt == 16 )
1252  {
1253  lMax = 7000;
1254  lMult = 2;
1255  }
1256  if ( nBitCnt == 24 )
1257  {
1258  lMax = 5000;
1259  lMult = 6;
1260  }
1261  else if ( nBitCnt == 1 )
1262  {
1263  lMax = 3000;
1264  lMult = 12;
1265  }
1266 
1267  // #i75172# isolated static conditions
1268  const bool bOnlyYScroll(!lXDiff && std::abs(lYDiff) != 0 && std::abs(lYDiff) < lMax);
1269  const bool bAllowedWithChildWindows(GetWin()->GetWindowClipRegionPixel().IsNull());
1270  const bool bSmoothScrollAllowed(bOnlyYScroll && mbEnableSmooth && GetViewOptions()->IsSmoothScroll() && bAllowedWithChildWindows);
1271 
1272  if(bSmoothScrollAllowed)
1273  {
1274  Imp()->m_bStopSmooth = false;
1275 
1276  const SwRect aOldVis( VisArea() );
1277 
1278  //create virtual device and set.
1279  const Size aPixSz = GetWin()->PixelToLogic(Size(1,1));
1281  pVout->SetLineColor( GetWin()->GetLineColor() );
1282  pVout->SetFillColor( GetWin()->GetFillColor() );
1283  MapMode aMapMode( GetWin()->GetMapMode() );
1284  pVout->SetMapMode( aMapMode );
1285  Size aSize( maVisArea.Width()+2*aPixSz.Width(), std::abs(lYDiff)+(2*aPixSz.Height()) );
1286  if ( pRect )
1287  aSize.setWidth( std::min(aSize.Width(), pRect->GetWidth()+2*aPixSz.Width()) );
1288  if ( pVout->SetOutputSize( aSize ) )
1289  {
1290  mnLockPaint++;
1291 
1292  //First Paint everything in the virtual device.
1293  SwRect aRect( VisArea() );
1294  aRect.Height( aSize.Height() );
1295  if ( pRect )
1296  {
1297  aRect.Pos().setX( std::max(aRect.Left(),pRect->Left()-aPixSz.Width()) );
1298  aRect.Right( std::min(aRect.Right()+2*aPixSz.Width(), pRect->Right()+aPixSz.Width()));
1299  }
1300  else
1301  aRect.AddWidth(2*aPixSz.Width() );
1302  aRect.Pos().setY( lYDiff < 0 ? aOldVis.Bottom() - aPixSz.Height()
1303  : aRect.Top() - aSize.Height() + aPixSz.Height() );
1304  aRect.Pos().setX( std::max( 0L, aRect.Left()-aPixSz.Width() ) );
1305  aRect.Pos() = GetWin()->PixelToLogic( GetWin()->LogicToPixel( aRect.Pos()));
1306  aRect.SSize( GetWin()->PixelToLogic( GetWin()->LogicToPixel( aRect.SSize())) );
1307  maVisArea = aRect;
1308  const Point aPt( -aRect.Left(), -aRect.Top() );
1309  aMapMode.SetOrigin( aPt );
1310  pVout->SetMapMode( aMapMode );
1311  OutputDevice *pOld = mpOut;
1312  mpOut = pVout.get();
1313 
1314  {
1315  // #i75172# To get a clean repaint, a new ObjectContact is needed here. Without, the
1316  // repaint would not be correct since it would use the wrong DrawPage visible region.
1317  // This repaint IS about painting something currently outside the visible part (!).
1318  // For that purpose, AddWindowToPaintView is used which creates a new SdrPageViewWindow
1319  // and all the necessary stuff. It's not cheap, but necessary here. Alone because repaint
1320  // target really is NOT the current window.
1321  // Also will automatically NOT use PreRendering and overlay (since target is VirtualDevice)
1322  if(!HasDrawView())
1323  MakeDrawView();
1324  SdrView* pDrawView = GetDrawView();
1325  pDrawView->AddWindowToPaintView(pVout, nullptr);
1326 
1327  // clear mpWin during DLPrePaint2 to get paint preparation for mpOut, but set it again
1328  // immediately afterwards. There are many decisions in SW which imply that Printing
1329  // is used when mpWin == 0 (wrong but widely used).
1330  vcl::Window* pOldWin = mpWin;
1331  mpWin = nullptr;
1332  DLPrePaint2(vcl::Region(aRect.SVRect()));
1333  mpWin = pOldWin;
1334 
1335  // SW paint stuff
1336  PaintDesktop(*GetOut(), aRect);
1337  SwViewShell::mbLstAct = true;
1338  GetLayout()->PaintSwFrame( *GetOut(), aRect );
1339  SwViewShell::mbLstAct = false;
1340 
1341  // end paint and destroy ObjectContact again
1342  DLPostPaint2(true);
1343  pDrawView->DeleteWindowFromPaintView(pVout);
1344  }
1345 
1346  mpOut = pOld;
1347  maVisArea = aOldVis;
1348 
1349  //Now shift in parts and copy the new Pixel from the virtual device.
1350 
1351  // ??????????????????????
1352  // or is it better to get the scrollfactor from the User
1353  // as option?
1354  // ??????????????????????
1355  long lMaDelta = aPixSz.Height();
1356  if ( std::abs(lYDiff) > ( maVisArea.Height() / 3 ) )
1357  lMaDelta *= 6;
1358  else
1359  lMaDelta *= 2;
1360 
1361  lMaDelta *= lMult;
1362 
1363  if ( lYDiff < 0 )
1364  lMaDelta = -lMaDelta;
1365 
1366  long lDiff = lYDiff;
1367  while ( lDiff )
1368  {
1369  long lScroll;
1370  if ( Imp()->m_bStopSmooth || std::abs(lDiff) <= std::abs(lMaDelta) )
1371  {
1372  lScroll = lDiff;
1373  lDiff = 0;
1374  }
1375  else
1376  {
1377  lScroll = lMaDelta;
1378  lDiff -= lMaDelta;
1379  }
1380 
1381  const SwRect aTmpOldVis = VisArea();
1382  maVisArea.Pos().AdjustY( -lScroll );
1383  maVisArea.Pos() = GetWin()->PixelToLogic( GetWin()->LogicToPixel( VisArea().Pos()));
1384  lScroll = aTmpOldVis.Top() - VisArea().Top();
1385  if ( pRect )
1386  {
1387  tools::Rectangle aTmp( aTmpOldVis.SVRect() );
1388  aTmp.SetLeft( pRect->Left() );
1389  aTmp.SetRight( pRect->Right() );
1390  GetWin()->Scroll( 0, lScroll, aTmp, ScrollFlags::Children);
1391  }
1392  else
1393  GetWin()->Scroll( 0, lScroll, ScrollFlags::Children );
1394 
1395  const Point aTmpPt( -VisArea().Left(), -VisArea().Top() );
1396  MapMode aTmpMapMode( GetWin()->GetMapMode() );
1397  aTmpMapMode.SetOrigin( aTmpPt );
1398  GetWin()->SetMapMode( aTmpMapMode );
1399 
1400  if ( Imp()->HasDrawView() )
1401  Imp()->GetDrawView()->VisAreaChanged( GetWin() );
1402 
1404  if ( !Imp()->m_bStopSmooth )
1405  {
1406  const bool bScrollDirectionIsUp(lScroll > 0);
1407  Imp()->m_aSmoothRect = VisArea();
1408 
1409  if(bScrollDirectionIsUp)
1410  {
1411  Imp()->m_aSmoothRect.Bottom( VisArea().Top() + lScroll + aPixSz.Height());
1412  }
1413  else
1414  {
1415  Imp()->m_aSmoothRect.Top( VisArea().Bottom() + lScroll - aPixSz.Height());
1416  }
1417 
1418  Imp()->m_bSmoothUpdate = true;
1419  GetWin()->PaintImmediately();
1420  Imp()->m_bSmoothUpdate = false;
1421 
1422  if(!Imp()->m_bStopSmooth)
1423  {
1424  // start paint on logic base
1425  const tools::Rectangle aTargetLogic(Imp()->m_aSmoothRect.SVRect());
1426  DLPrePaint2(vcl::Region(aTargetLogic));
1427 
1428  // get target rectangle in discrete pixels
1430  const tools::Rectangle aTargetPixel(rTargetDevice.LogicToPixel(aTargetLogic));
1431 
1432  // get source top-left in discrete pixels
1433  const Point aSourceTopLeft(pVout->LogicToPixel(aTargetLogic.TopLeft()));
1434 
1435  // switch off MapModes
1436  const bool bMapModeWasEnabledDest(rTargetDevice.IsMapModeEnabled());
1437  const bool bMapModeWasEnabledSource(pVout->IsMapModeEnabled());
1438  rTargetDevice.EnableMapMode(false);
1439  pVout->EnableMapMode(false);
1440 
1441  rTargetDevice.DrawOutDev(
1442  aTargetPixel.TopLeft(), aTargetPixel.GetSize(), // dest
1443  aSourceTopLeft, aTargetPixel.GetSize(), // source
1444  *pVout);
1445 
1446  // restore MapModes
1447  rTargetDevice.EnableMapMode(bMapModeWasEnabledDest);
1448  pVout->EnableMapMode(bMapModeWasEnabledSource);
1449 
1450  // end paint on logoc base
1451  DLPostPaint2(true);
1452  }
1453  else
1454  --mnLockPaint;
1455  }
1456  }
1457  pVout.disposeAndClear();
1458  GetWin()->PaintImmediately();
1459  if ( !Imp()->m_bStopSmooth )
1460  --mnLockPaint;
1462  return true;
1463  }
1464  pVout.disposeAndClear();
1465  }
1466 #endif
1467 
1468  maVisArea.Pos().AdjustX( -lXDiff );
1469  maVisArea.Pos().AdjustY( -lYDiff );
1470  if ( pRect )
1471  GetWin()->Scroll( lXDiff, lYDiff, *pRect, ScrollFlags::Children);
1472  else
1473  GetWin()->Scroll( lXDiff, lYDiff, ScrollFlags::Children);
1474  return false;
1475 }
1476 
1477 void SwViewShell::PaintDesktop(vcl::RenderContext& rRenderContext, const SwRect &rRect)
1478 {
1479  if ( !GetWin() && !GetOut()->GetConnectMetaFile() )
1480  return; //for the printer we don't do anything here.
1481 
1482  //Catch exceptions, so that it doesn't look so surprising.
1483  //Can e.g. happen during Idle.
1484  //Unfortunately we must at any rate Paint the rectangles next to the pages,
1485  //as these are not painted at VisPortChgd.
1486  bool bBorderOnly = false;
1487  const SwRootFrame *pRoot = GetLayout();
1488  if ( rRect.Top() > pRoot->getFrameArea().Bottom() )
1489  {
1490  const SwFrame *pPg = pRoot->Lower();
1491  while ( pPg && pPg->GetNext() )
1492  pPg = pPg->GetNext();
1493  if ( !pPg || !pPg->getFrameArea().IsOver( VisArea() ) )
1494  bBorderOnly = true;
1495  }
1496 
1497  const bool bBookMode = GetViewOptions()->IsViewLayoutBookMode();
1498 
1499  SwRegionRects aRegion( rRect );
1500 
1501  //mod #i6193: remove sidebar area to avoid flickering
1502  const SwPostItMgr* pPostItMgr = GetPostItMgr();
1503  const SwTwips nSidebarWidth = pPostItMgr && pPostItMgr->HasNotes() && pPostItMgr->ShowNotes() ?
1504  pPostItMgr->GetSidebarWidth() + pPostItMgr->GetSidebarBorderWidth() :
1505  0;
1506 
1507  if ( bBorderOnly )
1508  {
1509  const SwFrame *pPage =pRoot->Lower();
1510  SwRect aLeft( rRect ), aRight( rRect );
1511  while ( pPage )
1512  {
1513  long nTmp = pPage->getFrameArea().Left();
1514  if ( nTmp < aLeft.Right() )
1515  aLeft.Right( nTmp );
1516  nTmp = pPage->getFrameArea().Right();
1517  if ( nTmp > aRight.Left() )
1518  {
1519  aRight.Left( nTmp + nSidebarWidth );
1520  }
1521  pPage = pPage->GetNext();
1522  }
1523  aRegion.clear();
1524  if ( aLeft.HasArea() )
1525  aRegion.push_back( aLeft );
1526  if ( aRight.HasArea() )
1527  aRegion.push_back( aRight );
1528  }
1529  else
1530  {
1531  const SwFrame *pPage = Imp()->GetFirstVisPage(&rRenderContext);
1532  const SwTwips nBottom = rRect.Bottom();
1533  while ( pPage && !aRegion.empty() &&
1534  (pPage->getFrameArea().Top() <= nBottom) )
1535  {
1536  SwRect aPageRect( pPage->getFrameArea() );
1537  if ( bBookMode )
1538  {
1539  const SwPageFrame& rFormatPage = static_cast<const SwPageFrame*>(pPage)->GetFormatPage();
1540  aPageRect.SSize( rFormatPage.getFrameArea().SSize() );
1541  }
1542 
1543  const bool bSidebarRight =
1545  aPageRect.Pos().AdjustX( -(bSidebarRight ? 0 : nSidebarWidth) );
1546  aPageRect.AddWidth(nSidebarWidth );
1547 
1548  if ( aPageRect.IsOver( rRect ) )
1549  aRegion -= aPageRect;
1550 
1551  pPage = pPage->GetNext();
1552  }
1553  }
1554  if ( !aRegion.empty() )
1555  PaintDesktop_(aRegion);
1556 }
1557 
1558 // PaintDesktop is split in two, this part is also used by PreviewPage
1560 {
1561  // OD 2004-04-23 #116347#
1562  GetOut()->Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR );
1563  GetOut()->SetLineColor();
1564 
1565  for ( auto &rRgn : rRegion )
1566  {
1567  const tools::Rectangle aRectangle(rRgn.SVRect());
1568 
1569  // #i93170#
1570  // Here we have a real Problem. On the one hand we have the buffering for paint
1571  // and overlay which needs an embracing pair of DLPrePaint2/DLPostPaint2 calls,
1572  // on the other hand the MapMode is not set correctly when this code is executed.
1573  // This is done in the users of this method, for each SWpage before painting it.
1574  // Since the MapMode is not correct here, the call to DLPostPaint2 will paint
1575  // existing FormControls due to the current MapMode.
1576 
1577  // There are basically three solutions for this:
1578 
1579  // (1) Set the MapMode correct, move the background painting to the users of
1580  // this code
1581 
1582  // (2) Do no DLPrePaint2/DLPostPaint2 here; no SdrObjects are allowed to lie in
1583  // the desktop region. Disadvantage: the desktop will not be part of the
1584  // buffers, e.g. overlay. Thus, as soon as overlay will be used over the
1585  // desktop, it will not work.
1586 
1587  // (3) expand DLPostPaint2 with a flag to signal if FormControl paints shall
1588  // be done or not
1589 
1590  // Currently, (3) will be the best possible solution. It will keep overlay and
1591  // buffering intact and work without MapMode for single pages. In the medium
1592  // to long run, (1) will need to be used and the bool bPaintFormLayer needs
1593  // to be removed again
1594 
1595  // #i68597# inform Drawinglayer about display change
1596  DLPrePaint2(vcl::Region(aRectangle));
1597 
1598  // #i75172# needed to move line/Fill color setters into loop since DLPrePaint2
1599  // may exchange GetOut(), that's it's purpose. This happens e.g. at print preview.
1601  GetOut()->SetLineColor();
1602  GetOut()->DrawRect(aRectangle);
1603 
1604  DLPostPaint2(false);
1605  }
1606 
1607  GetOut()->Pop();
1608 }
1609 
1611 {
1612  if ( !GetWin() )
1613  return false;
1614 
1615  const SwPageFrame *pPage = Imp()->GetFirstVisPage(GetOut());
1616  const SwTwips nBottom = VisArea().Bottom();
1617  const SwTwips nRight = VisArea().Right();
1618  bool bRet = false;
1619  while ( !bRet && pPage && ((pPage->getFrameArea().Top() <= nBottom) &&
1620  (pPage->getFrameArea().Left() <= nRight)))
1621  {
1622  if ( pPage->IsInvalid() || pPage->IsInvalidFly() )
1623  bRet = true;
1624  pPage = static_cast<const SwPageFrame*>(pPage->GetNext());
1625  }
1626 
1627  if ( bRet )
1628  {
1629  //Unfortunately Start/EndAction won't help here, as the Paint originated
1630  //from GUI and so Clipping has been set against getting through.
1631  //Ergo: do it all yourself (see ImplEndAction())
1632  if ( Imp()->GetRegion() && Imp()->GetRegion()->GetOrigin() != VisArea())
1633  Imp()->DelRegion();
1634 
1635  SwLayAction aAction( GetLayout(), Imp() );
1636  aAction.SetComplete( false );
1637  // We increment the action counter to avoid a recursive call of actions
1638  // e.g. from a SwFEShell::RequestObjectResize(..) in bug 95829.
1639  // A recursive call of actions is no good idea because the inner action
1640  // can't format frames which are locked by the outer action. This may
1641  // cause and endless loop.
1642  ++mnStartAction;
1643  aAction.Action(GetWin());
1644  --mnStartAction;
1645 
1646  SwRegionRects *pRegion = Imp()->GetRegion();
1647  if ( pRegion && aAction.IsBrowseActionStop() )
1648  {
1649  //only of interest when something has changed in the visible range
1650  bool bStop = true;
1651  for ( size_t i = 0; i < pRegion->size(); ++i )
1652  {
1653  const SwRect &rTmp = (*pRegion)[i];
1654  bStop = rTmp.IsOver( VisArea() );
1655  if ( !bStop )
1656  break;
1657  }
1658  if ( bStop )
1659  {
1660  Imp()->DelRegion();
1661  pRegion = nullptr;
1662  }
1663  }
1664 
1665  if ( pRegion )
1666  {
1667  //First Invert then Compress, never the other way round!
1668  pRegion->Invert();
1669  pRegion->Compress();
1670  bRet = false;
1671  if ( !pRegion->empty() )
1672  {
1673  SwRegionRects aRegion( rRect );
1674  for ( size_t i = 0; i < pRegion->size(); ++i )
1675  { const SwRect &rTmp = (*pRegion)[i];
1676  if ( !rRect.IsInside( rTmp ) )
1677  {
1678  InvalidateWindows( rTmp );
1679  if ( rTmp.IsOver( VisArea() ) )
1680  { aRegion -= rTmp;
1681  bRet = true;
1682  }
1683  }
1684  }
1685  if ( bRet )
1686  {
1687  for ( size_t i = 0; i < aRegion.size(); ++i )
1688  GetWin()->Invalidate( aRegion[i].SVRect() );
1689 
1690  if ( rRect != VisArea() )
1691  {
1692  //rRect == VisArea is the special case for new or
1693  //Shift-Ctrl-R, when it shouldn't be necessary to
1694  //hold the rRect again in Document coordinates.
1695  if ( maInvalidRect.IsEmpty() )
1696  maInvalidRect = rRect;
1697  else
1698  maInvalidRect.Union( rRect );
1699  }
1700  }
1701  }
1702  else
1703  bRet = false;
1704  Imp()->DelRegion();
1705  }
1706  else
1707  bRet = false;
1708  }
1709  return bRet;
1710 }
1711 
1712 namespace
1713 {
1715 class RenderContextGuard
1716 {
1717  std::unique_ptr<SdrPaintWindow> m_TemporaryPaintWindow;
1718  SdrPageWindow* m_pPatchedPageWindow;
1719  SdrPaintWindow* m_pPreviousPaintWindow = nullptr;
1720 
1721 public:
1722  RenderContextGuard(VclPtr<vcl::RenderContext>& pRef, vcl::RenderContext* pValue, SwViewShell* pShell)
1723  : m_pPatchedPageWindow(nullptr)
1724  {
1725  pRef = pValue;
1726 
1727  if (pValue == pShell->GetWin())
1728  return;
1729 
1730  SdrView* pDrawView(pShell->Imp()->GetDrawView());
1731 
1732  if (nullptr == pDrawView)
1733  return;
1734 
1735  SdrPageView* pSdrPageView(pDrawView->GetSdrPageView());
1736 
1737  if (nullptr != pSdrPageView)
1738  {
1739  m_pPatchedPageWindow = pSdrPageView->FindPageWindow(*pShell->GetWin());
1740 
1741  if (nullptr != m_pPatchedPageWindow)
1742  {
1743  m_TemporaryPaintWindow.reset(new SdrPaintWindow(*pDrawView, *pValue));
1744  m_pPreviousPaintWindow = m_pPatchedPageWindow->patchPaintWindow(*m_TemporaryPaintWindow);
1745  }
1746  }
1747  }
1748 
1749  ~RenderContextGuard()
1750  {
1751  if(nullptr != m_pPatchedPageWindow)
1752  {
1753  m_pPatchedPageWindow->unpatchPaintWindow(m_pPreviousPaintWindow);
1754  }
1755  }
1756 };
1757 }
1758 
1759 void SwViewShell::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle &rRect)
1760 {
1761  RenderContextGuard aGuard(mpOut, &rRenderContext, this);
1762  if ( mnLockPaint )
1763  {
1764  if ( Imp()->m_bSmoothUpdate )
1765  {
1766  SwRect aTmp( rRect );
1767  if ( !Imp()->m_aSmoothRect.IsInside( aTmp ) )
1768  Imp()->m_bStopSmooth = true;
1769  else
1770  {
1771  Imp()->m_aSmoothRect = aTmp;
1772  return;
1773  }
1774  }
1775  else
1776  return;
1777  }
1778 
1779  if ( SwRootFrame::IsInPaint() )
1780  {
1781  //During the publication of a page at printing the Paint is buffered.
1782  SwPaintQueue::Add( this, SwRect( rRect ) );
1783  return;
1784  }
1785 
1786  //With !nStartAction I try to protect me against erroneous code at other places.
1787  //Hopefully it will not lead to problems!?
1788  if ( mbPaintWorks && !mnStartAction )
1789  {
1790  if( GetWin() && GetWin()->IsVisible() )
1791  {
1792  SwRect aRect( rRect );
1793  if ( mbPaintInProgress ) //Guard against double Paints!
1794  {
1795  GetWin()->Invalidate( rRect );
1796  return;
1797  }
1798 
1799  mbPaintInProgress = true;
1800  CurrShell aCurr( this );
1801  SwRootFrame::SetNoVirDev( true );
1802 
1803  //We don't want to Clip to and from, we trust that all are limited
1804  //to the rectangle and only need to calculate the clipping once.
1805  //The ClipRect is removed here once and not recovered, as externally
1806  //no one needs it anymore anyway.
1807  //Not when we paint a Metafile.
1808  if( !GetOut()->GetConnectMetaFile() && GetOut()->IsClipRegion())
1809  GetOut()->SetClipRegion();
1810 
1811  if ( IsPreview() )
1812  {
1813  //When useful, process or destroy the old InvalidRect.
1814  if ( aRect.IsInside( maInvalidRect ) )
1815  ResetInvalidRect();
1816  SwViewShell::mbLstAct = true;
1817  GetLayout()->PaintSwFrame( rRenderContext, aRect );
1818  SwViewShell::mbLstAct = false;
1819  }
1820  else
1821  {
1822  //When one of the visible pages still has anything entered for
1823  //Repaint, Repaint must be triggered.
1824  if ( !CheckInvalidForPaint( aRect ) )
1825  {
1826  // --> OD 2009-08-12 #i101192#
1827  // start Pre/PostPaint encapsulation to avoid screen blinking
1828  const vcl::Region aRepaintRegion(aRect.SVRect());
1829  DLPrePaint2(aRepaintRegion);
1830 
1831  // <--
1832  PaintDesktop(rRenderContext, aRect);
1833 
1834  //When useful, process or destroy the old InvalidRect.
1835  if ( aRect.IsInside( maInvalidRect ) )
1836  ResetInvalidRect();
1837  SwViewShell::mbLstAct = true;
1838  GetLayout()->PaintSwFrame( rRenderContext, aRect );
1839  SwViewShell::mbLstAct = false;
1840  // --> OD 2009-08-12 #i101192#
1841  // end Pre/PostPaint encapsulation
1842  DLPostPaint2(true);
1843  // <--
1844  }
1845  }
1846  SwRootFrame::SetNoVirDev( false );
1847  mbPaintInProgress = false;
1848  UISizeNotify();
1849  }
1850  }
1851  else
1852  {
1853  if ( maInvalidRect.IsEmpty() )
1854  maInvalidRect = SwRect( rRect );
1855  else
1856  maInvalidRect.Union( SwRect( rRect ) );
1857 
1858  if ( mbInEndAction && GetWin() )
1859  {
1860  const vcl::Region aRegion(GetWin()->GetPaintRegion());
1861  RectangleVector aRectangles;
1862  aRegion.GetRegionRectangles(aRectangles);
1863 
1864  for(const auto& rRectangle : aRectangles)
1865  {
1866  Imp()->AddPaintRect(rRectangle);
1867  }
1868 
1869  //RegionHandle hHdl( aRegion.BeginEnumRects() );
1870  //Rectangle aRect;
1871  //while ( aRegion.GetEnumRects( hHdl, aRect ) )
1872  // Imp()->AddPaintRect( aRect );
1873  //aRegion.EndEnumRects( hHdl );
1874  }
1875  else if ( SfxProgress::GetActiveProgress( GetDoc()->GetDocShell() ) &&
1876  GetOut() == GetWin() )
1877  {
1878  // #i68597#
1879  const vcl::Region aDLRegion(rRect);
1880  DLPrePaint2(aDLRegion);
1881 
1882  rRenderContext.Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR );
1883  rRenderContext.SetFillColor( Imp()->GetRetoucheColor() );
1884  rRenderContext.SetLineColor();
1885  rRenderContext.DrawRect( rRect );
1886  rRenderContext.Pop();
1887  // #i68597#
1888  DLPostPaint2(true);
1889  }
1890  }
1891 }
1892 
1893 void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contextHeight, int tilePosX, int tilePosY, long tileWidth, long tileHeight)
1894 {
1895  // SwViewShell's output device setup
1896  // TODO clean up SwViewShell's approach to output devices (the many of
1897  // them - mpBufferedOut, mpOut, mpWin, ...)
1898  OutputDevice *pSaveOut = mpOut;
1900  mpOut = &rDevice;
1901 
1902  // resizes the virtual device so to contain the entries context
1903  rDevice.SetOutputSizePixel(Size(contextWidth, contextHeight));
1904 
1905  // setup the output device to draw the tile
1906  MapMode aMapMode(rDevice.GetMapMode());
1907  aMapMode.SetMapUnit(MapUnit::MapTwip);
1908  aMapMode.SetOrigin(Point(-tilePosX, -tilePosY));
1909 
1910  // Scaling. Must convert from pixels to twips. We know
1911  // that VirtualDevices use a DPI of 96.
1912  Fraction scaleX = Fraction(contextWidth, 96) * Fraction(1440) / Fraction(tileWidth);
1913  Fraction scaleY = Fraction(contextHeight, 96) * Fraction(1440) / Fraction(tileHeight);
1914  aMapMode.SetScaleX(scaleX);
1915  aMapMode.SetScaleY(scaleY);
1916  rDevice.SetMapMode(aMapMode);
1917 
1918  // Update scaling of SwEditWin and its sub-widgets, needed for comments.
1919  sal_uInt16 nOldZoomValue = 0;
1920  if (GetWin() && GetWin()->GetMapMode().GetScaleX() != scaleX)
1921  {
1922  double fScale = double(scaleX);
1923  SwViewOption aOption(*GetViewOptions());
1924  nOldZoomValue = aOption.GetZoom();
1925  aOption.SetZoom(fScale * 100);
1926  ApplyViewOptions(aOption);
1927  // Make sure the map mode (disabled in SwXTextDocument::initializeForTiledRendering()) is still disabled.
1928  GetWin()->EnableMapMode(false);
1929  }
1930 
1931  tools::Rectangle aOutRect(Point(tilePosX, tilePosY),
1932  rDevice.PixelToLogic(Size(contextWidth, contextHeight)));
1933 
1934  // Make the requested area visible -- we can't use MakeVisible as that will
1935  // only scroll the contents, but won't zoom/resize if needed.
1936  // Without this, items/text that are outside the visible area (in the SwView)
1937  // won't be painted when rendering tiles (at least when using either the
1938  // tiledrendering app, or the gtktiledviewer) -- although ultimately we
1939  // probably want to fix things so that the SwView's area doesn't affect
1940  // tiled rendering?
1941  VisPortChgd(SwRect(aOutRect));
1942 
1943  // Invoke SwLayAction if layout is not yet ready.
1944  CheckInvalidForPaint(aOutRect);
1945 
1946  // draw - works in logic coordinates
1947  Paint(rDevice, aOutRect);
1948 
1949  SwPostItMgr* pPostItMgr = GetPostItMgr();
1950  if (GetViewOptions()->IsPostIts() && pPostItMgr)
1951  pPostItMgr->PaintTile(rDevice);
1952 
1953  // SwViewShell's output device tear down
1954 
1955  // A view shell can get a PaintTile call for a tile at a zoom level
1956  // different from the one, the related client really is.
1957  // In such a case it is better to reset the current scale value to
1958  // the original one, since such a value should be in synchronous with
1959  // the zoom level in the client (see setClientZoom).
1960  // At present the zoom value returned by GetViewOptions()->GetZoom() is
1961  // used in SwXTextDocument methods (postMouseEvent and setGraphicSelection)
1962  // for passing the correct mouse position to an edited chart (if any).
1963  if (nOldZoomValue !=0)
1964  {
1965  SwViewOption aOption(*GetViewOptions());
1966  aOption.SetZoom(nOldZoomValue);
1967  ApplyViewOptions(aOption);
1968 
1969  // Changing the zoom value doesn't always trigger the updating of
1970  // the client ole object area, so we call it directly.
1971  SfxInPlaceClient* pIPClient = GetSfxViewShell()->GetIPClient();
1972  if (pIPClient)
1973  {
1974  pIPClient->VisAreaChanged();
1975  }
1976  // Make sure the map mode (disabled in SwXTextDocument::initializeForTiledRendering()) is still disabled.
1977  GetWin()->EnableMapMode(false);
1978  }
1979 
1980  mpOut = pSaveOut;
1982 }
1983 
1985 {
1986  if( rNew != maBrowseBorder )
1987  {
1988  maBrowseBorder = rNew;
1989  if ( maVisArea.HasArea() )
1990  InvalidateLayout( false );
1991  }
1992 }
1993 
1995 {
1996  return maBrowseBorder;
1997 }
1998 
2000 {
2001  const SwPostItMgr* pPostItMgr = GetPostItMgr();
2002  if ( pPostItMgr && pPostItMgr->HasNotes() && pPostItMgr->ShowNotes() )
2003  {
2004  Size aBorder( maBrowseBorder );
2005  aBorder.AdjustWidth(maBrowseBorder.Width() );
2006  aBorder.AdjustWidth(pPostItMgr->GetSidebarWidth(true) + pPostItMgr->GetSidebarBorderWidth(true) );
2007  return maVisArea.Width() - GetOut()->PixelToLogic(aBorder).Width();
2008  }
2009  else
2010  return maVisArea.Width() - 2 * GetOut()->PixelToLogic(maBrowseBorder).Width();
2011 }
2012 
2013 void SwViewShell::InvalidateLayout( bool bSizeChanged )
2014 {
2015  if ( !bSizeChanged && !GetViewOptions()->getBrowseMode() &&
2016  !GetViewOptions()->IsWhitespaceHidden() )
2017  return;
2018 
2019  CurrShell aCurr( this );
2020 
2021  OSL_ENSURE( GetLayout(), "Layout not ready" );
2022 
2023  // When the Layout doesn't have a height yet, nothing is formatted.
2024  // That leads to problems with Invalidate, e.g. when setting up a new View
2025  // the content is inserted and formatted (regardless of empty VisArea).
2026  // Therefore the pages must be roused for formatting.
2027  if( !GetLayout()->getFrameArea().Height() )
2028  {
2029  SwFrame* pPage = GetLayout()->Lower();
2030  while( pPage )
2031  {
2032  pPage->InvalidateSize_();
2033  pPage = pPage->GetNext();
2034  }
2035  return;
2036  }
2037 
2038  LockPaint();
2039  StartAction();
2040 
2041  SwPageFrame *pPg = static_cast<SwPageFrame*>(GetLayout()->Lower());
2042  do
2043  { pPg->InvalidateSize();
2044  pPg->InvalidatePrt_();
2045  pPg->InvaPercentLowers();
2046  if ( bSizeChanged )
2047  {
2048  pPg->PrepareHeader();
2049  pPg->PrepareFooter();
2050  }
2051  pPg = static_cast<SwPageFrame*>(pPg->GetNext());
2052  } while ( pPg );
2053 
2054  // When the size ratios in browse mode change,
2055  // the Position and PrtArea of the Content and Tab frames must be Invalidated.
2057  // In case of layout or mode change, the ContentFrames need a size-Invalidate
2058  // because of printer/screen formatting.
2059  if ( bSizeChanged )
2061 
2062  GetLayout()->InvalidateAllContent( nInv );
2063 
2064  SwFrame::CheckPageDescs( static_cast<SwPageFrame*>(GetLayout()->Lower()) );
2065 
2066  EndAction();
2067  UnlockPaint();
2068 }
2069 
2071 {
2072  return mpLayout.get();
2073 }
2074 
2076 {
2077  OutputDevice* pTmpOut = nullptr;
2078  if ( GetWin() &&
2079  GetViewOptions()->getBrowseMode() &&
2080  !GetViewOptions()->IsPrtFormat() )
2081  pTmpOut = GetWin();
2082  else
2083  pTmpOut = GetDoc()->getIDocumentDeviceAccess().getReferenceDevice( true );
2084 
2085  return *pTmpOut;
2086 }
2087 
2089 {
2090  return mxDoc->GetNodes();
2091 }
2092 
2094 {
2095 }
2096 
2098 {
2099  Size aSz;
2100  const SwRootFrame* pRoot = GetLayout();
2101  if( pRoot )
2102  aSz = pRoot->getFrameArea().SSize();
2103 
2104  return aSz;
2105 }
2106 
2108 {
2109  return GetDoc()->GetAttrPool();
2110 }
2111 
2113 {
2114  for(SwViewShell& rSh : GetRingContainer())
2115  rSh.StartAction();
2116 
2117  ImplApplyViewOptions( rOpt );
2118 
2119  // With one layout per view it is no longer necessary
2120  // to sync these "layout related" view options
2121  // But as long as we have to disable "multiple layout"
2122 
2123  for(SwViewShell& rSh : GetRingContainer())
2124  {
2125  if(&rSh == this)
2126  continue;
2127  SwViewOption aOpt( *rSh.GetViewOptions() );
2128  aOpt.SetFieldName( rOpt.IsFieldName() );
2129  aOpt.SetShowHiddenField( rOpt.IsShowHiddenField() );
2130  aOpt.SetShowHiddenPara( rOpt.IsShowHiddenPara() );
2131  aOpt.SetShowHiddenChar( rOpt.IsShowHiddenChar() );
2132  aOpt.SetViewLayoutBookMode( rOpt.IsViewLayoutBookMode() );
2133  aOpt.SetHideWhitespaceMode(rOpt.IsHideWhitespaceMode());
2134  aOpt.SetViewLayoutColumns(rOpt.GetViewLayoutColumns());
2135  aOpt.SetPostIts(rOpt.IsPostIts());
2136  if ( !(aOpt == *rSh.GetViewOptions()) )
2137  rSh.ImplApplyViewOptions( aOpt );
2138  }
2139  // End of disabled multiple window
2140 
2141  for(SwViewShell& rSh : GetRingContainer())
2142  rSh.EndAction();
2143 }
2144 
2146 {
2147  if (*mpOpt == rOpt)
2148  return;
2149 
2150  vcl::Window *pMyWin = GetWin();
2151  if( !pMyWin )
2152  {
2153  OSL_ENSURE( pMyWin, "SwViewShell::ApplyViewOptions: no window" );
2154  return;
2155  }
2156 
2157  CurrShell aCurr( this );
2158 
2159  bool bReformat = false;
2160 
2161  if( mpOpt->IsShowHiddenField() != rOpt.IsShowHiddenField() )
2162  {
2163  static_cast<SwHiddenTextFieldType*>(mxDoc->getIDocumentFieldsAccess().GetSysFieldType( SwFieldIds::HiddenText ))->
2164  SetHiddenFlag( !rOpt.IsShowHiddenField() );
2165  bReformat = true;
2166  }
2167  if ( mpOpt->IsShowHiddenPara() != rOpt.IsShowHiddenPara() )
2168  {
2169  SwHiddenParaFieldType* pFieldType = static_cast<SwHiddenParaFieldType*>(GetDoc()->
2170  getIDocumentFieldsAccess().GetSysFieldType(SwFieldIds::HiddenPara));
2171  if( pFieldType && pFieldType->HasWriterListeners() )
2172  {
2174  pFieldType->ModifyNotification( &aHint, nullptr);
2175  }
2176  bReformat = true;
2177  }
2178  if ( !bReformat && mpOpt->IsShowHiddenChar() != rOpt.IsShowHiddenChar() )
2179  {
2180  bReformat = GetDoc()->ContainsHiddenChars();
2181  }
2182 
2183  // bReformat becomes true, if ...
2184  // - fieldnames apply or not ...
2185  // ( - SwEndPortion must _no_ longer be generated. )
2186  // - Of course, the screen is something completely different than the printer ...
2187  bReformat = bReformat || mpOpt->IsFieldName() != rOpt.IsFieldName();
2188 
2189  // The map mode is changed, minima/maxima will be attended by UI
2190  if( mpOpt->GetZoom() != rOpt.GetZoom() && !IsPreview() )
2191  {
2192  MapMode aMode( pMyWin->GetMapMode() );
2193  Fraction aNewFactor( rOpt.GetZoom(), 100 );
2194  aMode.SetScaleX( aNewFactor );
2195  aMode.SetScaleY( aNewFactor );
2196  pMyWin->SetMapMode( aMode );
2197  // if not a reference device (printer) is used for formatting,
2198  // but the screen, new formatting is needed for zoomfactor changes.
2199  if (mpOpt->getBrowseMode() || mpOpt->IsWhitespaceHidden())
2200  bReformat = true;
2201  }
2202 
2203  bool bBrowseModeChanged = false;
2204  if( mpOpt->getBrowseMode() != rOpt.getBrowseMode() )
2205  {
2206  bBrowseModeChanged = true;
2207  bReformat = true;
2208  }
2209  else if( mpOpt->getBrowseMode() && mpOpt->IsPrtFormat() != rOpt.IsPrtFormat() )
2210  bReformat = true;
2211 
2212  bool bHideWhitespaceModeChanged = false;
2213  if (mpOpt->IsWhitespaceHidden() != rOpt.IsWhitespaceHidden())
2214  {
2215  // When whitespace is hidden, view change needs reformatting.
2216  bHideWhitespaceModeChanged = true;
2217  bReformat = true;
2218  }
2219 
2220  if ( HasDrawView() || rOpt.IsGridVisible() )
2221  {
2222  if ( !HasDrawView() )
2223  MakeDrawView();
2224 
2225  SwDrawView *pDView = Imp()->GetDrawView();
2226  if ( pDView->IsDragStripes() != rOpt.IsCrossHair() )
2227  pDView->SetDragStripes( rOpt.IsCrossHair() );
2228 
2229  if ( pDView->IsGridSnap() != rOpt.IsSnap() )
2230  pDView->SetGridSnap( rOpt.IsSnap() );
2231 
2232  if ( pDView->IsGridVisible() != rOpt.IsGridVisible() )
2233  pDView->SetGridVisible( rOpt.IsGridVisible() );
2234 
2235  const Size &rSz = rOpt.GetSnapSize();
2236  pDView->SetGridCoarse( rSz );
2237 
2238  const Size aFSize
2239  ( rSz.Width() ? rSz.Width() / (rOpt.GetDivisionX()+1) : 0,
2240  rSz.Height()? rSz.Height()/ (rOpt.GetDivisionY()+1) : 0);
2241  pDView->SetGridFine( aFSize );
2242  Fraction aSnGrWdtX(rSz.Width(), rOpt.GetDivisionX() + 1);
2243  Fraction aSnGrWdtY(rSz.Height(), rOpt.GetDivisionY() + 1);
2244  pDView->SetSnapGridWidth( aSnGrWdtX, aSnGrWdtY );
2245 
2246  // set handle size to 9 pixels, always
2247  pDView->SetMarkHdlSizePixel(9);
2248  }
2249 
2250  bool bOnlineSpellChgd = mpOpt->IsOnlineSpell() != rOpt.IsOnlineSpell();
2251 
2252  *mpOpt = rOpt; // First the options are taken.
2253  mpOpt->SetUIOptions(rOpt);
2254 
2255  mxDoc->GetDocumentSettingManager().set(DocumentSettingId::HTML_MODE, 0 != ::GetHtmlMode(mxDoc->GetDocShell()));
2256 
2257  if( bBrowseModeChanged || bHideWhitespaceModeChanged )
2258  {
2259  // #i44963# Good occasion to check if page sizes in
2260  // page descriptions are still set to (LONG_MAX, LONG_MAX) (html import)
2261  mxDoc->CheckDefaultPageFormat();
2262  InvalidateLayout( true );
2263  }
2264 
2265  pMyWin->Invalidate();
2266  if ( bReformat )
2267  {
2268  // Nothing helps, we need to send all ContentFrames a
2269  // Prepare, we format anew:
2270  StartAction();
2271  Reformat();
2272  EndAction();
2273  }
2274 
2275  if( !bOnlineSpellChgd )
2276  return;
2277 
2278  bool bOnlineSpl = rOpt.IsOnlineSpell();
2279  for(SwViewShell& rSh : GetRingContainer())
2280  {
2281  if(&rSh == this)
2282  continue;
2283  rSh.mpOpt->SetOnlineSpell( bOnlineSpl );
2284  vcl::Window *pTmpWin = rSh.GetWin();
2285  if( pTmpWin )
2286  pTmpWin->Invalidate();
2287  }
2288 
2289 }
2290 
2292 {
2293  mpOpt->SetUIOptions(rOpt);
2294  //the API-Flag of the view options is set but never reset
2295  //it is required to set scroll bars in readonly documents
2296  if(rOpt.IsStarOneSetting())
2297  mpOpt->SetStarOneSetting(true);
2298 
2299  mpOpt->SetSymbolFont(rOpt.GetSymbolFont());
2300 }
2301 
2303 {
2304  //JP 01.02.99: at readonly flag query properly
2305  // and if need be format; Bug 61335
2306 
2307  // Are we switching from readonly to edit?
2308  if( bSet == mpOpt->IsReadonly() )
2309  return;
2310 
2311  // so that the flags can be queried properly.
2312  mpOpt->SetReadonly( false );
2313 
2314  bool bReformat = mpOpt->IsFieldName();
2315 
2316  mpOpt->SetReadonly( bSet );
2317 
2318  if( bReformat )
2319  {
2320  StartAction();
2321  Reformat();
2322  if ( GetWin() )
2323  GetWin()->Invalidate();
2324  EndAction();
2325  }
2326  else if ( GetWin() )
2327  GetWin()->Invalidate();
2328  if( Imp()->IsAccessible() )
2330 }
2331 
2333 {
2334  if( bSet != mpOpt->IsPDFExport() )
2335  {
2336  if( bSet && mpOpt->getBrowseMode() )
2337  mpOpt->SetPrtFormat( true );
2338  mpOpt->SetPDFExport(bSet);
2339  }
2340 }
2341 
2343 {
2344  if( bSet != mpOpt->IsSelectionInReadonly() )
2345  {
2346  mpOpt->SetSelectionInReadonly(bSet);
2347  }
2348 }
2349 
2351 {
2352  mpOpt->SetPrtFormat( bSet );
2353 }
2354 
2356 {
2357  if ( mbDocSizeChgd )
2358  {
2359  mbDocSizeChgd = false;
2360  bool bOld = bInSizeNotify;
2361  bInSizeNotify = true;
2362  ::SizeNotify( this, GetDocSize() );
2363  bInSizeNotify = bOld;
2364  }
2365 }
2366 
2367 void SwViewShell::SetRestoreActions(sal_uInt16 nSet)
2368 {
2369  OSL_ENSURE(!GetRestoreActions()||!nSet, "multiple restore of the Actions ?");
2370  Imp()->SetRestoreActions(nSet);
2371 }
2373 {
2374  return Imp()->GetRestoreActions();
2375 }
2376 
2378 {
2379  return GetLayout()->IsNewLayout();
2380 }
2381 
2382 uno::Reference< css::accessibility::XAccessible > SwViewShell::CreateAccessible()
2383 {
2384  uno::Reference< css::accessibility::XAccessible > xAcc;
2385 
2386  // We require a layout and an XModel to be accessible.
2387  OSL_ENSURE( mpLayout, "no layout, no access" );
2388  OSL_ENSURE( GetWin(), "no window, no access" );
2389 
2390  if( mxDoc->getIDocumentLayoutAccess().GetCurrentViewShell() && GetWin() )
2391  xAcc = Imp()->GetAccessibleMap().GetDocumentView();
2392 
2393  return xAcc;
2394 }
2395 
2396 uno::Reference< css::accessibility::XAccessible > SwViewShell::CreateAccessiblePreview()
2397 {
2398  OSL_ENSURE( IsPreview(),
2399  "Can't create accessible preview for non-preview SwViewShell" );
2400 
2401  // We require a layout and an XModel to be accessible.
2402  OSL_ENSURE( mpLayout, "no layout, no access" );
2403  OSL_ENSURE( GetWin(), "no window, no access" );
2404 
2405  if ( IsPreview() && GetLayout()&& GetWin() )
2406  {
2408  PagePreviewLayout()->maPreviewPages,
2409  GetWin()->GetMapMode().GetScaleX(),
2410  GetLayout()->GetPageByPageNum( PagePreviewLayout()->mnSelectedPageNum ),
2411  PagePreviewLayout()->maWinSize );
2412  }
2413  return nullptr;
2414 }
2415 
2417 {
2418  if( Imp() && Imp()->IsAccessible() )
2420 }
2421 
2426  const SwTextFrame* _pToTextFrame )
2427 {
2428  if ( GetLayout() && GetLayout()->IsAnyShellAccessible() )
2429  {
2430  Imp()->InvalidateAccessibleParaFlowRelation_( _pFromTextFrame, _pToTextFrame );
2431  }
2432 }
2433 
2438 {
2439  if ( GetLayout() && GetLayout()->IsAnyShellAccessible() )
2440  {
2442  }
2443 }
2444 
2449 {
2450  if ( GetLayout() && GetLayout()->IsAnyShellAccessible() )
2451  {
2452  Imp()->InvalidateAccessibleParaAttrs_( rTextFrame );
2453  }
2454 }
2455 
2457 {
2458  if ( Imp()->IsAccessible() )
2459  {
2460  return &(Imp()->GetAccessibleMap());
2461  }
2462 
2463  return nullptr;
2464 }
2465 
2467 {
2469  return;
2470  if (mpOpt->IsPagePreview() && !rAccessibilityOptions.GetIsForPagePreviews())
2471  {
2472  mpAccOptions->SetAlwaysAutoColor(false);
2473  mpAccOptions->SetStopAnimatedGraphics(false);
2474  }
2475  else
2476  {
2477  mpAccOptions->SetAlwaysAutoColor(rAccessibilityOptions.GetIsAutomaticFontColor());
2478  mpAccOptions->SetStopAnimatedGraphics(! rAccessibilityOptions.GetIsAllowAnimatedGraphics());
2479 
2480  // Form view
2481  // Always set this option, not only if document is read-only:
2482  mpOpt->SetSelectionInReadonly(rAccessibilityOptions.IsSelectionInReadonly());
2483  }
2484 }
2485 
2487 {
2488  return mpShellRes;
2489 }
2490 
2491 void SwViewShell::SetCareDialog(const std::shared_ptr<weld::Window>& rNew)
2492 {
2493  (*mpCareDialog.get()) = rNew;
2494 }
2495 
2496 sal_uInt16 SwViewShell::GetPageCount() const
2497 {
2498  return GetLayout() ? GetLayout()->GetPageNum() : 1;
2499 }
2500 
2501 Size SwViewShell::GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const
2502 {
2503  Size aSize;
2504  const SwRootFrame* pTmpRoot = GetLayout();
2505  if( pTmpRoot && nPageNum )
2506  {
2507  const SwPageFrame* pPage = static_cast<const SwPageFrame*>
2508  (pTmpRoot->Lower());
2509 
2510  while( --nPageNum && pPage->GetNext() )
2511  pPage = static_cast<const SwPageFrame*>( pPage->GetNext() );
2512 
2513  if( !bSkipEmptyPages && pPage->IsEmptyPage() && pPage->GetNext() )
2514  pPage = static_cast<const SwPageFrame*>( pPage->GetNext() );
2515 
2516  aSize = pPage->getFrameArea().SSize();
2517  }
2518  return aSize;
2519 }
2520 
2521 // #i12836# enhanced pdf export
2522 sal_Int32 SwViewShell::GetPageNumAndSetOffsetForPDF( OutputDevice& rOut, const SwRect& rRect ) const
2523 {
2524  OSL_ENSURE( GetLayout(), "GetPageNumAndSetOffsetForPDF assumes presence of layout" );
2525 
2526  sal_Int32 nRet = -1;
2527 
2528  // #i40059# Position out of bounds:
2529  SwRect aRect( rRect );
2530  aRect.Pos().setX( std::max( aRect.Left(), GetLayout()->getFrameArea().Left() ) );
2531 
2532  const SwPageFrame* pPage = GetLayout()->GetPageAtPos( aRect.Center() );
2533  if ( pPage )
2534  {
2535  OSL_ENSURE( pPage, "GetPageNumAndSetOffsetForPDF: No page found" );
2536 
2537  Point aOffset( pPage->getFrameArea().Pos() );
2538  aOffset.setX( -aOffset.X() );
2539  aOffset.setY( -aOffset.Y() );
2540 
2541  MapMode aMapMode( rOut.GetMapMode() );
2542  aMapMode.SetOrigin( aOffset );
2543  rOut.SetMapMode( aMapMode );
2544 
2545  nRet = pPage->GetPhyPageNum() - 1;
2546  }
2547 
2548  return nRet;
2549 }
2550 
2551 // --> PB 2007-05-30 #146850#
2552 const BitmapEx& SwViewShell::GetReplacementBitmap( bool bIsErrorState )
2553 {
2554  if (bIsErrorState)
2555  {
2556  if (!m_xErrorBmp)
2557  m_xErrorBmp.reset(new BitmapEx(RID_GRAPHIC_ERRORBMP));
2558  return *m_xErrorBmp;
2559  }
2560 
2561  if (!m_xReplaceBmp)
2562  m_xReplaceBmp.reset(new BitmapEx(RID_GRAPHIC_REPLACEBMP));
2563  return *m_xReplaceBmp;
2564 }
2565 
2567 {
2568  m_xErrorBmp.reset();
2569  m_xReplaceBmp.reset();
2570 }
2571 
2573 {
2574  SwView* pView = GetDoc()->GetDocShell() ? GetDoc()->GetDocShell()->GetView() : nullptr;
2575  if ( pView )
2576  return pView->GetPostItMgr();
2577 
2578  return nullptr;
2579 }
2580 
2581 /*
2582  * Document Interface Access
2583  */
2584 const IDocumentSettingAccess& SwViewShell::getIDocumentSettingAccess() const { return mxDoc->GetDocumentSettingManager(); }
2585 IDocumentSettingAccess& SwViewShell::getIDocumentSettingAccess() { return mxDoc->GetDocumentSettingManager(); }
2586 const IDocumentDeviceAccess& SwViewShell::getIDocumentDeviceAccess() const { return mxDoc->getIDocumentDeviceAccess(); }
2587 IDocumentDeviceAccess& SwViewShell::getIDocumentDeviceAccess() { return mxDoc->getIDocumentDeviceAccess(); }
2588 const IDocumentMarkAccess* SwViewShell::getIDocumentMarkAccess() const { return mxDoc->getIDocumentMarkAccess(); }
2589 IDocumentMarkAccess* SwViewShell::getIDocumentMarkAccess() { return mxDoc->getIDocumentMarkAccess(); }
2590 const IDocumentDrawModelAccess& SwViewShell::getIDocumentDrawModelAccess() const { return mxDoc->getIDocumentDrawModelAccess(); }
2591 IDocumentDrawModelAccess& SwViewShell::getIDocumentDrawModelAccess() { return mxDoc->getIDocumentDrawModelAccess(); }
2592 const IDocumentRedlineAccess& SwViewShell::getIDocumentRedlineAccess() const { return mxDoc->getIDocumentRedlineAccess(); }
2593 IDocumentRedlineAccess& SwViewShell::getIDocumentRedlineAccess() { return mxDoc->getIDocumentRedlineAccess(); }
2594 const IDocumentLayoutAccess& SwViewShell::getIDocumentLayoutAccess() const { return mxDoc->getIDocumentLayoutAccess(); }
2595 IDocumentLayoutAccess& SwViewShell::getIDocumentLayoutAccess() { return mxDoc->getIDocumentLayoutAccess(); }
2596 IDocumentContentOperations& SwViewShell::getIDocumentContentOperations() { return mxDoc->getIDocumentContentOperations(); }
2597 IDocumentStylePoolAccess& SwViewShell::getIDocumentStylePoolAccess() { return mxDoc->getIDocumentStylePoolAccess(); }
2598 const IDocumentStatistics& SwViewShell::getIDocumentStatistics() const { return mxDoc->getIDocumentStatistics(); }
2599 
2601 { return mxDoc->GetIDocumentUndoRedo(); }
2603 { return mxDoc->GetIDocumentUndoRedo(); }
2604 
2605 // --> OD 2007-11-14 #i83479#
2607 {
2608  return &mxDoc->getIDocumentListItems();
2609 }
2610 
2612 {
2613  return &mxDoc->getIDocumentOutlineNodes();
2614 }
2615 
2616 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::shared_ptr< SfxDialogController > & GetController()
vcl::RenderContext * GetOut() const
Definition: viewsh.hxx:338
void SetClipRegion()
SfxViewFrame * GetViewFrame() const
OUString GetNumStr(sal_Int32 nNo) const
long Width() const
VclPtr< OutputDevice > mpPrePostOutDev
Definition: viewsh.hxx:221
bool mbInEndAction
Definition: viewsh.hxx:127
void setOutputToWindow(bool bOutputToWindow)
Definition: viewsh.cxx:126
Base class of the Writer layout elements.
Definition: frame.hxx:297
std::stack< vcl::Region > mPrePostPaintRegions
Definition: viewsh.hxx:220
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:151
void FireAccessibleEvents()
Fire all accessible events that have been collected so far.
Definition: viewimp.cxx:451
long GetWidth() const
void DelRegion()
Definition: viewimp.cxx:116
void SetAddExtLeading(bool bNew)
Definition: viewsh.cxx:791
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: viewsh.cxx:136
void EnablePaint(bool bEnable)
void SetMsWordCompTrailingBlanks(bool _bMsWordCompTrailingBlanks)
Definition: viewsh.cxx:910
SdrPreRenderDevice * GetPreRenderDevice() const
MapMode maPrePostMapMode
Definition: viewsh.hxx:222
virtual void ApplyViewOptions(const SwViewOption &rOpt)
Definition: viewsh.cxx:2112
static void notifyDocumentSizeChanged(SfxViewShell const *pThisView, const OString &rPayload, vcl::ITiledRenderable *pDoc, bool bInvalidateAll=true)
virtual void DeleteWindowFromPaintView(OutputDevice *pOldWin) override
SfxChildWindow * GetChildWindow(sal_uInt16)
const SwNodes & GetNodes() const
Definition: viewsh.cxx:2088
const SwRect & GetOrigin() const
Definition: swregion.hxx:47
void ImplEndAction(const bool bIdleEnd)
Definition: viewsh.cxx:239
SdrView * GetDrawView()
Definition: vnew.cxx:375
const SwPageFrame * GetPageAtPos(const Point &rPt, const Size *pSize=nullptr, bool bExtend=false) const
Point rPt: The point that should be used to find the page Size pSize: If given, we return the (first)...
Definition: findfrm.cxx:572
bool HasCharts() const
Definition: viewsh.cxx:666
SwRect & Union(const SwRect &rRect)
Definition: swrect.cxx:41
void SetGridFine(const Size &rSiz)
void EndDrawLayers(SdrPaintWindow &rPaintWindow, bool bPaintFormLayer)
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
Definition: ndole.hxx:161
void SetZoom(sal_uInt16 n)
Definition: viewopt.hxx:488
long AdjustWidth(long n)
const IDocumentStatistics & getIDocumentStatistics() const
Provides access to the document statistics interface.
Definition: viewsh.cxx:2598
SwViewShellImp * Imp()
Definition: viewsh.hxx:182
void SetDoNotJustifyLinesWithManualBreak(bool _bDoNotJustifyLinesWithManualBreak)
Definition: viewsh.cxx:892
static void CheckPageDescs(SwPageFrame *pStart, bool bNotifyFields=true, SwPageFrame **ppPrev=nullptr)
Check all pages (starting from the given one) if they use the appropriate frame format.
Definition: pagechg.cxx:1003
static ShellResource * GetShellRes()
Definition: viewsh.cxx:2486
void SetParaSpaceMaxAtPages(bool bNew)
Definition: viewsh.cxx:767
void SetAddParaSpacingToTableCells(bool _bAddParaSpacingToTableCells)
Sets if paragraph and table spacing is added at bottom of table cells.
Definition: viewsh.cxx:822
SwDocShell * GetDocShell()
Definition: doc.hxx:1348
virtual void CalcLayout()
Definition: viewsh.cxx:973
void InvalidateAllContent(SwInvalidateFlags nInvalidate)
Invalidate all Content, Size or PrtArea.
Definition: wsfrm.cxx:4104
void Compress()
Definition: swregion.cxx:145
IDocumentDeviceAccess const & getIDocumentDeviceAccess() const
Definition: doc.cxx:238
void InvalidateAccessibleParaAttrs(const SwTextFrame &rTextFrame)
invalidate attributes for paragraphs and paragraph's characters
Definition: viewsh.cxx:2448
static bool IsInPaint()
Definition: rootfrm.hxx:361
long Height() const
virtual void UpdatePageFields(SfxPoolItem *)=0
SAL_DLLPRIVATE void ImplApplyViewOptions(const SwViewOption &rOpt)
Definition: viewsh.cxx:2145
void InvalidateAccessibleParaAttrs_(const SwTextFrame &rTextFrame)
invalidate attributes for paragraphs and paragraph's characters
Definition: viewimp.cxx:417
const IDocumentOutlineNodes * getIDocumentOutlineNodesAccess() const
Definition: viewsh.cxx:2611
static void SetNoVirDev(const bool bNew)
Definition: rootfrm.hxx:363
virtual void SetModified()=0
Must be called manually at changes of format.
sal_uIntPtr sal_uLong
void disposeAndClear()
Provides numbered items of a document.
bool IsPostIts() const
Definition: viewopt.hxx:271
const OUString & GetChartTableName() const
Definition: ndole.hxx:152
bool IsMapModeEnabled() const
SwAccessibleMap & GetAccessibleMap()
Definition: viewimp.hxx:269
Provides access to the marks of a document.
void InvalidateSize_()
Definition: frame.hxx:751
bool mbShowFooterSeparator
Flag to say that we are showing the footer control.
Definition: viewsh.hxx:135
void Height(long nNew)
Definition: swrect.hxx:191
VclPtr< OutputDevice > mpOut
Window, Printer, VirtDev, ...
Definition: viewsh.hxx:115
virtual void setReferenceDeviceType(bool bNewVirtual, bool bNewHiRes)=0
Sets the type of the reference device used for formatting the document.
sal_Int16 nId
VclPtr< vcl::Window > mpWin
= 0 during printing or pdf export
Definition: viewsh.hxx:114
bool HasDrawView() const
Definition: vnew.cxx:360
const SwPageFrame & GetFormatPage() const
Definition: pagechg.cxx:2414
bool SmoothScroll(long lXDiff, long lYDiff, const tools::Rectangle *)
Definition: viewsh.cxx:1244
const MapMode & GetMapMode() const
SwRect m_aSmoothRect
Definition: viewimp.hxx:83
const IDocumentSettingAccess & getIDocumentSettingAccess() const
Provides access to the document setting interface.
Definition: viewsh.cxx:2584
void UpdateAllCharts()
update all charts for which any table exists
Definition: viewsh.cxx:659
sw::sidebarwindows::SidebarPosition SidebarPosition() const
asks the page on which side a margin should be shown, e.g for notes returns true for left side...
Definition: pagechg.cxx:1373
void PaintTile(VirtualDevice &rDevice, int contextWidth, int contextHeight, int tilePosX, int tilePosY, long tileWidth, long tileHeight)
Paint tile.
Definition: viewsh.cxx:1893
SwNode & GetNode() const
Definition: ndindex.hxx:119
long SwTwips
Definition: swtypes.hxx:49
void SetSnapGridWidth(const Fraction &rX, const Fraction &rY)
std::unique_ptr< BitmapEx > m_xErrorBmp
error display of missed images
Definition: viewsh.hxx:98
void EndProgress(SwDocShell const *pDocShell)
Definition: mainwn.cxx:92
virtual void VisPortChgd(const SwRect &)
Definition: viewsh.cxx:1073
void PageNumNotify(SwViewShell const *pVwSh, sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUString &rPgStr)
Definition: edtwin3.cxx:67
bool mbOutputToWindow
The virtual device we paint to will end up on the screen.
Definition: viewsh.hxx:178
void Pos(const Point &rNew)
Definition: swrect.hxx:169
void VisAreaChanged(const OutputDevice *pOut)
void EnableMapMode(bool bEnable=true)
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
SfxViewShell * GetSfxViewShell() const
Definition: viewsh.hxx:441
virtual void PaintSwFrame(vcl::RenderContext &rRenderContext, SwRect const &, SwPrintData const *const pPrintData=nullptr) const override
Paint once for every visible page which is touched by Rect.
Definition: paintfrm.cxx:2936
void setTiledPainting(bool bTiledPainting)
void SetRestoreActions(sal_uInt16 nSet)
Definition: viewsh.cxx:2367
bool IsShowHiddenPara() const
Definition: viewopt.hxx:379
void UISizeNotify()
Definition: viewsh.cxx:2355
unsigned long GetSidebarBorderWidth(bool bPx=false) const
Definition: PostItMgr.cxx:2081
void SetGridCoarse(const Size &rSiz)
void PaintImmediately()
bool HasWriterListeners() const
Definition: calbck.hxx:208
void SizeNotify(SwViewShell const *pVwSh, const Size &rSize)
Definition: edtwin3.cxx:56
The root element of a Writer document layout.
Definition: rootfrm.hxx:80
long AdjustHeight(long n)
For old documents the Field-Which IDs must be preserved !!!
void SetMapMode()
sal_Int32 GetBrowseWidth() const
Definition: viewsh.cxx:1999
sal_uInt16 GetRestoreActions() const
Definition: viewsh.cxx:2372
static void lcl_InvalidateAllObjPos(SwViewShell &_rSh)
local method to invalidate/re-calculate positions of floating screen objects (Writer fly frame and dr...
Definition: viewsh.cxx:737
void SetCalcLayout(bool bNew)
Definition: layact.hxx:147
virtual void SetReadonlyOption(bool bSet)
Definition: viewsh.cxx:2302
void PaintTransparentChildren(vcl::Window const &rWindow, tools::Rectangle const &rPixelRect)
const SwPageFrame * GetFirstVisPage(OutputDevice const *pRenderContext) const
Management of the first visible Page.
Definition: viewimp.cxx:270
std::vector< tools::Rectangle > RectangleVector
void CheckViewLayout(const SwViewOption *pViewOpt, const SwRect *pVisArea)
Definition: pagechg.cxx:2072
sal_uInt16 GetPhyPageNum() const
Definition: pagefrm.hxx:191
virtual void LockExpFields()=0
IDocumentContentOperations & getIDocumentContentOperations()
Provides access to the content operations interface.
Definition: viewsh.cxx:2596
virtual void UpdateExpFields(SwTextField *pField, bool bUpdateRefFields)=0
bool AddPaintRect(const SwRect &rRect)
Definition: viewsh.cxx:525
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:357
void SetGridSnap(bool bOn)
void SetUseFormerTextWrapping(bool _bUseFormerTextWrapping)
Definition: viewsh.cxx:879
virtual void set(DocumentSettingId id, bool value)=0
Set the specified document setting.
bool IsFieldName() const
Definition: viewopt.hxx:267
sal_uInt16 mnLockPaint
!= 0 if Paint is locked.
Definition: viewsh.hxx:174
wrapper class for the positioning of Writer fly frames and drawing objects
long Right() const
void Top(const long nTop)
Definition: swrect.hxx:204
void StartProgress(const char *pMessResId, long nStartValue, long nEndValue, SwDocShell *pDocShell)
Definition: mainwn.cxx:52
SwAccessibleMap * GetAccessibleMap()
Definition: viewsh.cxx:2456
short GetDivisionX() const
Definition: viewopt.hxx:426
rtl::Reference< SwDoc > mxDoc
The document; never 0.
Definition: viewsh.hxx:171
bool GetIsForPagePreviews() const
void ReformatAllTextObjects()
const SwRect & getFrameArea() const
Definition: frame.hxx:177
bool IsGridVisible() const
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
bool getBrowseMode() const
Definition: viewopt.hxx:454
OutputDevice & GetTargetOutputDevice()
bool IsEmptyPage() const
Definition: pagefrm.hxx:144
short GetDivisionY() const
Definition: viewopt.hxx:428
void PrePaint()
Definition: viewsh.cxx:163
void InvalidateLayout(bool bSizeChanged)
Definition: viewsh.cxx:2013
css::uno::Reference< css::accessibility::XAccessible > GetDocumentPreview(const std::vector< std::unique_ptr< PreviewPage >> &_rPreviewPages, const Fraction &_rScale, const SwPageFrame *_pSelectedPageFrame, const Size &_rPreviewWinSize)
Definition: accmap.cxx:1847
void SetRestoreActions(sal_uInt16 nSet)
Definition: viewimp.hxx:207
static bool IsFuzzing()
Size maBrowseBorder
Definition: viewsh.hxx:106
void SetEmptyDbFieldHidesPara(bool bEmptyDbFieldHidesPara)
Definition: viewsh.cxx:928
static void lcl_PaintTransparentFormControls(SwViewShell const &rShell, SwRect const &rRect)
Definition: viewsh.cxx:143
SwRect maVisArea
The modern version of VisArea.
Definition: viewsh.hxx:169
void Invert()
invert current rectangle
Definition: swregion.cxx:122
void Flush()
Definition: fntcache.cxx:161
bool m_bStopSmooth
Definition: viewimp.hxx:80
void Action(OutputDevice *pRenderContext)
Definition: layact.cxx:320
void SetUIOptions(const SwViewOption &rOpt)
Definition: viewsh.cxx:2291
void ApplyAccessibilityOptions(SvtAccessibilityOptions const &rAccessibilityOptions)
Definition: viewsh.cxx:2466
SwInvalidateFlags
Definition: rootfrm.hxx:51
void UnlockPaint()
Definition: vdraw.cxx:82
bool mbHeaderFooterEdit
Flag to say that we are editing header or footer (according to the bShow(Header|Footer)Separator abov...
Definition: viewsh.hxx:136
IDocumentStylePoolAccess & getIDocumentStylePoolAccess()
Provides access to the document style pool interface.
Definition: viewsh.cxx:2597
SwDoc * GetDoc() const
Definition: viewsh.hxx:281
long Top() const
const IDocumentMarkAccess * getIDocumentMarkAccess() const
Provides access to the document bookmark interface.
Definition: viewsh.cxx:2588
void Right(const long nRight)
Definition: swrect.hxx:200
static Color & GetAppBackgroundColor()
Definition: viewopt.cxx:375
void unpatchPaintWindow(SdrPaintWindow *pPreviousPaintWindow)
virtual bool get_visible() const =0
const IDocumentDrawModelAccess & getIDocumentDrawModelAccess() const
Provides access to the document draw model interface.
Definition: viewsh.cxx:2590
const IDocumentRedlineAccess & getIDocumentRedlineAccess() const
Provides access to the document redline interface.
Definition: viewsh.cxx:2592
SwPagePreviewLayout * PagePreviewLayout()
Definition: viewpg.cxx:32
void PrepareFooter()
Creates or removes footer.
Definition: hffrm.cxx:723
bool IsEmpty() const
Definition: swrect.hxx:292
void SetBrowseBorder(const Size &rNew)
Definition: viewsh.cxx:1984
void ResetInvalidRect()
Definition: viewsh.hxx:584
static weld::Window * GetCareDialog(SwViewShell const &rVSh)
Definition: viewsh.hxx:438
void DrawRect(const tools::Rectangle &rRect)
bool IsDummyPage(sal_uInt16 nPageNum) const
Definition: viewsh.cxx:629
void SetPDFExportOption(bool bSet)
Definition: viewsh.cxx:2332
virtual void ModifyNotification(const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue)
Definition: calbck.hxx:154
bool GetIsAllowAnimatedGraphics() const
vcl::RenderContext & GetRefDev() const
Definition: viewsh.cxx:2075
void MakeVisible(const SwRect &)
Definition: viewsh.cxx:567
void PaintTile(OutputDevice &rRenderContext)
Definition: PostItMgr.cxx:972
SAL_DLLPRIVATE void PaintDesktop(vcl::RenderContext &rRenderContext, const SwRect &)
Definition: viewsh.cxx:1477
sal_uInt16 GetVirtPageNum() const
Definition: trvlfrm.cxx:1805
SAL_DLLPRIVATE bool CheckInvalidForPaint(const SwRect &)
Definition: viewsh.cxx:1610
void SetStatBar(bool bNew)
Definition: layact.cxx:90
bool IsInvalidFly() const
Definition: pagefrm.hxx:430
bool CalcRects()
Definition: PostItMgr.cxx:526
void SizeChgNotify()
Definition: viewsh.cxx:1034
struct _xmlTextWriter * xmlTextWriterPtr
Try to prevent visible SwParaPortions from being deleted.
Definition: swcache.hxx:121
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
Definition: viewsh.cxx:2586
const SfxItemPool & GetAttrPool() const
Definition: viewsh.hxx:611
void SetLineColor()
bool IsCrossHair() const
Definition: viewopt.hxx:367
SdrPaintWindow * BeginDrawLayers(OutputDevice *pOut, const vcl::Region &rReg, bool bDisableIntersect=false)
#define SAL_MAX_INT32
SfxViewShell * mpSfxViewShell
Definition: viewsh.hxx:109
void Reset()
Definition: layact.cxx:282
css::uno::Reference< css::accessibility::XAccessible > GetDocumentView()
Definition: accmap.cxx:1842
sal_uInt16 GetPageCount() const
Definition: viewsh.cxx:2496
bool ContainsHiddenChars() const
Checks if any of the text node contains hidden characters.
Definition: doc.cxx:1767
const SwSortedObjs * GetSortedObjs() const
Definition: pagefrm.hxx:119
int i
void UpdateFields(bool bCloseDB=false)
Forces update of each field.
Definition: viewsh.cxx:640
const SwRect & VisArea() const
Definition: viewsh.cxx:560
SdrPaintWindow * patchPaintWindow(SdrPaintWindow &rPaintWindow)
virtual void DrawSelChanged()
Definition: viewsh.cxx:2093
The usage of LayAction is always the same:
Definition: layact.hxx:56
bool IsViewLayoutBookMode() const
Definition: viewopt.hxx:461
void RepaintPagePreview(SwViewShell const *pVwSh, const SwRect &rRect)
Definition: edtwin3.cxx:110
bool mbShowHeaderSeparator
Flag to say that we are showing the header control.
Definition: viewsh.hxx:134
Document statistics information.
SwRect GetBoundRect(OutputDevice const *pOutputDevice) const
Definition: paintfrm.cxx:6105
virtual void SetShowHeaderFooterSeparator(FrameControlType eControl, bool bShow)
Definition: viewsh.cxx:93
SwPageFrame * FindPageFrame()
Definition: frame.hxx:660
static bool bInSizeNotify
Definition: viewsh.cxx:88
void AddWidth(const long nAdd)
Definition: swrect.cxx:160
bool IsDummyPage(sal_uInt16 nPageNum) const
Definition: trvlfrm.cxx:1612
void LayoutIdle()
Definition: viewsh.cxx:684
void InvalidateAccessibleFocus()
Definition: viewsh.cxx:2416
bool SetOutputSizePixel(const Size &rNewSize, bool bErase=true)
const SwFrame * Lower() const
Definition: layfrm.hxx:101
bool ActionPend() const
Definition: viewsh.hxx:196
std::unique_ptr< SwAccessibilityOptions > mpAccOptions
Definition: viewsh.hxx:118
Size GetDocSize() const
Definition: viewsh.cxx:2097
SwPageDesc * GetPageDesc()
Definition: pagefrm.hxx:130
void Reformat()
Invalidates complete Layout (ApplyViewOption).
Definition: viewsh.cxx:948
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
bool IsPreview() const
Definition: viewsh.hxx:488
void SetOrigin(const Point &rOrigin)
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:337
bool SetOutputSize(const Size &rNewSize)
void SetReadonlySelectionOption(bool bSet)
Definition: viewsh.cxx:2342
void StartAction()
Definition: vdraw.cxx:49
SAL_DLLPRIVATE void PaintDesktop_(const SwRegionRects &rRegion)
Definition: viewsh.cxx:1559
void StartAction()
Definition: viewsh.hxx:589
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
bool HasArea() const
Definition: swrect.hxx:288
void SetFillColor()
css::uno::Reference< css::accessibility::XAccessible > CreateAccessiblePreview()
Definition: viewsh.cxx:2396
const Color & GetLineColor() const
void ImplStartAction()
Definition: viewsh.cxx:455
void DeleteReplacementBitmaps()
Definition: viewsh.cxx:2566
void UpdateAllCharts()
Definition: doc.hxx:1289
virtual css::uno::Reference< css::frame::XModel > GetCurrentDocument() const
IDocumentState const & getIDocumentState() const
Definition: doc.cxx:394
Provides access to settings of a document.
bool IsExpFields() const
Definition: layact.hxx:162
void DLPostPaint2(bool bPaintFormLayer)
Definition: viewsh.cxx:211
void Validate()
Marks a node in the document model.
Definition: ndindex.hxx:31
void LockPaint()
Definition: viewsh.hxx:601
static weld::Window * CareChildWin(SwViewShell const &rVSh)
Definition: viewsh.cxx:597
bool IsExtraData(const SwDoc *pDoc)
Definition: frmtool.cxx:3772
bool isOutputToWindow() const
Definition: viewsh.cxx:131
ring_container GetRingContainer()
bool IsOnlineSpell() const
Definition: viewopt.hxx:353
Text operation/manipulation interface.
void ChgNumberDigits()
Definition: viewsh.cxx:965
void SSize(const Size &rNew)
Definition: swrect.hxx:178
void PrepareHeader()
Make this public, so that the SwViewShell can access it when switching from browse mode Add/remove he...
Definition: hffrm.cxx:682
virtual sal_uInt16 GetBitCount() const
SwStartNode * GetStartNode()
Definition: node.hxx:591
void SetActualWin(const OutputDevice *pWin)
SwFntCache * pFntCache
Definition: fntcache.cxx:64
A page of the document layout.
Definition: pagefrm.hxx:41
const IDocumentLayoutAccess & getIDocumentLayoutAccess() const
Provides access to the document layout interface.
Definition: viewsh.cxx:2594
bool mbPaintInProgress
Definition: viewsh.hxx:124
void InvalidateWindows(const SwRect &rRect)
Definition: viewsh.cxx:541
const long LONG_MAX
const OUString & GetSymbolFont() const
Definition: viewopt.hxx:557
void SetFieldName(bool b)
Definition: viewopt.hxx:268
void InvalidateAllObjPos()
Invalidate/re-calculate the position of all floating screen objects (Writer fly frames and drawing ob...
Definition: wsfrm.cxx:4151
Point Center() const
Definition: swrect.cxx:35
void EndAction()
Definition: vdraw.cxx:59
static ShellResource * mpShellRes
Resources for the Shell.
Definition: viewsh.hxx:166
void InvalidateSize()
Definition: frame.hxx:1007
bool m_bSmoothUpdate
Definition: viewimp.hxx:79
Size GetPageSize(sal_uInt16 nPageNum, bool bSkipEmptyPages) const
Definition: viewsh.cxx:2501
void InvalidateFocus()
Definition: accmap.cxx:2773
void EndAction(const bool bIdleEnd=false)
Definition: viewsh.hxx:594
void LayoutPostIts()
Definition: PostItMgr.cxx:681
Point PixelToLogic(const Point &rDevicePt) const
Point LogicToPixel(const Point &rLogicPt) const
void InvalidateAccessibleParaFlowRelation(const SwTextFrame *_pFromTextFrame, const SwTextFrame *_pToTextFrame)
invalidate CONTENT_FLOWS_FROM/_TO relation for paragraphs
Definition: viewsh.cxx:2425
bool IsHideWhitespaceMode() const
Definition: viewopt.hxx:465
void SetConsiderWrapOnObjPos(bool _bConsiderWrapOnObjPos)
Definition: viewsh.cxx:868
Provides access to the formatting devices of a document.
static bool mbLstAct
Definition: viewsh.hxx:100
void UpdateAccessible()
Update (this) accessible view.
Definition: viewimp.cxx:285
void UpdateDrawLayersRegion(OutputDevice *pOut, const vcl::Region &rReg)
IDocumentUndoRedo const & GetIDocumentUndoRedo() const
Provides access to the document undo/redo interface.
Definition: viewsh.cxx:2602
void Left(const long nLeft)
Definition: swrect.hxx:195
FrameControlType
Definition: swtypes.hxx:236
sal_uInt16 GetNumPages() const
Definition: viewsh.cxx:622
void Bottom(const long nBottom)
Definition: swrect.hxx:209
virtual void Scroll(long nHorzScroll, long nVertScroll, ScrollFlags nFlags=ScrollFlags::NONE)
static void Add(SwViewShell *pSh, const SwRect &rNew)
Definition: vprint.cxx:83
bool mbDocSizeChgd
Definition: viewsh.hxx:120
SfxInPlaceClient * GetIPClient() const
void MakeDrawView()
Definition: vnew.cxx:365
tools::Rectangle SVRect() const
Definition: swrect.hxx:280
static vcl::DeleteOnDeinit< std::shared_ptr< weld::Window > > mpCareDialog
Avoid this window.
Definition: viewsh.hxx:167
void SetUseFormerLineSpacing(bool _bUseFormerLineSpacing)
Sets if former formatting of text lines with proportional line spacing should used.
Definition: viewsh.cxx:839
static void SetCareDialog(const std::shared_ptr< weld::Window > &rNew)
Definition: viewsh.cxx:2491
void ScrollMDI(SwViewShell const *pVwSh, const SwRect &rRect, sal_uInt16 nRangeX, sal_uInt16 nRangeY)
Definition: edtwin3.cxx:35
SwDrawView * GetDrawView()
Definition: viewimp.hxx:154
void PrePaint()
void SetAddExtLeading(bool bEnabled)
#define SAL_WARN_IF(condition, area, stream)
void CorrectPositions()
Definition: PostItMgr.cxx:1996
void ToggleHeaderFooterEdit()
Acts both for headers / footers, depending on the bShow(Header|Footer)Separator flags.
Definition: viewsh.cxx:105
bool IsBrowseActionStop() const
Definition: layact.hxx:165
sal_uInt16 GetPhyPageNum() const
Definition: trvlfrm.cxx:1694
const IDocumentListItems * getIDocumentListItemsAccess() const
Definition: viewsh.cxx:2606
void InvaPercentLowers(SwTwips nDiff=0)
Invalidates the inner Frames, whose width and/or height are calculated using percentages.
Definition: wsfrm.cxx:3511
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:423
void Width(long nNew)
Definition: swrect.hxx:187
sal_Int32 GetPageNumAndSetOffsetForPDF(OutputDevice &rOut, const SwRect &rRect) const
Definition: viewsh.cxx:2522
void SetUseFormerObjectPositioning(bool _bUseFormerObjPos)
Sets IDocumentSettingAccess if former object positioning should be used.
Definition: viewsh.cxx:856
vcl::Window * GetWin() const
Definition: viewsh.hxx:337
Provides outline nodes of a document.
bool mbPaintWorks
Definition: viewsh.hxx:122
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:254
static void lcl_InvalidateAllContent(SwViewShell &rSh, SwInvalidateFlags nInv)
Definition: viewsh.cxx:717
bool IsStarOneSetting() const
Definition: viewopt.hxx:614
Point GetPagePos(sal_uInt16 nPageNum) const
Definition: viewsh.cxx:617
std::unique_ptr< BitmapEx > m_xReplaceBmp
replaced display of still loaded images
Definition: viewsh.hxx:97
void SetComplete(bool bNew)
Definition: layact.hxx:145
const Size & GetSnapSize() const
Definition: viewopt.hxx:346
VclPtr< OutputDevice > mpBufferedOut
Definition: viewsh.hxx:142
void LockPaint()
Definition: vdraw.cxx:69
bool IsInside(const Point &rPOINT) const
Definition: swrect.cxx:105
void GetRegionRectangles(RectangleVector &rTarget) const
void SetReschedule(bool bNew)
Definition: layact.hxx:148
void SetGridVisible(bool bOn)
bool IsGridSnap() const
static VclPtr< reference_type > Create(Arg &&...arg)
virtual Dialog * getDialog()=0
constexpr TypedWhichId< SwMsgPoolItem > RES_HIDDENPARA_PRINT(176)
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
Definition: viewsh.cxx:1759
const char sDisplay[]
SwPostItMgr * GetPostItMgr()
Definition: view.hxx:621
sal_uInt16 GetZoom() const
Definition: viewopt.hxx:487
void SetUseVirDev(bool bNew)
Definition: viewsh.cxx:806
const Size & GetBrowseBorder() const
Definition: viewsh.cxx:1994
bool IsUseHeaderFooterMenu() const
Definition: viewopt.hxx:292
void Rescale()
Definition: PostItMgr.cxx:2175
bool HasNotes() const
Definition: PostItMgr.cxx:2050
void DLPrePaint2(const vcl::Region &rRegion)
Definition: viewsh.cxx:172
virtual OutputDevice * getReferenceDevice(bool bCreate) const =0
Returns the current reference device.
virtual void AddWindowToPaintView(OutputDevice *pNewWin, vcl::Window *pWindow) override
bool IsPrtFormat() const
Definition: viewopt.hxx:523
void SetParaSpaceMax(bool bNew)
Definition: viewsh.cxx:755
long Left() const
void ImplUnlockPaint(bool bVirDev)
Definition: viewsh.cxx:468
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
bool IsScrollMDI(SwViewShell const *pVwSh, const SwRect &rRect)
Definition: edtwin3.cxx:45
#define FAR_AWAY
Definition: frmtool.hxx:52
static SfxProgress * GetActiveProgress(SfxObjectShell const *pDocSh=nullptr)
bool IsSelectionInReadonly() const
const SwPostItMgr * GetPostItMgr() const
Definition: viewsh.hxx:556
void InvalidateAccessibleParaTextSelection()
invalidate text selection for paragraphs
Definition: viewsh.cxx:2437
void InvalidateAccessibleParaFlowRelation_(const SwTextFrame *_pFromTextFrame, const SwTextFrame *_pToTextFrame)
invalidate CONTENT_FLOWS_FROM/_TO relation for paragraphs
Definition: viewimp.cxx:377
void InvalidateAccessibleEditableState(bool bAllShells, const SwFrame *pFrame=nullptr)
Invalidate editable state for all accessible frames.
Definition: viewimp.cxx:348
unsigned long GetSidebarWidth(bool bPx=false) const
Definition: PostItMgr.cxx:2055
bool IsGridVisible() const
Definition: viewopt.hxx:348
SwRootFramePtr mpLayout
Definition: viewsh.hxx:144
void SetPaint(bool bNew)
Definition: layact.hxx:144
SwDocPosUpdate is sent to signal that only the frames from or to a specified document-global position...
Definition: hints.hxx:183
VirtualDevice * get() const
Provides access to the layout of a document.
void SetLeft(long v)
void InvalidatePrt_()
Definition: frame.hxx:759
void SetSubtractFlysAnchoredAtFlys(bool bSubtractFlysAnchoredAtFlys)
Definition: viewsh.cxx:922
Access to the style pool.
bool mbEnableSmooth
Definition: viewsh.hxx:130
void SetPrtFormatOption(bool bSet)
Definition: viewsh.cxx:2350
SdrPaintWindow * mpTargetPaintWindow
Definition: viewsh.hxx:141
bool IsEndActionByVirDev() const
Definition: viewsh.hxx:200
bool GetIsAutomaticFontColor() const
const SwView * GetView() const
Definition: docsh.hxx:220
SwRegionRects * GetRegion()
Definition: viewimp.hxx:149
Left
bool IsShowHiddenChar(bool bHard=false) const
Definition: viewopt.hxx:303
bool IsNewLayout() const
Definition: rootfrm.hxx:368
bool AddPaintRect(const SwRect &rRect)
Definition: viewimp.cxx:121
void SetDragStripes(bool bOn)
SwRect maInvalidRect
Definition: viewsh.hxx:107
Point GetPagePos(sal_uInt16 nPageNum) const
Returns the absolute document position of the desired page.
Definition: trvlfrm.cxx:1573
bool IsShowHiddenField() const
Definition: viewopt.hxx:310
bool IsInvalid() const
Definition: pagefrm.hxx:426
void SetFirstVisPageInvalid()
Definition: viewsh.cxx:1025
virtual void UnlockExpFields()=0
sal_uInt16 GetRestoreActions() const
Definition: viewimp.hxx:208
bool IsDragStripes() const
virtual void UpdateFields(bool bCloseDB)=0
bool ShowNotes() const
Definition: PostItMgr.cxx:2044
bool IsShowHeaderFooterSeparator(FrameControlType eControl)
Definition: viewsh.hxx:563
std::unique_ptr< SwViewOption > mpOpt
Definition: viewsh.hxx:117
bool IsOver(const SwRect &rRect) const
Definition: swrect.cxx:123
void SetProtectForm(bool _bProtectForm)
Definition: viewsh.cxx:904
bool IsSnap() const
Definition: viewopt.hxx:340
#define DOCUMENTBORDER
Definition: swtypes.hxx:82
bool IsWhitespaceHidden() const
Definition: viewopt.hxx:470
const BitmapEx & GetReplacementBitmap(bool bIsErrorState)
Definition: viewsh.cxx:2552
SwRootFrame * GetLayout() const
Definition: viewsh.cxx:2070
void Push(PushFlags nFlags=PushFlags::ALL)
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:205
void SetTabCompat(bool bNew)
Definition: viewsh.cxx:779
void SetMarkHdlSizePixel(sal_uInt16 nSiz)
void setWidth(long nWidth)
bool HasDrawViewDrag() const
Definition: vnew.cxx:370
sal_uInt16 GetPageNum() const
Definition: rootfrm.hxx:308
sal_uInt16 GetViewLayoutColumns() const
Definition: viewopt.hxx:463
sal_uInt16 mnStartAction
!= 0 if at least one Action is active.
Definition: viewsh.hxx:173
bool IsViewLocked() const
Definition: viewsh.hxx:461
SAL_DLLPRIVATE void DrawOutDev(const Point &, const Size &, const Point &, const Size &, const Printer &)=delete
Definition: view.hxx:144
void ImplLockPaint()
Definition: viewsh.cxx:461
const Color & GetFillColor() const
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1315
void UnlockPaint(bool bVirDev=false)
Definition: viewsh.hxx:606
css::uno::Reference< css::accessibility::XAccessible > CreateAccessible()
Definition: viewsh.cxx:2382
bool IsNewLayout() const
Definition: viewsh.cxx:2377
SwFrame * GetNext()
Definition: frame.hxx:656
void InvalidateAccessibleParaTextSelection_()
invalidate text selection for paragraphs
Definition: viewimp.cxx:405
const SvxNumberType & GetNumType() const
Definition: pagedesc.hxx:193