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