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