LibreOffice Module sw (master)  1
notxtfrm.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 <hintids.hxx>
21 #include <tools/urlobj.hxx>
22 #include <vcl/imapobj.hxx>
23 #include <vcl/imap.hxx>
24 #include <svl/urihelper.hxx>
25 #include <sfx2/progress.hxx>
26 #include <sfx2/printer.hxx>
27 #include <editeng/udlnitem.hxx>
28 #include <editeng/colritem.hxx>
29 #include <editeng/boxitem.hxx>
30 #include <fmturl.hxx>
31 #include <fmtsrnd.hxx>
32 #include <frmfmt.hxx>
33 #include <swrect.hxx>
34 #include <fesh.hxx>
35 #include <doc.hxx>
40 #include <flyfrm.hxx>
41 #include <flyfrms.hxx>
42 #include <frmtool.hxx>
43 #include <viewopt.hxx>
44 #include <viewimp.hxx>
45 #include <pam.hxx>
46 #include <hints.hxx>
47 #include <rootfrm.hxx>
48 #include <dflyobj.hxx>
49 #include <pagefrm.hxx>
50 #include <notxtfrm.hxx>
51 #include <grfatr.hxx>
52 #include <charatr.hxx>
53 #include <ndnotxt.hxx>
54 #include <ndgrf.hxx>
55 #include <ndole.hxx>
56 #include <swregion.hxx>
57 #include <poolfmt.hxx>
58 #include <strings.hrc>
59 #include <accessibilityoptions.hxx>
60 #include <com/sun/star/embed/EmbedMisc.hpp>
61 #include <com/sun/star/embed/EmbedStates.hpp>
62 #include <com/sun/star/embed/XEmbeddedObject.hpp>
63 #include <svtools/embedhlp.hxx>
64 #include <dview.hxx>
71 #include <txtfly.hxx>
75 
76 // MM02 needed for VOC mechanism and getting the OC - may be moved to an own file
77 #include <svx/sdrpagewindow.hxx>
78 #include <svx/svdpagv.hxx>
83 
84 using namespace com::sun::star;
85 
86 static bool GetRealURL( const SwGrfNode& rNd, OUString& rText )
87 {
88  bool bRet = rNd.GetFileFilterNms( &rText, nullptr );
89  if( bRet )
92  if (rText.startsWith("data:image")) rText = "inline image";
93 
94  return bRet;
95 }
96 
97 static void lcl_PaintReplacement( const SwRect &rRect, const OUString &rText,
98  const SwViewShell &rSh, const SwNoTextFrame *pFrame,
99  bool bDefect )
100 {
101  static vcl::Font aFont = []()
102  {
103  vcl::Font tmp;
104  tmp.SetWeight( WEIGHT_BOLD );
105  tmp.SetStyleName( OUString() );
106  tmp.SetFamilyName("Arial Unicode");
107  tmp.SetFamily( FAMILY_SWISS );
108  tmp.SetTransparent( true );
109  return tmp;
110  }();
111 
112  Color aCol( COL_RED );
113  FontLineStyle eUnderline = LINESTYLE_NONE;
114  const SwFormatURL &rURL = pFrame->FindFlyFrame()->GetFormat()->GetURL();
115  if( !rURL.GetURL().isEmpty() || rURL.GetMap() )
116  {
117  bool bVisited = false;
118  if ( rURL.GetMap() )
119  {
120  ImageMap *pMap = const_cast<ImageMap*>(rURL.GetMap());
121  for( size_t i = 0; i < pMap->GetIMapObjectCount(); ++i )
122  {
123  IMapObject *pObj = pMap->GetIMapObject( i );
124  if( rSh.GetDoc()->IsVisitedURL( pObj->GetURL() ) )
125  {
126  bVisited = true;
127  break;
128  }
129  }
130  }
131  else if ( !rURL.GetURL().isEmpty() )
132  bVisited = rSh.GetDoc()->IsVisitedURL( rURL.GetURL() );
133 
134  SwFormat *pFormat = rSh.GetDoc()->getIDocumentStylePoolAccess().GetFormatFromPool( o3tl::narrowing<sal_uInt16>
136  aCol = pFormat->GetColor().GetValue();
137  eUnderline = pFormat->GetUnderline().GetLineStyle();
138  }
139 
140  aFont.SetUnderline( eUnderline );
141  aFont.SetColor( aCol );
142 
143  const BitmapEx& rBmp = const_cast<SwViewShell&>(rSh).GetReplacementBitmap(bDefect);
144  Graphic::DrawEx(*rSh.GetOut(), rText, aFont, rBmp, rRect.Pos(), rRect.SSize());
145 }
146 
148 : SwContentFrame( pNode, pSib )
149 {
151 }
152 
154 {
155  return new SwNoTextFrame(this, pSib);
156 }
157 
159 {
160  StopAnimation();
161 
163 }
164 
166 {
167 }
168 
169 void SetOutDev( SwViewShell *pSh, OutputDevice *pOut )
170 {
171  pSh->mpOut = pOut;
172 }
173 
174 static void lcl_ClearArea( const SwFrame &rFrame,
175  vcl::RenderContext &rOut, const SwRect& rPtArea,
176  const SwRect &rGrfArea )
177 {
178  SwRegionRects aRegion( rPtArea, 4 );
179  aRegion -= rGrfArea;
180 
181  if ( aRegion.empty() )
182  return;
183 
184  const SvxBrushItem *pItem;
185  std::optional<Color> xCol;
186  SwRect aOrigRect;
188 
189  if ( rFrame.GetBackgroundBrush( aFillAttributes, pItem, xCol, aOrigRect, false, /*bConsiderTextBox=*/false ) )
190  {
191  SwRegionRects const region(rPtArea);
192  basegfx::utils::B2DClipState aClipState;
193  const bool bDone(::DrawFillAttributes(aFillAttributes, aOrigRect, region, aClipState, rOut));
194 
195  if(!bDone)
196  {
197  for( const auto &rRegion : aRegion )
198  {
199  ::DrawGraphic(pItem, rOut, aOrigRect, rRegion);
200  }
201  }
202  }
203  else
204  {
205  rOut.Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR );
206  rOut.SetFillColor( rFrame.getRootFrame()->GetCurrShell()->Imp()->GetRetoucheColor());
207  rOut.SetLineColor();
208  for( const auto &rRegion : aRegion )
209  rOut.DrawRect( rRegion.SVRect() );
210  rOut.Pop();
211  }
212 }
213 
214 void SwNoTextFrame::PaintSwFrame(vcl::RenderContext& rRenderContext, SwRect const& rRect, SwPrintData const*const) const
215 {
216  if ( getFrameArea().IsEmpty() )
217  return;
218 
219  const SwViewShell* pSh = getRootFrame()->GetCurrShell();
220  if( !pSh->GetViewOptions()->IsGraphic() )
221  {
222  StopAnimation();
223  // #i6467# - no paint of placeholder for page preview
224  if ( pSh->GetWin() && !pSh->IsPreview() )
225  {
226  const SwNoTextNode* pNd = GetNode()->GetNoTextNode();
227  OUString aText( pNd->GetTitle() );
228  if ( aText.isEmpty() && pNd->IsGrfNode() )
229  GetRealURL( *static_cast<const SwGrfNode*>(pNd), aText );
230  if( aText.isEmpty() )
231  aText = FindFlyFrame()->GetFormat()->GetName();
232  lcl_PaintReplacement( getFrameArea(), aText, *pSh, this, false );
233  }
234  return;
235  }
236 
238  // #i9684# Stop animation during printing/pdf export
239  !pSh->GetWin() )
240  StopAnimation();
241 
242  SfxProgress::EnterLock(); // No progress reschedules in paint (SwapIn)
243 
244  rRenderContext.Push();
245  bool bClip = true;
246  tools::PolyPolygon aPoly;
247 
248  SwNoTextNode& rNoTNd = const_cast<SwNoTextNode&>(*static_cast<const SwNoTextNode*>(GetNode()));
249  SwGrfNode* pGrfNd = rNoTNd.GetGrfNode();
250  if( pGrfNd )
251  pGrfNd->SetFrameInPaint( true );
252 
253  // #i13147# - add 2nd parameter with value <true> to
254  // method call <FindFlyFrame().GetContour(..)> to indicate that it is called
255  // for paint in order to avoid load of the intrinsic graphic.
256  if ( ( !rRenderContext.GetConnectMetaFile() ||
257  !pSh->GetWin() ) &&
258  FindFlyFrame()->GetContour( aPoly, true )
259  )
260  {
261  rRenderContext.SetClipRegion(vcl::Region(aPoly));
262  bClip = false;
263  }
264 
265  SwRect aOrigPaint( rRect );
266  if ( HasAnimation() && pSh->GetWin() )
267  {
268  aOrigPaint = getFrameArea(); aOrigPaint += getFramePrintArea().Pos();
269  }
270 
271  SwRect aGrfArea( getFrameArea() );
272  SwRect aPaintArea( aGrfArea );
273 
274  // In case the picture fly frm was clipped, render it with the origin
275  // size instead of scaling it
277  {
278  auto pFindFly = FindFlyFrame();
279  if (pFindFly && pFindFly->IsFlyFreeFrame())
280  {
281  const SwFlyFreeFrame *pFly = static_cast< const SwFlyFreeFrame* >( pFindFly );
282  bool bGetUnclippedFrame=true;
283  const SfxPoolItem* pItem;
284  if( pFly->GetFormat() && SfxItemState::SET == pFly->GetFormat()->GetItemState(RES_BOX, false, &pItem) )
285  {
286  const SvxBoxItem& rBox = *static_cast<const SvxBoxItem*>(pItem);
287  if( rBox.HasBorder( /*bTreatPaddingAsBorder*/true) )
288  bGetUnclippedFrame = false;
289  }
290 
291  if( bGetUnclippedFrame )
292  aGrfArea = SwRect( getFrameArea().Pos( ), pFly->GetUnclippedFrame( ).SSize( ) );
293  }
294  }
295 
296  aPaintArea.Intersection_( aOrigPaint );
297 
299  aNormal.Justify(); // Normalized rectangle for the comparisons
300 
301  if( aPaintArea.Overlaps( aNormal ) )
302  {
303  // Calculate the four to-be-deleted rectangles
304  if( pSh->GetWin() )
305  ::lcl_ClearArea( *this, rRenderContext, aPaintArea, aNormal );
306 
307  // The intersection of the PaintArea and the Bitmap contains the absolutely visible area of the Frame
308  aPaintArea.Intersection_( aNormal );
309 
310  if ( bClip )
311  rRenderContext.IntersectClipRegion( aPaintArea.SVRect() );
313  PaintPicture( &rRenderContext, aGrfArea );
314  }
315  else
316  // If it's not visible, simply delete the given Area
317  lcl_ClearArea( *this, rRenderContext, aPaintArea, SwRect() );
318  if( pGrfNd )
319  pGrfNd->SetFrameInPaint( false );
320 
321  rRenderContext.Pop();
323 }
324 
332 static void lcl_CalcRect( Point& rPt, Size& rDim, MirrorGraph nMirror )
333 {
334  if( nMirror == MirrorGraph::Vertical || nMirror == MirrorGraph::Both )
335  {
336  rPt.setX(rPt.getX() + rDim.Width() -1);
337  rDim.setWidth( -rDim.Width() );
338  }
339 
340  if( nMirror == MirrorGraph::Horizontal || nMirror == MirrorGraph::Both )
341  {
342  rPt.setY(rPt.getY() + rDim.Height() -1);
343  rDim.setHeight( -rDim.Height() );
344  }
345 }
346 
348 void SwNoTextFrame::GetGrfArea( SwRect &rRect, SwRect* pOrigRect ) const
349 {
350  // Currently only used for scaling, cropping and mirroring the contour of graphics!
351  // Everything else is handled by GraphicObject
352  // We put the graphic's visible rectangle into rRect.
353  // pOrigRect contains position and size of the whole graphic.
354 
355  // RotateFlyFrame3: SwFrame may be transformed. Get untransformed
356  // SwRect(s) as base of calculation
357  const TransformableSwFrame* pTransformableSwFrame(getTransformableSwFrame());
358  const SwRect aFrameArea(pTransformableSwFrame ? pTransformableSwFrame->getUntransformedFrameArea() : getFrameArea());
359  const SwRect aFramePrintArea(pTransformableSwFrame ? pTransformableSwFrame->getUntransformedFramePrintArea() : getFramePrintArea());
360 
361  const SwAttrSet& rAttrSet = GetNode()->GetSwAttrSet();
362  const SwCropGrf& rCrop = rAttrSet.GetCropGrf();
363  MirrorGraph nMirror = rAttrSet.GetMirrorGrf().GetValue();
364 
365  if( rAttrSet.GetMirrorGrf().IsGrfToggle() )
366  {
367  if( !(FindPageFrame()->GetVirtPageNum() % 2) )
368  {
369  switch ( nMirror )
370  {
371  case MirrorGraph::Dont: nMirror = MirrorGraph::Vertical; break;
372  case MirrorGraph::Vertical: nMirror = MirrorGraph::Dont; break;
373  case MirrorGraph::Horizontal: nMirror = MirrorGraph::Both; break;
374  default: nMirror = MirrorGraph::Horizontal; break;
375  }
376  }
377  }
378 
379  // We read graphic from the Node, if needed.
380  // It may fail, however.
381  tools::Long nLeftCrop, nRightCrop, nTopCrop, nBottomCrop;
382  Size aOrigSz( static_cast<const SwNoTextNode*>(GetNode())->GetTwipSize() );
383  if ( !aOrigSz.Width() )
384  {
385  aOrigSz.setWidth( aFramePrintArea.Width() );
386  nLeftCrop = -rCrop.GetLeft();
387  nRightCrop = -rCrop.GetRight();
388  }
389  else
390  {
391  nLeftCrop = std::max( aOrigSz.Width() -
392  (rCrop.GetRight() + rCrop.GetLeft()), tools::Long(1) );
393  const double nScale = double(aFramePrintArea.Width()) / double(nLeftCrop);
394  nLeftCrop = tools::Long(nScale * -rCrop.GetLeft() );
395  nRightCrop = tools::Long(nScale * -rCrop.GetRight() );
396  }
397 
398  // crop values have to be mirrored too
399  if( nMirror == MirrorGraph::Vertical || nMirror == MirrorGraph::Both )
400  {
401  tools::Long nTmpCrop = nLeftCrop;
402  nLeftCrop = nRightCrop;
403  nRightCrop= nTmpCrop;
404  }
405 
406  if( !aOrigSz.Height() )
407  {
408  aOrigSz.setHeight( aFramePrintArea.Height() );
409  nTopCrop = -rCrop.GetTop();
410  nBottomCrop= -rCrop.GetBottom();
411  }
412  else
413  {
414  nTopCrop = std::max( aOrigSz.Height() - (rCrop.GetTop() + rCrop.GetBottom()), tools::Long(1) );
415  const double nScale = double(aFramePrintArea.Height()) / double(nTopCrop);
416  nTopCrop = tools::Long(nScale * -rCrop.GetTop() );
417  nBottomCrop= tools::Long(nScale * -rCrop.GetBottom() );
418  }
419 
420  // crop values have to be mirrored too
421  if( nMirror == MirrorGraph::Horizontal || nMirror == MirrorGraph::Both )
422  {
423  tools::Long nTmpCrop = nTopCrop;
424  nTopCrop = nBottomCrop;
425  nBottomCrop= nTmpCrop;
426  }
427 
428  Size aVisSz( aFramePrintArea.SSize() );
429  Size aGrfSz( aVisSz );
430  Point aVisPt( aFrameArea.Pos() + aFramePrintArea.Pos() );
431  Point aGrfPt( aVisPt );
432 
433  // Set the "visible" rectangle first
434  if ( nLeftCrop > 0 )
435  {
436  aVisPt.setX(aVisPt.getX() + nLeftCrop);
437  aVisSz.AdjustWidth( -nLeftCrop );
438  }
439  if ( nTopCrop > 0 )
440  {
441  aVisPt.setY(aVisPt.getY() + nTopCrop);
442  aVisSz.AdjustHeight( -nTopCrop );
443  }
444  if ( nRightCrop > 0 )
445  aVisSz.AdjustWidth( -nRightCrop );
446  if ( nBottomCrop > 0 )
447  aVisSz.AdjustHeight( -nBottomCrop );
448 
449  rRect.Pos ( aVisPt );
450  rRect.SSize( aVisSz );
451 
452  // Calculate the whole graphic if needed
453  if ( !pOrigRect )
454  return;
455 
456  Size aTmpSz( aGrfSz );
457  aGrfPt.setX(aGrfPt.getX() + nLeftCrop);
458  aTmpSz.AdjustWidth( -(nLeftCrop + nRightCrop) );
459  aGrfPt.setY(aGrfPt.getY() + nTopCrop);
460  aTmpSz.AdjustHeight( -(nTopCrop + nBottomCrop) );
461 
462  if( MirrorGraph::Dont != nMirror )
463  lcl_CalcRect( aGrfPt, aTmpSz, nMirror );
464 
465  pOrigRect->Pos ( aGrfPt );
466  pOrigRect->SSize( aTmpSz );
467 }
468 
471 {
472  // Return the Frame's size
473  const SwFrame *pFly = FindFlyFrame();
474  if( !pFly )
475  pFly = this;
476  return pFly->getFramePrintArea().SSize();
477 }
478 
480 {
481  // RotateFlyFrame3 - inner frame. Get rotation and check if used
482  const double fRotation(getLocalFrameRotation());
483  const bool bRotated(!basegfx::fTools::equalZero(fRotation));
484 
485  if(bRotated)
486  {
487  SwFlyFreeFrame* pUpperFly(dynamic_cast< SwFlyFreeFrame* >(GetUpper()));
488 
489  if(pUpperFly)
490  {
491  if(!pUpperFly->isFrameAreaDefinitionValid())
492  {
493  // RotateFlyFrame3: outer frame *needs* to be layouted first, force this by calling
494  // it's ::Calc directly
495  pUpperFly->Calc(pRenderContext);
496  }
497 
498  // Reset outer frame to unrotated state. This is necessary to make the
499  // layouting below work as currently implemented in Writer. As expected
500  // using Transformations allows to do this on the fly due to all information
501  // being included there.
502  // The full solution would be to adapt the whole layouting
503  // process of Writer to take care of Transformations, but that
504  // is currently beyond scope
505  if(pUpperFly->isTransformableSwFrame())
506  {
508  }
509  }
510 
511  // Re-layout may be partially (see all isFrameAreaDefinitionValid() flags),
512  // so resetting the local SwFrame(s) in the local SwFrameAreaDefinition is also
513  // needed (e.g. for PrintPreview).
514  // Reset to BoundAreas will be done below automatically
516  {
518  }
519  }
520 
521  SwContentNotify aNotify( this );
522  SwBorderAttrAccess aAccess( SwFrame::GetCache(), this );
523  const SwBorderAttrs &rAttrs = *aAccess.Get();
524 
526  {
527  MakePos();
528 
529  if ( !isFrameAreaSizeValid() )
530  {
532  aFrm.Width( GetUpper()->getFramePrintArea().Width() );
533  }
534 
535  MakePrtArea( rAttrs );
536 
537  if ( !isFrameAreaSizeValid() )
538  {
539  setFrameAreaSizeValid(true);
540  Format(getRootFrame()->GetCurrShell()->GetOut());
541  }
542  }
543 
544  // RotateFlyFrame3 - inner frame
545  if(bRotated)
546  {
547  SwFlyFreeFrame* pUpperFly(dynamic_cast< SwFlyFreeFrame* >(GetUpper()));
548 
549  if(pUpperFly)
550  {
551  // restore outer frame back to Transformed state, that means
552  // set the SwFrameAreaDefinition(s) back to BoundAreas of
553  // the transformed SwFrame. All needed information is part
554  // of the already correctly created Transformations of the
555  // upper frame, so it can be re-created on the fly
556  if(pUpperFly->isTransformableSwFrame())
557  {
559  }
560  }
561 
562  // After the unrotated layout is finished, apply possible set rotation to it
563  // get center from outer frame (layout frame) to be on the safe side
564  const Point aCenter(GetUpper() ? GetUpper()->getFrameArea().Center() : getFrameArea().Center());
565  const basegfx::B2DPoint aB2DCenter(aCenter.X(), aCenter.Y());
566 
568  {
570  }
571 
573  fRotation,
574  aB2DCenter);
576  }
577  else
578  {
579  // reset transformations to show that they are not used
580  mpTransformableSwFrame.reset();
581  }
582 }
583 
584 // RotateFlyFrame3 - Support for Transformations - outer frame
586 {
588  {
589  // use pre-created transformation
591  }
592 
593  // call parent
595 }
596 
598 {
600  {
601  // use pre-created transformation
603  }
604 
605  // call parent
607 }
608 
609 // RotateFlyFrame3 - Support for Transformations
610 void SwNoTextFrame::transform_translate(const Point& rOffset)
611 {
612  // call parent - this will do the basic transform for SwRect(s)
613  // in the SwFrameAreaDefinition
615 
616  // check if the Transformations need to be adapted
618  {
619  const basegfx::B2DHomMatrix aTransform(
621  rOffset.X(), rOffset.Y()));
622 
623  // transform using TransformableSwFrame
624  getTransformableSwFrame()->transform(aTransform);
625  }
626 }
627 
628 // RotateFlyFrame3 - inner frame
629 // Check if we contain a SwGrfNode and get possible rotation from it
631 {
632  const SwNoTextNode* pSwNoTextNode(nullptr != GetNode() ? GetNode()->GetNoTextNode() : nullptr);
633 
634  if(nullptr != pSwNoTextNode)
635  {
636  const SwGrfNode* pSwGrfNode(pSwNoTextNode->GetGrfNode());
637 
638  if(nullptr != pSwGrfNode)
639  {
640  const SwAttrSet& rSwAttrSet(pSwGrfNode->GetSwAttrSet());
641  const SwRotationGrf& rSwRotationGrf(rSwAttrSet.GetRotationGrf());
642  const double fRotate = -toRadians(rSwRotationGrf.GetValue());
643 
644  return basegfx::normalizeToRange(fRotate, F_2PI);
645  }
646  }
647 
648  // no rotation
649  return 0.0;
650 }
651 
653 void SwNoTextFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderAttrs * )
654 {
655  const Size aNewSize( GetSize() );
656 
657  // Did the height change?
658  SwTwips nChgHght = IsVertical() ?
659  static_cast<SwTwips>(aNewSize.Width() - getFramePrintArea().Width()) :
660  static_cast<SwTwips>(aNewSize.Height() - getFramePrintArea().Height());
661  if( nChgHght > 0)
662  Grow( nChgHght );
663  else if( nChgHght < 0)
664  Shrink( std::min(getFramePrintArea().Height(), tools::Long(-nChgHght)) );
665 }
666 
667 bool SwNoTextFrame::GetCharRect( SwRect &rRect, const SwPosition& rPos,
668  SwCursorMoveState *pCMS, bool /*bAllowFarAway*/ ) const
669 {
670  if ( &rPos.nNode.GetNode() != static_cast<SwNode const *>(GetNode()) )
671  return false;
672 
673  Calc(getRootFrame()->GetCurrShell()->GetOut());
674  SwRect aFrameRect( getFrameArea() );
675  rRect = aFrameRect;
676  rRect.Pos( getFrameArea().Pos() + getFramePrintArea().Pos() );
677  rRect.SSize( getFramePrintArea().SSize() );
678 
679  rRect.Justify();
680 
681  // Is the Bitmap in the visible area at all?
682  if( !aFrameRect.Overlaps( rRect ) )
683  {
684  // If not, then the Cursor is on the Frame
685  rRect = aFrameRect;
686  rRect.Width( 1 );
687  }
688  else
689  rRect.Intersection_( aFrameRect );
690 
691  if ( pCMS && pCMS->m_bRealHeight )
692  {
693  pCMS->m_aRealHeight.setY(rRect.Height());
694  pCMS->m_aRealHeight.setX(0);
695  }
696 
697  return true;
698 }
699 
701  SwCursorMoveState*, bool ) const
702 {
703  SwContentNode* pCNd = const_cast<SwContentNode*>(GetNode());
704  pPos->nNode = *pCNd;
705  pPos->nContent.Assign( pCNd, 0 );
706  return true;
707 }
708 
710 {
711  SwFlyFrame* pFly = FindFlyFrame();
712  if( pFly && pFly->GetFormat()->GetSurround().IsContour() )
713  {
714  ClrContourCache( pFly->GetVirtDrawObj() );
716  }
717 }
718 
720 {
721  if(GetNode()->GetNodeType() != SwNodeType::Grf)
722  {
723  InvalidatePrt();
725  return;
726  }
727  SwGrfNode* pNd = static_cast<SwGrfNode*>(GetNode());
728  ClearCache();
729  auto pVSh = pNd->GetDoc().getIDocumentLayoutAccess().GetCurrentViewShell();
730  if(pVSh)
732 }
733 
734 void SwNoTextFrame::SwClientNotify(const SwModify& rModify, const SfxHint& rHint)
735 {
736  if(dynamic_cast<const sw::GrfRereadAndInCacheHint*>(&rHint))
737  {
738  if(SwNodeType::Grf != GetNode()->GetNodeType())
739  {
740  InvalidatePrt();
742  }
743  return;
744  }
745  if(dynamic_cast<const sw::PreGraphicArrivedHint*>(&rHint))
746  {
748  return;
749  }
750  if (rHint.GetId() != SfxHintId::SwLegacyModify)
751  return;
752  auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
753  sal_uInt16 nWhich = pLegacy->GetWhich();
754 
755  // #i73788#
756  // no <SwContentFrame::Modify(..)> for RES_LINKED_GRAPHIC_STREAM_ARRIVED
757  if ( RES_GRAPHIC_PIECE_ARRIVED != nWhich &&
759  {
760  SwContentFrame::SwClientNotify(rModify, rHint);
761  }
762 
763  bool bComplete = true;
764 
765  switch( nWhich )
766  {
770  return;
771 
772  case RES_OBJECTDYING:
773  break;
774 
775  case RES_UPDATE_ATTR:
776  if (GetNode()->GetNodeType() != SwNodeType::Grf) {
777  break;
778  }
779  [[fallthrough]];
780  case RES_FMT_CHG:
781  ClearCache();
782  break;
783 
784  case RES_ATTRSET_CHG:
785  {
786  sal_uInt16 n;
787  for( n = RES_GRFATR_BEGIN; n < RES_GRFATR_END; ++n )
788  if( SfxItemState::SET == static_cast<const SwAttrSetChg*>(pLegacy->m_pOld)->GetChgSet()->
789  GetItemState( n, false ))
790  {
791  ClearCache();
792 
793  if(RES_GRFATR_ROTATION == n)
794  {
795  // RotGrfFlyFrame: Update Handles in view, these may be rotation-dependent
796  // (e.g. crop handles) and need a visualisation update
797  if ( GetNode()->GetNodeType() == SwNodeType::Grf )
798  {
799  SwGrfNode* pNd = static_cast<SwGrfNode*>( GetNode());
801 
802  if(pVSh)
803  {
804  SdrView* pDrawView = pVSh->GetDrawView();
805 
806  if(pDrawView)
807  {
808  pDrawView->AdjustMarkHdl(nullptr);
809  }
810  }
811 
812  // RotateFlyFrame3 - invalidate needed for ContentFrame (inner, this)
813  // and LayoutFrame (outer, GetUpper). It is possible to only invalidate
814  // the outer frame, but that leads to an in-between state that gets
815  // potentially painted
816  if(GetUpper())
817  {
819  }
820 
821  InvalidateAll_();
822  }
823  }
824  break;
825  }
826  if( RES_GRFATR_END == n ) // not found
827  return ;
828  }
829  break;
830 
831  default:
832  if ( !pLegacy->m_pNew || !isGRFATR(nWhich) )
833  return;
834  }
835 
836  if( bComplete )
837  {
838  InvalidatePrt();
840  }
841 }
842 
843 static void lcl_correctlyAlignRect( SwRect& rAlignedGrfArea, const SwRect& rInArea, vcl::RenderContext const * pOut )
844 {
845 
846  if(!pOut)
847  return;
848  tools::Rectangle aPxRect = pOut->LogicToPixel( rInArea.SVRect() );
849  tools::Rectangle aNewPxRect( aPxRect );
850  while( aNewPxRect.Left() < aPxRect.Left() )
851  {
852  rAlignedGrfArea.AddLeft( 1 );
853  aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
854  }
855  while( aNewPxRect.Top() < aPxRect.Top() )
856  {
857  rAlignedGrfArea.AddTop(+1);
858  aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
859  }
860  while( aNewPxRect.Bottom() > aPxRect.Bottom() )
861  {
862  rAlignedGrfArea.AddBottom( -1 );
863  aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
864  }
865  while( aNewPxRect.Right() > aPxRect.Right() )
866  {
867  rAlignedGrfArea.AddRight(-1);
868  aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
869  }
870 }
871 
873  vcl::RenderContext& rOutputDevice,
875  const basegfx::B2DRange& rSourceRange,
876  const basegfx::B2DRange& rTargetRange)
877 {
878  if(!rSequence.empty() && !basegfx::fTools::equalZero(rSourceRange.getWidth()) && !basegfx::fTools::equalZero(rSourceRange.getHeight()))
879  {
880  if(!basegfx::fTools::equalZero(rTargetRange.getWidth()) && !basegfx::fTools::equalZero(rTargetRange.getHeight()))
881  {
882  // map graphic range to target range. This will e.g. automatically include
883  // the mapping from 1/100th mm content to twips if needed when the target
884  // range is defined in twips
885  const basegfx::B2DHomMatrix aMappingTransform(
887  rSourceRange,
888  rTargetRange));
889 
890  // Fill ViewInformation. Use MappingTransform here, so there is no need to
891  // embed the primitives to it. Use original TargetRange here so there is also
892  // no need to embed the primitives to a MaskPrimitive for cropping. This works
893  // only in this case where the graphic object cannot be rotated, though.
894  const drawinglayer::geometry::ViewInformation2D aViewInformation2D(
895  aMappingTransform,
896  rOutputDevice.GetViewTransformation(),
897  rTargetRange,
898  nullptr,
899  0.0);
900 
901  // get a primitive processor for rendering
902  std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor2D(
904  rOutputDevice, aViewInformation2D) );
905 
906  // render and cleanup
907  pProcessor2D->process(rSequence);
908  return true;
909  }
910  }
911 
912  return false;
913 }
914 
915 // MM02 original using falölback to VOC and primitive-based version
917  vcl::RenderContext & rOutputDevice,
918  GraphicObject const& rGrfObj,
919  GraphicAttr const& rGraphicAttr,
920  const basegfx::B2DHomMatrix& rGraphicTransform,
921  const OUString& rName,
922  const OUString& rTitle,
923  const OUString& rDescription)
924 {
925  // RotGrfFlyFrame: unify using GraphicPrimitive2D
926  // -> the primitive handles all crop and mirror stuff
927  // -> the primitive renderer will create the needed pdf export data
928  // -> if bitmap content, it will be cached system-dependent
931  rGraphicTransform,
932  rGrfObj,
933  rGraphicAttr);
934 
935  // MM02 use primitive-based version for visualization
937  rOutputDevice,
938  aContent,
939  rGraphicTransform,
940  rName,
941  rTitle,
942  rDescription);
943 }
944 
945 // MM02 new VOC and primitive-based version
947  vcl::RenderContext & rOutputDevice,
949  const basegfx::B2DHomMatrix& rGraphicTransform,
950  const OUString& rName,
951  const OUString& rTitle,
952  const OUString& rDescription)
953 {
954  // RotateFlyFrame3: If ClipRegion is set at OutputDevice, we
955  // need to use that. Usually the renderer would be a VCL-based
956  // PrimitiveRenderer, but there are system-specific shortcuts that
957  // will *not* use the VCL-Paint of Bitmap and thus ignore this.
958  // Anyways, indirectly using a CLipRegion set at the target OutDev
959  // when using a PrimitiveRenderer is a non-valid implication.
960  // First tried only to use when HasPolyPolygonOrB2DPolyPolygon(),
961  // but there is an optimization at ClipRegion creation that detects
962  // a single Rectangle in a tools::PolyPolygon and forces to a simple
963  // RegionBand-based implementation, so cannot use it here.
964  if(rOutputDevice.IsClipRegion())
965  {
966  const basegfx::B2DPolyPolygon aClip(rOutputDevice.GetClipRegion().GetAsB2DPolyPolygon());
967 
968  if(0 != aClip.count())
969  {
970  rContent.resize(1);
971  rContent[0] =
973  aClip,
975  }
976  }
977 
978  if(!rName.isEmpty() || !rTitle.isEmpty() || !rDescription.isEmpty())
979  {
980  // Embed to ObjectInfoPrimitive2D when we have Name/Title/Description
981  // information available
982  rContent.resize(1);
983  rContent[0] =
986  rName,
987  rTitle,
988  rDescription);
989  }
990 
991  basegfx::B2DRange aTargetRange(0.0, 0.0, 1.0, 1.0);
992  aTargetRange.transform(rGraphicTransform);
993 
995  rOutputDevice,
996  rContent,
997  aTargetRange,
998  aTargetRange);
999 }
1000 
1001 // DrawContact section
1002 namespace { // anonymous namespace
1003 class ViewObjectContactOfSwNoTextFrame : public sdr::contact::ViewObjectContact
1004 {
1005 protected:
1007  const sdr::contact::DisplayInfo& rDisplayInfo) const override;
1008 
1009 public:
1010  ViewObjectContactOfSwNoTextFrame(
1011  sdr::contact::ObjectContact& rObjectContact,
1012  sdr::contact::ViewContact& rViewContact);
1013 };
1014 
1015 class ViewContactOfSwNoTextFrame : public sdr::contact::ViewContact
1016 {
1017 private:
1018  // owner
1019  const SwNoTextFrame& mrSwNoTextFrame;
1020 
1021 protected:
1022  // Create an Object-Specific ViewObjectContact, set ViewContact and
1023  // ObjectContact. Always needs to return something.
1025  sdr::contact::ObjectContact& rObjectContact) override;
1026 
1027 public:
1028  // read-access to owner
1029  const SwNoTextFrame& getSwNoTextFrame() const { return mrSwNoTextFrame; }
1030 
1031  // basic constructor, used from SwNoTextFrame.
1032  explicit ViewContactOfSwNoTextFrame(const SwNoTextFrame& rSwNoTextFrame);
1033 };
1034 
1035 drawinglayer::primitive2d::Primitive2DContainer ViewObjectContactOfSwNoTextFrame::createPrimitive2DSequence(
1036  const sdr::contact::DisplayInfo& /*rDisplayInfo*/) const
1037 {
1038  // MM02 get all the parameters formally used in paintGraphicUsingPrimitivesHelper
1039  ViewContactOfSwNoTextFrame& rVCOfNTF(static_cast<ViewContactOfSwNoTextFrame&>(GetViewContact()));
1040  const SwNoTextFrame& rSwNoTextFrame(rVCOfNTF.getSwNoTextFrame());
1041  SwNoTextNode& rNoTNd(const_cast<SwNoTextNode&>(*static_cast<const SwNoTextNode*>(rSwNoTextFrame.GetNode())));
1042  SwGrfNode* pGrfNd(rNoTNd.GetGrfNode());
1043 
1044  if(nullptr != pGrfNd)
1045  {
1046  const bool bPrn(GetObjectContact().isOutputToPrinter() || GetObjectContact().isOutputToRecordingMetaFile());
1047  const GraphicObject& rGrfObj(pGrfNd->GetGrfObj(bPrn));
1048  GraphicAttr aGraphicAttr;
1049  pGrfNd->GetGraphicAttr(aGraphicAttr, &rSwNoTextFrame);
1050  const basegfx::B2DHomMatrix aGraphicTransform(rSwNoTextFrame.getFrameAreaTransformation());
1051 
1052  // MM02 this is the right place in the VOC-Mechanism to create
1053  // the primitives for visualization - these will be automatically
1054  // buffered and reused
1057  aGraphicTransform,
1058  rGrfObj,
1059  aGraphicAttr);
1060 
1061  return aContent;
1062  }
1063 
1065 }
1066 
1067 ViewObjectContactOfSwNoTextFrame::ViewObjectContactOfSwNoTextFrame(
1068  sdr::contact::ObjectContact& rObjectContact,
1069  sdr::contact::ViewContact& rViewContact)
1070 : sdr::contact::ViewObjectContact(rObjectContact, rViewContact)
1071 {
1072 }
1073 
1074 sdr::contact::ViewObjectContact& ViewContactOfSwNoTextFrame::CreateObjectSpecificViewObjectContact(
1075  sdr::contact::ObjectContact& rObjectContact)
1076 {
1077  sdr::contact::ViewObjectContact* pRetval = new ViewObjectContactOfSwNoTextFrame(rObjectContact, *this);
1078  return *pRetval;
1079 }
1080 
1081 ViewContactOfSwNoTextFrame::ViewContactOfSwNoTextFrame(
1082  const SwNoTextFrame& rSwNoTextFrame
1083 )
1084 : mrSwNoTextFrame(rSwNoTextFrame)
1085 {
1086 }
1087 } // end of anonymous namespace
1088 
1090 {
1091  if(!mpViewContact)
1092  {
1093  const_cast< SwNoTextFrame* >(this)->mpViewContact =
1094  std::make_unique<ViewContactOfSwNoTextFrame>(*this);
1095  }
1096 
1097  return *mpViewContact;
1098 }
1099 
1107 void SwNoTextFrame::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfArea ) const
1108 {
1109  SwViewShell* pShell = getRootFrame()->GetCurrShell();
1110 
1111  SwNoTextNode& rNoTNd = const_cast<SwNoTextNode&>(*static_cast<const SwNoTextNode*>(GetNode()));
1112  SwGrfNode* pGrfNd = rNoTNd.GetGrfNode();
1113  SwOLENode* pOLENd = rNoTNd.GetOLENode();
1114 
1115  const bool bPrn = pOut == rNoTNd.getIDocumentDeviceAccess().getPrinter( false ) ||
1116  pOut->GetConnectMetaFile();
1117 
1118  const bool bIsChart = pOLENd && pOLENd->GetOLEObj().GetObject().IsChart();
1119 
1120  // calculate aligned rectangle from parameter <rGrfArea>.
1121  // Use aligned rectangle <aAlignedGrfArea> instead of <rGrfArea> in
1122  // the following code.
1123  SwRect aAlignedGrfArea = rGrfArea;
1124  ::SwAlignRect( aAlignedGrfArea, pShell, pOut );
1125 
1126  if( !bIsChart )
1127  {
1128  // Because for drawing a graphic left-top-corner and size coordinations are
1129  // used, these coordinations have to be determined on pixel level.
1130  ::SwAlignGrfRect( &aAlignedGrfArea, *pOut );
1131  }
1132  else //if( bIsChart )
1133  {
1134  // #i78025# charts own borders are not completely visible
1135  // the above pixel correction is not correct - at least not for charts
1136  // so a different pixel correction is chosen here
1137  // this might be a good idea for all other OLE objects also,
1138  // but as I cannot oversee the consequences I fix it only for charts for now
1139  lcl_correctlyAlignRect( aAlignedGrfArea, rGrfArea, pOut );
1140  }
1141 
1142  if( pGrfNd )
1143  {
1144  // Fix for bug fdo#33781
1145  const AntialiasingFlags nFormerAntialiasingAtOutput( pOut->GetAntialiasing() );
1147  {
1148  pOut->SetAntialiasing( nFormerAntialiasingAtOutput | AntialiasingFlags::Enable );
1149  }
1150 
1151  bool bContinue = true;
1152  const GraphicObject& rGrfObj = pGrfNd->GetGrfObj(bPrn);
1153 
1154  GraphicAttr aGrfAttr;
1155  pGrfNd->GetGraphicAttr( aGrfAttr, this );
1156 
1157  if( !bPrn )
1158  {
1159  // #i73788#
1160  if ( pGrfNd->IsLinkedInputStreamReady() )
1161  {
1162  pGrfNd->UpdateLinkWithInputStream();
1163  }
1164  // #i85717#, #i90395# - check, if asynchronous retrieval
1165  // if input stream for the graphic is possible
1166  else if ( ( rGrfObj.GetType() == GraphicType::Default ||
1167  rGrfObj.GetType() == GraphicType::NONE ) &&
1168  pGrfNd->IsLinkedFile() &&
1170  {
1171  Size aTmpSz;
1172  ::sfx2::SvLinkSource* pGrfObj = pGrfNd->GetLink()->GetObj();
1173  if( !pGrfObj ||
1174  !pGrfObj->IsDataComplete() ||
1175  !(aTmpSz = pGrfNd->GetTwipSize()).Width() ||
1176  !aTmpSz.Height())
1177  {
1178  pGrfNd->TriggerAsyncRetrieveInputStream(); // #i73788#
1179  }
1180  OUString aText( pGrfNd->GetTitle() );
1181  if ( aText.isEmpty() )
1182  GetRealURL( *pGrfNd, aText );
1183  ::lcl_PaintReplacement( aAlignedGrfArea, aText, *pShell, this, false );
1184  bContinue = false;
1185  }
1186  }
1187 
1188  if( bContinue )
1189  {
1190  if( rGrfObj.GetGraphic().IsSupportedGraphic())
1191  {
1192  const bool bAnimate = rGrfObj.IsAnimated() &&
1193  !pShell->IsPreview() &&
1195  // #i9684# Stop animation during printing/pdf export
1196  pShell->GetWin();
1197 
1198  if( bAnimate &&
1199  FindFlyFrame() != ::GetFlyFromMarked( nullptr, pShell ))
1200  {
1201  OutputDevice* pVout;
1202  if( pOut == pShell->GetOut() && SwRootFrame::FlushVout() )
1203  {
1204  pVout = pOut;
1205  pOut = pShell->GetOut();
1206  }
1207  else if( pShell->GetWin() && pOut->IsVirtual() )
1208  {
1209  pVout = pOut;
1210  pOut = pShell->GetWin()->GetOutDev();
1211  }
1212  else
1213  pVout = nullptr;
1214 
1215  OSL_ENSURE( !pOut->IsVirtual() ||
1216  pShell->GetViewOptions()->IsPDFExport() || pShell->isOutputToWindow(),
1217  "pOut should not be a virtual device" );
1218 
1219  pGrfNd->StartGraphicAnimation(pOut, aAlignedGrfArea.Pos(),
1220  aAlignedGrfArea.SSize(), reinterpret_cast<sal_IntPtr>(this),
1221  pVout );
1222  }
1223  else
1224  {
1225  // MM02 To allow system-dependent buffering of the involved
1226  // bitmaps it is necessary to re-use the involved primitives
1227  // and their already executed decomposition (also for
1228  // performance reasons). This is usually done in DrawingLayer
1229  // by using the VOC-Mechanism (see descriptions elsewhere).
1230  // To get that here, make the involved SwNoTextFrame (this)
1231  // a sdr::contact::ViewContact supplier by supporting
1232  // a GetViewContact() - call. For ObjectContact we can use
1233  // the already existing ObjectContact from the involved
1234  // DrawingLayer. For this, the helper classes
1235  // ViewObjectContactOfSwNoTextFrame
1236  // ViewContactOfSwNoTextFrame
1237  // are created which support the VOC-mechanism in its minimal
1238  // form. This allows automatic and view-dependent (multiple edit
1239  // windows, print, etc.) re-use of the created primitives.
1240  // Also: Will be very useful when completely changing the Writer
1241  // repaint to VOC and Primitives, too.
1242  static const char* pDisableMM02Goodies(getenv("SAL_DISABLE_MM02_GOODIES"));
1243  static bool bUseViewObjectContactMechanism(nullptr == pDisableMM02Goodies);
1244  // tdf#130951 for safety reasons use fallback if ViewObjectContactMechanism
1245  // fails for some reason - usually could only be not to find the correct
1246  // SdrPageWindow
1247  bool bSucceeded(false);
1248 
1249  if(bUseViewObjectContactMechanism)
1250  {
1251  // MM02 use VOC-mechanism and buffer primitives
1252  SwViewShellImp* pImp(pShell->Imp());
1253  SdrPageView* pPageView(nullptr != pImp
1254  ? pImp->GetPageView()
1255  : nullptr);
1256  // tdf#130951 caution - target may be Window, use the correct OutputDevice
1257  OutputDevice* pTarget(pShell->isOutputToWindow()
1258  ? pShell->GetWin()->GetOutDev()
1259  : pShell->GetOut());
1260  SdrPageWindow* pPageWindow(nullptr != pPageView && nullptr != pTarget
1261  ? pPageView->FindPageWindow(*pTarget)
1262  : nullptr);
1263 
1264  if(nullptr != pPageWindow)
1265  {
1266  sdr::contact::ObjectContact& rOC(pPageWindow->GetObjectContact());
1268  sdr::contact::ViewObjectContact& rVOC(rVC.GetViewObjectContact(rOC));
1269  sdr::contact::DisplayInfo aDisplayInfo;
1270 
1271  drawinglayer::primitive2d::Primitive2DContainer aPrimitives(rVOC.getPrimitive2DSequence(aDisplayInfo));
1272  const basegfx::B2DHomMatrix aGraphicTransform(getFrameAreaTransformation());
1273 
1275  *pOut,
1276  aPrimitives,
1277  aGraphicTransform,
1278  nullptr == pGrfNd->GetFlyFormat() ? OUString() : pGrfNd->GetFlyFormat()->GetName(),
1279  rNoTNd.GetTitle(),
1280  rNoTNd.GetDescription());
1281  bSucceeded = true;
1282  }
1283  }
1284 
1285  if(!bSucceeded)
1286  {
1287  // MM02 fallback to direct paint with primitive-recreation
1288  // which will block reusage of system-dependent bitmap data
1289  const basegfx::B2DHomMatrix aGraphicTransform(getFrameAreaTransformation());
1290 
1292  *pOut,
1293  rGrfObj,
1294  aGrfAttr,
1295  aGraphicTransform,
1296  nullptr == pGrfNd->GetFlyFormat() ? OUString() : pGrfNd->GetFlyFormat()->GetName(),
1297  rNoTNd.GetTitle(),
1298  rNoTNd.GetDescription());
1299  }
1300  }
1301  }
1302  else
1303  {
1304  TranslateId pResId;
1305 
1306  if( GraphicType::NONE == rGrfObj.GetType() )
1307  pResId = STR_COMCORE_READERROR;
1308  else if ( !rGrfObj.GetGraphic().IsSupportedGraphic() )
1309  pResId = STR_COMCORE_CANT_SHOW;
1310 
1311  OUString aText;
1312  if ( !pResId &&
1313  (aText = pGrfNd->GetTitle()).isEmpty() &&
1314  (!GetRealURL( *pGrfNd, aText ) || aText.isEmpty()))
1315  {
1316  pResId = STR_COMCORE_READERROR;
1317  }
1318  if (pResId)
1319  aText = SwResId(pResId);
1320 
1321  ::lcl_PaintReplacement( aAlignedGrfArea, aText, *pShell, this, true );
1322  }
1323  }
1324 
1326  pOut->SetAntialiasing( nFormerAntialiasingAtOutput );
1327  }
1328  else // bIsChart || pOLENd
1329  {
1330  // Fix for bug fdo#33781
1331  const AntialiasingFlags nFormerAntialiasingAtOutput( pOut->GetAntialiasing() );
1333  {
1334  AntialiasingFlags nNewAntialiasingAtOutput = nFormerAntialiasingAtOutput | AntialiasingFlags::Enable;
1335 
1336  // #i99665#
1337  // Adjust AntiAliasing mode at output device for chart OLE
1338  if ( pOLENd->IsChart() )
1339  nNewAntialiasingAtOutput |= AntialiasingFlags::PixelSnapHairline;
1340 
1341  pOut->SetAntialiasing( nNewAntialiasingAtOutput );
1342  }
1343 
1344  bool bDone(false);
1345 
1346  if(bIsChart)
1347  {
1348  basegfx::B2DRange aSourceRange;
1351  aSourceRange,
1352  bPrn));
1353 
1354  if(!aSequence.empty() && !aSourceRange.isEmpty())
1355  {
1356  const basegfx::B2DRange aTargetRange(
1357  aAlignedGrfArea.Left(), aAlignedGrfArea.Top(),
1358  aAlignedGrfArea.Right(), aAlignedGrfArea.Bottom());
1359 
1361  *pOut,
1362  aSequence,
1363  aSourceRange,
1364  aTargetRange);
1365  }
1366  }
1367 
1368  if(!bDone && pOLENd)
1369  {
1370  // SwOLENode does not have a known GraphicObject, need to
1371  // work with Graphic instead
1372  const Graphic* pGraphic = pOLENd->GetGraphic();
1373  const Point aPosition(aAlignedGrfArea.Pos());
1374  const Size aSize(aAlignedGrfArea.SSize());
1375 
1376  if ( pGraphic && pGraphic->GetType() != GraphicType::NONE )
1377  {
1378  pGraphic->Draw(*pOut, aPosition, aSize);
1379 
1380  // shade the representation if the object is activated outplace
1381  uno::Reference < embed::XEmbeddedObject > xObj = pOLENd->GetOLEObj().GetOleRef();
1382  if ( xObj.is() && xObj->getCurrentState() == embed::EmbedStates::ACTIVE )
1383  {
1384 
1387  aPosition,
1388  aSize),
1389  pOut);
1390  }
1391  }
1392  else
1393  {
1395  tools::Rectangle(aPosition, aSize),
1396  pOLENd->GetOLEObj().GetCurrentPersistName(),
1397  pOut);
1398  }
1399 
1400  sal_Int64 nMiscStatus = pOLENd->GetOLEObj().GetOleRef()->getStatus( pOLENd->GetAspect() );
1401  if ( !bPrn && dynamic_cast< const SwCursorShell *>( pShell ) != nullptr &&
1402  (nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE))
1403  {
1404  const SwFlyFrame *pFly = FindFlyFrame();
1405  assert( pFly != nullptr );
1406  static_cast<SwFEShell*>(pShell)->ConnectObj( pOLENd->GetOLEObj().GetObject(), pFly->getFramePrintArea(), pFly->getFrameArea());
1407  }
1408  }
1409 
1410  // see #i99665#
1412  {
1413  pOut->SetAntialiasing( nFormerAntialiasingAtOutput );
1414  }
1415  }
1416 }
1417 
1419 {
1420  const SwViewShell* pSh = getRootFrame()->GetCurrShell();
1421 
1422  if ( !pSh || !pSh->GetViewOptions()->IsGraphic() )
1423  {
1424  return true;
1425  }
1426 
1427  const SwGrfNode *pNd;
1428 
1429  if( nullptr != (pNd = GetNode()->GetGrfNode()) )
1430  {
1431  if(pNd->IsTransparent())
1432  {
1433  return true;
1434  }
1435  }
1436 
1437  // RotateFlyFrame3: If we are transformed, there are 'free' areas between
1438  // the Graphic and the Border/Padding stuff - at least as long as those
1439  // (Border and Padding) are not transformed, too
1441  {
1442  // we can be more specific - rotations of multiples of
1443  // 90 degrees will leave no gaps. Go from [0.0 .. F_2PI]
1444  // to [0 .. 360] and check modulo 90
1445  const tools::Long nRot(static_cast<tools::Long>(basegfx::rad2deg(getLocalFrameRotation())));
1446  const bool bMultipleOf90(0 == (nRot % 90));
1447 
1448  if(!bMultipleOf90)
1449  {
1450  return true;
1451  }
1452  }
1453 
1454  //#29381# OLE are always transparent
1455  if(nullptr != GetNode()->GetOLENode())
1456  {
1457  return true;
1458  }
1459 
1460  // return false by default to avoid background paint
1461  return false;
1462 }
1463 
1465 {
1466  // Stop animated graphics
1467  const SwGrfNode* pGrfNd = GetNode()->GetGrfNode();
1468 
1469  if( pGrfNd && pGrfNd->IsAnimated() )
1470  {
1471  const_cast< SwGrfNode* >(pGrfNd)->StopGraphicAnimation( pOut, reinterpret_cast<sal_IntPtr>(this) );
1472  }
1473 }
1474 
1476 {
1477  const SwGrfNode* pGrfNd = GetNode()->GetGrfNode();
1478  return pGrfNd && pGrfNd->IsAnimated();
1479 }
1480 
1481 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetFamily(FontFamily)
vcl::RenderContext * GetOut() const
Definition: viewsh.hxx:338
void SetClipRegion()
vcl::Region GetClipRegion() const
void transform(const basegfx::B2DHomMatrix &aTransform)
Definition: wsfrm.cxx:286
bool IsContour() const
Definition: fmtsrnd.hxx:53
const SwVirtFlyDrawObj * GetVirtDrawObj() const
Definition: fly.cxx:2783
Base class of the Writer layout elements.
Definition: frame.hxx:315
virtual basegfx::B2DHomMatrix getFramePrintAreaTransformation() const override
Definition: notxtfrm.cxx:597
TransformableSwFrame * getTransformableSwFrame()
Definition: notxtfrm.hxx:90
const SvxColorItem & GetColor(bool=true) const
Definition: charatr.hxx:128
void Right(const tools::Long nRight)
Definition: swrect.hxx:199
sal_Int64 GetAspect() const
Definition: ndole.hxx:136
virtual const SwFlyFrameFormat * GetFormat() const override
Definition: fly.cxx:2877
Marks a position in the document model.
Definition: pam.hxx:35
sal_Int32 GetLeft() const
void MakePrtArea(const SwBorderAttrs &)
Definition: calcmove.cxx:1075
const tools::SvRef< sfx2::SvBaseLink > & GetLink() const
Definition: ndgrf.hxx:132
void SetAntialiasing(AntialiasingFlags nMode)
sal_uInt16 GetWhich() const
Definition: calbck.hxx:75
const SvxUnderlineItem & GetUnderline(bool=true) const
GetMethods: Bool indicates whether to search only in Set (FALSE) or also in Parents.
Definition: charatr.hxx:118
SdrView * GetDrawView()
Definition: vnew.cxx:373
bool IsGrfNode() const
Definition: node.hxx:657
SwTwips Grow(SwTwips, bool bTst=false, bool bInfo=false)
Definition: wsfrm.cxx:1503
AntialiasingFlags
double getHeight() const
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
Definition: ndole.hxx:161
bool m_bRealHeight
should the real height be calculated?
Definition: crstate.hxx:141
SwRect getUntransformedFramePrintArea() const
Definition: wsfrm.cxx:188
void setWidth(tools::Long nWidth)
virtual bool IsVirtual() const
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:112
SwViewShellImp * Imp()
Definition: viewsh.hxx:182
TransformableSwFrame * getTransformableSwFrame()
Definition: flyfrms.hxx:132
const SwAccessibilityOptions * GetAccessibilityOptions() const
Definition: viewsh.hxx:431
constexpr TypedWhichId< SwFormatChg > RES_FMT_CHG(162)
double normalizeToRange(double v, const double fRange)
bool equalZero(const T &rfVal)
bool IsGraphic() const
Definition: viewopt.hxx:333
virtual ~SwNoTextFrame() override
Definition: notxtfrm.cxx:165
constexpr tools::Long Left() const
virtual basegfx::B2DHomMatrix getFrameAreaTransformation() const override
Definition: notxtfrm.cxx:585
void Left(const tools::Long nLeft)
Definition: swrect.hxx:194
SwNodeIndex nNode
Definition: pam.hxx:37
void SetCompletePaint() const
Definition: frame.hxx:995
constexpr::Color COL_RED(0x80, 0x00, 0x00)
virtual basegfx::B2DHomMatrix getFramePrintAreaTransformation() const
Definition: wsfrm.cxx:134
long Long
const SwRect & getFramePrintArea() const
Definition: frame.hxx:181
static void DrawShading(const tools::Rectangle &rRect, OutputDevice *pOut)
sdr::contact::ViewContact & GetViewContact() const
Definition: notxtfrm.cxx:1089
static SwCache & GetCache()
Definition: frame.hxx:522
constexpr TypedWhichId< SwMsgPoolItem > RES_LINKED_GRAPHIC_STREAM_ARRIVED(189)
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
Definition: ndole.cxx:909
SwNoTextFrame(SwNoTextNode *const, SwFrame *)
Definition: notxtfrm.cxx:147
sal_Int64 n
bool IsSupportedGraphic() const
bool IsVisitedURL(const OUString &rURL)
Definition: visiturl.cxx:100
SVL_DLLPUBLIC OUString removePassword(OUString const &rURI, INetURLObject::EncodeMechanism eEncodeMechanism, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
VclPtr< OutputDevice > mpOut
Window, Printer, VirtDev, ...
Definition: viewsh.hxx:115
void SetWeight(FontWeight)
bool IsLinkedFile() const
Definition: ndgrf.hxx:164
SwNode & GetNode() const
Definition: ndindex.hxx:119
MirrorGraph
Definition: grfatr.hxx:31
void Draw(OutputDevice &rOutDev, const Point &rDestPt) const
double toRadians(Degree10 x)
void IntersectClipRegion(const tools::Rectangle &rRect)
GDIMetaFile * GetConnectMetaFile() const
friend class SwNoTextFrame
Definition: ndnotxt.hxx:33
void Pos(const Point &rNew)
Definition: swrect.hxx:168
RotateFlyFrame3: Helper class when you want to make your SwFrame derivate transformable.
Definition: frame.hxx:236
size_t GetIMapObjectCount() const
virtual void Calc(vcl::RenderContext *pRenderContext) const
Definition: trvlfrm.cxx:1788
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr) override
Calculate the Bitmap's site, if needed.
Definition: notxtfrm.cxx:653
virtual void MakeAll(vcl::RenderContext *pRenderContext) override
Definition: notxtfrm.cxx:479
Center
virtual basegfx::B2DHomMatrix getFrameAreaTransformation() const
Definition: wsfrm.cxx:124
constexpr double rad2deg(double v)
AntialiasingFlags GetAntialiasing() const
SfxHintId GetId() const
bool isFrameAreaDefinitionValid() const
Definition: frame.hxx:172
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: wsfrm.cxx:2340
double getLocalFrameRotation() const
Definition: notxtfrm.cxx:630
std::unique_ptr< BaseProcessor2D > createProcessor2DFromOutputDevice(OutputDevice &rTargetOutDev, const drawinglayer::geometry::ViewInformation2D &rViewInformation2D)
bool IsLinkedInputStreamReady() const
Definition: ndgrf.hxx:144
void AddTop(const tools::Long nAdd)
Definition: swrect.cxx:165
WEIGHT_BOLD
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:165
SwRect & Intersection_(const SwRect &rRect)
Definition: swrect.cxx:80
constexpr tools::Long Width() const
bool IsChart() const
Definition: ndole.cxx:632
drawinglayer::primitive2d::Primitive2DContainer const & tryToGetChartContentAsPrimitive2DSequence(basegfx::B2DRange &rRange, bool bSynchron)
Definition: ndole.cxx:1054
bool IsAsyncRetrieveInputStreamPossible() const
Definition: ndgrf.cxx:886
double getWidth() const
bool isGRFATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:508
constexpr sal_uInt16 RES_GRFATR_END(150)
void SwAlignRect(SwRect &rRect, const SwViewShell *pSh, const vcl::RenderContext *pRenderContext)
Function is also used outside this file.
Definition: paintfrm.cxx:1124
LINESTYLE_NONE
void restoreFrameAreas()
Definition: wsfrm.cxx:268
SwIndex nContent
Definition: pam.hxx:38
const SwRect & getFrameArea() const
Definition: frame.hxx:180
void TriggerAsyncRetrieveInputStream()
Definition: ndgrf.cxx:826
GraphicAttr & GetGraphicAttr(GraphicAttr &, const SwFrame *pFrame) const
Returns the with our graphic attributes filled Graphic-Attr-Structure.
Definition: ndgrf.cxx:731
BASEGFX_DLLPUBLIC void transform(const B2DHomMatrix &rMatrix)
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:426
bool isTransformableSwFrame() const
Definition: flyfrms.hxx:131
svt::EmbeddedObjectRef & GetObject()
Definition: ndole.cxx:961
const OUString & GetName() const
Definition: format.hxx:115
bool DrawFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes, const SwRect &rOriginalLayoutRect, const SwRegionRects &rPaintRegion, const basegfx::utils::B2DClipState &rClipState, vcl::RenderContext &rOut)
Definition: paintfrm.cxx:1723
std::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr
Definition: format.hxx:41
void Width(tools::Long nNew)
Definition: swrect.hxx:186
static void lcl_CalcRect(Point &rPt, Size &rDim, MirrorGraph nMirror)
Calculate the position and the size of the graphic in the Frame, corresponding to the current graphic...
Definition: notxtfrm.cxx:332
bool HasAnimation() const
Definition: notxtfrm.cxx:1475
const SwFormatSurround & GetSurround(bool=true) const
Definition: fmtsrnd.hxx:66
SwDoc * GetDoc() const
Definition: viewsh.hxx:281
void SetUnderline(FontLineStyle)
void DrawGraphic(const SvxBrushItem *, vcl::RenderContext &, const SwRect &rOrg, const SwRect &rOut, const sal_uInt8 nGrfNum=GRFNUM_NO, const bool bConsiderBackgroundTransparency=false)
Definition: paintfrm.cxx:1814
virtual bool GetModelPositionForViewPoint(SwPosition *pPos, Point &aPoint, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
Definition: notxtfrm.cxx:700
SwFlyFrame * FindFlyFrame()
Definition: frame.hxx:1112
bool GetFileFilterNms(OUString *pFileNm, OUString *pFilterNm) const
Definition: ndgrf.cxx:492
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
Definition: node.cxx:2098
std::unique_ptr< TransformableSwFrame > mpTransformableSwFrame
Definition: notxtfrm.hxx:45
const OUString & GetCurrentPersistName() const
Definition: ndole.hxx:69
void DrawRect(const tools::Rectangle &rRect)
Base class for various Writer styles.
Definition: format.hxx:46
virtual void transform_translate(const Point &rOffset) override
Definition: notxtfrm.cxx:610
sal_uInt16 GetVirtPageNum() const
Definition: trvlfrm.cxx:1806
bool isEmpty() const
constexpr TypedWhichId< SwRotationGrf > RES_GRFATR_ROTATION(135)
B2DHomMatrix createSourceRangeTargetRangeTransform(const B2DRange &rSourceRange, const B2DRange &rTargetRange)
void StopAnimation(const OutputDevice *=nullptr) const
Definition: notxtfrm.cxx:1464
void SetLineColor()
void paintGraphicUsingPrimitivesHelper(vcl::RenderContext &rOutputDevice, GraphicObject const &rGrfObj, GraphicAttr const &rGraphicAttr, const basegfx::B2DHomMatrix &rGraphicTransform, const OUString &rName, const OUString &rTitle, const OUString &rDescription)
Definition: notxtfrm.cxx:916
constexpr TypedWhichId< SwUpdateAttr > RES_UPDATE_ATTR(167)
void SetFamilyName(const OUString &rFamilyName)
void InvalidatePrt()
Definition: frame.hxx:1037
static void lcl_ClearArea(const SwFrame &rFrame, vcl::RenderContext &rOut, const SwRect &rPtArea, const SwRect &rGrfArea)
Definition: notxtfrm.cxx:174
Internet visited.
Definition: poolfmt.hxx:121
int i
bool IsClipRegion() const
virtual bool IsDataComplete() const
SwDoc & GetDoc()
Definition: node.hxx:212
GraphicType GetType() const
void PaintPicture(vcl::RenderContext *, const SwRect &) const
Paint the graphic.
Definition: notxtfrm.cxx:1107
SwIndex & Assign(SwIndexReg *, sal_Int32)
Definition: index.cxx:206
bool IsAnimated() const
Definition: ndgrf.hxx:95
void AddBottom(const tools::Long nAdd)
Definition: swrect.cxx:167
SwPageFrame * FindPageFrame()
Definition: frame.hxx:681
virtual SwFormat * GetFormatFromPool(sal_uInt16 nId)=0
Return required automatic format base class.
static void lcl_PaintReplacement(const SwRect &rRect, const OUString &rText, const SwViewShell &rSh, const SwNoTextFrame *pFrame, bool bDefect)
Definition: notxtfrm.cxx:97
const Graphic * GetGraphic()
Definition: ndole.cxx:244
std::unique_ptr< sdr::contact::ViewContact > mpViewContact
Definition: notxtfrm.hxx:56
bool IsPreview() const
Definition: viewsh.hxx:488
#define F_2PI
SwNoTextNode * GetNoTextNode()
Definition: ndnotxt.hxx:96
const SwFormatURL & GetURL(bool=true) const
Definition: fmturl.hxx:78
SwLayoutFrame * GetUpper()
Definition: frame.hxx:679
constexpr tools::Long Right() const
void SetFillColor()
constexpr TypedWhichId< SwAttrSetChg > RES_ATTRSET_CHG(163)
bool isFramePrintAreaValid() const
Definition: frame.hxx:169
Internet normal.
Definition: poolfmt.hxx:120
virtual ViewObjectContact & CreateObjectSpecificViewObjectContact(ObjectContact &rObjectContact)
virtual void PaintSwFrame(vcl::RenderContext &rRenderContext, SwRect const &, SwPrintData const *const pPrintData=nullptr) const override
Definition: notxtfrm.cxx:214
constexpr tools::Long Top() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
Definition: format.cxx:388
const IDocumentSettingAccess * getIDocumentSettingAccess() const
Provides access to the document setting interface.
Definition: node.cxx:2097
bool IsPDFExport() const
Definition: viewopt.hxx:417
bool isFrameAreaPositionValid() const
Definition: frame.hxx:167
static bool paintUsingPrimitivesHelper(vcl::RenderContext &rOutputDevice, const drawinglayer::primitive2d::Primitive2DContainer &rSequence, const basegfx::B2DRange &rSourceRange, const basegfx::B2DRange &rTargetRange)
Definition: notxtfrm.cxx:872
const Size & GetSize() const
By returning the surrounding Fly's size which equals the graphic's size.
Definition: notxtfrm.cxx:470
bool isOutputToWindow() const
Definition: viewsh.cxx:134
void AddRight(const tools::Long nAdd)
Definition: swrect.cxx:164
OUString GetDescription() const
Definition: ndnotxt.cxx:282
void SSize(const Size &rNew)
Definition: swrect.hxx:177
Point m_aRealHeight
contains then the position/height of the cursor
Definition: crstate.hxx:137
bool isFrameAreaSizeValid() const
Definition: frame.hxx:168
constexpr TypedWhichId< SwMsgPoolItem > RES_GRAPHIC_PIECE_ARRIVED(177)
virtual SfxPrinter * getPrinter(bool bCreate) const =0
Return the printer set at the document.
const GraphicObject & GetGrfObj(bool bWait=false) const
Definition: ndgrf.cxx:377
bool IsTransparent() const
Definition: notxtfrm.cxx:1418
tools::Long SwTwips
Definition: swtypes.hxx:52
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:405
GraphicType GetType() const
virtual Size GetTwipSize() const override
Definition: ndgrf.cxx:430
static bool GetRealURL(const SwGrfNode &rNd, OUString &rText)
Definition: notxtfrm.cxx:86
SwBorderAttrs * Get()
Definition: frmtool.cxx:2643
SwTwips Shrink(SwTwips, bool bTst=false, bool bInfo=false)
Definition: wsfrm.cxx:1547
void SetColor(const Color &)
void SetFrameInPaint(bool b)
Definition: ndgrf.hxx:104
static void DrawPaintReplacement(const tools::Rectangle &rRect, const OUString &rText, OutputDevice *pOut)
constexpr tools::Long Bottom() const
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
const ImageMap * GetMap() const
Definition: fmturl.hxx:68
sal_Int32 GetBottom() const
FontLineStyle GetLineStyle() const
const SwRect & GetUnclippedFrame() const
Definition: flyfrms.hxx:112
bool GetBackgroundBrush(drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes, const SvxBrushItem *&rpBrush, std::optional< Color > &rxColor, SwRect &rOrigRect, bool bLowerMode, bool bConsiderTextBox) const
Determine the background brush for the frame: the background brush is taken from it-self or from its ...
Definition: paintfrm.cxx:7287
void AddLeft(const tools::Long nAdd)
Definition: swrect.cxx:162
sal_Int32 GetTop() const
void Bottom(const tools::Long nBottom)
Definition: swrect.hxx:208
const SwContentNode * GetNode() const
Definition: notxtfrm.hxx:66
bool HasBorder(bool bTreatPaddingAsBorder) const
void SetStyleName(const OUString &rStyleName)
void Justify()
Definition: swrect.cxx:131
tools::Rectangle SVRect() const
Definition: swrect.hxx:272
general base class for all free-flowing frames
Definition: flyfrm.hxx:78
Color GetRetoucheColor() const
Definition: viewimp.cxx:242
const Graphic & GetGraphic() const
void GetGrfArea(SwRect &rRect, SwRect *) const
Calculate the Bitmap's position and the size within the passed rectangle.
Definition: notxtfrm.cxx:348
constexpr tools::Long Height() const
static void LeaveLock()
static void DrawEx(OutputDevice &rOutDev, const OUString &rText, vcl::Font &rFont, const BitmapEx &rBitmap, const Point &rDestPt, const Size &rDestSize)
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
void ClrContourCache(const SdrObject *pObj)
Definition: txtfly.cxx:134
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:423
vcl::Window * GetWin() const
Definition: viewsh.hxx:337
SwFlyFrame * GetFlyFromMarked(const SdrMarkList *pLst, SwViewShell *pSh)
Definition: feshview.cxx:139
constexpr sal_uInt16 RES_GRFATR_BEGIN(RES_FRMATR_END)
OUString GetTitle() const
Definition: ndnotxt.cxx:258
void InvalidateAll_()
Definition: frame.hxx:804
void SetTransparent(bool bTransparent)
void SwAlignGrfRect(SwRect *pGrfRect, const vcl::RenderContext &rOut)
Method to pixel-align rectangle for drawing graphic object.
Definition: paintfrm.cxx:1230
void ClearCache()
Definition: notxtfrm.cxx:709
FAMILY_SWISS
static void EnterLock()
::OutputDevice const * GetOutDev() const
tools::Long AdjustWidth(tools::Long n)
void AdjustMarkHdl(SfxViewShell *pOtherShell=nullptr)
SwRect getUntransformedFrameArea() const
Definition: wsfrm.cxx:164
void StartGraphicAnimation(OutputDevice *pOut, const Point &rPt, const Size &rSz, tools::Long nExtraData, OutputDevice *pFirstFrameOutDev)
wrappers for non-const calls at GraphicObject
Definition: ndgrf.hxx:86
void Top(const tools::Long nTop)
Definition: swrect.hxx:203
void UpdateLinkWithInputStream()
Definition: ndgrf.cxx:868
void setFrameAreaSizeValid(bool bNew)
Definition: wsfrm.cxx:91
SwFrameType mnFrameType
Definition: frame.hxx:415
const basegfx::B2DHomMatrix & getLocalFrameAreaTransformation() const
Definition: frame.hxx:256
virtual bool GetCharRect(SwRect &, const SwPosition &, SwCursorMoveState *=nullptr, bool bAllowFarAway=true) const override
Definition: notxtfrm.cxx:667
tools::Long AdjustHeight(tools::Long n)
bool IsChart() const
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
constexpr TypedWhichId< SvxBoxItem > RES_BOX(106)
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
Definition: node.hxx:715
sal_Int32 GetRight() const
void setHeight(tools::Long nHeight)
basegfx::B2DPolyPolygon GetAsB2DPolyPolygon() const
IMapObject * GetIMapObject(size_t nPos) const
bool IsVertical() const
Definition: frame.hxx:974
virtual void Calc(vcl::RenderContext *pRenderContext) const override
Definition: fly.cxx:2887
static bool IsAntiAliasing()
Definition: dview.cxx:129
virtual void NotifyBackground(SwPageFrame *_pPageFrame, const SwRect &_rRect, PrepareHint _eHint)=0
method to trigger notification of 'background'
virtual void DestroyImpl() override
Definition: notxtfrm.cxx:158
void OnGraphicArrived()
Definition: notxtfrm.cxx:719
bool IsTransparent() const
Definition: ndgrf.cxx:820
bool GetContour(tools::PolyPolygon &rContour, const bool _bForPaint=false) const
#i13147# - If called for paint and the contains a graphic, load of intrinsic graphic ...
Definition: fly.cxx:2636
bool IsAnimated() const
SwGrfNode * GetGrfNode()
Definition: ndgrf.hxx:154
virtual void MakePos()
Definition: calcmove.cxx:539
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
FontLineStyle
void adaptFrameAreasToTransformations()
Definition: wsfrm.cxx:233
void SetOutDev(SwViewShell *pSh, OutputDevice *pOut)
Definition: notxtfrm.cxx:169
static bool FlushVout()
Output virtual Device (e.g. for animations)
Definition: virtoutp.cxx:30
virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequence(const DisplayInfo &rDisplayInfo) const
void Push(PushFlags nFlags=PushFlags::ALL)
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:207
basegfx::B2DHomMatrix GetViewTransformation() const
void Height(tools::Long nNew)
Definition: swrect.hxx:190
void OnGraphicArrived(const SwRect &)
Definition: viewsh.cxx:2581
void createFrameAreaTransformations(double fRotation, const basegfx::B2DPoint &rCenter)
Definition: wsfrm.cxx:213
const basegfx::B2DHomMatrix & getLocalFramePrintAreaTransformation() const
Definition: frame.hxx:262
SwFrameFormat * GetFlyFormat() const
If node is in a fly return the respective format.
Definition: node.cxx:719
bool Overlaps(const SwRect &rRect) const
Definition: swrect.cxx:123
virtual SwContentFrame * MakeFrame(SwFrame *) override
MakeFrame will be called for a certain layout pSib is another SwFrame of the same layout (e...
Definition: notxtfrm.cxx:153
const OUString & GetURL() const
bool isTransformableSwFrame() const
Definition: notxtfrm.hxx:89
SwRootFrame * getRootFrame()
Definition: frame.hxx:680
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_OBJECTDYING(RES_MSG_BEGIN)
virtual void transform_translate(const Point &rOffset)
Definition: wsfrm.cxx:147
const Color & GetValue() const
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: notxtfrm.cxx:734
virtual void DestroyImpl() override
Definition: ssfrm.cxx:422
static void lcl_correctlyAlignRect(SwRect &rAlignedGrfArea, const SwRect &rInArea, vcl::RenderContext const *pOut)
Definition: notxtfrm.cxx:843
const OUString & GetURL() const
Definition: fmturl.hxx:66
Base class of the Writer document model elements.
Definition: node.hxx:80