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