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