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(dynamic_cast<const sw::PreGraphicArrivedHint*>(&rHint))
743 {
745 return;
746 }
747 if (rHint.GetId() != SfxHintId::SwLegacyModify)
748 return;
749 auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
750 sal_uInt16 nWhich = pLegacy->GetWhich();
751
752 // #i73788#
753 // no <SwContentFrame::Modify(..)> for RES_LINKED_GRAPHIC_STREAM_ARRIVED
754 if ( RES_GRAPHIC_PIECE_ARRIVED != nWhich &&
756 {
757 SwContentFrame::SwClientNotify(rModify, rHint);
758 }
759
760 bool bComplete = true;
761
762 switch( nWhich )
763 {
767 return;
768
769 case RES_OBJECTDYING:
770 break;
771
772 case RES_UPDATE_ATTR:
773 if (GetNode()->GetNodeType() != SwNodeType::Grf) {
774 break;
775 }
776 [[fallthrough]];
777 case RES_FMT_CHG:
778 ClearCache();
779 break;
780
781 case RES_ATTRSET_CHG:
782 {
783 sal_uInt16 n;
784 for( n = RES_GRFATR_BEGIN; n < RES_GRFATR_END; ++n )
785 if( SfxItemState::SET == static_cast<const SwAttrSetChg*>(pLegacy->m_pOld)->GetChgSet()->
786 GetItemState( n, false ))
787 {
788 ClearCache();
789
791 {
792 // RotGrfFlyFrame: Update Handles in view, these may be rotation-dependent
793 // (e.g. crop handles) and need a visualisation update
794 if ( GetNode()->GetNodeType() == SwNodeType::Grf )
795 {
796 SwGrfNode* pNd = static_cast<SwGrfNode*>( GetNode());
798
799 if(pVSh)
800 {
801 SdrView* pDrawView = pVSh->GetDrawView();
802
803 if(pDrawView)
804 {
805 pDrawView->AdjustMarkHdl(nullptr);
806 }
807 }
808
809 // RotateFlyFrame3 - invalidate needed for ContentFrame (inner, this)
810 // and LayoutFrame (outer, GetUpper). It is possible to only invalidate
811 // the outer frame, but that leads to an in-between state that gets
812 // potentially painted
813 if(GetUpper())
814 {
816 }
817
819 }
820 }
821 break;
822 }
823 if( RES_GRFATR_END == n ) // not found
824 return ;
825 }
826 break;
827
828 default:
829 if ( !pLegacy->m_pNew || !isGRFATR(nWhich) )
830 return;
831 }
832
833 if( bComplete )
834 {
837 }
838}
839
840static void lcl_correctlyAlignRect( SwRect& rAlignedGrfArea, const SwRect& rInArea, vcl::RenderContext const * pOut )
841{
842
843 if(!pOut)
844 return;
845 tools::Rectangle aPxRect = pOut->LogicToPixel( rInArea.SVRect() );
846 tools::Rectangle aNewPxRect( aPxRect );
847 while( aNewPxRect.Left() < aPxRect.Left() )
848 {
849 rAlignedGrfArea.AddLeft( 1 );
850 aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
851 }
852 while( aNewPxRect.Top() < aPxRect.Top() )
853 {
854 rAlignedGrfArea.AddTop(+1);
855 aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
856 }
857 while( aNewPxRect.Bottom() > aPxRect.Bottom() )
858 {
859 rAlignedGrfArea.AddBottom( -1 );
860 aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
861 }
862 while( aNewPxRect.Right() > aPxRect.Right() )
863 {
864 rAlignedGrfArea.AddRight(-1);
865 aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
866 }
867}
868
870 vcl::RenderContext& rOutputDevice,
872 const basegfx::B2DRange& rSourceRange,
873 const basegfx::B2DRange& rTargetRange)
874{
875 if(!rSequence.empty() && !basegfx::fTools::equalZero(rSourceRange.getWidth()) && !basegfx::fTools::equalZero(rSourceRange.getHeight()))
876 {
877 if(!basegfx::fTools::equalZero(rTargetRange.getWidth()) && !basegfx::fTools::equalZero(rTargetRange.getHeight()))
878 {
879 // map graphic range to target range. This will e.g. automatically include
880 // the mapping from 1/100th mm content to twips if needed when the target
881 // range is defined in twips
882 const basegfx::B2DHomMatrix aMappingTransform(
884 rSourceRange,
885 rTargetRange));
886
887 // Fill ViewInformation. Use MappingTransform here, so there is no need to
888 // embed the primitives to it. Use original TargetRange here so there is also
889 // no need to embed the primitives to a MaskPrimitive for cropping. This works
890 // only in this case where the graphic object cannot be rotated, though.
892 aViewInformation2D.setObjectTransformation(aMappingTransform);
893 aViewInformation2D.setViewTransformation(rOutputDevice.GetViewTransformation());
894 aViewInformation2D.setViewport(rTargetRange);
895
896 // get a primitive processor for rendering
897 std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor2D(
899 rOutputDevice, aViewInformation2D) );
900
901 // render and cleanup
902 pProcessor2D->process(rSequence);
903 return true;
904 }
905 }
906
907 return false;
908}
909
910// MM02 original using fallback to VOC and primitive-based version
912 vcl::RenderContext & rOutputDevice,
913 GraphicObject const& rGrfObj,
914 GraphicAttr const& rGraphicAttr,
915 const basegfx::B2DHomMatrix& rGraphicTransform,
916 const OUString& rName,
917 const OUString& rTitle,
918 const OUString& rDescription)
919{
920 // RotGrfFlyFrame: unify using GraphicPrimitive2D
921 // -> the primitive handles all crop and mirror stuff
922 // -> the primitive renderer will create the needed pdf export data
923 // -> if bitmap content, it will be cached system-dependent
926 rGraphicTransform,
927 rGrfObj,
928 rGraphicAttr);
929
930 // MM02 use primitive-based version for visualization
932 rOutputDevice,
933 aContent,
934 rGraphicTransform,
935 rName,
936 rTitle,
937 rDescription);
938}
939
940// MM02 new VOC and primitive-based version
942 vcl::RenderContext & rOutputDevice,
944 const basegfx::B2DHomMatrix& rGraphicTransform,
945 const OUString& rName,
946 const OUString& rTitle,
947 const OUString& rDescription)
948{
949 // RotateFlyFrame3: If ClipRegion is set at OutputDevice, we
950 // need to use that. Usually the renderer would be a VCL-based
951 // PrimitiveRenderer, but there are system-specific shortcuts that
952 // will *not* use the VCL-Paint of Bitmap and thus ignore this.
953 // Anyways, indirectly using a CLipRegion set at the target OutDev
954 // when using a PrimitiveRenderer is a non-valid implication.
955 // First tried only to use when HasPolyPolygonOrB2DPolyPolygon(),
956 // but there is an optimization at ClipRegion creation that detects
957 // a single Rectangle in a tools::PolyPolygon and forces to a simple
958 // RegionBand-based implementation, so cannot use it here.
959 if(rOutputDevice.IsClipRegion())
960 {
962
963 if(0 != aClip.count())
964 {
965 rContent.resize(1);
966 rContent[0] =
968 std::move(aClip),
970 }
971 }
972
973 if(!rName.isEmpty() || !rTitle.isEmpty() || !rDescription.isEmpty())
974 {
975 // Embed to ObjectInfoPrimitive2D when we have Name/Title/Description
976 // information available
977 rContent.resize(1);
978 rContent[0] =
981 rName,
982 rTitle,
983 rDescription);
984 }
985
986 basegfx::B2DRange aTargetRange(0.0, 0.0, 1.0, 1.0);
987 aTargetRange.transform(rGraphicTransform);
988
990 rOutputDevice,
991 rContent,
992 aTargetRange,
993 aTargetRange);
994}
995
996// DrawContact section
997namespace { // anonymous namespace
998class ViewObjectContactOfSwNoTextFrame : public sdr::contact::ViewObjectContact
999{
1000protected:
1001 virtual void createPrimitive2DSequence(
1002 const sdr::contact::DisplayInfo& rDisplayInfo,
1004
1005public:
1006 ViewObjectContactOfSwNoTextFrame(
1007 sdr::contact::ObjectContact& rObjectContact,
1008 sdr::contact::ViewContact& rViewContact);
1009};
1010
1011class ViewContactOfSwNoTextFrame : public sdr::contact::ViewContact
1012{
1013private:
1014 // owner
1015 const SwNoTextFrame& mrSwNoTextFrame;
1016
1017protected:
1018 // Create an Object-Specific ViewObjectContact, set ViewContact and
1019 // ObjectContact. Always needs to return something.
1021 sdr::contact::ObjectContact& rObjectContact) override;
1022
1023public:
1024 // read-access to owner
1025 const SwNoTextFrame& getSwNoTextFrame() const { return mrSwNoTextFrame; }
1026
1027 // basic constructor, used from SwNoTextFrame.
1028 explicit ViewContactOfSwNoTextFrame(const SwNoTextFrame& rSwNoTextFrame);
1029};
1030
1031void ViewObjectContactOfSwNoTextFrame::createPrimitive2DSequence(
1032 const sdr::contact::DisplayInfo& /*rDisplayInfo*/,
1034{
1035 // MM02 get all the parameters formally used in paintGraphicUsingPrimitivesHelper
1036 ViewContactOfSwNoTextFrame& rVCOfNTF(static_cast<ViewContactOfSwNoTextFrame&>(GetViewContact()));
1037 const SwNoTextFrame& rSwNoTextFrame(rVCOfNTF.getSwNoTextFrame());
1038 SwNoTextNode& rNoTNd(const_cast<SwNoTextNode&>(*static_cast<const SwNoTextNode*>(rSwNoTextFrame.GetNode())));
1039 SwGrfNode* pGrfNd(rNoTNd.GetGrfNode());
1040
1041 if(nullptr != pGrfNd)
1042 {
1043 const bool bPrn(GetObjectContact().isOutputToPrinter() || GetObjectContact().isOutputToRecordingMetaFile());
1044 const GraphicObject& rGrfObj(pGrfNd->GetGrfObj(bPrn));
1045 GraphicAttr aGraphicAttr;
1046 pGrfNd->GetGraphicAttr(aGraphicAttr, &rSwNoTextFrame);
1047 const basegfx::B2DHomMatrix aGraphicTransform(rSwNoTextFrame.getFrameAreaTransformation());
1048
1049 // MM02 this is the right place in the VOC-Mechanism to create
1050 // the primitives for visualization - these will be automatically
1051 // buffered and reused
1053 aGraphicTransform,
1054 rGrfObj,
1055 aGraphicAttr));
1056 }
1057}
1058
1059ViewObjectContactOfSwNoTextFrame::ViewObjectContactOfSwNoTextFrame(
1060 sdr::contact::ObjectContact& rObjectContact,
1061 sdr::contact::ViewContact& rViewContact)
1062: sdr::contact::ViewObjectContact(rObjectContact, rViewContact)
1063{
1064}
1065
1066sdr::contact::ViewObjectContact& ViewContactOfSwNoTextFrame::CreateObjectSpecificViewObjectContact(
1067 sdr::contact::ObjectContact& rObjectContact)
1068{
1069 sdr::contact::ViewObjectContact* pRetval = new ViewObjectContactOfSwNoTextFrame(rObjectContact, *this);
1070 return *pRetval;
1071}
1072
1073ViewContactOfSwNoTextFrame::ViewContactOfSwNoTextFrame(
1074 const SwNoTextFrame& rSwNoTextFrame
1075)
1076: mrSwNoTextFrame(rSwNoTextFrame)
1077{
1078}
1079} // end of anonymous namespace
1080
1082{
1083 if(!mpViewContact)
1084 {
1085 const_cast< SwNoTextFrame* >(this)->mpViewContact =
1086 std::make_unique<ViewContactOfSwNoTextFrame>(*this);
1087 }
1088
1089 return *mpViewContact;
1090}
1091
1099void SwNoTextFrame::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfArea ) const
1100{
1101 SwViewShell* pShell = getRootFrame()->GetCurrShell();
1102
1103 SwNoTextNode& rNoTNd = const_cast<SwNoTextNode&>(*static_cast<const SwNoTextNode*>(GetNode()));
1104 SwGrfNode* pGrfNd = rNoTNd.GetGrfNode();
1105 SwOLENode* pOLENd = rNoTNd.GetOLENode();
1106
1107 const bool bPrn = pOut == rNoTNd.getIDocumentDeviceAccess().getPrinter( false ) ||
1108 pOut->GetConnectMetaFile();
1109
1110 const bool bIsChart = pOLENd && pOLENd->GetOLEObj().GetObject().IsChart();
1111
1112 // calculate aligned rectangle from parameter <rGrfArea>.
1113 // Use aligned rectangle <aAlignedGrfArea> instead of <rGrfArea> in
1114 // the following code.
1115 SwRect aAlignedGrfArea = rGrfArea;
1116 ::SwAlignRect( aAlignedGrfArea, pShell, pOut );
1117
1118 if( !bIsChart )
1119 {
1120 // Because for drawing a graphic left-top-corner and size coordinations are
1121 // used, these coordinations have to be determined on pixel level.
1122 ::SwAlignGrfRect( &aAlignedGrfArea, *pOut );
1123 }
1124 else //if( bIsChart )
1125 {
1126 // #i78025# charts own borders are not completely visible
1127 // the above pixel correction is not correct - at least not for charts
1128 // so a different pixel correction is chosen here
1129 // this might be a good idea for all other OLE objects also,
1130 // but as I cannot oversee the consequences I fix it only for charts for now
1131 lcl_correctlyAlignRect( aAlignedGrfArea, rGrfArea, pOut );
1132 }
1133
1134 if( pGrfNd )
1135 {
1136 // Fix for bug fdo#33781
1137 const AntialiasingFlags nFormerAntialiasingAtOutput( pOut->GetAntialiasing() );
1139 pOut->SetAntialiasing( nFormerAntialiasingAtOutput | AntialiasingFlags::Enable );
1140
1141 ImplPaintPictureGraphic( pOut, pGrfNd, bPrn, aAlignedGrfArea, pShell, rNoTNd );
1142
1144 pOut->SetAntialiasing( nFormerAntialiasingAtOutput );
1145 }
1146 else // bIsChart || pOLENd
1147 {
1148 // Fix for bug fdo#33781
1149 const AntialiasingFlags nFormerAntialiasingAtOutput( pOut->GetAntialiasing() );
1151 {
1152 AntialiasingFlags nNewAntialiasingAtOutput = nFormerAntialiasingAtOutput | AntialiasingFlags::Enable;
1153
1154 // #i99665#
1155 // Adjust AntiAliasing mode at output device for chart OLE
1156 if ( pOLENd->IsChart() )
1157 nNewAntialiasingAtOutput |= AntialiasingFlags::PixelSnapHairline;
1158
1159 pOut->SetAntialiasing( nNewAntialiasingAtOutput );
1160 }
1161
1162 ImplPaintPictureBitmap( pOut, pOLENd, bIsChart, bPrn, aAlignedGrfArea, pShell );
1163
1164 // see #i99665#
1166 {
1167 pOut->SetAntialiasing( nFormerAntialiasingAtOutput );
1168 }
1169 }
1170}
1171
1173 SwGrfNode* pGrfNd, bool bPrn,
1174 const SwRect& rAlignedGrfArea, SwViewShell* pShell,
1175 SwNoTextNode& rNoTNd ) const
1176{
1177 bool bContinue = true;
1178 const GraphicObject& rGrfObj = pGrfNd->GetGrfObj(bPrn);
1179
1180 GraphicAttr aGrfAttr;
1181 pGrfNd->GetGraphicAttr( aGrfAttr, this );
1182
1183 if( !bPrn )
1184 {
1185 // #i73788#
1186 if ( pGrfNd->IsLinkedInputStreamReady() )
1187 {
1188 pGrfNd->UpdateLinkWithInputStream();
1189 }
1190 // #i85717#, #i90395# - check, if asynchronous retrieval
1191 // if input stream for the graphic is possible
1192 else if ( ( rGrfObj.GetType() == GraphicType::Default ||
1193 rGrfObj.GetType() == GraphicType::NONE ) &&
1194 pGrfNd->IsLinkedFile() &&
1196 {
1197 Size aTmpSz;
1198 ::sfx2::SvLinkSource* pGrfObj = pGrfNd->GetLink()->GetObj();
1199 if( !pGrfObj ||
1200 !pGrfObj->IsDataComplete() ||
1201 !(aTmpSz = pGrfNd->GetTwipSize()).Width() ||
1202 !aTmpSz.Height())
1203 {
1204 pGrfNd->TriggerAsyncRetrieveInputStream(); // #i73788#
1205 }
1206 OUString aText( pGrfNd->GetTitle() );
1207 if ( aText.isEmpty() )
1208 GetRealURL( *pGrfNd, aText );
1209 ::lcl_PaintReplacement( rAlignedGrfArea, aText, *pShell, this, false );
1210 bContinue = false;
1211 }
1212 }
1213
1214 if( !bContinue )
1215 return;
1216
1217 if( !rGrfObj.GetGraphic().IsSupportedGraphic())
1218 {
1219 ImplPaintPictureReplacement(rGrfObj, pGrfNd, rAlignedGrfArea, pShell);
1220 return;
1221 }
1222
1223 const bool bAnimate = rGrfObj.IsAnimated() &&
1224 !pShell->IsPreview() &&
1226 // #i9684# Stop animation during printing/pdf export
1227 pShell->GetWin();
1228 if( bAnimate &&
1229 FindFlyFrame() != ::GetFlyFromMarked( nullptr, pShell ))
1230 {
1231 ImplPaintPictureAnimate(pOut, pShell, pGrfNd, rAlignedGrfArea);
1232 return;
1233 }
1234
1235 // MM02 To allow system-dependent buffering of the involved
1236 // bitmaps it is necessary to re-use the involved primitives
1237 // and their already executed decomposition (also for
1238 // performance reasons). This is usually done in DrawingLayer
1239 // by using the VOC-Mechanism (see descriptions elsewhere).
1240 // To get that here, make the involved SwNoTextFrame (this)
1241 // a sdr::contact::ViewContact supplier by supporting
1242 // a GetViewContact() - call. For ObjectContact we can use
1243 // the already existing ObjectContact from the involved
1244 // DrawingLayer. For this, the helper classes
1245 // ViewObjectContactOfSwNoTextFrame
1246 // ViewContactOfSwNoTextFrame
1247 // are created which support the VOC-mechanism in its minimal
1248 // form. This allows automatic and view-dependent (multiple edit
1249 // windows, print, etc.) re-use of the created primitives.
1250 // Also: Will be very useful when completely changing the Writer
1251 // repaint to VOC and Primitives, too.
1252 static const char* pDisableMM02Goodies(getenv("SAL_DISABLE_MM02_GOODIES"));
1253 static bool bUseViewObjectContactMechanism(nullptr == pDisableMM02Goodies);
1254 // tdf#130951 for safety reasons use fallback if ViewObjectContactMechanism
1255 // fails for some reason - usually could only be not to find the correct
1256 // SdrPageWindow
1257 bool bSucceeded(false);
1258
1259 if(bUseViewObjectContactMechanism)
1260 {
1261 // MM02 use VOC-mechanism and buffer primitives
1262 SwViewShellImp* pImp(pShell->Imp());
1263 SdrPageView* pPageView(nullptr != pImp
1264 ? pImp->GetPageView()
1265 : nullptr);
1266 // tdf#130951 caution - target may be Window, use the correct OutputDevice
1267 OutputDevice* pTarget(pShell->isOutputToWindow()
1268 ? pShell->GetWin()->GetOutDev()
1269 : pShell->GetOut());
1270 SdrPageWindow* pPageWindow(nullptr != pPageView && nullptr != pTarget
1271 ? pPageView->FindPageWindow(*pTarget)
1272 : nullptr);
1273
1274 if(nullptr != pPageWindow)
1275 {
1276 sdr::contact::ObjectContact& rOC(pPageWindow->GetObjectContact());
1279 sdr::contact::DisplayInfo aDisplayInfo;
1280
1282 const basegfx::B2DHomMatrix aGraphicTransform(getFrameAreaTransformation());
1283
1285 *pOut,
1286 aPrimitives,
1287 aGraphicTransform,
1288 nullptr == pGrfNd->GetFlyFormat() ? OUString() : pGrfNd->GetFlyFormat()->GetName(),
1289 rNoTNd.GetTitle(),
1290 rNoTNd.GetDescription());
1291 bSucceeded = true;
1292 }
1293 }
1294
1295 if(!bSucceeded)
1296 {
1297 // MM02 fallback to direct paint with primitive-recreation
1298 // which will block reusage of system-dependent bitmap data
1299 const basegfx::B2DHomMatrix aGraphicTransform(getFrameAreaTransformation());
1300
1302 *pOut,
1303 rGrfObj,
1304 aGrfAttr,
1305 aGraphicTransform,
1306 nullptr == pGrfNd->GetFlyFormat() ? OUString() : pGrfNd->GetFlyFormat()->GetName(),
1307 rNoTNd.GetTitle(),
1308 rNoTNd.GetDescription());
1309 }
1310}
1311
1313 SwGrfNode* pGrfNd, const SwRect& rAlignedGrfArea) const
1314{
1315 OutputDevice* pVout;
1316 if( pOut == pShell->GetOut() && SwRootFrame::FlushVout() )
1317 {
1318 pVout = pOut;
1319 pOut = pShell->GetOut();
1320 }
1321 else if( pShell->GetWin() && pOut->IsVirtual() )
1322 {
1323 pVout = pOut;
1324 pOut = pShell->GetWin()->GetOutDev();
1325 }
1326 else
1327 pVout = nullptr;
1328
1329 OSL_ENSURE( !pOut->IsVirtual() ||
1330 pShell->GetViewOptions()->IsPDFExport() || pShell->isOutputToWindow(),
1331 "pOut should not be a virtual device" );
1332
1333 pGrfNd->StartGraphicAnimation(pOut, rAlignedGrfArea.Pos(),
1334 rAlignedGrfArea.SSize(), reinterpret_cast<sal_IntPtr>(this),
1335 pVout );
1336}
1337
1339 const SwRect& rAlignedGrfArea, SwViewShell* pShell) const
1340{
1341 TranslateId pResId;
1342
1343 if( GraphicType::NONE == rGrfObj.GetType() )
1344 pResId = STR_COMCORE_READERROR;
1345 else if ( !rGrfObj.GetGraphic().IsSupportedGraphic() )
1346 pResId = STR_COMCORE_CANT_SHOW;
1347
1348 OUString aText;
1349 if ( !pResId &&
1350 (aText = pGrfNd->GetTitle()).isEmpty() &&
1351 (!GetRealURL( *pGrfNd, aText ) || aText.isEmpty()))
1352 {
1353 pResId = STR_COMCORE_READERROR;
1354 }
1355 if (pResId)
1356 aText = SwResId(pResId);
1357
1358 ::lcl_PaintReplacement( rAlignedGrfArea, aText, *pShell, this, true );
1359}
1360
1362 SwOLENode* pOLENd, bool bIsChart, bool bPrn, const SwRect& rAlignedGrfArea,
1363 SwViewShell* pShell ) const
1364{
1365 bool bDone(false);
1366
1367 if(bIsChart)
1368 {
1369 basegfx::B2DRange aSourceRange;
1372 aSourceRange,
1373 bPrn));
1374
1375 if(!aSequence.empty() && !aSourceRange.isEmpty())
1376 {
1377 const basegfx::B2DRange aTargetRange(
1378 rAlignedGrfArea.Left(), rAlignedGrfArea.Top(),
1379 rAlignedGrfArea.Right(), rAlignedGrfArea.Bottom());
1380
1382 *pOut,
1383 aSequence,
1384 aSourceRange,
1385 aTargetRange);
1386 }
1387 }
1388
1389 if(bDone || !pOLENd)
1390 return;
1391
1392 // SwOLENode does not have a known GraphicObject, need to
1393 // work with Graphic instead
1394 const Graphic* pGraphic = pOLENd->GetGraphic();
1395 const Point aPosition(rAlignedGrfArea.Pos());
1396 const Size aSize(rAlignedGrfArea.SSize());
1397
1398 if ( pGraphic && pGraphic->GetType() != GraphicType::NONE )
1399 {
1400 pGraphic->Draw(*pOut, aPosition, aSize);
1401
1402 // shade the representation if the object is activated outplace
1403 uno::Reference < embed::XEmbeddedObject > xObj = pOLENd->GetOLEObj().GetOleRef();
1404 if ( xObj.is() && xObj->getCurrentState() == embed::EmbedStates::ACTIVE )
1405 {
1406
1409 aPosition,
1410 aSize),
1411 pOut);
1412 }
1413 }
1414 else
1415 {
1417 tools::Rectangle(aPosition, aSize),
1418 pOLENd->GetOLEObj().GetCurrentPersistName(),
1419 pOut);
1420 }
1421
1422 sal_Int64 nMiscStatus = pOLENd->GetOLEObj().GetOleRef()->getStatus( pOLENd->GetAspect() );
1423 if ( !bPrn && dynamic_cast< const SwCursorShell *>( pShell ) != nullptr &&
1424 (nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE))
1425 {
1426 const SwFlyFrame *pFly = FindFlyFrame();
1427 assert( pFly != nullptr );
1428 static_cast<SwFEShell*>(pShell)->ConnectObj( pOLENd->GetOLEObj().GetObject(), pFly->getFramePrintArea(), pFly->getFrameArea());
1429 }
1430}
1431
1433{
1434 const SwViewShell* pSh = getRootFrame()->GetCurrShell();
1435
1436 if ( !pSh || !pSh->GetViewOptions()->IsGraphic() )
1437 {
1438 return true;
1439 }
1440
1441 const SwGrfNode *pNd;
1442
1443 if( nullptr != (pNd = GetNode()->GetGrfNode()) )
1444 {
1445 if(pNd->IsTransparent())
1446 {
1447 return true;
1448 }
1449 }
1450
1451 // RotateFlyFrame3: If we are transformed, there are 'free' areas between
1452 // the Graphic and the Border/Padding stuff - at least as long as those
1453 // (Border and Padding) are not transformed, too
1455 {
1456 // we can be more specific - rotations of multiples of
1457 // 90 degrees will leave no gaps. Go from [0.0 .. 2PI]
1458 // to [0 .. 360] and check modulo 90
1460 const bool bMultipleOf90(0 == (nRot % 90));
1461
1462 if(!bMultipleOf90)
1463 {
1464 return true;
1465 }
1466 }
1467
1468 //#29381# OLE are always transparent
1469 if(nullptr != GetNode()->GetOLENode())
1470 {
1471 return true;
1472 }
1473
1474 // return false by default to avoid background paint
1475 return false;
1476}
1477
1479{
1480 // Stop animated graphics
1481 const SwGrfNode* pGrfNd = GetNode()->GetGrfNode();
1482
1483 if( pGrfNd && pGrfNd->IsAnimated() )
1484 {
1485 const_cast< SwGrfNode* >(pGrfNd)->StopGraphicAnimation( pOut, reinterpret_cast<sal_IntPtr>(this) );
1486 }
1487}
1488
1490{
1491 const SwGrfNode* pGrfNd = GetNode()->GetGrfNode();
1492 return pGrfNd && pGrfNd->IsAnimated();
1493}
1494
1495/* 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:317
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:2688
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
Definition: cntfrm.hxx:58
virtual void DestroyImpl() override
Definition: ssfrm.cxx:426
void MakePrtArea(const SwBorderAttrs &)
Definition: calcmove.cxx:1063
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: wsfrm.cxx:2347
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:413
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:434
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:2811
virtual const SwFlyFrameFormat * GetFormat() const override
Definition: fly.cxx:2905
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:2664
virtual void Calc(vcl::RenderContext *pRenderContext) const override
Definition: fly.cxx:2915
bool isTransformableSwFrame() const
Definition: flyfrms.hxx:132
const SwRect & GetUnclippedFrame() const
Definition: flyfrms.hxx:113
TransformableSwFrame * getTransformableSwFrame()
Definition: flyfrms.hxx:133
bool IsContour() const
Definition: fmtsrnd.hxx:53
const ImageMap * GetMap() const
Definition: fmturl.hxx:68
const OUString & GetURL() const
Definition: fmturl.hxx:66
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:78
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:125
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:148
bool isFramePrintAreaValid() const
Definition: frame.hxx:168
bool isFrameAreaSizeValid() const
Definition: frame.hxx:167
virtual basegfx::B2DHomMatrix getFramePrintAreaTransformation() const
Definition: wsfrm.cxx:135
void setFrameAreaSizeValid(bool bNew)
Definition: wsfrm.cxx:92
Base class of the Writer layout elements.
Definition: frame.hxx:315
SwTwips Grow(SwTwips, bool bTst=false, bool bInfo=false)
Definition: wsfrm.cxx:1510
sal_uInt16 GetVirtPageNum() const
Definition: trvlfrm.cxx:1817
SwTwips Shrink(SwTwips, bool bTst=false, bool bInfo=false)
Definition: wsfrm.cxx:1554
SwFlyFrame * FindFlyFrame()
Definition: frame.hxx:1111
SwFrameType mnFrameType
Definition: frame.hxx:414
virtual void Calc(vcl::RenderContext *pRenderContext) const
Definition: trvlfrm.cxx:1799
virtual void MakePos()
Definition: calcmove.cxx:526
static SwCache & GetCache()
Definition: frame.hxx:521
void InvalidatePrt()
Definition: frame.hxx:1036
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:7424
SwLayoutFrame * GetUpper()
Definition: frame.hxx:678
bool IsVertical() const
Definition: frame.hxx:973
SwRootFrame * getRootFrame()
Definition: frame.hxx:679
void SetCompletePaint() const
Definition: frame.hxx:994
SwPageFrame * FindPageFrame()
Definition: frame.hxx:680
void InvalidateAll_()
Definition: frame.hxx:803
virtual Size GetTwipSize() const override
Definition: ndgrf.cxx:432
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:733
void UpdateLinkWithInputStream()
Definition: ndgrf.cxx:870
const GraphicObject & GetGrfObj(bool bWait=false) const
Definition: ndgrf.cxx:379
bool GetFileFilterNms(OUString *pFileNm, OUString *pFilterNm) const
Definition: ndgrf.cxx:494
void SetFrameInPaint(bool b)
Definition: ndgrf.hxx:104
void TriggerAsyncRetrieveInputStream()
Definition: ndgrf.cxx:828
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:822
bool IsAsyncRetrieveInputStreamPossible() const
Definition: ndgrf.cxx:888
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:1489
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:1361
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:1478
void ImplPaintPictureGraphic(vcl::RenderContext *pOut, SwGrfNode *pGrfNd, bool bPrn, const SwRect &rAlignedGrfArea, SwViewShell *pShell, SwNoTextNode &rNoTNd) const
Definition: notxtfrm.cxx:1172
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:1338
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:1099
sdr::contact::ViewContact & GetViewContact() const
Definition: notxtfrm.cxx:1081
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:1312
virtual void MakeAll(vcl::RenderContext *pRenderContext) override
Definition: notxtfrm.cxx:478
bool IsTransparent() const
Definition: notxtfrm.cxx:1432
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:739
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
Definition: node.cxx:2154
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:2153
bool IsChart() const
Definition: ndole.cxx:632
sal_Int64 GetAspect() const
Definition: ndole.hxx:140
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:116
const Graphic * GetGraphic()
Definition: ndole.cxx:245
drawinglayer::primitive2d::Primitive2DContainer const & tryToGetChartContentAsPrimitive2DSequence(basegfx::B2DRange &rRange, bool bSynchron)
Definition: ndole.cxx:1085
svt::EmbeddedObjectRef & GetObject()
Definition: ndole.cxx:992
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
Definition: ndole.cxx:941
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:208
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:532
bool IsGraphic() const
Definition: viewopt.hxx:443
Color GetRetoucheColor() const
Definition: viewimp.cxx:290
SdrPageView * GetPageView()
Definition: viewimp.hxx:166
vcl::RenderContext * GetOut() const
Definition: viewsh.hxx:347
bool IsPreview() const
Definition: viewsh.hxx:498
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:433
VclPtr< OutputDevice > mpOut
Window, Printer, VirtDev, ...
Definition: viewsh.hxx:123
bool isOutputToWindow() const
Definition: viewsh.cxx:137
SwViewShellImp * Imp()
Definition: viewsh.hxx:190
vcl::Window * GetWin() const
Definition: viewsh.hxx:346
void OnGraphicArrived(const SwRect &)
Definition: viewsh.cxx:2689
SwDoc * GetDoc() const
Definition: viewsh.hxx:290
const SwAccessibilityOptions * GetAccessibilityOptions() const
Definition: viewsh.hxx:441
SdrView * GetDrawView()
Definition: vnew.cxx:373
RotateFlyFrame3: Helper class when you want to make your SwFrame derivate transformable.
Definition: frame.hxx:236
SwRect getUntransformedFramePrintArea() const
Definition: wsfrm.cxx:189
void adaptFrameAreasToTransformations()
Definition: wsfrm.cxx:234
void restoreFrameAreas()
Definition: wsfrm.cxx:269
const basegfx::B2DHomMatrix & getLocalFrameAreaTransformation() const
Definition: frame.hxx:255
void transform(const basegfx::B2DHomMatrix &aTransform)
Definition: wsfrm.cxx:287
SwRect getUntransformedFrameArea() const
Definition: wsfrm.cxx:165
const basegfx::B2DHomMatrix & getLocalFramePrintAreaTransformation() const
Definition: frame.hxx:261
void createFrameAreaTransformations(double fRotation, const basegfx::B2DPoint &rCenter)
Definition: wsfrm.cxx:214
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 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:139
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:1232
bool DrawFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes, const SwRect &rOriginalLayoutRect, const SwRegionRects &rPaintRegion, const basegfx::utils::B2DClipState &rClipState, vcl::RenderContext &rOut)
Definition: paintfrm.cxx:1725
void SwAlignRect(SwRect &rRect, const SwViewShell *pSh, const vcl::RenderContext *pRenderContext)
Function <SwAlignRect(..)> is also used outside this file.
Definition: paintfrm.cxx:1126
void DrawGraphic(const SvxBrushItem *, vcl::RenderContext &, const SwRect &rOrg, const SwRect &rOut, const sal_uInt8 nGrfNum=GRFNUM_NO, const bool bConsiderBackgroundTransparency=false)
Definition: paintfrm.cxx:1814
MirrorGraph
Definition: grfatr.hxx:32
constexpr sal_uInt16 RES_GRFATR_BEGIN(RES_FRMATR_END)
constexpr TypedWhichId< SwMsgPoolItem > RES_GRAPHIC_PIECE_ARRIVED(177)
constexpr TypedWhichId< SwRotationGrf > RES_GRFATR_ROTATION(137)
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_OBJECTDYING(RES_MSG_BEGIN)
constexpr TypedWhichId< SwFormatChg > RES_FMT_CHG(162)
constexpr TypedWhichId< SwAttrSetChg > RES_ATTRSET_CHG(163)
constexpr TypedWhichId< SwUpdateAttr > RES_UPDATE_ATTR(167)
constexpr TypedWhichId< SwMsgPoolItem > RES_LINKED_GRAPHIC_STREAM_ARRIVED(189)
constexpr sal_uInt16 RES_GRFATR_END(150)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(106)
bool isGRFATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:502
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:869
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:911
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:840
@ 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:37
SwNode & GetNode() const
Definition: pam.hxx:80
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
Definition: pam.cxx:230
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