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