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