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
84using namespace com::sun::star;
85
86static 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
97static 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("Noto Sans");
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{
161
163}
164
166{
167}
168
170{
171 pSh->mpOut = pOut;
172}
173
174static 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);
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 {
207 rOut.SetLineColor();
208 for( const auto &rRegion : aRegion )
209 rOut.DrawRect( rRegion.SVRect() );
210 rOut.Pop();
211 }
212}
213
214void 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 {
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() )
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
331static 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
347void 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 {
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
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
609void 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
652void 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)
664}
665
667 SwCursorMoveState *pCMS, bool /*bAllowFarAway*/ ) const
668{
669 if ( &rPos.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 pPos->Assign(*GetNode());
703 return true;
704}
705
707{
708 SwFlyFrame* pFly = FindFlyFrame();
709 if( pFly && pFly->GetFormat()->GetSurround().IsContour() )
710 {
713 }
714}
715
717{
718 if(GetNode()->GetNodeType() != SwNodeType::Grf)
719 {
722 return;
723 }
724 SwGrfNode* pNd = static_cast<SwGrfNode*>(GetNode());
725 ClearCache();
727 if(pVSh)
729}
730
731void SwNoTextFrame::SwClientNotify(const SwModify& rModify, const SfxHint& rHint)
732{
733 if(dynamic_cast<const sw::GrfRereadAndInCacheHint*>(&rHint))
734 {
735 if(SwNodeType::Grf != GetNode()->GetNodeType())
736 {
739 }
740 return;
741 }
742 if(rHint.GetId() == SfxHintId::SwPreGraphicArrived
743 || rHint.GetId() == SfxHintId::SwGraphicPieceArrived
744 || rHint.GetId() == SfxHintId::SwLinkedGraphicStreamArrived)
745 {
747 return;
748 }
749 else if (rHint.GetId() != SfxHintId::SwLegacyModify)
750 return;
751 auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
752 sal_uInt16 nWhich = pLegacy->GetWhich();
753
754 SwContentFrame::SwClientNotify(rModify, rHint);
755
756 bool bComplete = true;
757
758 switch( nWhich )
759 {
760 case RES_OBJECTDYING:
761 break;
762
763 case RES_UPDATE_ATTR:
764 if (GetNode()->GetNodeType() != SwNodeType::Grf) {
765 break;
766 }
767 [[fallthrough]];
768 case RES_FMT_CHG:
769 ClearCache();
770 break;
771
772 case RES_ATTRSET_CHG:
773 {
774 sal_uInt16 n;
775 for( n = RES_GRFATR_BEGIN; n < RES_GRFATR_END; ++n )
776 if( SfxItemState::SET == static_cast<const SwAttrSetChg*>(pLegacy->m_pOld)->GetChgSet()->
777 GetItemState( n, false ))
778 {
779 ClearCache();
780
782 {
783 // RotGrfFlyFrame: Update Handles in view, these may be rotation-dependent
784 // (e.g. crop handles) and need a visualisation update
785 if ( GetNode()->GetNodeType() == SwNodeType::Grf )
786 {
787 SwGrfNode* pNd = static_cast<SwGrfNode*>( GetNode());
789
790 if(pVSh)
791 {
792 SdrView* pDrawView = pVSh->GetDrawView();
793
794 if(pDrawView)
795 {
796 pDrawView->AdjustMarkHdl(nullptr);
797 }
798 }
799
800 // RotateFlyFrame3 - invalidate needed for ContentFrame (inner, this)
801 // and LayoutFrame (outer, GetUpper). It is possible to only invalidate
802 // the outer frame, but that leads to an in-between state that gets
803 // potentially painted
804 if(GetUpper())
805 {
807 }
808
810 }
811 }
812 break;
813 }
814 if( RES_GRFATR_END == n ) // not found
815 return ;
816 }
817 break;
818
819 default:
820 if ( !pLegacy->m_pNew || !isGRFATR(nWhich) )
821 return;
822 }
823
824 if( bComplete )
825 {
828 }
829}
830
831static void lcl_correctlyAlignRect( SwRect& rAlignedGrfArea, const SwRect& rInArea, vcl::RenderContext const * pOut )
832{
833
834 if(!pOut)
835 return;
836 tools::Rectangle aPxRect = pOut->LogicToPixel( rInArea.SVRect() );
837 tools::Rectangle aNewPxRect( aPxRect );
838 while( aNewPxRect.Left() < aPxRect.Left() )
839 {
840 rAlignedGrfArea.AddLeft( 1 );
841 aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
842 }
843 while( aNewPxRect.Top() < aPxRect.Top() )
844 {
845 rAlignedGrfArea.AddTop(+1);
846 aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
847 }
848 while( aNewPxRect.Bottom() > aPxRect.Bottom() )
849 {
850 rAlignedGrfArea.AddBottom( -1 );
851 aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
852 }
853 while( aNewPxRect.Right() > aPxRect.Right() )
854 {
855 rAlignedGrfArea.AddRight(-1);
856 aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
857 }
858}
859
861 vcl::RenderContext& rOutputDevice,
863 const basegfx::B2DRange& rSourceRange,
864 const basegfx::B2DRange& rTargetRange)
865{
866 if(!rSequence.empty() && !basegfx::fTools::equalZero(rSourceRange.getWidth()) && !basegfx::fTools::equalZero(rSourceRange.getHeight()))
867 {
868 if(!basegfx::fTools::equalZero(rTargetRange.getWidth()) && !basegfx::fTools::equalZero(rTargetRange.getHeight()))
869 {
870 // map graphic range to target range. This will e.g. automatically include
871 // the mapping from 1/100th mm content to twips if needed when the target
872 // range is defined in twips
873 const basegfx::B2DHomMatrix aMappingTransform(
875 rSourceRange,
876 rTargetRange));
877
878 // Fill ViewInformation. Use MappingTransform here, so there is no need to
879 // embed the primitives to it. Use original TargetRange here so there is also
880 // no need to embed the primitives to a MaskPrimitive for cropping. This works
881 // only in this case where the graphic object cannot be rotated, though.
883 aViewInformation2D.setObjectTransformation(aMappingTransform);
884 aViewInformation2D.setViewTransformation(rOutputDevice.GetViewTransformation());
885 aViewInformation2D.setViewport(rTargetRange);
886
887 // get a primitive processor for rendering
888 std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor2D(
890 rOutputDevice, aViewInformation2D) );
891
892 // render and cleanup
893 pProcessor2D->process(rSequence);
894 return true;
895 }
896 }
897
898 return false;
899}
900
901// MM02 original using fallback to VOC and primitive-based version
903 vcl::RenderContext & rOutputDevice,
904 GraphicObject const& rGrfObj,
905 GraphicAttr const& rGraphicAttr,
906 const basegfx::B2DHomMatrix& rGraphicTransform,
907 const OUString& rName,
908 const OUString& rTitle,
909 const OUString& rDescription)
910{
911 // RotGrfFlyFrame: unify using GraphicPrimitive2D
912 // -> the primitive handles all crop and mirror stuff
913 // -> the primitive renderer will create the needed pdf export data
914 // -> if bitmap content, it will be cached system-dependent
917 rGraphicTransform,
918 rGrfObj,
919 rGraphicAttr);
920
921 // MM02 use primitive-based version for visualization
923 rOutputDevice,
924 aContent,
925 rGraphicTransform,
926 rName,
927 rTitle,
928 rDescription);
929}
930
931// MM02 new VOC and primitive-based version
933 vcl::RenderContext & rOutputDevice,
935 const basegfx::B2DHomMatrix& rGraphicTransform,
936 const OUString& rName,
937 const OUString& rTitle,
938 const OUString& rDescription)
939{
940 // RotateFlyFrame3: If ClipRegion is set at OutputDevice, we
941 // need to use that. Usually the renderer would be a VCL-based
942 // PrimitiveRenderer, but there are system-specific shortcuts that
943 // will *not* use the VCL-Paint of Bitmap and thus ignore this.
944 // Anyways, indirectly using a CLipRegion set at the target OutDev
945 // when using a PrimitiveRenderer is a non-valid implication.
946 // First tried only to use when HasPolyPolygonOrB2DPolyPolygon(),
947 // but there is an optimization at ClipRegion creation that detects
948 // a single Rectangle in a tools::PolyPolygon and forces to a simple
949 // RegionBand-based implementation, so cannot use it here.
950 if(rOutputDevice.IsClipRegion())
951 {
953
954 if(0 != aClip.count())
955 {
956 rContent.resize(1);
957 rContent[0] =
959 std::move(aClip),
961 }
962 }
963
964 if(!rName.isEmpty() || !rTitle.isEmpty() || !rDescription.isEmpty())
965 {
966 // Embed to ObjectInfoPrimitive2D when we have Name/Title/Description
967 // information available
968 rContent.resize(1);
969 rContent[0] =
972 rName,
973 rTitle,
974 rDescription);
975 }
976
977 basegfx::B2DRange aTargetRange(0.0, 0.0, 1.0, 1.0);
978 aTargetRange.transform(rGraphicTransform);
979
981 rOutputDevice,
982 rContent,
983 aTargetRange,
984 aTargetRange);
985}
986
987// DrawContact section
988namespace { // anonymous namespace
989class ViewObjectContactOfSwNoTextFrame : public sdr::contact::ViewObjectContact
990{
991protected:
992 virtual void createPrimitive2DSequence(
993 const sdr::contact::DisplayInfo& rDisplayInfo,
995
996 // tdf#155190 disable this so superclass doesn't wrongly produce NonStruct
997 virtual bool isExportPDFTags() const override { return false; }
998
999public:
1000 ViewObjectContactOfSwNoTextFrame(
1001 sdr::contact::ObjectContact& rObjectContact,
1002 sdr::contact::ViewContact& rViewContact);
1003};
1004
1005class ViewContactOfSwNoTextFrame : public sdr::contact::ViewContact
1006{
1007private:
1008 // owner
1009 const SwNoTextFrame& mrSwNoTextFrame;
1010
1011protected:
1012 // Create an Object-Specific ViewObjectContact, set ViewContact and
1013 // ObjectContact. Always needs to return something.
1015 sdr::contact::ObjectContact& rObjectContact) override;
1016
1017public:
1018 // read-access to owner
1019 const SwNoTextFrame& getSwNoTextFrame() const { return mrSwNoTextFrame; }
1020
1021 // basic constructor, used from SwNoTextFrame.
1022 explicit ViewContactOfSwNoTextFrame(const SwNoTextFrame& rSwNoTextFrame);
1023};
1024
1025void ViewObjectContactOfSwNoTextFrame::createPrimitive2DSequence(
1026 const sdr::contact::DisplayInfo& /*rDisplayInfo*/,
1028{
1029 // MM02 get all the parameters formally used in paintGraphicUsingPrimitivesHelper
1030 ViewContactOfSwNoTextFrame& rVCOfNTF(static_cast<ViewContactOfSwNoTextFrame&>(GetViewContact()));
1031 const SwNoTextFrame& rSwNoTextFrame(rVCOfNTF.getSwNoTextFrame());
1032 SwNoTextNode& rNoTNd(const_cast<SwNoTextNode&>(*static_cast<const SwNoTextNode*>(rSwNoTextFrame.GetNode())));
1033 SwGrfNode* pGrfNd(rNoTNd.GetGrfNode());
1034
1035 if(nullptr != pGrfNd)
1036 {
1037 const bool bPrn(GetObjectContact().isOutputToPrinter() || GetObjectContact().isOutputToRecordingMetaFile());
1038 const GraphicObject& rGrfObj(pGrfNd->GetGrfObj(bPrn));
1039 GraphicAttr aGraphicAttr;
1040 pGrfNd->GetGraphicAttr(aGraphicAttr, &rSwNoTextFrame);
1041 const basegfx::B2DHomMatrix aGraphicTransform(rSwNoTextFrame.getFrameAreaTransformation());
1042
1043 // MM02 this is the right place in the VOC-Mechanism to create
1044 // the primitives for visualization - these will be automatically
1045 // buffered and reused
1047 aGraphicTransform,
1048 rGrfObj,
1049 aGraphicAttr));
1050 }
1051}
1052
1053ViewObjectContactOfSwNoTextFrame::ViewObjectContactOfSwNoTextFrame(
1054 sdr::contact::ObjectContact& rObjectContact,
1055 sdr::contact::ViewContact& rViewContact)
1056: sdr::contact::ViewObjectContact(rObjectContact, rViewContact)
1057{
1058}
1059
1060sdr::contact::ViewObjectContact& ViewContactOfSwNoTextFrame::CreateObjectSpecificViewObjectContact(
1061 sdr::contact::ObjectContact& rObjectContact)
1062{
1063 sdr::contact::ViewObjectContact* pRetval = new ViewObjectContactOfSwNoTextFrame(rObjectContact, *this);
1064 return *pRetval;
1065}
1066
1067ViewContactOfSwNoTextFrame::ViewContactOfSwNoTextFrame(
1068 const SwNoTextFrame& rSwNoTextFrame
1069)
1070: mrSwNoTextFrame(rSwNoTextFrame)
1071{
1072}
1073} // end of anonymous namespace
1074
1076{
1077 if(!mpViewContact)
1078 {
1079 const_cast< SwNoTextFrame* >(this)->mpViewContact =
1080 std::make_unique<ViewContactOfSwNoTextFrame>(*this);
1081 }
1082
1083 return *mpViewContact;
1084}
1085
1093void SwNoTextFrame::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfArea ) const
1094{
1095 SwViewShell* pShell = getRootFrame()->GetCurrShell();
1096
1097 SwNoTextNode& rNoTNd = const_cast<SwNoTextNode&>(*static_cast<const SwNoTextNode*>(GetNode()));
1098 SwGrfNode* pGrfNd = rNoTNd.GetGrfNode();
1099 SwOLENode* pOLENd = rNoTNd.GetOLENode();
1100
1101 const bool bPrn = pOut == rNoTNd.getIDocumentDeviceAccess().getPrinter( false ) ||
1102 pOut->GetConnectMetaFile();
1103
1104 const bool bIsChart = pOLENd && pOLENd->GetOLEObj().GetObject().IsChart();
1105
1106 // calculate aligned rectangle from parameter <rGrfArea>.
1107 // Use aligned rectangle <aAlignedGrfArea> instead of <rGrfArea> in
1108 // the following code.
1109 SwRect aAlignedGrfArea = rGrfArea;
1110 ::SwAlignRect( aAlignedGrfArea, pShell, pOut );
1111
1112 if( !bIsChart )
1113 {
1114 // Because for drawing a graphic left-top-corner and size coordinations are
1115 // used, these coordinations have to be determined on pixel level.
1116 ::SwAlignGrfRect( &aAlignedGrfArea, *pOut );
1117 }
1118 else //if( bIsChart )
1119 {
1120 // #i78025# charts own borders are not completely visible
1121 // the above pixel correction is not correct - at least not for charts
1122 // so a different pixel correction is chosen here
1123 // this might be a good idea for all other OLE objects also,
1124 // but as I cannot oversee the consequences I fix it only for charts for now
1125 lcl_correctlyAlignRect( aAlignedGrfArea, rGrfArea, pOut );
1126 }
1127
1128 if( pGrfNd )
1129 {
1130 // Fix for bug fdo#33781
1131 const AntialiasingFlags nFormerAntialiasingAtOutput( pOut->GetAntialiasing() );
1133 pOut->SetAntialiasing( nFormerAntialiasingAtOutput | AntialiasingFlags::Enable );
1134
1135 ImplPaintPictureGraphic( pOut, pGrfNd, bPrn, aAlignedGrfArea, pShell, rNoTNd );
1136
1138 pOut->SetAntialiasing( nFormerAntialiasingAtOutput );
1139 }
1140 else // bIsChart || pOLENd
1141 {
1142 // Fix for bug fdo#33781
1143 const AntialiasingFlags nFormerAntialiasingAtOutput( pOut->GetAntialiasing() );
1145 {
1146 AntialiasingFlags nNewAntialiasingAtOutput = nFormerAntialiasingAtOutput | AntialiasingFlags::Enable;
1147
1148 // #i99665#
1149 // Adjust AntiAliasing mode at output device for chart OLE
1150 if ( pOLENd->IsChart() )
1151 nNewAntialiasingAtOutput |= AntialiasingFlags::PixelSnapHairline;
1152
1153 pOut->SetAntialiasing( nNewAntialiasingAtOutput );
1154 }
1155
1156 ImplPaintPictureBitmap( pOut, pOLENd, bIsChart, bPrn, aAlignedGrfArea, pShell );
1157
1158 // see #i99665#
1160 {
1161 pOut->SetAntialiasing( nFormerAntialiasingAtOutput );
1162 }
1163 }
1164}
1165
1167 SwGrfNode* pGrfNd, bool bPrn,
1168 const SwRect& rAlignedGrfArea, SwViewShell* pShell,
1169 SwNoTextNode& rNoTNd ) const
1170{
1171 bool bContinue = true;
1172 const GraphicObject& rGrfObj = pGrfNd->GetGrfObj(bPrn);
1173
1174 GraphicAttr aGrfAttr;
1175 pGrfNd->GetGraphicAttr( aGrfAttr, this );
1176
1177 if( !bPrn )
1178 {
1179 // #i73788#
1180 if ( pGrfNd->IsLinkedInputStreamReady() )
1181 {
1182 pGrfNd->UpdateLinkWithInputStream();
1183 }
1184 // #i85717#, #i90395# - check, if asynchronous retrieval
1185 // if input stream for the graphic is possible
1186 else if ( ( rGrfObj.GetType() == GraphicType::Default ||
1187 rGrfObj.GetType() == GraphicType::NONE ) &&
1188 pGrfNd->IsLinkedFile() &&
1190 {
1191 Size aTmpSz;
1192 ::sfx2::SvLinkSource* pGrfObj = pGrfNd->GetLink()->GetObj();
1193 if( !pGrfObj ||
1194 !pGrfObj->IsDataComplete() ||
1195 !(aTmpSz = pGrfNd->GetTwipSize()).Width() ||
1196 !aTmpSz.Height())
1197 {
1198 pGrfNd->TriggerAsyncRetrieveInputStream(); // #i73788#
1199 }
1200 OUString aText( pGrfNd->GetTitle() );
1201 if ( aText.isEmpty() )
1202 GetRealURL( *pGrfNd, aText );
1203 ::lcl_PaintReplacement( rAlignedGrfArea, aText, *pShell, this, false );
1204 bContinue = false;
1205 }
1206 }
1207
1208 if( !bContinue )
1209 return;
1210
1211 if( !rGrfObj.GetGraphic().IsSupportedGraphic())
1212 {
1213 ImplPaintPictureReplacement(rGrfObj, pGrfNd, rAlignedGrfArea, pShell);
1214 return;
1215 }
1216
1217 const bool bAnimate = rGrfObj.IsAnimated() &&
1218 !pShell->IsPreview() &&
1220 // #i9684# Stop animation during printing/pdf export
1221 pShell->GetWin();
1222 if( bAnimate &&
1223 FindFlyFrame() != ::GetFlyFromMarked( nullptr, pShell ))
1224 {
1225 ImplPaintPictureAnimate(pOut, pShell, pGrfNd, rAlignedGrfArea);
1226 return;
1227 }
1228
1229 // MM02 To allow system-dependent buffering of the involved
1230 // bitmaps it is necessary to re-use the involved primitives
1231 // and their already executed decomposition (also for
1232 // performance reasons). This is usually done in DrawingLayer
1233 // by using the VOC-Mechanism (see descriptions elsewhere).
1234 // To get that here, make the involved SwNoTextFrame (this)
1235 // a sdr::contact::ViewContact supplier by supporting
1236 // a GetViewContact() - call. For ObjectContact we can use
1237 // the already existing ObjectContact from the involved
1238 // DrawingLayer. For this, the helper classes
1239 // ViewObjectContactOfSwNoTextFrame
1240 // ViewContactOfSwNoTextFrame
1241 // are created which support the VOC-mechanism in its minimal
1242 // form. This allows automatic and view-dependent (multiple edit
1243 // windows, print, etc.) re-use of the created primitives.
1244 // Also: Will be very useful when completely changing the Writer
1245 // repaint to VOC and Primitives, too.
1246 static const char* pDisableMM02Goodies(getenv("SAL_DISABLE_MM02_GOODIES"));
1247 static bool bUseViewObjectContactMechanism(nullptr == pDisableMM02Goodies);
1248 // tdf#130951 for safety reasons use fallback if ViewObjectContactMechanism
1249 // fails for some reason - usually could only be not to find the correct
1250 // SdrPageWindow
1251 bool bSucceeded(false);
1252
1253 if(bUseViewObjectContactMechanism)
1254 {
1255 // MM02 use VOC-mechanism and buffer primitives
1256 SwViewShellImp* pImp(pShell->Imp());
1257 SdrPageView* pPageView(nullptr != pImp
1258 ? pImp->GetPageView()
1259 : nullptr);
1260 // tdf#130951 caution - target may be Window, use the correct OutputDevice
1261 OutputDevice* pTarget((pShell->isOutputToWindow() && pShell->GetWin())
1262 ? pShell->GetWin()->GetOutDev()
1263 : pShell->GetOut());
1264 SdrPageWindow* pPageWindow(nullptr != pPageView && nullptr != pTarget
1265 ? pPageView->FindPageWindow(*pTarget)
1266 : nullptr);
1267
1268 if(nullptr != pPageWindow)
1269 {
1270 sdr::contact::ObjectContact& rOC(pPageWindow->GetObjectContact());
1273 sdr::contact::DisplayInfo aDisplayInfo;
1274
1276 const basegfx::B2DHomMatrix aGraphicTransform(getFrameAreaTransformation());
1277
1279 *pOut,
1280 aPrimitives,
1281 aGraphicTransform,
1282 nullptr == pGrfNd->GetFlyFormat() ? OUString() : pGrfNd->GetFlyFormat()->GetName(),
1283 rNoTNd.GetTitle(),
1284 rNoTNd.GetDescription());
1285 bSucceeded = true;
1286 }
1287 }
1288
1289 if(!bSucceeded)
1290 {
1291 // MM02 fallback to direct paint with primitive-recreation
1292 // which will block reusage of system-dependent bitmap data
1293 const basegfx::B2DHomMatrix aGraphicTransform(getFrameAreaTransformation());
1294
1296 *pOut,
1297 rGrfObj,
1298 aGrfAttr,
1299 aGraphicTransform,
1300 nullptr == pGrfNd->GetFlyFormat() ? OUString() : pGrfNd->GetFlyFormat()->GetName(),
1301 rNoTNd.GetTitle(),
1302 rNoTNd.GetDescription());
1303 }
1304}
1305
1307 SwGrfNode* pGrfNd, const SwRect& rAlignedGrfArea) const
1308{
1309 OutputDevice* pVout;
1310 if( pOut == pShell->GetOut() && SwRootFrame::FlushVout() )
1311 {
1312 pVout = pOut;
1313 pOut = pShell->GetOut();
1314 }
1315 else if( pShell->GetWin() && pOut->IsVirtual() )
1316 {
1317 pVout = pOut;
1318 pOut = pShell->GetWin()->GetOutDev();
1319 }
1320 else
1321 pVout = nullptr;
1322
1323 OSL_ENSURE( !pOut->IsVirtual() ||
1324 pShell->GetViewOptions()->IsPDFExport() || pShell->isOutputToWindow(),
1325 "pOut should not be a virtual device" );
1326
1327 pGrfNd->StartGraphicAnimation(pOut, rAlignedGrfArea.Pos(),
1328 rAlignedGrfArea.SSize(), reinterpret_cast<sal_IntPtr>(this),
1329 pVout );
1330}
1331
1333 const SwRect& rAlignedGrfArea, SwViewShell* pShell) const
1334{
1335 TranslateId pResId;
1336
1337 if( GraphicType::NONE == rGrfObj.GetType() )
1338 pResId = STR_COMCORE_READERROR;
1339 else if ( !rGrfObj.GetGraphic().IsSupportedGraphic() )
1340 pResId = STR_COMCORE_CANT_SHOW;
1341
1342 OUString aText;
1343 if ( !pResId &&
1344 (aText = pGrfNd->GetTitle()).isEmpty() &&
1345 (!GetRealURL( *pGrfNd, aText ) || aText.isEmpty()))
1346 {
1347 pResId = STR_COMCORE_READERROR;
1348 }
1349 if (pResId)
1350 aText = SwResId(pResId);
1351
1352 ::lcl_PaintReplacement( rAlignedGrfArea, aText, *pShell, this, true );
1353}
1354
1356 SwOLENode* pOLENd, bool bIsChart, bool bPrn, const SwRect& rAlignedGrfArea,
1357 SwViewShell* pShell ) const
1358{
1359 bool bDone(false);
1360
1361 if(bIsChart)
1362 {
1363 basegfx::B2DRange aSourceRange;
1366 aSourceRange,
1367 bPrn));
1368
1369 if(!aSequence.empty() && !aSourceRange.isEmpty())
1370 {
1371 const basegfx::B2DRange aTargetRange(
1372 rAlignedGrfArea.Left(), rAlignedGrfArea.Top(),
1373 rAlignedGrfArea.Right(), rAlignedGrfArea.Bottom());
1374
1376 *pOut,
1377 aSequence,
1378 aSourceRange,
1379 aTargetRange);
1380 }
1381 }
1382
1383 if(bDone || !pOLENd)
1384 return;
1385
1386 // SwOLENode does not have a known GraphicObject, need to
1387 // work with Graphic instead
1388 const Graphic* pGraphic = pOLENd->GetGraphic();
1389 const Point aPosition(rAlignedGrfArea.Pos());
1390 const Size aSize(rAlignedGrfArea.SSize());
1391
1392 if ( pGraphic && pGraphic->GetType() != GraphicType::NONE )
1393 {
1394 pGraphic->Draw(*pOut, aPosition, aSize);
1395
1396 // shade the representation if the object is activated outplace
1397 uno::Reference < embed::XEmbeddedObject > xObj = pOLENd->GetOLEObj().GetOleRef();
1398 if ( xObj.is() && xObj->getCurrentState() == embed::EmbedStates::ACTIVE )
1399 {
1400
1403 aPosition,
1404 aSize),
1405 pOut);
1406 }
1407 }
1408 else
1409 {
1411 tools::Rectangle(aPosition, aSize),
1412 pOLENd->GetOLEObj().GetCurrentPersistName(),
1413 pOut);
1414 }
1415
1416 sal_Int64 nMiscStatus = pOLENd->GetOLEObj().GetOleRef()->getStatus( pOLENd->GetAspect() );
1417 if ( !bPrn && dynamic_cast< const SwCursorShell *>( pShell ) != nullptr &&
1418 (nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE))
1419 {
1420 const SwFlyFrame *pFly = FindFlyFrame();
1421 assert( pFly != nullptr );
1422 static_cast<SwFEShell*>(pShell)->ConnectObj( pOLENd->GetOLEObj().GetObject(), pFly->getFramePrintArea(), pFly->getFrameArea());
1423 }
1424}
1425
1427{
1428 const SwViewShell* pSh = getRootFrame()->GetCurrShell();
1429
1430 if ( !pSh || !pSh->GetViewOptions()->IsGraphic() )
1431 {
1432 return true;
1433 }
1434
1435 const SwGrfNode *pNd;
1436
1437 if( nullptr != (pNd = GetNode()->GetGrfNode()) )
1438 {
1439 if(pNd->IsTransparent())
1440 {
1441 return true;
1442 }
1443 }
1444
1445 // RotateFlyFrame3: If we are transformed, there are 'free' areas between
1446 // the Graphic and the Border/Padding stuff - at least as long as those
1447 // (Border and Padding) are not transformed, too
1449 {
1450 // we can be more specific - rotations of multiples of
1451 // 90 degrees will leave no gaps. Go from [0.0 .. 2PI]
1452 // to [0 .. 360] and check modulo 90
1454 const bool bMultipleOf90(0 == (nRot % 90));
1455
1456 if(!bMultipleOf90)
1457 {
1458 return true;
1459 }
1460 }
1461
1462 //#29381# OLE are always transparent
1463 if(nullptr != GetNode()->GetOLENode())
1464 {
1465 return true;
1466 }
1467
1468 // return false by default to avoid background paint
1469 return false;
1470}
1471
1473{
1474 // Stop animated graphics
1475 const SwGrfNode* pGrfNd = GetNode()->GetGrfNode();
1476
1477 if( pGrfNd && pGrfNd->IsAnimated() )
1478 {
1479 const_cast< SwGrfNode* >(pGrfNd)->StopGraphicAnimation( pOut, reinterpret_cast<sal_IntPtr>(this) );
1480 }
1481}
1482
1484{
1485 const SwGrfNode* pGrfNd = GetNode()->GetGrfNode();
1486 return pGrfNd && pGrfNd->IsAnimated();
1487}
1488
1489/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
AntialiasingFlags
const Graphic & GetGraphic() const
GraphicType GetType() const
bool IsAnimated() const
bool IsSupportedGraphic() const
GraphicType GetType() const
void Draw(OutputDevice &rOutDev, const Point &rDestPt) const
static void DrawEx(OutputDevice &rOutDev, const OUString &rText, vcl::Font &rFont, const BitmapEx &rBitmap, const Point &rDestPt, const Size &rDestSize)
virtual SfxPrinter * getPrinter(bool bCreate) const =0
Return the printer set at the document.
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
virtual SwFormat * GetFormatFromPool(sal_uInt16 nId)=0
Return required automatic format base class.
const OUString & GetURL() const
IMapObject * GetIMapObject(size_t nPos) const
size_t GetIMapObjectCount() const
GDIMetaFile * GetConnectMetaFile() const
basegfx::B2DHomMatrix GetViewTransformation() const
vcl::Region GetClipRegion() const
void DrawRect(const tools::Rectangle &rRect)
bool IsClipRegion() const
void SetLineColor()
void SetClipRegion()
void SetFillColor()
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
void IntersectClipRegion(const tools::Rectangle &rRect)
void AdjustMarkHdl(SfxViewShell *pOtherShell=nullptr)
SdrPageWindow * FindPageWindow(const SdrPaintWindow &rPaintWindow) const
const sdr::contact::ObjectContact & GetObjectContact() const
EnumT GetValue() const
SfxHintId GetId() const
static void LeaveLock()
static void EnterLock()
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
bool HasBorder(bool bTreatPaddingAsBorder) const
const Color & GetValue() const
sal_Int32 GetTop() const
sal_Int32 GetRight() const
sal_Int32 GetLeft() const
sal_Int32 GetBottom() const
FontLineStyle GetLineStyle() const
virtual void NotifyBackground(SwPageFrame *_pPageFrame, const SwRect &_rRect, PrepareHint _eHint)=0
method to trigger notification of 'background'
const SwAttrSet * GetChgSet() const
What has changed.
Definition: hints.hxx:347
const SwMirrorGrf & GetMirrorGrf(bool=true) const
Definition: grfatr.hxx:282
const SwCropGrf & GetCropGrf(bool=true) const
Definition: grfatr.hxx:284
const SwRotationGrf & GetRotationGrf(bool=true) const
Definition: grfatr.hxx:286
SwBorderAttrs * Get()
Definition: frmtool.cxx:2686
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
Definition: cntfrm.hxx:59
virtual void DestroyImpl() override
Definition: ssfrm.cxx:428
void MakePrtArea(const SwBorderAttrs &)
Definition: calcmove.cxx:1063
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: wsfrm.cxx:2352
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
Definition: node.hxx:765
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:419
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:440
bool IsVisitedURL(std::u16string_view rURL)
Definition: visiturl.cxx:100
static bool IsAntiAliasing()
Definition: dview.cxx:130
general base class for all free-flowing frames
Definition: flyfrm.hxx:79
const SwVirtFlyDrawObj * GetVirtDrawObj() const
Definition: fly.cxx:3017
virtual const SwFlyFrameFormat * GetFormat() const override
Definition: fly.cxx:3111
bool GetContour(tools::PolyPolygon &rContour, const bool _bForPaint=false) const
#i13147# - If called for paint and the <SwNoTextFrame> contains a graphic, load of intrinsic graphic ...
Definition: fly.cxx:2870
virtual void Calc(vcl::RenderContext *pRenderContext) const override
Definition: fly.cxx:3148
bool isTransformableSwFrame() const
Definition: flyfrms.hxx:134
const SwRect & GetUnclippedFrame() const
Definition: flyfrms.hxx:115
TransformableSwFrame * getTransformableSwFrame()
Definition: flyfrms.hxx:135
bool IsContour() const
Definition: fmtsrnd.hxx:53
SfxPoolItem subclass that wraps a URL.
Definition: fmturl.hxx:33
const ImageMap * GetMap() const
Definition: fmturl.hxx:67
const OUString & GetURL() const
Definition: fmturl.hxx:65
Base class for various Writer styles.
Definition: format.hxx:47
const SvxUnderlineItem & GetUnderline(bool=true) const
GetMethods: Bool indicates whether to search only in Set (FALSE) or also in Parents.
Definition: charatr.hxx:118
const OUString & GetName() const
Definition: format.hxx:131
const SwFormatSurround & GetSurround(bool=true) const
Definition: fmtsrnd.hxx:66
const SwFormatURL & GetURL(bool=true) const
Definition: fmturl.hxx:77
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
Templatized version of GetItemState() to directly return the correct type.
Definition: format.hxx:111
const SvxColorItem & GetColor(bool=true) const
Definition: charatr.hxx:128
const SwRect & getFrameArea() const
Definition: frame.hxx:179
bool isFrameAreaDefinitionValid() const
Definition: frame.hxx:171
virtual basegfx::B2DHomMatrix getFrameAreaTransformation() const
Definition: wsfrm.cxx:127
bool isFrameAreaPositionValid() const
Definition: frame.hxx:166
const SwRect & getFramePrintArea() const
Definition: frame.hxx:180
virtual void transform_translate(const Point &rOffset)
Definition: wsfrm.cxx:150
bool isFramePrintAreaValid() const
Definition: frame.hxx:168
bool isFrameAreaSizeValid() const
Definition: frame.hxx:167
virtual basegfx::B2DHomMatrix getFramePrintAreaTransformation() const
Definition: wsfrm.cxx:137
void setFrameAreaSizeValid(bool bNew)
Definition: wsfrm.cxx:94
Base class of the Writer layout elements.
Definition: frame.hxx:315
SwTwips Grow(SwTwips, bool bTst=false, bool bInfo=false)
Definition: wsfrm.cxx:1515
sal_uInt16 GetVirtPageNum() const
Definition: trvlfrm.cxx:1817
SwTwips Shrink(SwTwips, bool bTst=false, bool bInfo=false)
Definition: wsfrm.cxx:1559
SwFlyFrame * FindFlyFrame()
Definition: frame.hxx:1117
SwFrameType mnFrameType
Definition: frame.hxx:414
virtual void Calc(vcl::RenderContext *pRenderContext) const
Definition: trvlfrm.cxx:1799
virtual void MakePos()
Calculates the frame area position, in case it's invalid.
Definition: calcmove.cxx:526
static SwCache & GetCache()
Definition: frame.hxx:523
void InvalidatePrt()
Definition: frame.hxx:1042
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:7543
SwLayoutFrame * GetUpper()
Definition: frame.hxx:684
bool IsVertical() const
Definition: frame.hxx:979
SwRootFrame * getRootFrame()
Definition: frame.hxx:685
void SetCompletePaint() const
Definition: frame.hxx:1000
SwPageFrame * FindPageFrame()
Definition: frame.hxx:686
void InvalidateAll_()
Definition: frame.hxx:809
virtual Size GetTwipSize() const override
Definition: ndgrf.cxx:424
bool IsLinkedFile() const
Definition: ndgrf.hxx:164
const tools::SvRef< sfx2::SvBaseLink > & GetLink() const
Definition: ndgrf.hxx:132
bool IsAnimated() const
Definition: ndgrf.hxx:95
GraphicAttr & GetGraphicAttr(GraphicAttr &, const SwFrame *pFrame) const
Returns the with our graphic attributes filled Graphic-Attr-Structure.
Definition: ndgrf.cxx:724
void UpdateLinkWithInputStream()
Definition: ndgrf.cxx:860
const GraphicObject & GetGrfObj(bool bWait=false) const
Definition: ndgrf.cxx:379
bool GetFileFilterNms(OUString *pFileNm, OUString *pFilterNm) const
Definition: ndgrf.cxx:485
void SetFrameInPaint(bool b)
Definition: ndgrf.hxx:104
void TriggerAsyncRetrieveInputStream()
Definition: ndgrf.cxx:819
bool IsLinkedInputStreamReady() const
Definition: ndgrf.hxx:144
void StartGraphicAnimation(OutputDevice *pOut, const Point &rPt, const Size &rSz, tools::Long nRendererId, OutputDevice *pFirstFrameOutDev)
wrappers for non-const calls at GraphicObject
Definition: ndgrf.hxx:86
bool IsTransparent() const
Definition: ndgrf.cxx:813
bool IsAsyncRetrieveInputStreamPossible() const
Definition: ndgrf.cxx:878
bool IsGrfToggle() const
Definition: grfatr.hxx:65
virtual void PaintSwFrame(vcl::RenderContext &rRenderContext, SwRect const &, SwPrintData const *const pPrintData=nullptr) const override
Definition: notxtfrm.cxx:214
virtual void DestroyImpl() override
Definition: notxtfrm.cxx:158
TransformableSwFrame * getTransformableSwFrame()
Definition: notxtfrm.hxx:101
bool HasAnimation() const
Definition: notxtfrm.cxx:1483
std::unique_ptr< TransformableSwFrame > mpTransformableSwFrame
Definition: notxtfrm.hxx:45
virtual void transform_translate(const Point &rOffset) override
Definition: notxtfrm.cxx:609
bool isTransformableSwFrame() const
Definition: notxtfrm.hxx:100
void GetGrfArea(SwRect &rRect, SwRect *) const
Calculate the Bitmap's position and the size within the passed rectangle.
Definition: notxtfrm.cxx:347
void ImplPaintPictureBitmap(vcl::RenderContext *pOut, SwOLENode *pOLENd, bool bIsChart, bool bPrn, const SwRect &rAlignedGrfArea, SwViewShell *pShell) const
Definition: notxtfrm.cxx:1355
void OnGraphicArrived()
Definition: notxtfrm.cxx:716
std::unique_ptr< sdr::contact::ViewContact > mpViewContact
Definition: notxtfrm.hxx:56
const SwContentNode * GetNode() const
Definition: notxtfrm.hxx:77
virtual basegfx::B2DHomMatrix getFramePrintAreaTransformation() const override
Definition: notxtfrm.cxx:596
void StopAnimation(const OutputDevice *=nullptr) const
Definition: notxtfrm.cxx:1472
void ImplPaintPictureGraphic(vcl::RenderContext *pOut, SwGrfNode *pGrfNd, bool bPrn, const SwRect &rAlignedGrfArea, SwViewShell *pShell, SwNoTextNode &rNoTNd) const
Definition: notxtfrm.cxx:1166
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: notxtfrm.cxx:731
SwNoTextFrame(SwNoTextNode *const, SwFrame *)
Definition: notxtfrm.cxx:147
void ImplPaintPictureReplacement(const GraphicObject &rGrfObj, SwGrfNode *pGrfNd, const SwRect &rAlignedGrfArea, SwViewShell *pShell) const
Definition: notxtfrm.cxx:1332
const Size & GetSize() const
By returning the surrounding Fly's size which equals the graphic's size.
Definition: notxtfrm.cxx:469
void PaintPicture(vcl::RenderContext *, const SwRect &) const
Paint the graphic.
Definition: notxtfrm.cxx:1093
sdr::contact::ViewContact & GetViewContact() const
Definition: notxtfrm.cxx:1075
virtual bool GetCharRect(SwRect &, const SwPosition &, SwCursorMoveState *=nullptr, bool bAllowFarAway=true) const override
Definition: notxtfrm.cxx:666
void ImplPaintPictureAnimate(vcl::RenderContext *pOut, SwViewShell *pShell, SwGrfNode *pGrfNd, const SwRect &rAlignedGrfArea) const
Definition: notxtfrm.cxx:1306
virtual void MakeAll(vcl::RenderContext *pRenderContext) override
Definition: notxtfrm.cxx:478
bool IsTransparent() const
Definition: notxtfrm.cxx:1426
void ClearCache()
Definition: notxtfrm.cxx:706
void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr) override
Calculate the Bitmap's site, if needed.
Definition: notxtfrm.cxx:652
virtual basegfx::B2DHomMatrix getFrameAreaTransformation() const override
Definition: notxtfrm.cxx:584
virtual ~SwNoTextFrame() override
Definition: notxtfrm.cxx:165
double getLocalFrameRotation() const
Definition: notxtfrm.cxx:629
virtual bool GetModelPositionForViewPoint(SwPosition *pPos, Point &aPoint, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
Definition: notxtfrm.cxx:699
Layout frame for SwNoTextNode, i.e. graphics and OLE nodes (including charts).
Definition: ndnotxt.hxx:30
OUString GetDescription() const
Definition: ndnotxt.cxx:282
OUString GetTitle() const
Definition: ndnotxt.cxx:258
friend class SwNoTextFrame
Definition: ndnotxt.hxx:32
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
Base class of the Writer document model elements.
Definition: node.hxx:98
bool IsGrfNode() const
Definition: node.hxx:707
SwFrameFormat * GetFlyFormat() const
If node is in a fly return the respective format.
Definition: node.cxx:738
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
Definition: node.cxx:2139
SwGrfNode * GetGrfNode()
Definition: ndgrf.hxx:154
SwDoc & GetDoc()
Definition: node.hxx:233
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
Definition: ndole.hxx:165
SwNoTextNode * GetNoTextNode()
Definition: ndnotxt.hxx:95
const IDocumentSettingAccess * getIDocumentSettingAccess() const
Provides access to the document setting interface.
Definition: node.cxx:2138
bool IsChart() const
Definition: ndole.cxx:703
sal_Int64 GetAspect() const
Definition: ndole.hxx:140
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:116
const Graphic * GetGraphic()
Definition: ndole.cxx:285
drawinglayer::primitive2d::Primitive2DContainer const & tryToGetChartContentAsPrimitive2DSequence(basegfx::B2DRange &rRange, bool bSynchron)
Definition: ndole.cxx:1156
svt::EmbeddedObjectRef & GetObject()
Definition: ndole.cxx:1063
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
Definition: ndole.cxx:1012
const OUString & GetCurrentPersistName() const
Definition: ndole.hxx:72
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
void Height(tools::Long nNew)
Definition: swrect.hxx:193
void Top(const tools::Long nTop)
Definition: swrect.hxx:206
void Right(const tools::Long nRight)
Definition: swrect.hxx:202
void Bottom(const tools::Long nBottom)
Definition: swrect.hxx:211
SwRect & Intersection_(const SwRect &rRect)
Definition: swrect.cxx:81
void Pos(const Point &rNew)
Definition: swrect.hxx:171
void AddLeft(const tools::Long nAdd)
Definition: swrect.cxx:125
void SSize(const Size &rNew)
Definition: swrect.hxx:180
void AddBottom(const tools::Long nAdd)
Definition: swrect.cxx:130
void AddRight(const tools::Long nAdd)
Definition: swrect.cxx:127
bool Overlaps(const SwRect &rRect) const
Definition: swrect.hxx:374
void AddTop(const tools::Long nAdd)
Definition: swrect.cxx:128
void Justify()
Definition: swrect.cxx:94
tools::Rectangle SVRect() const
Definition: swrect.hxx:292
void Left(const tools::Long nLeft)
Definition: swrect.hxx:197
void Width(tools::Long nNew)
Definition: swrect.hxx:189
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:215
static bool FlushVout()
Output virtual Device (e.g. for animations)
Definition: virtoutp.cxx:30
Degree10 GetValue() const
Definition: grfatr.hxx:109
bool IsPDFExport() const
Definition: viewopt.hxx:590
bool IsGraphic() const
Definition: viewopt.hxx:501
Color GetRetoucheColor() const
Definition: viewimp.cxx:290
SdrPageView * GetPageView()
Definition: viewimp.hxx:166
vcl::RenderContext * GetOut() const
Definition: viewsh.hxx:364
bool IsPreview() const
Definition: viewsh.hxx:516
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:451
VclPtr< OutputDevice > mpOut
Window, Printer, VirtDev, ...
Definition: viewsh.hxx:142
bool isOutputToWindow() const
Definition: viewsh.cxx:138
SwViewShellImp * Imp()
Definition: viewsh.hxx:210
vcl::Window * GetWin() const
Definition: viewsh.hxx:363
void OnGraphicArrived(const SwRect &)
Definition: viewsh.cxx:2683
SwDoc * GetDoc() const
Definition: viewsh.hxx:307
const SwAccessibilityOptions * GetAccessibilityOptions() const
Definition: viewsh.hxx:459
SdrView * GetDrawView()
Definition: vnew.cxx:371
RotateFlyFrame3: Helper class when you want to make your SwFrame derivate transformable.
Definition: frame.hxx:236
SwRect getUntransformedFramePrintArea() const
Definition: wsfrm.cxx:191
void adaptFrameAreasToTransformations()
Definition: wsfrm.cxx:236
void restoreFrameAreas()
Definition: wsfrm.cxx:271
const basegfx::B2DHomMatrix & getLocalFrameAreaTransformation() const
Definition: frame.hxx:255
void transform(const basegfx::B2DHomMatrix &aTransform)
Definition: wsfrm.cxx:289
SwRect getUntransformedFrameArea() const
Definition: wsfrm.cxx:167
const basegfx::B2DHomMatrix & getLocalFramePrintAreaTransformation() const
Definition: frame.hxx:261
void createFrameAreaTransformations(double fRotation, const basegfx::B2DPoint &rCenter)
Definition: wsfrm.cxx:216
sal_uInt32 count() const
BASEGFX_DLLPUBLIC void transform(const B2DHomMatrix &rMatrix)
TYPE getWidth() const
bool isEmpty() const
TYPE getHeight() const
void setViewport(const basegfx::B2DRange &rNew)
void setObjectTransformation(const basegfx::B2DHomMatrix &rNew)
void setViewTransformation(const basegfx::B2DHomMatrix &rNew)
virtual void visit(const Primitive2DReference &)=0
ViewObjectContact & GetViewObjectContact(ObjectContact &rObjectContact)
virtual ViewObjectContact & CreateObjectSpecificViewObjectContact(ObjectContact &rObjectContact)
drawinglayer::primitive2d::Primitive2DContainer const & getPrimitive2DSequence(const DisplayInfo &rDisplayInfo) const
virtual bool isExportPDFTags() const
virtual void createPrimitive2DSequence(const DisplayInfo &rDisplayInfo, drawinglayer::primitive2d::Primitive2DDecompositionVisitor &rVisitor) const
virtual bool IsDataComplete() const
static void DrawPaintReplacement(const tools::Rectangle &rRect, const OUString &rText, OutputDevice *pOut)
static void DrawShading(const tools::Rectangle &rRect, OutputDevice *pOut)
constexpr tools::Long Top() const
constexpr tools::Long Right() const
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
void SetStyleName(const OUString &rStyleName)
void SetTransparent(bool bTransparent)
void SetColor(const Color &)
void SetWeight(FontWeight)
void SetFamily(FontFamily)
void SetUnderline(FontLineStyle)
void SetFamilyName(const OUString &rFamilyName)
basegfx::B2DPolyPolygon GetAsB2DPolyPolygon() const
::OutputDevice const * GetOutDev() const
constexpr ::Color COL_RED(0x80, 0x00, 0x00)
double toRadians(D x)
SwFlyFrame * GetFlyFromMarked(const SdrMarkList *pLst, SwViewShell *pSh)
Definition: feshview.cxx:140
FontLineStyle
LINESTYLE_NONE
FAMILY_SWISS
WEIGHT_BOLD
void SwAlignGrfRect(SwRect *pGrfRect, const vcl::RenderContext &rOut)
Method to pixel-align rectangle for drawing graphic object.
Definition: paintfrm.cxx:1239
bool DrawFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes, const SwRect &rOriginalLayoutRect, const SwRegionRects &rPaintRegion, const basegfx::utils::B2DClipState &rClipState, vcl::RenderContext &rOut)
Definition: paintfrm.cxx:1732
void SwAlignRect(SwRect &rRect, const SwViewShell *pSh, const vcl::RenderContext *pRenderContext)
Function <SwAlignRect(..)> is also used outside this file.
Definition: paintfrm.cxx:1133
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:1821
MirrorGraph
Definition: grfatr.hxx:32
constexpr sal_uInt16 RES_GRFATR_BEGIN(RES_FRMATR_END)
constexpr TypedWhichId< SwAttrSetChg > RES_ATTRSET_CHG(169)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(112)
constexpr TypedWhichId< SwRotationGrf > RES_GRFATR_ROTATION(143)
constexpr TypedWhichId< SwUpdateAttr > RES_UPDATE_ATTR(170)
constexpr sal_uInt16 RES_GRFATR_END(156)
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_OBJECTDYING(RES_FORMAT_MSG_BEGIN)
constexpr TypedWhichId< SwFormatChg > RES_FMT_CHG(168)
bool isGRFATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:500
sal_Int64 n
SVL_DLLPUBLIC OUString removePassword(OUString const &rURI, INetURLObject::EncodeMechanism eEncodeMechanism, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
bool equalZero(const T &rfVal)
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
B2DHomMatrix createSourceRangeTargetRangeTransform(const B2DRange &rSourceRange, const B2DRange &rTargetRange)
double normalizeToRange(double v, const double fRange)
constexpr double rad2deg(double v)
std::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr
Definition: format.hxx:41
std::unique_ptr< BaseProcessor2D > createProcessor2DFromOutputDevice(OutputDevice &rTargetOutDev, const drawinglayer::geometry::ViewInformation2D &rViewInformation2D)
int i
long Long
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
Definition: nodeoffset.hxx:35
static void lcl_ClearArea(const SwFrame &rFrame, vcl::RenderContext &rOut, const SwRect &rPtArea, const SwRect &rGrfArea)
Definition: notxtfrm.cxx:174
static bool GetRealURL(const SwGrfNode &rNd, OUString &rText)
Definition: notxtfrm.cxx:86
static bool paintUsingPrimitivesHelper(vcl::RenderContext &rOutputDevice, const drawinglayer::primitive2d::Primitive2DContainer &rSequence, const basegfx::B2DRange &rSourceRange, const basegfx::B2DRange &rTargetRange)
Definition: notxtfrm.cxx:860
static void lcl_PaintReplacement(const SwRect &rRect, const OUString &rText, const SwViewShell &rSh, const SwNoTextFrame *pFrame, bool bDefect)
Definition: notxtfrm.cxx:97
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:902
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
void SetOutDev(SwViewShell *pSh, OutputDevice *pOut)
Definition: notxtfrm.cxx:169
static void lcl_correctlyAlignRect(SwRect &rAlignedGrfArea, const SwRect &rInArea, vcl::RenderContext const *pOut)
Definition: notxtfrm.cxx:831
@ RES_POOLCHR_INET_VISIT
Internet visited.
Definition: poolfmt.hxx:121
@ RES_POOLCHR_INET_NORMAL
Internet normal.
Definition: poolfmt.hxx:120
bool m_bRealHeight
should the real height be calculated?
Definition: crstate.hxx:141
Point m_aRealHeight
contains then the position/height of the cursor
Definition: crstate.hxx:137
Marks a position in the document model.
Definition: pam.hxx:38
SwNode & GetNode() const
Definition: pam.hxx:81
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
Definition: pam.cxx:231
sal_uInt16 GetWhich() const
Definition: calbck.hxx:75
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:168
tools::Long SwTwips
Definition: swtypes.hxx:51
@ FlyFrameAttributesChanged
Center
void ClrContourCache(const SdrObject *pObj)
Definition: txtfly.cxx:137
oslFileHandle & pOut