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
610{
611 // call parent - this will do the basic transform for SwRect(s)
612 // in the SwFrameAreaDefinition
614
615 // check if the Transformations need to be adapted
617 {
618 const basegfx::B2DHomMatrix aTransform(
620 rOffset.X(), rOffset.Y()));
621
622 // transform using TransformableSwFrame
623 getTransformableSwFrame()->transform(aTransform);
624 }
625}
626
627// RotateFlyFrame3 - inner frame
628// Check if we contain a SwGrfNode and get possible rotation from it
630{
631 const SwNoTextNode* pSwNoTextNode(nullptr != GetNode() ? GetNode()->GetNoTextNode() : nullptr);
632
633 if(nullptr != pSwNoTextNode)
634 {
635 const SwGrfNode* pSwGrfNode(pSwNoTextNode->GetGrfNode());
636
637 if(nullptr != pSwGrfNode)
638 {
639 const SwAttrSet& rSwAttrSet(pSwGrfNode->GetSwAttrSet());
640 const SwRotationGrf& rSwRotationGrf(rSwAttrSet.GetRotationGrf());
641 const double fRotate = -toRadians(rSwRotationGrf.GetValue());
642
643 return basegfx::normalizeToRange(fRotate, 2 * M_PI);
644 }
645 }
646
647 // no rotation
648 return 0.0;
649}
650
652{
653 (void)xmlTextWriterStartElement(writer, reinterpret_cast<const xmlChar*>("notxt"));
654 dumpAsXmlAttributes(writer);
655
656 (void)xmlTextWriterStartElement(writer, BAD_CAST("infos"));
657 dumpInfosAsXml(writer);
658 (void)xmlTextWriterEndElement(writer);
659 dumpChildrenAsXml(writer);
660
661 (void)xmlTextWriterEndElement(writer);
662}
663
665void SwNoTextFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderAttrs * )
666{
667 const Size aNewSize( GetSize() );
668
669 // Did the height change?
670 SwTwips nChgHght = IsVertical() ?
671 static_cast<SwTwips>(aNewSize.Width() - getFramePrintArea().Width()) :
672 static_cast<SwTwips>(aNewSize.Height() - getFramePrintArea().Height());
673 if( nChgHght > 0)
674 Grow( nChgHght );
675 else if( nChgHght < 0)
677}
678
680 SwCursorMoveState *pCMS, bool /*bAllowFarAway*/ ) const
681{
682 if ( &rPos.GetNode() != static_cast<SwNode const *>(GetNode()) )
683 return false;
684
685 Calc(getRootFrame()->GetCurrShell()->GetOut());
686 SwRect aFrameRect( getFrameArea() );
687 rRect = aFrameRect;
688 rRect.Pos( getFrameArea().Pos() + getFramePrintArea().Pos() );
689 rRect.SSize( getFramePrintArea().SSize() );
690
691 rRect.Justify();
692
693 // Is the Bitmap in the visible area at all?
694 if( !aFrameRect.Overlaps( rRect ) )
695 {
696 // If not, then the Cursor is on the Frame
697 rRect = aFrameRect;
698 rRect.Width( 1 );
699 }
700 else
701 rRect.Intersection_( aFrameRect );
702
703 if ( pCMS && pCMS->m_bRealHeight )
704 {
705 pCMS->m_aRealHeight.setY(rRect.Height());
706 pCMS->m_aRealHeight.setX(0);
707 }
708
709 return true;
710}
711
713 SwCursorMoveState*, bool ) const
714{
715 pPos->Assign(*GetNode());
716 return true;
717}
718
720{
721 SwFlyFrame* pFly = FindFlyFrame();
722 if( pFly && pFly->GetFormat()->GetSurround().IsContour() )
723 {
726 }
727}
728
730{
731 if(GetNode()->GetNodeType() != SwNodeType::Grf)
732 {
735 return;
736 }
737 SwGrfNode* pNd = static_cast<SwGrfNode*>(GetNode());
738 ClearCache();
740 if(pVSh)
742}
743
744void SwNoTextFrame::SwClientNotify(const SwModify& rModify, const SfxHint& rHint)
745{
746 if(dynamic_cast<const sw::GrfRereadAndInCacheHint*>(&rHint))
747 {
748 if(SwNodeType::Grf != GetNode()->GetNodeType())
749 {
752 }
753 return;
754 }
755 if(rHint.GetId() == SfxHintId::SwPreGraphicArrived
756 || rHint.GetId() == SfxHintId::SwGraphicPieceArrived
757 || rHint.GetId() == SfxHintId::SwLinkedGraphicStreamArrived)
758 {
760 return;
761 }
762 else if (rHint.GetId() != SfxHintId::SwLegacyModify)
763 return;
764 auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
765 sal_uInt16 nWhich = pLegacy->GetWhich();
766
767 SwContentFrame::SwClientNotify(rModify, rHint);
768
769 bool bComplete = true;
770
771 switch( nWhich )
772 {
773 case RES_OBJECTDYING:
774 break;
775
776 case RES_UPDATE_ATTR:
777 if (GetNode()->GetNodeType() != SwNodeType::Grf) {
778 break;
779 }
780 [[fallthrough]];
781 case RES_FMT_CHG:
782 ClearCache();
783 break;
784
785 case RES_ATTRSET_CHG:
786 {
787 sal_uInt16 n;
788 for( n = RES_GRFATR_BEGIN; n < RES_GRFATR_END; ++n )
789 if( SfxItemState::SET == static_cast<const SwAttrSetChg*>(pLegacy->m_pOld)->GetChgSet()->
790 GetItemState( n, false ))
791 {
792 ClearCache();
793
795 {
796 // RotGrfFlyFrame: Update Handles in view, these may be rotation-dependent
797 // (e.g. crop handles) and need a visualisation update
798 if ( GetNode()->GetNodeType() == SwNodeType::Grf )
799 {
800 SwGrfNode* pNd = static_cast<SwGrfNode*>( GetNode());
802
803 if(pVSh)
804 {
805 SdrView* pDrawView = pVSh->GetDrawView();
806
807 if(pDrawView)
808 {
809 pDrawView->AdjustMarkHdl(nullptr);
810 }
811 }
812
813 // RotateFlyFrame3 - invalidate needed for ContentFrame (inner, this)
814 // and LayoutFrame (outer, GetUpper). It is possible to only invalidate
815 // the outer frame, but that leads to an in-between state that gets
816 // potentially painted
817 if(GetUpper())
818 {
820 }
821
823 }
824 }
825 break;
826 }
827 if( RES_GRFATR_END == n ) // not found
828 return ;
829 }
830 break;
831
832 default:
833 if ( !pLegacy->m_pNew || !isGRFATR(nWhich) )
834 return;
835 }
836
837 if( bComplete )
838 {
841 }
842}
843
844static void lcl_correctlyAlignRect( SwRect& rAlignedGrfArea, const SwRect& rInArea, vcl::RenderContext const * pOut )
845{
846
847 if(!pOut)
848 return;
849 tools::Rectangle aPxRect = pOut->LogicToPixel( rInArea.SVRect() );
850 tools::Rectangle aNewPxRect( aPxRect );
851 while( aNewPxRect.Left() < aPxRect.Left() )
852 {
853 rAlignedGrfArea.AddLeft( 1 );
854 aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
855 }
856 while( aNewPxRect.Top() < aPxRect.Top() )
857 {
858 rAlignedGrfArea.AddTop(+1);
859 aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
860 }
861 while( aNewPxRect.Bottom() > aPxRect.Bottom() )
862 {
863 rAlignedGrfArea.AddBottom( -1 );
864 aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
865 }
866 while( aNewPxRect.Right() > aPxRect.Right() )
867 {
868 rAlignedGrfArea.AddRight(-1);
869 aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
870 }
871}
872
874 vcl::RenderContext& rOutputDevice,
876 const basegfx::B2DRange& rSourceRange,
877 const basegfx::B2DRange& rTargetRange)
878{
879 if(!rSequence.empty() && !basegfx::fTools::equalZero(rSourceRange.getWidth()) && !basegfx::fTools::equalZero(rSourceRange.getHeight()))
880 {
881 if(!basegfx::fTools::equalZero(rTargetRange.getWidth()) && !basegfx::fTools::equalZero(rTargetRange.getHeight()))
882 {
883 // map graphic range to target range. This will e.g. automatically include
884 // the mapping from 1/100th mm content to twips if needed when the target
885 // range is defined in twips
886 const basegfx::B2DHomMatrix aMappingTransform(
888 rSourceRange,
889 rTargetRange));
890
891 // Fill ViewInformation. Use MappingTransform here, so there is no need to
892 // embed the primitives to it. Use original TargetRange here so there is also
893 // no need to embed the primitives to a MaskPrimitive for cropping. This works
894 // only in this case where the graphic object cannot be rotated, though.
896 aViewInformation2D.setObjectTransformation(aMappingTransform);
897 aViewInformation2D.setViewTransformation(rOutputDevice.GetViewTransformation());
898 aViewInformation2D.setViewport(rTargetRange);
899
900 // get a primitive processor for rendering
901 std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor2D(
903 rOutputDevice, aViewInformation2D) );
904
905 // render and cleanup
906 pProcessor2D->process(rSequence);
907 return true;
908 }
909 }
910
911 return false;
912}
913
914// MM02 original using fallback to VOC and primitive-based version
916 vcl::RenderContext & rOutputDevice,
917 GraphicObject const& rGrfObj,
918 GraphicAttr const& rGraphicAttr,
919 const basegfx::B2DHomMatrix& rGraphicTransform,
920 const OUString& rName,
921 const OUString& rTitle,
922 const OUString& rDescription)
923{
924 // RotGrfFlyFrame: unify using GraphicPrimitive2D
925 // -> the primitive handles all crop and mirror stuff
926 // -> the primitive renderer will create the needed pdf export data
927 // -> if bitmap content, it will be cached system-dependent
930 rGraphicTransform,
931 rGrfObj,
932 rGraphicAttr);
933
934 // MM02 use primitive-based version for visualization
936 rOutputDevice,
937 aContent,
938 rGraphicTransform,
939 rName,
940 rTitle,
941 rDescription);
942}
943
944// MM02 new VOC and primitive-based version
946 vcl::RenderContext & rOutputDevice,
948 const basegfx::B2DHomMatrix& rGraphicTransform,
949 const OUString& rName,
950 const OUString& rTitle,
951 const OUString& rDescription)
952{
953 // RotateFlyFrame3: If ClipRegion is set at OutputDevice, we
954 // need to use that. Usually the renderer would be a VCL-based
955 // PrimitiveRenderer, but there are system-specific shortcuts that
956 // will *not* use the VCL-Paint of Bitmap and thus ignore this.
957 // Anyways, indirectly using a CLipRegion set at the target OutDev
958 // when using a PrimitiveRenderer is a non-valid implication.
959 // First tried only to use when HasPolyPolygonOrB2DPolyPolygon(),
960 // but there is an optimization at ClipRegion creation that detects
961 // a single Rectangle in a tools::PolyPolygon and forces to a simple
962 // RegionBand-based implementation, so cannot use it here.
963 if(rOutputDevice.IsClipRegion())
964 {
966
967 if(0 != aClip.count())
968 {
969 rContent.resize(1);
970 rContent[0] =
972 std::move(aClip),
974 }
975 }
976
977 if(!rName.isEmpty() || !rTitle.isEmpty() || !rDescription.isEmpty())
978 {
979 // Embed to ObjectInfoPrimitive2D when we have Name/Title/Description
980 // information available
981 rContent.resize(1);
982 rContent[0] =
985 rName,
986 rTitle,
987 rDescription);
988 }
989
990 basegfx::B2DRange aTargetRange(0.0, 0.0, 1.0, 1.0);
991 aTargetRange.transform(rGraphicTransform);
992
994 rOutputDevice,
995 rContent,
996 aTargetRange,
997 aTargetRange);
998}
999
1000// DrawContact section
1001namespace { // anonymous namespace
1002class ViewObjectContactOfSwNoTextFrame : public sdr::contact::ViewObjectContact
1003{
1004protected:
1005 virtual void createPrimitive2DSequence(
1006 const sdr::contact::DisplayInfo& rDisplayInfo,
1008
1009 // tdf#155190 disable this so superclass doesn't wrongly produce NonStruct
1010 virtual bool isExportPDFTags() const override { return false; }
1011
1012public:
1013 ViewObjectContactOfSwNoTextFrame(
1014 sdr::contact::ObjectContact& rObjectContact,
1015 sdr::contact::ViewContact& rViewContact);
1016};
1017
1018class ViewContactOfSwNoTextFrame : public sdr::contact::ViewContact
1019{
1020private:
1021 // owner
1022 const SwNoTextFrame& mrSwNoTextFrame;
1023
1024protected:
1025 // Create an Object-Specific ViewObjectContact, set ViewContact and
1026 // ObjectContact. Always needs to return something.
1028 sdr::contact::ObjectContact& rObjectContact) override;
1029
1030public:
1031 // read-access to owner
1032 const SwNoTextFrame& getSwNoTextFrame() const { return mrSwNoTextFrame; }
1033
1034 // basic constructor, used from SwNoTextFrame.
1035 explicit ViewContactOfSwNoTextFrame(const SwNoTextFrame& rSwNoTextFrame);
1036};
1037
1038void ViewObjectContactOfSwNoTextFrame::createPrimitive2DSequence(
1039 const sdr::contact::DisplayInfo& /*rDisplayInfo*/,
1041{
1042 // MM02 get all the parameters formally used in paintGraphicUsingPrimitivesHelper
1043 ViewContactOfSwNoTextFrame& rVCOfNTF(static_cast<ViewContactOfSwNoTextFrame&>(GetViewContact()));
1044 const SwNoTextFrame& rSwNoTextFrame(rVCOfNTF.getSwNoTextFrame());
1045 SwNoTextNode& rNoTNd(const_cast<SwNoTextNode&>(*static_cast<const SwNoTextNode*>(rSwNoTextFrame.GetNode())));
1046 SwGrfNode* pGrfNd(rNoTNd.GetGrfNode());
1047
1048 if(nullptr != pGrfNd)
1049 {
1050 const bool bPrn(GetObjectContact().isOutputToPrinter() || GetObjectContact().isOutputToRecordingMetaFile());
1051 const GraphicObject& rGrfObj(pGrfNd->GetGrfObj(bPrn));
1052 GraphicAttr aGraphicAttr;
1053 pGrfNd->GetGraphicAttr(aGraphicAttr, &rSwNoTextFrame);
1054 const basegfx::B2DHomMatrix aGraphicTransform(rSwNoTextFrame.getFrameAreaTransformation());
1055
1056 // MM02 this is the right place in the VOC-Mechanism to create
1057 // the primitives for visualization - these will be automatically
1058 // buffered and reused
1060 aGraphicTransform,
1061 rGrfObj,
1062 aGraphicAttr));
1063 }
1064}
1065
1066ViewObjectContactOfSwNoTextFrame::ViewObjectContactOfSwNoTextFrame(
1067 sdr::contact::ObjectContact& rObjectContact,
1068 sdr::contact::ViewContact& rViewContact)
1069: sdr::contact::ViewObjectContact(rObjectContact, rViewContact)
1070{
1071}
1072
1073sdr::contact::ViewObjectContact& ViewContactOfSwNoTextFrame::CreateObjectSpecificViewObjectContact(
1074 sdr::contact::ObjectContact& rObjectContact)
1075{
1076 sdr::contact::ViewObjectContact* pRetval = new ViewObjectContactOfSwNoTextFrame(rObjectContact, *this);
1077 return *pRetval;
1078}
1079
1080ViewContactOfSwNoTextFrame::ViewContactOfSwNoTextFrame(
1081 const SwNoTextFrame& rSwNoTextFrame
1082)
1083: mrSwNoTextFrame(rSwNoTextFrame)
1084{
1085}
1086} // end of anonymous namespace
1087
1089{
1090 if(!mpViewContact)
1091 {
1092 const_cast< SwNoTextFrame* >(this)->mpViewContact =
1093 std::make_unique<ViewContactOfSwNoTextFrame>(*this);
1094 }
1095
1096 return *mpViewContact;
1097}
1098
1106void SwNoTextFrame::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfArea ) const
1107{
1108 SwViewShell* pShell = getRootFrame()->GetCurrShell();
1109
1110 SwNoTextNode& rNoTNd = const_cast<SwNoTextNode&>(*static_cast<const SwNoTextNode*>(GetNode()));
1111 SwGrfNode* pGrfNd = rNoTNd.GetGrfNode();
1112 SwOLENode* pOLENd = rNoTNd.GetOLENode();
1113
1114 const bool bPrn = pOut == rNoTNd.getIDocumentDeviceAccess().getPrinter( false ) ||
1115 pOut->GetConnectMetaFile();
1116
1117 const bool bIsChart = pOLENd && pOLENd->GetOLEObj().GetObject().IsChart();
1118
1119 // calculate aligned rectangle from parameter <rGrfArea>.
1120 // Use aligned rectangle <aAlignedGrfArea> instead of <rGrfArea> in
1121 // the following code.
1122 SwRect aAlignedGrfArea = rGrfArea;
1123 ::SwAlignRect( aAlignedGrfArea, pShell, pOut );
1124
1125 if( !bIsChart )
1126 {
1127 // Because for drawing a graphic left-top-corner and size coordinations are
1128 // used, these coordinations have to be determined on pixel level.
1129 ::SwAlignGrfRect( &aAlignedGrfArea, *pOut );
1130 }
1131 else //if( bIsChart )
1132 {
1133 // #i78025# charts own borders are not completely visible
1134 // the above pixel correction is not correct - at least not for charts
1135 // so a different pixel correction is chosen here
1136 // this might be a good idea for all other OLE objects also,
1137 // but as I cannot oversee the consequences I fix it only for charts for now
1138 lcl_correctlyAlignRect( aAlignedGrfArea, rGrfArea, pOut );
1139 }
1140
1141 if( pGrfNd )
1142 {
1143 // Fix for bug fdo#33781
1144 const AntialiasingFlags nFormerAntialiasingAtOutput( pOut->GetAntialiasing() );
1146 pOut->SetAntialiasing( nFormerAntialiasingAtOutput | AntialiasingFlags::Enable );
1147
1148 ImplPaintPictureGraphic( pOut, pGrfNd, bPrn, aAlignedGrfArea, pShell, rNoTNd );
1149
1151 pOut->SetAntialiasing( nFormerAntialiasingAtOutput );
1152 }
1153 else // bIsChart || pOLENd
1154 {
1155 // Fix for bug fdo#33781
1156 const AntialiasingFlags nFormerAntialiasingAtOutput( pOut->GetAntialiasing() );
1158 {
1159 AntialiasingFlags nNewAntialiasingAtOutput = nFormerAntialiasingAtOutput | AntialiasingFlags::Enable;
1160
1161 // #i99665#
1162 // Adjust AntiAliasing mode at output device for chart OLE
1163 if ( pOLENd->IsChart() )
1164 nNewAntialiasingAtOutput |= AntialiasingFlags::PixelSnapHairline;
1165
1166 pOut->SetAntialiasing( nNewAntialiasingAtOutput );
1167 }
1168
1169 ImplPaintPictureBitmap( pOut, pOLENd, bIsChart, bPrn, aAlignedGrfArea, pShell );
1170
1171 // see #i99665#
1173 {
1174 pOut->SetAntialiasing( nFormerAntialiasingAtOutput );
1175 }
1176 }
1177}
1178
1180 SwGrfNode* pGrfNd, bool bPrn,
1181 const SwRect& rAlignedGrfArea, SwViewShell* pShell,
1182 SwNoTextNode& rNoTNd ) const
1183{
1184 bool bContinue = true;
1185 const GraphicObject& rGrfObj = pGrfNd->GetGrfObj(bPrn);
1186
1187 GraphicAttr aGrfAttr;
1188 pGrfNd->GetGraphicAttr( aGrfAttr, this );
1189
1190 if( !bPrn )
1191 {
1192 // #i73788#
1193 if ( pGrfNd->IsLinkedInputStreamReady() )
1194 {
1195 pGrfNd->UpdateLinkWithInputStream();
1196 }
1197 // #i85717#, #i90395# - check, if asynchronous retrieval
1198 // if input stream for the graphic is possible
1199 else if ( ( rGrfObj.GetType() == GraphicType::Default ||
1200 rGrfObj.GetType() == GraphicType::NONE ) &&
1201 pGrfNd->IsLinkedFile() &&
1203 {
1204 Size aTmpSz;
1205 ::sfx2::SvLinkSource* pGrfObj = pGrfNd->GetLink()->GetObj();
1206 if( !pGrfObj ||
1207 !pGrfObj->IsDataComplete() ||
1208 !(aTmpSz = pGrfNd->GetTwipSize()).Width() ||
1209 !aTmpSz.Height())
1210 {
1211 pGrfNd->TriggerAsyncRetrieveInputStream(); // #i73788#
1212 }
1213 OUString aText( pGrfNd->GetTitle() );
1214 if ( aText.isEmpty() )
1215 GetRealURL( *pGrfNd, aText );
1216 ::lcl_PaintReplacement( rAlignedGrfArea, aText, *pShell, this, false );
1217 bContinue = false;
1218 }
1219 }
1220
1221 if( !bContinue )
1222 return;
1223
1224 if( !rGrfObj.GetGraphic().IsSupportedGraphic())
1225 {
1226 ImplPaintPictureReplacement(rGrfObj, pGrfNd, rAlignedGrfArea, pShell);
1227 return;
1228 }
1229
1230 const bool bAnimate = rGrfObj.IsAnimated() &&
1231 !pShell->IsPreview() &&
1233 // #i9684# Stop animation during printing/pdf export
1234 pShell->GetWin();
1235 if( bAnimate &&
1236 FindFlyFrame() != ::GetFlyFromMarked( nullptr, pShell ))
1237 {
1238 ImplPaintPictureAnimate(pOut, pShell, pGrfNd, rAlignedGrfArea);
1239 return;
1240 }
1241
1242 // MM02 To allow system-dependent buffering of the involved
1243 // bitmaps it is necessary to re-use the involved primitives
1244 // and their already executed decomposition (also for
1245 // performance reasons). This is usually done in DrawingLayer
1246 // by using the VOC-Mechanism (see descriptions elsewhere).
1247 // To get that here, make the involved SwNoTextFrame (this)
1248 // a sdr::contact::ViewContact supplier by supporting
1249 // a GetViewContact() - call. For ObjectContact we can use
1250 // the already existing ObjectContact from the involved
1251 // DrawingLayer. For this, the helper classes
1252 // ViewObjectContactOfSwNoTextFrame
1253 // ViewContactOfSwNoTextFrame
1254 // are created which support the VOC-mechanism in its minimal
1255 // form. This allows automatic and view-dependent (multiple edit
1256 // windows, print, etc.) re-use of the created primitives.
1257 // Also: Will be very useful when completely changing the Writer
1258 // repaint to VOC and Primitives, too.
1259 static const char* pDisableMM02Goodies(getenv("SAL_DISABLE_MM02_GOODIES"));
1260 static bool bUseViewObjectContactMechanism(nullptr == pDisableMM02Goodies);
1261 // tdf#130951 for safety reasons use fallback if ViewObjectContactMechanism
1262 // fails for some reason - usually could only be not to find the correct
1263 // SdrPageWindow
1264 bool bSucceeded(false);
1265
1266 if(bUseViewObjectContactMechanism)
1267 {
1268 // MM02 use VOC-mechanism and buffer primitives
1269 SwViewShellImp* pImp(pShell->Imp());
1270 SdrPageView* pPageView(nullptr != pImp
1271 ? pImp->GetPageView()
1272 : nullptr);
1273 // tdf#130951 caution - target may be Window, use the correct OutputDevice
1274 OutputDevice* pTarget((pShell->isOutputToWindow() && pShell->GetWin())
1275 ? pShell->GetWin()->GetOutDev()
1276 : pShell->GetOut());
1277 SdrPageWindow* pPageWindow(nullptr != pPageView && nullptr != pTarget
1278 ? pPageView->FindPageWindow(*pTarget)
1279 : nullptr);
1280
1281 if(nullptr != pPageWindow)
1282 {
1283 sdr::contact::ObjectContact& rOC(pPageWindow->GetObjectContact());
1286 sdr::contact::DisplayInfo aDisplayInfo;
1287
1289 const basegfx::B2DHomMatrix aGraphicTransform(getFrameAreaTransformation());
1290
1292 *pOut,
1293 aPrimitives,
1294 aGraphicTransform,
1295 nullptr == pGrfNd->GetFlyFormat() ? OUString() : pGrfNd->GetFlyFormat()->GetName(),
1296 rNoTNd.GetTitle(),
1297 rNoTNd.GetDescription());
1298 bSucceeded = true;
1299 }
1300 }
1301
1302 if(!bSucceeded)
1303 {
1304 // MM02 fallback to direct paint with primitive-recreation
1305 // which will block reusage of system-dependent bitmap data
1306 const basegfx::B2DHomMatrix aGraphicTransform(getFrameAreaTransformation());
1307
1309 *pOut,
1310 rGrfObj,
1311 aGrfAttr,
1312 aGraphicTransform,
1313 nullptr == pGrfNd->GetFlyFormat() ? OUString() : pGrfNd->GetFlyFormat()->GetName(),
1314 rNoTNd.GetTitle(),
1315 rNoTNd.GetDescription());
1316 }
1317}
1318
1320 SwGrfNode* pGrfNd, const SwRect& rAlignedGrfArea) const
1321{
1322 OutputDevice* pVout;
1323 if( pOut == pShell->GetOut() && SwRootFrame::FlushVout() )
1324 {
1325 pVout = pOut;
1326 pOut = pShell->GetOut();
1327 }
1328 else if( pShell->GetWin() && pOut->IsVirtual() )
1329 {
1330 pVout = pOut;
1331 pOut = pShell->GetWin()->GetOutDev();
1332 }
1333 else
1334 pVout = nullptr;
1335
1336 OSL_ENSURE( !pOut->IsVirtual() ||
1337 pShell->GetViewOptions()->IsPDFExport() || pShell->isOutputToWindow(),
1338 "pOut should not be a virtual device" );
1339
1340 pGrfNd->StartGraphicAnimation(pOut, rAlignedGrfArea.Pos(),
1341 rAlignedGrfArea.SSize(), reinterpret_cast<sal_IntPtr>(this),
1342 pVout );
1343}
1344
1346 const SwRect& rAlignedGrfArea, SwViewShell* pShell) const
1347{
1348 TranslateId pResId;
1349
1350 if( GraphicType::NONE == rGrfObj.GetType() )
1351 pResId = STR_COMCORE_READERROR;
1352 else if ( !rGrfObj.GetGraphic().IsSupportedGraphic() )
1353 pResId = STR_COMCORE_CANT_SHOW;
1354
1355 OUString aText;
1356 if ( !pResId &&
1357 (aText = pGrfNd->GetTitle()).isEmpty() &&
1358 (!GetRealURL( *pGrfNd, aText ) || aText.isEmpty()))
1359 {
1360 pResId = STR_COMCORE_READERROR;
1361 }
1362 if (pResId)
1363 aText = SwResId(pResId);
1364
1365 ::lcl_PaintReplacement( rAlignedGrfArea, aText, *pShell, this, true );
1366}
1367
1369 SwOLENode* pOLENd, bool bIsChart, bool bPrn, const SwRect& rAlignedGrfArea,
1370 SwViewShell* pShell ) const
1371{
1372 bool bDone(false);
1373
1374 if(bIsChart)
1375 {
1376 basegfx::B2DRange aSourceRange;
1379 aSourceRange,
1380 bPrn));
1381
1382 if(!aSequence.empty() && !aSourceRange.isEmpty())
1383 {
1384 const basegfx::B2DRange aTargetRange(
1385 rAlignedGrfArea.Left(), rAlignedGrfArea.Top(),
1386 rAlignedGrfArea.Right(), rAlignedGrfArea.Bottom());
1387
1389 *pOut,
1390 aSequence,
1391 aSourceRange,
1392 aTargetRange);
1393 }
1394 }
1395
1396 if(bDone || !pOLENd)
1397 return;
1398
1399 // SwOLENode does not have a known GraphicObject, need to
1400 // work with Graphic instead
1401 const Graphic* pGraphic = pOLENd->GetGraphic();
1402 const Point aPosition(rAlignedGrfArea.Pos());
1403 const Size aSize(rAlignedGrfArea.SSize());
1404
1405 if ( pGraphic && pGraphic->GetType() != GraphicType::NONE )
1406 {
1407 pGraphic->Draw(*pOut, aPosition, aSize);
1408
1409 // shade the representation if the object is activated outplace
1410 uno::Reference < embed::XEmbeddedObject > xObj = pOLENd->GetOLEObj().GetOleRef();
1411 if ( xObj.is() && xObj->getCurrentState() == embed::EmbedStates::ACTIVE )
1412 {
1413
1416 aPosition,
1417 aSize),
1418 pOut);
1419 }
1420 }
1421 else
1422 {
1424 tools::Rectangle(aPosition, aSize),
1425 pOLENd->GetOLEObj().GetCurrentPersistName(),
1426 pOut);
1427 }
1428
1429 sal_Int64 nMiscStatus = pOLENd->GetOLEObj().GetOleRef()->getStatus( pOLENd->GetAspect() );
1430 if ( !bPrn && dynamic_cast< const SwCursorShell *>( pShell ) != nullptr &&
1431 (nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE))
1432 {
1433 const SwFlyFrame *pFly = FindFlyFrame();
1434 assert( pFly != nullptr );
1435 static_cast<SwFEShell*>(pShell)->ConnectObj( pOLENd->GetOLEObj().GetObject(), pFly->getFramePrintArea(), pFly->getFrameArea());
1436 }
1437}
1438
1440{
1441 const SwViewShell* pSh = getRootFrame()->GetCurrShell();
1442
1443 if ( !pSh || !pSh->GetViewOptions()->IsGraphic() )
1444 {
1445 return true;
1446 }
1447
1448 const SwGrfNode *pNd;
1449
1450 if( nullptr != (pNd = GetNode()->GetGrfNode()) )
1451 {
1452 if(pNd->IsTransparent())
1453 {
1454 return true;
1455 }
1456 }
1457
1458 // RotateFlyFrame3: If we are transformed, there are 'free' areas between
1459 // the Graphic and the Border/Padding stuff - at least as long as those
1460 // (Border and Padding) are not transformed, too
1462 {
1463 // we can be more specific - rotations of multiples of
1464 // 90 degrees will leave no gaps. Go from [0.0 .. 2PI]
1465 // to [0 .. 360] and check modulo 90
1467 const bool bMultipleOf90(0 == (nRot % 90));
1468
1469 if(!bMultipleOf90)
1470 {
1471 return true;
1472 }
1473 }
1474
1475 //#29381# OLE are always transparent
1476 if(nullptr != GetNode()->GetOLENode())
1477 {
1478 return true;
1479 }
1480
1481 // return false by default to avoid background paint
1482 return false;
1483}
1484
1486{
1487 // Stop animated graphics
1488 const SwGrfNode* pGrfNd = GetNode()->GetGrfNode();
1489
1490 if( pGrfNd && pGrfNd->IsAnimated() )
1491 {
1492 const_cast< SwGrfNode* >(pGrfNd)->StopGraphicAnimation( pOut, reinterpret_cast<sal_IntPtr>(this) );
1493 }
1494}
1495
1497{
1498 const SwGrfNode* pGrfNd = GetNode()->GetGrfNode();
1499 return pGrfNd && pGrfNd->IsAnimated();
1500}
1501
1502/* 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)
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long X() const
constexpr tools::Long getX() const
constexpr tools::Long getY() const
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:2696
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:2353
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
Definition: node.hxx:727
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:3025
virtual const SwFlyFrameFormat * GetFormat() const override
Definition: fly.cxx:3119
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:2878
virtual void Calc(vcl::RenderContext *pRenderContext) const override
Definition: fly.cxx:3156
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:1516
sal_uInt16 GetVirtPageNum() const
Definition: trvlfrm.cxx:1817
SwTwips Shrink(SwTwips, bool bTst=false, bool bInfo=false)
Definition: wsfrm.cxx:1560
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 dumpInfosAsXml(xmlTextWriterPtr writer) const
Definition: xmldump.cxx:171
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:7639
SwLayoutFrame * GetUpper()
Definition: frame.hxx:684
virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer) const
Definition: xmldump.cxx:188
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
void dumpChildrenAsXml(xmlTextWriterPtr writer) const
Definition: xmldump.cxx:246
virtual Size GetTwipSize() const override
Definition: ndgrf.cxx:409
bool IsLinkedFile() const
Definition: ndgrf.hxx:160
const tools::SvRef< sfx2::SvBaseLink > & GetLink() const
Definition: ndgrf.hxx:128
bool IsAnimated() const
Definition: ndgrf.hxx:91
GraphicAttr & GetGraphicAttr(GraphicAttr &, const SwFrame *pFrame) const
Returns the with our graphic attributes filled Graphic-Attr-Structure.
Definition: ndgrf.cxx:709
void UpdateLinkWithInputStream()
Definition: ndgrf.cxx:845
const GraphicObject & GetGrfObj(bool bWait=false) const
Definition: ndgrf.cxx:364
bool GetFileFilterNms(OUString *pFileNm, OUString *pFilterNm) const
Definition: ndgrf.cxx:470
void SetFrameInPaint(bool b)
Definition: ndgrf.hxx:100
void TriggerAsyncRetrieveInputStream()
Definition: ndgrf.cxx:804
bool IsLinkedInputStreamReady() const
Definition: ndgrf.hxx:140
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:82
bool IsTransparent() const
Definition: ndgrf.cxx:798
bool IsAsyncRetrieveInputStreamPossible() const
Definition: ndgrf.cxx:863
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:1496
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:1368
void OnGraphicArrived()
Definition: notxtfrm.cxx:729
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:1485
void ImplPaintPictureGraphic(vcl::RenderContext *pOut, SwGrfNode *pGrfNd, bool bPrn, const SwRect &rAlignedGrfArea, SwViewShell *pShell, SwNoTextNode &rNoTNd) const
Definition: notxtfrm.cxx:1179
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: notxtfrm.cxx:744
SwNoTextFrame(SwNoTextNode *const, SwFrame *)
Definition: notxtfrm.cxx:147
void ImplPaintPictureReplacement(const GraphicObject &rGrfObj, SwGrfNode *pGrfNd, const SwRect &rAlignedGrfArea, SwViewShell *pShell) const
Definition: notxtfrm.cxx:1345
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:1106
sdr::contact::ViewContact & GetViewContact() const
Definition: notxtfrm.cxx:1088
virtual bool GetCharRect(SwRect &, const SwPosition &, SwCursorMoveState *=nullptr, bool bAllowFarAway=true) const override
Definition: notxtfrm.cxx:679
void ImplPaintPictureAnimate(vcl::RenderContext *pOut, SwViewShell *pShell, SwGrfNode *pGrfNd, const SwRect &rAlignedGrfArea) const
Definition: notxtfrm.cxx:1319
virtual void MakeAll(vcl::RenderContext *pRenderContext) override
Definition: notxtfrm.cxx:478
void dumpAsXml(xmlTextWriterPtr writer=nullptr) const override
Definition: notxtfrm.cxx:651
bool IsTransparent() const
Definition: notxtfrm.cxx:1439
void ClearCache()
Definition: notxtfrm.cxx:719
void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr) override
Calculate the Bitmap's site, if needed.
Definition: notxtfrm.cxx:665
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:712
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:195
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:150
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:588
bool IsGraphic() const
Definition: viewopt.hxx:499
Color GetRetoucheColor() const
Definition: viewimp.cxx:290
SdrPageView * GetPageView()
Definition: viewimp.hxx:166
vcl::RenderContext * GetOut() const
Definition: viewsh.hxx:365
bool IsPreview() const
Definition: viewsh.hxx:517
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:452
VclPtr< OutputDevice > mpOut
Window, Printer, VirtDev, ...
Definition: viewsh.hxx:142
bool isOutputToWindow() const
Definition: viewsh.cxx:152
SwViewShellImp * Imp()
Definition: viewsh.hxx:211
vcl::Window * GetWin() const
Definition: viewsh.hxx:364
void OnGraphicArrived(const SwRect &)
Definition: viewsh.cxx:2699
SwDoc * GetDoc() const
Definition: viewsh.hxx:308
const SwAccessibilityOptions * GetAccessibilityOptions() const
Definition: viewsh.hxx:460
SdrView * GetDrawView()
Definition: vnew.cxx:386
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)
struct _xmlTextWriter * xmlTextWriterPtr
double toRadians(D x)
SwFlyFrame * GetFlyFromMarked(const SdrMarkList *pLst, SwViewShell *pSh)
Definition: feshview.cxx:109
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:1241
bool DrawFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes, const SwRect &rOriginalLayoutRect, const SwRegionRects &rPaintRegion, const basegfx::utils::B2DClipState &rClipState, vcl::RenderContext &rOut)
Definition: paintfrm.cxx:1734
void SwAlignRect(SwRect &rRect, const SwViewShell *pSh, const vcl::RenderContext *pRenderContext)
Function <SwAlignRect(..)> is also used outside this file.
Definition: paintfrm.cxx:1135
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:1823
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:873
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:915
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:844
@ 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