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>
74 #include <osl/diagnose.h>
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  {
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 SvxBoxItem* pBoxItem;
284  if( pFly->GetFormat() && (pBoxItem = pFly->GetFormat()->GetItemIfSet(RES_BOX, false)) )
285  {
286  if( pBoxItem->HasBorder( /*bTreatPaddingAsBorder*/true) )
287  bGetUnclippedFrame = false;
288  }
289 
290  if( bGetUnclippedFrame )
291  aGrfArea = SwRect( getFrameArea().Pos( ), pFly->GetUnclippedFrame( ).SSize( ) );
292  }
293  }
294 
295  aPaintArea.Intersection_( aOrigPaint );
296 
298  aNormal.Justify(); // Normalized rectangle for the comparisons
299 
300  if( aPaintArea.Overlaps( aNormal ) )
301  {
302  // Calculate the four to-be-deleted rectangles
303  if( pSh->GetWin() )
304  ::lcl_ClearArea( *this, rRenderContext, aPaintArea, aNormal );
305 
306  // The intersection of the PaintArea and the Bitmap contains the absolutely visible area of the Frame
307  aPaintArea.Intersection_( aNormal );
308 
309  if ( bClip )
310  rRenderContext.IntersectClipRegion( aPaintArea.SVRect() );
312  PaintPicture( &rRenderContext, aGrfArea );
313  }
314  else
315  // If it's not visible, simply delete the given Area
316  lcl_ClearArea( *this, rRenderContext, aPaintArea, SwRect() );
317  if( pGrfNd )
318  pGrfNd->SetFrameInPaint( false );
319 
320  rRenderContext.Pop();
322 }
323 
331 static void lcl_CalcRect( Point& rPt, Size& rDim, MirrorGraph nMirror )
332 {
333  if( nMirror == MirrorGraph::Vertical || nMirror == MirrorGraph::Both )
334  {
335  rPt.setX(rPt.getX() + rDim.Width() -1);
336  rDim.setWidth( -rDim.Width() );
337  }
338 
339  if( nMirror == MirrorGraph::Horizontal || nMirror == MirrorGraph::Both )
340  {
341  rPt.setY(rPt.getY() + rDim.Height() -1);
342  rDim.setHeight( -rDim.Height() );
343  }
344 }
345 
347 void SwNoTextFrame::GetGrfArea( SwRect &rRect, SwRect* pOrigRect ) const
348 {
349  // Currently only used for scaling, cropping and mirroring the contour of graphics!
350  // Everything else is handled by GraphicObject
351  // We put the graphic's visible rectangle into rRect.
352  // pOrigRect contains position and size of the whole graphic.
353 
354  // RotateFlyFrame3: SwFrame may be transformed. Get untransformed
355  // SwRect(s) as base of calculation
356  const TransformableSwFrame* pTransformableSwFrame(getTransformableSwFrame());
357  const SwRect aFrameArea(pTransformableSwFrame ? pTransformableSwFrame->getUntransformedFrameArea() : getFrameArea());
358  const SwRect aFramePrintArea(pTransformableSwFrame ? pTransformableSwFrame->getUntransformedFramePrintArea() : getFramePrintArea());
359 
360  const SwAttrSet& rAttrSet = GetNode()->GetSwAttrSet();
361  const SwCropGrf& rCrop = rAttrSet.GetCropGrf();
362  MirrorGraph nMirror = rAttrSet.GetMirrorGrf().GetValue();
363 
364  if( rAttrSet.GetMirrorGrf().IsGrfToggle() )
365  {
366  if( !(FindPageFrame()->GetVirtPageNum() % 2) )
367  {
368  switch ( nMirror )
369  {
370  case MirrorGraph::Dont: nMirror = MirrorGraph::Vertical; break;
371  case MirrorGraph::Vertical: nMirror = MirrorGraph::Dont; break;
372  case MirrorGraph::Horizontal: nMirror = MirrorGraph::Both; break;
373  default: nMirror = MirrorGraph::Horizontal; break;
374  }
375  }
376  }
377 
378  // We read graphic from the Node, if needed.
379  // It may fail, however.
380  tools::Long nLeftCrop, nRightCrop, nTopCrop, nBottomCrop;
381  Size aOrigSz( static_cast<const SwNoTextNode*>(GetNode())->GetTwipSize() );
382  if ( !aOrigSz.Width() )
383  {
384  aOrigSz.setWidth( aFramePrintArea.Width() );
385  nLeftCrop = -rCrop.GetLeft();
386  nRightCrop = -rCrop.GetRight();
387  }
388  else
389  {
390  nLeftCrop = std::max( aOrigSz.Width() -
391  (rCrop.GetRight() + rCrop.GetLeft()), tools::Long(1) );
392  const double nScale = double(aFramePrintArea.Width()) / double(nLeftCrop);
393  nLeftCrop = tools::Long(nScale * -rCrop.GetLeft() );
394  nRightCrop = tools::Long(nScale * -rCrop.GetRight() );
395  }
396 
397  // crop values have to be mirrored too
398  if( nMirror == MirrorGraph::Vertical || nMirror == MirrorGraph::Both )
399  {
400  tools::Long nTmpCrop = nLeftCrop;
401  nLeftCrop = nRightCrop;
402  nRightCrop= nTmpCrop;
403  }
404 
405  if( !aOrigSz.Height() )
406  {
407  aOrigSz.setHeight( aFramePrintArea.Height() );
408  nTopCrop = -rCrop.GetTop();
409  nBottomCrop= -rCrop.GetBottom();
410  }
411  else
412  {
413  nTopCrop = std::max( aOrigSz.Height() - (rCrop.GetTop() + rCrop.GetBottom()), tools::Long(1) );
414  const double nScale = double(aFramePrintArea.Height()) / double(nTopCrop);
415  nTopCrop = tools::Long(nScale * -rCrop.GetTop() );
416  nBottomCrop= tools::Long(nScale * -rCrop.GetBottom() );
417  }
418 
419  // crop values have to be mirrored too
420  if( nMirror == MirrorGraph::Horizontal || nMirror == MirrorGraph::Both )
421  {
422  tools::Long nTmpCrop = nTopCrop;
423  nTopCrop = nBottomCrop;
424  nBottomCrop= nTmpCrop;
425  }
426 
427  Size aVisSz( aFramePrintArea.SSize() );
428  Size aGrfSz( aVisSz );
429  Point aVisPt( aFrameArea.Pos() + aFramePrintArea.Pos() );
430  Point aGrfPt( aVisPt );
431 
432  // Set the "visible" rectangle first
433  if ( nLeftCrop > 0 )
434  {
435  aVisPt.setX(aVisPt.getX() + nLeftCrop);
436  aVisSz.AdjustWidth( -nLeftCrop );
437  }
438  if ( nTopCrop > 0 )
439  {
440  aVisPt.setY(aVisPt.getY() + nTopCrop);
441  aVisSz.AdjustHeight( -nTopCrop );
442  }
443  if ( nRightCrop > 0 )
444  aVisSz.AdjustWidth( -nRightCrop );
445  if ( nBottomCrop > 0 )
446  aVisSz.AdjustHeight( -nBottomCrop );
447 
448  rRect.Pos ( aVisPt );
449  rRect.SSize( aVisSz );
450 
451  // Calculate the whole graphic if needed
452  if ( !pOrigRect )
453  return;
454 
455  Size aTmpSz( aGrfSz );
456  aGrfPt.setX(aGrfPt.getX() + nLeftCrop);
457  aTmpSz.AdjustWidth( -(nLeftCrop + nRightCrop) );
458  aGrfPt.setY(aGrfPt.getY() + nTopCrop);
459  aTmpSz.AdjustHeight( -(nTopCrop + nBottomCrop) );
460 
461  if( MirrorGraph::Dont != nMirror )
462  lcl_CalcRect( aGrfPt, aTmpSz, nMirror );
463 
464  pOrigRect->Pos ( aGrfPt );
465  pOrigRect->SSize( aTmpSz );
466 }
467 
470 {
471  // Return the Frame's size
472  const SwFrame *pFly = FindFlyFrame();
473  if( !pFly )
474  pFly = this;
475  return pFly->getFramePrintArea().SSize();
476 }
477 
479 {
480  // RotateFlyFrame3 - inner frame. Get rotation and check if used
481  const double fRotation(getLocalFrameRotation());
482  const bool bRotated(!basegfx::fTools::equalZero(fRotation));
483 
484  if(bRotated)
485  {
486  SwFlyFreeFrame* pUpperFly(dynamic_cast< SwFlyFreeFrame* >(GetUpper()));
487 
488  if(pUpperFly)
489  {
490  if(!pUpperFly->isFrameAreaDefinitionValid())
491  {
492  // RotateFlyFrame3: outer frame *needs* to be layouted first, force this by calling
493  // it's ::Calc directly
494  pUpperFly->Calc(pRenderContext);
495  }
496 
497  // Reset outer frame to unrotated state. This is necessary to make the
498  // layouting below work as currently implemented in Writer. As expected
499  // using Transformations allows to do this on the fly due to all information
500  // being included there.
501  // The full solution would be to adapt the whole layouting
502  // process of Writer to take care of Transformations, but that
503  // is currently beyond scope
504  if(pUpperFly->isTransformableSwFrame())
505  {
507  }
508  }
509 
510  // Re-layout may be partially (see all isFrameAreaDefinitionValid() flags),
511  // so resetting the local SwFrame(s) in the local SwFrameAreaDefinition is also
512  // needed (e.g. for PrintPreview).
513  // Reset to BoundAreas will be done below automatically
515  {
517  }
518  }
519 
520  SwContentNotify aNotify( this );
521  SwBorderAttrAccess aAccess( SwFrame::GetCache(), this );
522  const SwBorderAttrs &rAttrs = *aAccess.Get();
523 
525  {
526  MakePos();
527 
528  if ( !isFrameAreaSizeValid() )
529  {
531  aFrm.Width( GetUpper()->getFramePrintArea().Width() );
532  }
533 
534  MakePrtArea( rAttrs );
535 
536  if ( !isFrameAreaSizeValid() )
537  {
538  setFrameAreaSizeValid(true);
539  Format(getRootFrame()->GetCurrShell()->GetOut());
540  }
541  }
542 
543  // RotateFlyFrame3 - inner frame
544  if(bRotated)
545  {
546  SwFlyFreeFrame* pUpperFly(dynamic_cast< SwFlyFreeFrame* >(GetUpper()));
547 
548  if(pUpperFly)
549  {
550  // restore outer frame back to Transformed state, that means
551  // set the SwFrameAreaDefinition(s) back to BoundAreas of
552  // the transformed SwFrame. All needed information is part
553  // of the already correctly created Transformations of the
554  // upper frame, so it can be re-created on the fly
555  if(pUpperFly->isTransformableSwFrame())
556  {
558  }
559  }
560 
561  // After the unrotated layout is finished, apply possible set rotation to it
562  // get center from outer frame (layout frame) to be on the safe side
563  const Point aCenter(GetUpper() ? GetUpper()->getFrameArea().Center() : getFrameArea().Center());
564  const basegfx::B2DPoint aB2DCenter(aCenter.X(), aCenter.Y());
565 
567  {
569  }
570 
572  fRotation,
573  aB2DCenter);
575  }
576  else
577  {
578  // reset transformations to show that they are not used
579  mpTransformableSwFrame.reset();
580  }
581 }
582 
583 // RotateFlyFrame3 - Support for Transformations - outer frame
585 {
587  {
588  // use pre-created transformation
590  }
591 
592  // call parent
594 }
595 
597 {
599  {
600  // use pre-created transformation
602  }
603 
604  // call parent
606 }
607 
608 // RotateFlyFrame3 - Support for Transformations
609 void SwNoTextFrame::transform_translate(const Point& rOffset)
610 {
611  // call parent - this will do the basic transform for SwRect(s)
612  // in the SwFrameAreaDefinition
614 
615  // check if the Transformations need to be adapted
617  {
618  const basegfx::B2DHomMatrix aTransform(
620  rOffset.X(), rOffset.Y()));
621 
622  // transform using TransformableSwFrame
623  getTransformableSwFrame()->transform(aTransform);
624  }
625 }
626 
627 // RotateFlyFrame3 - inner frame
628 // Check if we contain a SwGrfNode and get possible rotation from it
630 {
631  const SwNoTextNode* pSwNoTextNode(nullptr != GetNode() ? GetNode()->GetNoTextNode() : nullptr);
632 
633  if(nullptr != pSwNoTextNode)
634  {
635  const SwGrfNode* pSwGrfNode(pSwNoTextNode->GetGrfNode());
636 
637  if(nullptr != pSwGrfNode)
638  {
639  const SwAttrSet& rSwAttrSet(pSwGrfNode->GetSwAttrSet());
640  const SwRotationGrf& rSwRotationGrf(rSwAttrSet.GetRotationGrf());
641  const double fRotate = -toRadians(rSwRotationGrf.GetValue());
642 
643  return basegfx::normalizeToRange(fRotate, 2 * M_PI);
644  }
645  }
646 
647  // no rotation
648  return 0.0;
649 }
650 
652 void SwNoTextFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderAttrs * )
653 {
654  const Size aNewSize( GetSize() );
655 
656  // Did the height change?
657  SwTwips nChgHght = IsVertical() ?
658  static_cast<SwTwips>(aNewSize.Width() - getFramePrintArea().Width()) :
659  static_cast<SwTwips>(aNewSize.Height() - getFramePrintArea().Height());
660  if( nChgHght > 0)
661  Grow( nChgHght );
662  else if( nChgHght < 0)
663  Shrink( std::min(getFramePrintArea().Height(), tools::Long(-nChgHght)) );
664 }
665 
666 bool SwNoTextFrame::GetCharRect( SwRect &rRect, const SwPosition& rPos,
667  SwCursorMoveState *pCMS, bool /*bAllowFarAway*/ ) const
668 {
669  if ( &rPos.nNode.GetNode() != static_cast<SwNode const *>(GetNode()) )
670  return false;
671 
672  Calc(getRootFrame()->GetCurrShell()->GetOut());
673  SwRect aFrameRect( getFrameArea() );
674  rRect = aFrameRect;
675  rRect.Pos( getFrameArea().Pos() + getFramePrintArea().Pos() );
676  rRect.SSize( getFramePrintArea().SSize() );
677 
678  rRect.Justify();
679 
680  // Is the Bitmap in the visible area at all?
681  if( !aFrameRect.Overlaps( rRect ) )
682  {
683  // If not, then the Cursor is on the Frame
684  rRect = aFrameRect;
685  rRect.Width( 1 );
686  }
687  else
688  rRect.Intersection_( aFrameRect );
689 
690  if ( pCMS && pCMS->m_bRealHeight )
691  {
692  pCMS->m_aRealHeight.setY(rRect.Height());
693  pCMS->m_aRealHeight.setX(0);
694  }
695 
696  return true;
697 }
698 
700  SwCursorMoveState*, bool ) const
701 {
702  SwContentNode* pCNd = const_cast<SwContentNode*>(GetNode());
703  pPos->nNode = *pCNd;
704  pPos->nContent.Assign( pCNd, 0 );
705  return true;
706 }
707 
709 {
710  SwFlyFrame* pFly = FindFlyFrame();
711  if( pFly && pFly->GetFormat()->GetSurround().IsContour() )
712  {
713  ClrContourCache( pFly->GetVirtDrawObj() );
715  }
716 }
717 
719 {
720  if(GetNode()->GetNodeType() != SwNodeType::Grf)
721  {
722  InvalidatePrt();
724  return;
725  }
726  SwGrfNode* pNd = static_cast<SwGrfNode*>(GetNode());
727  ClearCache();
728  auto pVSh = pNd->GetDoc().getIDocumentLayoutAccess().GetCurrentViewShell();
729  if(pVSh)
731 }
732 
733 void SwNoTextFrame::SwClientNotify(const SwModify& rModify, const SfxHint& rHint)
734 {
735  if(dynamic_cast<const sw::GrfRereadAndInCacheHint*>(&rHint))
736  {
737  if(SwNodeType::Grf != GetNode()->GetNodeType())
738  {
739  InvalidatePrt();
741  }
742  return;
743  }
744  if(dynamic_cast<const sw::PreGraphicArrivedHint*>(&rHint))
745  {
747  return;
748  }
749  if (rHint.GetId() != SfxHintId::SwLegacyModify)
750  return;
751  auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
752  sal_uInt16 nWhich = pLegacy->GetWhich();
753 
754  // #i73788#
755  // no <SwContentFrame::Modify(..)> for RES_LINKED_GRAPHIC_STREAM_ARRIVED
756  if ( RES_GRAPHIC_PIECE_ARRIVED != nWhich &&
758  {
759  SwContentFrame::SwClientNotify(rModify, rHint);
760  }
761 
762  bool bComplete = true;
763 
764  switch( nWhich )
765  {
769  return;
770 
771  case RES_OBJECTDYING:
772  break;
773 
774  case RES_UPDATE_ATTR:
775  if (GetNode()->GetNodeType() != SwNodeType::Grf) {
776  break;
777  }
778  [[fallthrough]];
779  case RES_FMT_CHG:
780  ClearCache();
781  break;
782 
783  case RES_ATTRSET_CHG:
784  {
785  sal_uInt16 n;
786  for( n = RES_GRFATR_BEGIN; n < RES_GRFATR_END; ++n )
787  if( SfxItemState::SET == static_cast<const SwAttrSetChg*>(pLegacy->m_pOld)->GetChgSet()->
788  GetItemState( n, false ))
789  {
790  ClearCache();
791 
792  if(RES_GRFATR_ROTATION == n)
793  {
794  // RotGrfFlyFrame: Update Handles in view, these may be rotation-dependent
795  // (e.g. crop handles) and need a visualisation update
796  if ( GetNode()->GetNodeType() == SwNodeType::Grf )
797  {
798  SwGrfNode* pNd = static_cast<SwGrfNode*>( GetNode());
800 
801  if(pVSh)
802  {
803  SdrView* pDrawView = pVSh->GetDrawView();
804 
805  if(pDrawView)
806  {
807  pDrawView->AdjustMarkHdl(nullptr);
808  }
809  }
810 
811  // RotateFlyFrame3 - invalidate needed for ContentFrame (inner, this)
812  // and LayoutFrame (outer, GetUpper). It is possible to only invalidate
813  // the outer frame, but that leads to an in-between state that gets
814  // potentially painted
815  if(GetUpper())
816  {
818  }
819 
820  InvalidateAll_();
821  }
822  }
823  break;
824  }
825  if( RES_GRFATR_END == n ) // not found
826  return ;
827  }
828  break;
829 
830  default:
831  if ( !pLegacy->m_pNew || !isGRFATR(nWhich) )
832  return;
833  }
834 
835  if( bComplete )
836  {
837  InvalidatePrt();
839  }
840 }
841 
842 static void lcl_correctlyAlignRect( SwRect& rAlignedGrfArea, const SwRect& rInArea, vcl::RenderContext const * pOut )
843 {
844 
845  if(!pOut)
846  return;
847  tools::Rectangle aPxRect = pOut->LogicToPixel( rInArea.SVRect() );
848  tools::Rectangle aNewPxRect( aPxRect );
849  while( aNewPxRect.Left() < aPxRect.Left() )
850  {
851  rAlignedGrfArea.AddLeft( 1 );
852  aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
853  }
854  while( aNewPxRect.Top() < aPxRect.Top() )
855  {
856  rAlignedGrfArea.AddTop(+1);
857  aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
858  }
859  while( aNewPxRect.Bottom() > aPxRect.Bottom() )
860  {
861  rAlignedGrfArea.AddBottom( -1 );
862  aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
863  }
864  while( aNewPxRect.Right() > aPxRect.Right() )
865  {
866  rAlignedGrfArea.AddRight(-1);
867  aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
868  }
869 }
870 
872  vcl::RenderContext& rOutputDevice,
874  const basegfx::B2DRange& rSourceRange,
875  const basegfx::B2DRange& rTargetRange)
876 {
877  if(!rSequence.empty() && !basegfx::fTools::equalZero(rSourceRange.getWidth()) && !basegfx::fTools::equalZero(rSourceRange.getHeight()))
878  {
879  if(!basegfx::fTools::equalZero(rTargetRange.getWidth()) && !basegfx::fTools::equalZero(rTargetRange.getHeight()))
880  {
881  // map graphic range to target range. This will e.g. automatically include
882  // the mapping from 1/100th mm content to twips if needed when the target
883  // range is defined in twips
884  const basegfx::B2DHomMatrix aMappingTransform(
886  rSourceRange,
887  rTargetRange));
888 
889  // Fill ViewInformation. Use MappingTransform here, so there is no need to
890  // embed the primitives to it. Use original TargetRange here so there is also
891  // no need to embed the primitives to a MaskPrimitive for cropping. This works
892  // only in this case where the graphic object cannot be rotated, though.
893  const drawinglayer::geometry::ViewInformation2D aViewInformation2D(
894  aMappingTransform,
895  rOutputDevice.GetViewTransformation(),
896  rTargetRange,
897  nullptr,
898  0.0);
899 
900  // get a primitive processor for rendering
901  std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor2D(
903  rOutputDevice, aViewInformation2D) );
904 
905  // render and cleanup
906  pProcessor2D->process(rSequence);
907  return true;
908  }
909  }
910 
911  return false;
912 }
913 
914 // MM02 original using falölback to VOC and primitive-based version
916  vcl::RenderContext & rOutputDevice,
917  GraphicObject const& rGrfObj,
918  GraphicAttr const& rGraphicAttr,
919  const basegfx::B2DHomMatrix& rGraphicTransform,
920  const OUString& rName,
921  const OUString& rTitle,
922  const OUString& rDescription)
923 {
924  // RotGrfFlyFrame: unify using GraphicPrimitive2D
925  // -> the primitive handles all crop and mirror stuff
926  // -> the primitive renderer will create the needed pdf export data
927  // -> if bitmap content, it will be cached system-dependent
930  rGraphicTransform,
931  rGrfObj,
932  rGraphicAttr);
933 
934  // MM02 use primitive-based version for visualization
936  rOutputDevice,
937  aContent,
938  rGraphicTransform,
939  rName,
940  rTitle,
941  rDescription);
942 }
943 
944 // MM02 new VOC and primitive-based version
946  vcl::RenderContext & rOutputDevice,
948  const basegfx::B2DHomMatrix& rGraphicTransform,
949  const OUString& rName,
950  const OUString& rTitle,
951  const OUString& rDescription)
952 {
953  // RotateFlyFrame3: If ClipRegion is set at OutputDevice, we
954  // need to use that. Usually the renderer would be a VCL-based
955  // PrimitiveRenderer, but there are system-specific shortcuts that
956  // will *not* use the VCL-Paint of Bitmap and thus ignore this.
957  // Anyways, indirectly using a CLipRegion set at the target OutDev
958  // when using a PrimitiveRenderer is a non-valid implication.
959  // First tried only to use when HasPolyPolygonOrB2DPolyPolygon(),
960  // but there is an optimization at ClipRegion creation that detects
961  // a single Rectangle in a tools::PolyPolygon and forces to a simple
962  // RegionBand-based implementation, so cannot use it here.
963  if(rOutputDevice.IsClipRegion())
964  {
965  const basegfx::B2DPolyPolygon aClip(rOutputDevice.GetClipRegion().GetAsB2DPolyPolygon());
966 
967  if(0 != aClip.count())
968  {
969  rContent.resize(1);
970  rContent[0] =
972  aClip,
974  }
975  }
976 
977  if(!rName.isEmpty() || !rTitle.isEmpty() || !rDescription.isEmpty())
978  {
979  // Embed to ObjectInfoPrimitive2D when we have Name/Title/Description
980  // information available
981  rContent.resize(1);
982  rContent[0] =
985  rName,
986  rTitle,
987  rDescription);
988  }
989 
990  basegfx::B2DRange aTargetRange(0.0, 0.0, 1.0, 1.0);
991  aTargetRange.transform(rGraphicTransform);
992 
994  rOutputDevice,
995  rContent,
996  aTargetRange,
997  aTargetRange);
998 }
999 
1000 // DrawContact section
1001 namespace { // anonymous namespace
1002 class ViewObjectContactOfSwNoTextFrame : public sdr::contact::ViewObjectContact
1003 {
1004 protected:
1005  virtual void createPrimitive2DSequence(
1006  const sdr::contact::DisplayInfo& rDisplayInfo,
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 void ViewObjectContactOfSwNoTextFrame::createPrimitive2DSequence(
1036  const sdr::contact::DisplayInfo& /*rDisplayInfo*/,
1038 {
1039  // MM02 get all the parameters formally used in paintGraphicUsingPrimitivesHelper
1040  ViewContactOfSwNoTextFrame& rVCOfNTF(static_cast<ViewContactOfSwNoTextFrame&>(GetViewContact()));
1041  const SwNoTextFrame& rSwNoTextFrame(rVCOfNTF.getSwNoTextFrame());
1042  SwNoTextNode& rNoTNd(const_cast<SwNoTextNode&>(*static_cast<const SwNoTextNode*>(rSwNoTextFrame.GetNode())));
1043  SwGrfNode* pGrfNd(rNoTNd.GetGrfNode());
1044 
1045  if(nullptr != pGrfNd)
1046  {
1047  const bool bPrn(GetObjectContact().isOutputToPrinter() || GetObjectContact().isOutputToRecordingMetaFile());
1048  const GraphicObject& rGrfObj(pGrfNd->GetGrfObj(bPrn));
1049  GraphicAttr aGraphicAttr;
1050  pGrfNd->GetGraphicAttr(aGraphicAttr, &rSwNoTextFrame);
1051  const basegfx::B2DHomMatrix aGraphicTransform(rSwNoTextFrame.getFrameAreaTransformation());
1052 
1053  // MM02 this is the right place in the VOC-Mechanism to create
1054  // the primitives for visualization - these will be automatically
1055  // buffered and reused
1057  aGraphicTransform,
1058  rGrfObj,
1059  aGraphicAttr));
1060  }
1061 }
1062 
1063 ViewObjectContactOfSwNoTextFrame::ViewObjectContactOfSwNoTextFrame(
1064  sdr::contact::ObjectContact& rObjectContact,
1065  sdr::contact::ViewContact& rViewContact)
1066 : sdr::contact::ViewObjectContact(rObjectContact, rViewContact)
1067 {
1068 }
1069 
1070 sdr::contact::ViewObjectContact& ViewContactOfSwNoTextFrame::CreateObjectSpecificViewObjectContact(
1071  sdr::contact::ObjectContact& rObjectContact)
1072 {
1073  sdr::contact::ViewObjectContact* pRetval = new ViewObjectContactOfSwNoTextFrame(rObjectContact, *this);
1074  return *pRetval;
1075 }
1076 
1077 ViewContactOfSwNoTextFrame::ViewContactOfSwNoTextFrame(
1078  const SwNoTextFrame& rSwNoTextFrame
1079 )
1080 : mrSwNoTextFrame(rSwNoTextFrame)
1081 {
1082 }
1083 } // end of anonymous namespace
1084 
1086 {
1087  if(!mpViewContact)
1088  {
1089  const_cast< SwNoTextFrame* >(this)->mpViewContact =
1090  std::make_unique<ViewContactOfSwNoTextFrame>(*this);
1091  }
1092 
1093  return *mpViewContact;
1094 }
1095 
1103 void SwNoTextFrame::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfArea ) const
1104 {
1105  SwViewShell* pShell = getRootFrame()->GetCurrShell();
1106 
1107  SwNoTextNode& rNoTNd = const_cast<SwNoTextNode&>(*static_cast<const SwNoTextNode*>(GetNode()));
1108  SwGrfNode* pGrfNd = rNoTNd.GetGrfNode();
1109  SwOLENode* pOLENd = rNoTNd.GetOLENode();
1110 
1111  const bool bPrn = pOut == rNoTNd.getIDocumentDeviceAccess().getPrinter( false ) ||
1112  pOut->GetConnectMetaFile();
1113 
1114  const bool bIsChart = pOLENd && pOLENd->GetOLEObj().GetObject().IsChart();
1115 
1116  // calculate aligned rectangle from parameter <rGrfArea>.
1117  // Use aligned rectangle <aAlignedGrfArea> instead of <rGrfArea> in
1118  // the following code.
1119  SwRect aAlignedGrfArea = rGrfArea;
1120  ::SwAlignRect( aAlignedGrfArea, pShell, pOut );
1121 
1122  if( !bIsChart )
1123  {
1124  // Because for drawing a graphic left-top-corner and size coordinations are
1125  // used, these coordinations have to be determined on pixel level.
1126  ::SwAlignGrfRect( &aAlignedGrfArea, *pOut );
1127  }
1128  else //if( bIsChart )
1129  {
1130  // #i78025# charts own borders are not completely visible
1131  // the above pixel correction is not correct - at least not for charts
1132  // so a different pixel correction is chosen here
1133  // this might be a good idea for all other OLE objects also,
1134  // but as I cannot oversee the consequences I fix it only for charts for now
1135  lcl_correctlyAlignRect( aAlignedGrfArea, rGrfArea, pOut );
1136  }
1137 
1138  if( pGrfNd )
1139  {
1140  // Fix for bug fdo#33781
1141  const AntialiasingFlags nFormerAntialiasingAtOutput( pOut->GetAntialiasing() );
1143  {
1144  pOut->SetAntialiasing( nFormerAntialiasingAtOutput | AntialiasingFlags::Enable );
1145  }
1146 
1147  bool bContinue = true;
1148  const GraphicObject& rGrfObj = pGrfNd->GetGrfObj(bPrn);
1149 
1150  GraphicAttr aGrfAttr;
1151  pGrfNd->GetGraphicAttr( aGrfAttr, this );
1152 
1153  if( !bPrn )
1154  {
1155  // #i73788#
1156  if ( pGrfNd->IsLinkedInputStreamReady() )
1157  {
1158  pGrfNd->UpdateLinkWithInputStream();
1159  }
1160  // #i85717#, #i90395# - check, if asynchronous retrieval
1161  // if input stream for the graphic is possible
1162  else if ( ( rGrfObj.GetType() == GraphicType::Default ||
1163  rGrfObj.GetType() == GraphicType::NONE ) &&
1164  pGrfNd->IsLinkedFile() &&
1166  {
1167  Size aTmpSz;
1168  ::sfx2::SvLinkSource* pGrfObj = pGrfNd->GetLink()->GetObj();
1169  if( !pGrfObj ||
1170  !pGrfObj->IsDataComplete() ||
1171  !(aTmpSz = pGrfNd->GetTwipSize()).Width() ||
1172  !aTmpSz.Height())
1173  {
1174  pGrfNd->TriggerAsyncRetrieveInputStream(); // #i73788#
1175  }
1176  OUString aText( pGrfNd->GetTitle() );
1177  if ( aText.isEmpty() )
1178  GetRealURL( *pGrfNd, aText );
1179  ::lcl_PaintReplacement( aAlignedGrfArea, aText, *pShell, this, false );
1180  bContinue = false;
1181  }
1182  }
1183 
1184  if( bContinue )
1185  {
1186  if( rGrfObj.GetGraphic().IsSupportedGraphic())
1187  {
1188  const bool bAnimate = rGrfObj.IsAnimated() &&
1189  !pShell->IsPreview() &&
1191  // #i9684# Stop animation during printing/pdf export
1192  pShell->GetWin();
1193 
1194  if( bAnimate &&
1195  FindFlyFrame() != ::GetFlyFromMarked( nullptr, pShell ))
1196  {
1197  OutputDevice* pVout;
1198  if( pOut == pShell->GetOut() && SwRootFrame::FlushVout() )
1199  {
1200  pVout = pOut;
1201  pOut = pShell->GetOut();
1202  }
1203  else if( pShell->GetWin() && pOut->IsVirtual() )
1204  {
1205  pVout = pOut;
1206  pOut = pShell->GetWin()->GetOutDev();
1207  }
1208  else
1209  pVout = nullptr;
1210 
1211  OSL_ENSURE( !pOut->IsVirtual() ||
1212  pShell->GetViewOptions()->IsPDFExport() || pShell->isOutputToWindow(),
1213  "pOut should not be a virtual device" );
1214 
1215  pGrfNd->StartGraphicAnimation(pOut, aAlignedGrfArea.Pos(),
1216  aAlignedGrfArea.SSize(), reinterpret_cast<sal_IntPtr>(this),
1217  pVout );
1218  }
1219  else
1220  {
1221  // MM02 To allow system-dependent buffering of the involved
1222  // bitmaps it is necessary to re-use the involved primitives
1223  // and their already executed decomposition (also for
1224  // performance reasons). This is usually done in DrawingLayer
1225  // by using the VOC-Mechanism (see descriptions elsewhere).
1226  // To get that here, make the involved SwNoTextFrame (this)
1227  // a sdr::contact::ViewContact supplier by supporting
1228  // a GetViewContact() - call. For ObjectContact we can use
1229  // the already existing ObjectContact from the involved
1230  // DrawingLayer. For this, the helper classes
1231  // ViewObjectContactOfSwNoTextFrame
1232  // ViewContactOfSwNoTextFrame
1233  // are created which support the VOC-mechanism in its minimal
1234  // form. This allows automatic and view-dependent (multiple edit
1235  // windows, print, etc.) re-use of the created primitives.
1236  // Also: Will be very useful when completely changing the Writer
1237  // repaint to VOC and Primitives, too.
1238  static const char* pDisableMM02Goodies(getenv("SAL_DISABLE_MM02_GOODIES"));
1239  static bool bUseViewObjectContactMechanism(nullptr == pDisableMM02Goodies);
1240  // tdf#130951 for safety reasons use fallback if ViewObjectContactMechanism
1241  // fails for some reason - usually could only be not to find the correct
1242  // SdrPageWindow
1243  bool bSucceeded(false);
1244 
1245  if(bUseViewObjectContactMechanism)
1246  {
1247  // MM02 use VOC-mechanism and buffer primitives
1248  SwViewShellImp* pImp(pShell->Imp());
1249  SdrPageView* pPageView(nullptr != pImp
1250  ? pImp->GetPageView()
1251  : nullptr);
1252  // tdf#130951 caution - target may be Window, use the correct OutputDevice
1253  OutputDevice* pTarget(pShell->isOutputToWindow()
1254  ? pShell->GetWin()->GetOutDev()
1255  : pShell->GetOut());
1256  SdrPageWindow* pPageWindow(nullptr != pPageView && nullptr != pTarget
1257  ? pPageView->FindPageWindow(*pTarget)
1258  : nullptr);
1259 
1260  if(nullptr != pPageWindow)
1261  {
1262  sdr::contact::ObjectContact& rOC(pPageWindow->GetObjectContact());
1264  sdr::contact::ViewObjectContact& rVOC(rVC.GetViewObjectContact(rOC));
1265  sdr::contact::DisplayInfo aDisplayInfo;
1266 
1267  drawinglayer::primitive2d::Primitive2DContainer aPrimitives(rVOC.getPrimitive2DSequence(aDisplayInfo));
1268  const basegfx::B2DHomMatrix aGraphicTransform(getFrameAreaTransformation());
1269 
1271  *pOut,
1272  aPrimitives,
1273  aGraphicTransform,
1274  nullptr == pGrfNd->GetFlyFormat() ? OUString() : pGrfNd->GetFlyFormat()->GetName(),
1275  rNoTNd.GetTitle(),
1276  rNoTNd.GetDescription());
1277  bSucceeded = true;
1278  }
1279  }
1280 
1281  if(!bSucceeded)
1282  {
1283  // MM02 fallback to direct paint with primitive-recreation
1284  // which will block reusage of system-dependent bitmap data
1285  const basegfx::B2DHomMatrix aGraphicTransform(getFrameAreaTransformation());
1286 
1288  *pOut,
1289  rGrfObj,
1290  aGrfAttr,
1291  aGraphicTransform,
1292  nullptr == pGrfNd->GetFlyFormat() ? OUString() : pGrfNd->GetFlyFormat()->GetName(),
1293  rNoTNd.GetTitle(),
1294  rNoTNd.GetDescription());
1295  }
1296  }
1297  }
1298  else
1299  {
1300  TranslateId pResId;
1301 
1302  if( GraphicType::NONE == rGrfObj.GetType() )
1303  pResId = STR_COMCORE_READERROR;
1304  else if ( !rGrfObj.GetGraphic().IsSupportedGraphic() )
1305  pResId = STR_COMCORE_CANT_SHOW;
1306 
1307  OUString aText;
1308  if ( !pResId &&
1309  (aText = pGrfNd->GetTitle()).isEmpty() &&
1310  (!GetRealURL( *pGrfNd, aText ) || aText.isEmpty()))
1311  {
1312  pResId = STR_COMCORE_READERROR;
1313  }
1314  if (pResId)
1315  aText = SwResId(pResId);
1316 
1317  ::lcl_PaintReplacement( aAlignedGrfArea, aText, *pShell, this, true );
1318  }
1319  }
1320 
1322  pOut->SetAntialiasing( nFormerAntialiasingAtOutput );
1323  }
1324  else // bIsChart || pOLENd
1325  {
1326  // Fix for bug fdo#33781
1327  const AntialiasingFlags nFormerAntialiasingAtOutput( pOut->GetAntialiasing() );
1329  {
1330  AntialiasingFlags nNewAntialiasingAtOutput = nFormerAntialiasingAtOutput | AntialiasingFlags::Enable;
1331 
1332  // #i99665#
1333  // Adjust AntiAliasing mode at output device for chart OLE
1334  if ( pOLENd->IsChart() )
1335  nNewAntialiasingAtOutput |= AntialiasingFlags::PixelSnapHairline;
1336 
1337  pOut->SetAntialiasing( nNewAntialiasingAtOutput );
1338  }
1339 
1340  bool bDone(false);
1341 
1342  if(bIsChart)
1343  {
1344  basegfx::B2DRange aSourceRange;
1347  aSourceRange,
1348  bPrn));
1349 
1350  if(!aSequence.empty() && !aSourceRange.isEmpty())
1351  {
1352  const basegfx::B2DRange aTargetRange(
1353  aAlignedGrfArea.Left(), aAlignedGrfArea.Top(),
1354  aAlignedGrfArea.Right(), aAlignedGrfArea.Bottom());
1355 
1357  *pOut,
1358  aSequence,
1359  aSourceRange,
1360  aTargetRange);
1361  }
1362  }
1363 
1364  if(!bDone && pOLENd)
1365  {
1366  // SwOLENode does not have a known GraphicObject, need to
1367  // work with Graphic instead
1368  const Graphic* pGraphic = pOLENd->GetGraphic();
1369  const Point aPosition(aAlignedGrfArea.Pos());
1370  const Size aSize(aAlignedGrfArea.SSize());
1371 
1372  if ( pGraphic && pGraphic->GetType() != GraphicType::NONE )
1373  {
1374  pGraphic->Draw(*pOut, aPosition, aSize);
1375 
1376  // shade the representation if the object is activated outplace
1377  uno::Reference < embed::XEmbeddedObject > xObj = pOLENd->GetOLEObj().GetOleRef();
1378  if ( xObj.is() && xObj->getCurrentState() == embed::EmbedStates::ACTIVE )
1379  {
1380 
1383  aPosition,
1384  aSize),
1385  pOut);
1386  }
1387  }
1388  else
1389  {
1391  tools::Rectangle(aPosition, aSize),
1392  pOLENd->GetOLEObj().GetCurrentPersistName(),
1393  pOut);
1394  }
1395 
1396  sal_Int64 nMiscStatus = pOLENd->GetOLEObj().GetOleRef()->getStatus( pOLENd->GetAspect() );
1397  if ( !bPrn && dynamic_cast< const SwCursorShell *>( pShell ) != nullptr &&
1398  (nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE))
1399  {
1400  const SwFlyFrame *pFly = FindFlyFrame();
1401  assert( pFly != nullptr );
1402  static_cast<SwFEShell*>(pShell)->ConnectObj( pOLENd->GetOLEObj().GetObject(), pFly->getFramePrintArea(), pFly->getFrameArea());
1403  }
1404  }
1405 
1406  // see #i99665#
1408  {
1409  pOut->SetAntialiasing( nFormerAntialiasingAtOutput );
1410  }
1411  }
1412 }
1413 
1415 {
1416  const SwViewShell* pSh = getRootFrame()->GetCurrShell();
1417 
1418  if ( !pSh || !pSh->GetViewOptions()->IsGraphic() )
1419  {
1420  return true;
1421  }
1422 
1423  const SwGrfNode *pNd;
1424 
1425  if( nullptr != (pNd = GetNode()->GetGrfNode()) )
1426  {
1427  if(pNd->IsTransparent())
1428  {
1429  return true;
1430  }
1431  }
1432 
1433  // RotateFlyFrame3: If we are transformed, there are 'free' areas between
1434  // the Graphic and the Border/Padding stuff - at least as long as those
1435  // (Border and Padding) are not transformed, too
1437  {
1438  // we can be more specific - rotations of multiples of
1439  // 90 degrees will leave no gaps. Go from [0.0 .. 2PI]
1440  // to [0 .. 360] and check modulo 90
1441  const tools::Long nRot(static_cast<tools::Long>(basegfx::rad2deg(getLocalFrameRotation())));
1442  const bool bMultipleOf90(0 == (nRot % 90));
1443 
1444  if(!bMultipleOf90)
1445  {
1446  return true;
1447  }
1448  }
1449 
1450  //#29381# OLE are always transparent
1451  if(nullptr != GetNode()->GetOLENode())
1452  {
1453  return true;
1454  }
1455 
1456  // return false by default to avoid background paint
1457  return false;
1458 }
1459 
1461 {
1462  // Stop animated graphics
1463  const SwGrfNode* pGrfNd = GetNode()->GetGrfNode();
1464 
1465  if( pGrfNd && pGrfNd->IsAnimated() )
1466  {
1467  const_cast< SwGrfNode* >(pGrfNd)->StopGraphicAnimation( pOut, reinterpret_cast<sal_IntPtr>(this) );
1468  }
1469 }
1470 
1472 {
1473  const SwGrfNode* pGrfNd = GetNode()->GetGrfNode();
1474  return pGrfNd && pGrfNd->IsAnimated();
1475 }
1476 
1477 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetFamily(FontFamily)
vcl::RenderContext * GetOut() const
Definition: viewsh.hxx:339
void SetClipRegion()
vcl::Region GetClipRegion() const
void transform(const basegfx::B2DHomMatrix &aTransform)
Definition: wsfrm.cxx:287
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
Definition: nodeoffset.hxx:35
bool IsContour() const
Definition: fmtsrnd.hxx:53
const SwVirtFlyDrawObj * GetVirtDrawObj() const
Definition: fly.cxx:2801
Base class of the Writer layout elements.
Definition: frame.hxx:314
virtual basegfx::B2DHomMatrix getFramePrintAreaTransformation() const override
Definition: notxtfrm.cxx:596
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:202
sal_Int64 GetAspect() const
Definition: ndole.hxx:139
virtual const SwFlyFrameFormat * GetFormat() const override
Definition: fly.cxx:2895
Marks a position in the document model.
Definition: pam.hxx:36
sal_Int32 GetLeft() const
void MakePrtArea(const SwBorderAttrs &)
Definition: calcmove.cxx:1062
const tools::SvRef< sfx2::SvBaseLink > & GetLink() const
Definition: ndgrf.hxx:132
void SetAntialiasing(AntialiasingFlags nMode)
sal_uInt16 GetWhich() const
Definition: calbck.hxx:74
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:666
SwTwips Grow(SwTwips, bool bTst=false, bool bInfo=false)
Definition: wsfrm.cxx:1503
AntialiasingFlags
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
Definition: ndole.hxx:164
bool m_bRealHeight
should the real height be calculated?
Definition: crstate.hxx:141
SwRect getUntransformedFramePrintArea() const
Definition: wsfrm.cxx:189
void setWidth(tools::Long nWidth)
virtual bool IsVirtual() const
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:115
SwViewShellImp * Imp()
Definition: viewsh.hxx:182
TransformableSwFrame * getTransformableSwFrame()
Definition: flyfrms.hxx:132
const SwAccessibilityOptions * GetAccessibilityOptions() const
Definition: viewsh.hxx:436
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:584
void Left(const tools::Long nLeft)
Definition: swrect.hxx:197
SwNodeIndex nNode
Definition: pam.hxx:38
void SetCompletePaint() const
Definition: frame.hxx:994
constexpr::Color COL_RED(0x80, 0x00, 0x00)
virtual basegfx::B2DHomMatrix getFramePrintAreaTransformation() const
Definition: wsfrm.cxx:135
long Long
const SwRect & getFramePrintArea() const
Definition: frame.hxx:180
static void DrawShading(const tools::Rectangle &rRect, OutputDevice *pOut)
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
sdr::contact::ViewContact & GetViewContact() const
Definition: notxtfrm.cxx:1085
static SwCache & GetCache()
Definition: frame.hxx:521
constexpr TypedWhichId< SwMsgPoolItem > RES_LINKED_GRAPHIC_STREAM_ARRIVED(189)
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
Definition: ndole.cxx:939
SwNoTextFrame(SwNoTextNode *const, SwFrame *)
Definition: notxtfrm.cxx:147
sal_Int64 n
bool IsSupportedGraphic() const
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:128
MirrorGraph
Definition: grfatr.hxx:31
void Draw(OutputDevice &rOutDev, const Point &rDestPt) const
void IntersectClipRegion(const tools::Rectangle &rRect)
GDIMetaFile * GetConnectMetaFile() const
friend class SwNoTextFrame
Definition: ndnotxt.hxx:32
void Pos(const Point &rNew)
Definition: swrect.hxx:171
RotateFlyFrame3: Helper class when you want to make your SwFrame derivate transformable.
Definition: frame.hxx:235
constexpr double rad2deg(double v)
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:652
virtual void MakeAll(vcl::RenderContext *pRenderContext) override
Definition: notxtfrm.cxx:478
Center
virtual basegfx::B2DHomMatrix getFrameAreaTransformation() const
Definition: wsfrm.cxx:125
AntialiasingFlags GetAntialiasing() const
SfxHintId GetId() const
bool isFrameAreaDefinitionValid() const
Definition: frame.hxx:171
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: wsfrm.cxx:2340
double getLocalFrameRotation() const
Definition: notxtfrm.cxx:629
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:128
WEIGHT_BOLD
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:164
SwRect & Intersection_(const SwRect &rRect)
Definition: swrect.cxx:81
constexpr tools::Long Width() const
bool IsChart() const
Definition: ndole.cxx:632
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
Templatized version of GetItemState() to directly return the correct type.
Definition: format.hxx:111
drawinglayer::primitive2d::Primitive2DContainer const & tryToGetChartContentAsPrimitive2DSequence(basegfx::B2DRange &rRange, bool bSynchron)
Definition: ndole.cxx:1083
bool IsAsyncRetrieveInputStreamPossible() const
Definition: ndgrf.cxx:888
bool isGRFATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:511
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:1126
LINESTYLE_NONE
void restoreFrameAreas()
Definition: wsfrm.cxx:269
SwIndex nContent
Definition: pam.hxx:39
const SwRect & getFrameArea() const
Definition: frame.hxx:179
void TriggerAsyncRetrieveInputStream()
Definition: ndgrf.cxx:828
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:990
const OUString & GetName() const
Definition: format.hxx:131
bool DrawFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes, const SwRect &rOriginalLayoutRect, const SwRegionRects &rPaintRegion, const basegfx::utils::B2DClipState &rClipState, vcl::RenderContext &rOut)
Definition: paintfrm.cxx:1725
bool IsVisitedURL(std::u16string_view rURL)
Definition: visiturl.cxx:100
std::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr
Definition: format.hxx:41
void Width(tools::Long nNew)
Definition: swrect.hxx:189
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:331
bool HasAnimation() const
Definition: notxtfrm.cxx:1471
const SwFormatSurround & GetSurround(bool=true) const
Definition: fmtsrnd.hxx:66
SwDoc * GetDoc() const
Definition: viewsh.hxx:282
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:1816
virtual bool GetModelPositionForViewPoint(SwPosition *pPos, Point &aPoint, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
Definition: notxtfrm.cxx:699
SwFlyFrame * FindFlyFrame()
Definition: frame.hxx:1111
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:2101
std::unique_ptr< TransformableSwFrame > mpTransformableSwFrame
Definition: notxtfrm.hxx:45
const OUString & GetCurrentPersistName() const
Definition: ndole.hxx:71
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:609
sal_uInt16 GetVirtPageNum() const
Definition: trvlfrm.cxx:1806
constexpr TypedWhichId< SwRotationGrf > RES_GRFATR_ROTATION(135)
B2DHomMatrix createSourceRangeTargetRangeTransform(const B2DRange &rSourceRange, const B2DRange &rTargetRange)
void StopAnimation(const OutputDevice *=nullptr) const
Definition: notxtfrm.cxx:1460
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:915
constexpr TypedWhichId< SwUpdateAttr > RES_UPDATE_ATTR(167)
void SetFamilyName(const OUString &rFamilyName)
virtual void createPrimitive2DSequence(const DisplayInfo &rDisplayInfo, drawinglayer::primitive2d::Primitive2DDecompositionVisitor &rVisitor) const
void InvalidatePrt()
Definition: frame.hxx:1036
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:213
GraphicType GetType() const
void PaintPicture(vcl::RenderContext *, const SwRect &) const
Paint the graphic.
Definition: notxtfrm.cxx:1103
virtual void visit(const Primitive2DReference &)=0
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:130
SwPageFrame * FindPageFrame()
Definition: frame.hxx:680
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:245
std::unique_ptr< sdr::contact::ViewContact > mpViewContact
Definition: notxtfrm.hxx:56
bool IsPreview() const
Definition: viewsh.hxx:493
SwNoTextNode * GetNoTextNode()
Definition: ndnotxt.hxx:95
const SwFormatURL & GetURL(bool=true) const
Definition: fmturl.hxx:78
SwLayoutFrame * GetUpper()
Definition: frame.hxx:678
constexpr tools::Long Right() const
void SetFillColor()
constexpr TypedWhichId< SwAttrSetChg > RES_ATTRSET_CHG(163)
bool isFramePrintAreaValid() const
Definition: frame.hxx:168
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
Layout frame for SwNoTextNode, i.e. graphics and OLE nodes (including charts).
Definition: ndnotxt.hxx:29
double toRadians(D x)
const IDocumentSettingAccess * getIDocumentSettingAccess() const
Provides access to the document setting interface.
Definition: node.cxx:2100
bool IsPDFExport() const
Definition: viewopt.hxx:417
bool isFrameAreaPositionValid() const
Definition: frame.hxx:166
static bool paintUsingPrimitivesHelper(vcl::RenderContext &rOutputDevice, const drawinglayer::primitive2d::Primitive2DContainer &rSequence, const basegfx::B2DRange &rSourceRange, const basegfx::B2DRange &rTargetRange)
Definition: notxtfrm.cxx:871
const Size & GetSize() const
By returning the surrounding Fly's size which equals the graphic's size.
Definition: notxtfrm.cxx:469
bool isOutputToWindow() const
Definition: viewsh.cxx:137
void AddRight(const tools::Long nAdd)
Definition: swrect.cxx:127
OUString GetDescription() const
Definition: ndnotxt.cxx:282
void SSize(const Size &rNew)
Definition: swrect.hxx:180
Point m_aRealHeight
contains then the position/height of the cursor
Definition: crstate.hxx:137
bool isFrameAreaSizeValid() const
Definition: frame.hxx:167
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:1414
tools::Long SwTwips
Definition: swtypes.hxx:51
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:2681
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:7411
void AddLeft(const tools::Long nAdd)
Definition: swrect.cxx:125
sal_Int32 GetTop() const
void Bottom(const tools::Long nBottom)
Definition: swrect.hxx:211
const SwContentNode * GetNode() const
Definition: notxtfrm.hxx:66
bool HasBorder(bool bTreatPaddingAsBorder) const
void SetStyleName(const OUString &rStyleName)
void Justify()
Definition: swrect.cxx:94
tools::Rectangle SVRect() const
Definition: swrect.hxx:292
general base class for all free-flowing frames
Definition: flyfrm.hxx:78
Color GetRetoucheColor() const
Definition: viewimp.cxx:286
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:347
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:137
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:428
vcl::Window * GetWin() const
Definition: viewsh.hxx:338
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:803
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:708
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:165
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:206
void UpdateLinkWithInputStream()
Definition: ndgrf.cxx:870
void setFrameAreaSizeValid(bool bNew)
Definition: wsfrm.cxx:92
SwFrameType mnFrameType
Definition: frame.hxx:414
const basegfx::B2DHomMatrix & getLocalFrameAreaTransformation() const
Definition: frame.hxx:255
virtual bool GetCharRect(SwRect &, const SwPosition &, SwCursorMoveState *=nullptr, bool bAllowFarAway=true) const override
Definition: notxtfrm.cxx:666
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:724
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:973
virtual void Calc(vcl::RenderContext *pRenderContext) const override
Definition: fly.cxx:2905
static bool IsAntiAliasing()
Definition: dview.cxx:130
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:718
bool IsTransparent() const
Definition: ndgrf.cxx:822
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:2654
bool IsAnimated() const
SwGrfNode * GetGrfNode()
Definition: ndgrf.hxx:154
virtual void MakePos()
Definition: calcmove.cxx:526
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
FontLineStyle
void adaptFrameAreasToTransformations()
Definition: wsfrm.cxx:234
void SetOutDev(SwViewShell *pSh, OutputDevice *pOut)
Definition: notxtfrm.cxx:169
static bool FlushVout()
Output virtual Device (e.g. for animations)
Definition: virtoutp.cxx:30
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:206
basegfx::B2DHomMatrix GetViewTransformation() const
void Height(tools::Long nNew)
Definition: swrect.hxx:193
void OnGraphicArrived(const SwRect &)
Definition: viewsh.cxx:2697
void createFrameAreaTransformations(double fRotation, const basegfx::B2DPoint &rCenter)
Definition: wsfrm.cxx:214
const basegfx::B2DHomMatrix & getLocalFramePrintAreaTransformation() const
Definition: frame.hxx:261
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.hxx:374
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:679
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_OBJECTDYING(RES_MSG_BEGIN)
virtual void transform_translate(const Point &rOffset)
Definition: wsfrm.cxx:148
const Color & GetValue() const
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: notxtfrm.cxx:733
virtual void DestroyImpl() override
Definition: ssfrm.cxx:426
static void lcl_correctlyAlignRect(SwRect &rAlignedGrfArea, const SwRect &rInArea, vcl::RenderContext const *pOut)
Definition: notxtfrm.cxx:842
const OUString & GetURL() const
Definition: fmturl.hxx:66
Base class of the Writer document model elements.
Definition: node.hxx:81