xref: /aoo41x/main/sw/source/core/doc/notxtfrm.cxx (revision ddde725d)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sw.hxx"
26 
27 
28 #include <hintids.hxx>
29 #include <tools/urlobj.hxx>
30 #include <vcl/print.hxx>
31 #include <vcl/virdev.hxx>
32 #include <vcl/svapp.hxx>
33 #include <svtools/imapobj.hxx>
34 #include <svtools/imap.hxx>
35 #include <svl/urihelper.hxx>
36 #include <svtools/soerr.hxx>
37 #include <sfx2/progress.hxx>
38 #include <sfx2/docfile.hxx>
39 #include <sfx2/printer.hxx>
40 #include <editeng/udlnitem.hxx>
41 #include <editeng/colritem.hxx>
42 #include <svx/xoutbmp.hxx>
43 #include <vcl/window.hxx>
44 #include <fmturl.hxx>
45 #include <fmtsrnd.hxx>
46 #include <frmfmt.hxx>
47 #include <swrect.hxx>
48 #include <fesh.hxx>
49 #include <doc.hxx>
50 #include <flyfrm.hxx>
51 #include <frmtool.hxx>
52 #include <viewopt.hxx>
53 #include <viewimp.hxx>
54 #include <pam.hxx>
55 #include <hints.hxx>
56 #include <rootfrm.hxx>
57 #include <dflyobj.hxx>
58 #include <pagefrm.hxx>
59 #include <notxtfrm.hxx>
60 #include <grfatr.hxx>
61 #include <charatr.hxx>
62 #include <fmtornt.hxx>
63 #include <ndnotxt.hxx>
64 #include <ndgrf.hxx>
65 #include <ndole.hxx>
66 #include <swregion.hxx>
67 #include <poolfmt.hxx>
68 #include <mdiexp.hxx>
69 #include <swwait.hxx>
70 #include <comcore.hrc>
71 #include <accessibilityoptions.hxx>
72 #include <com/sun/star/embed/EmbedMisc.hpp>
73 #include <com/sun/star/embed/EmbedStates.hpp>
74 
75 #include <svtools/embedhlp.hxx>
76 #include <svtools/chartprettypainter.hxx>
77 // --> OD 2009-03-05 #i99665#
78 #include <dview.hxx>
79 // <--
80 
81 #include <basegfx/matrix/b2dhommatrix.hxx>
82 #include <svx/sdr/contact/objectcontacttools.hxx>
83 #include <drawinglayer/processor2d/baseprocessor2d.hxx>
84 #include <basegfx/matrix/b2dhommatrixtools.hxx>
85 
86 using namespace com::sun::star;
87 
88 #define DEFTEXTSIZE  12
89 
90 extern void ClrContourCache( const SdrObject *pObj ); // TxtFly.Cxx
91 
92 
93 inline sal_Bool GetRealURL( const SwGrfNode& rNd, String& rTxt )
94 {
95 	sal_Bool bRet = rNd.GetFileFilterNms( &rTxt, 0 );
96 	if( bRet )
97 		rTxt = URIHelper::removePassword( rTxt, INetURLObject::WAS_ENCODED,
98 			   							INetURLObject::DECODE_UNAMBIGUOUS);
99 	return bRet;
100 }
101 
102 void lcl_PaintReplacement( const SwRect &rRect, const String &rText,
103 						   const ViewShell &rSh, const SwNoTxtFrm *pFrm,
104 						   sal_Bool bDefect )
105 {
106 	static Font *pFont = 0;
107 	if ( !pFont )
108 	{
109 		pFont = new Font();
110 		pFont->SetWeight( WEIGHT_BOLD );
111 		pFont->SetStyleName( aEmptyStr );
112 		pFont->SetName( String::CreateFromAscii(
113                             RTL_CONSTASCII_STRINGPARAM( "Arial Unicode" )));
114 		pFont->SetFamily( FAMILY_SWISS );
115 		pFont->SetTransparent( sal_True );
116 	}
117 
118 	Color aCol( COL_RED );
119 	FontUnderline eUnderline = UNDERLINE_NONE;
120 	const SwFmtURL &rURL = pFrm->FindFlyFrm()->GetFmt()->GetURL();
121 	if( rURL.GetURL().Len() || rURL.GetMap() )
122 	{
123 		sal_Bool bVisited = sal_False;
124 		if ( rURL.GetMap() )
125 		{
126 			ImageMap *pMap = (ImageMap*)rURL.GetMap();
127 			for( sal_uInt16 i = 0; i < pMap->GetIMapObjectCount(); i++ )
128 			{
129 				IMapObject *pObj = pMap->GetIMapObject( i );
130 				if( rSh.GetDoc()->IsVisitedURL( pObj->GetURL() ) )
131 				{
132 					bVisited = sal_True;
133 					break;
134 				}
135 			}
136 		}
137 		else if ( rURL.GetURL().Len() )
138 			bVisited = rSh.GetDoc()->IsVisitedURL( rURL.GetURL() );
139 
140 		SwFmt *pFmt = rSh.GetDoc()->GetFmtFromPool( static_cast<sal_uInt16>
141             (bVisited ? RES_POOLCHR_INET_VISIT : RES_POOLCHR_INET_NORMAL ) );
142 		aCol = pFmt->GetColor().GetValue();
143 		eUnderline = pFmt->GetUnderline().GetLineStyle();
144 	}
145 
146 	pFont->SetUnderline( eUnderline );
147 	pFont->SetColor( aCol );
148 
149     const BitmapEx& rBmp = ViewShell::GetReplacementBitmap( bDefect != sal_False );
150     Graphic::DrawEx( rSh.GetOut(), rText, *pFont, rBmp, rRect.Pos(), rRect.SSize() );
151 }
152 
153 /*************************************************************************
154 |*
155 |*	  SwGrfFrm::SwGrfFrm(ViewShell * const,SwGrfNode *)
156 |*
157 |*	  Beschreibung
158 |*	  Ersterstellung	JP 05.03.91
159 |*	  Letzte Aenderung	MA 03. Mar. 93
160 |*
161 *************************************************************************/
162 
163 
164 SwNoTxtFrm::SwNoTxtFrm(SwNoTxtNode * const pNode, SwFrm* pSib )
165 	: SwCntntFrm( pNode, pSib )
166 {
167 	InitCtor();
168 }
169 
170 // Initialisierung: z.Zt. Eintragen des Frames im Cache
171 
172 
173 void SwNoTxtFrm::InitCtor()
174 {
175     nType = FRMC_NOTXT;
176 	// Das Gewicht der Grafik ist 0, wenn sie noch nicht
177 	// gelesen ist, < 0, wenn ein Lesefehler auftrat und
178 	// Ersatzdarstellung angewendet werden musste und >0,
179 	// wenn sie zur Verfuegung steht.
180 	nWeight = 0;
181 }
182 
183 /*************************************************************************
184 |*
185 |*	  SwNoTxtNode::MakeFrm()
186 |*
187 |*	  Beschreibung
188 |*	  Ersterstellung	JP 05.03.91
189 |*	  Letzte Aenderung	MA 03. Mar. 93
190 |*
191 *************************************************************************/
192 
193 
194 SwCntntFrm *SwNoTxtNode::MakeFrm( SwFrm* pSib )
195 {
196 	return new SwNoTxtFrm(this, pSib);
197 }
198 
199 /*************************************************************************
200 |*
201 |*	  SwNoTxtFrm::~SwNoTxtFrm()
202 |*
203 |*	  Beschreibung
204 |*	  Ersterstellung	JP 05.03.91
205 |*	  Letzte Aenderung	MA 30. Apr. 96
206 |*
207 *************************************************************************/
208 
209 SwNoTxtFrm::~SwNoTxtFrm()
210 {
211 	StopAnimation();
212 }
213 
214 /*************************************************************************
215 |*
216 |*	  void SwNoTxtFrm::Modify( SwHint * pOld, SwHint * pNew )
217 |*
218 |*	  Beschreibung
219 |*	  Ersterstellung	JP 05.03.91
220 |*	  Letzte Aenderung	JP 05.03.91
221 |*
222 *************************************************************************/
223 
224 void SetOutDev( ViewShell *pSh, OutputDevice *pOut )
225 {
226 	pSh->pOut = pOut;
227 }
228 
229 
230 
231 
232 void lcl_ClearArea( const SwFrm &rFrm,
233 					OutputDevice &rOut, const SwRect& rPtArea,
234 					const SwRect &rGrfArea )
235 {
236 	SwRegionRects aRegion( rPtArea, 4, 4 );
237 	aRegion -= rGrfArea;
238 
239 	if ( aRegion.Count() )
240 	{
241 		const SvxBrushItem *pItem; const Color *pCol; SwRect aOrigRect;
242 		if ( rFrm.GetBackgroundBrush( pItem, pCol, aOrigRect, sal_False ) )
243 			for( sal_uInt16 i = 0; i < aRegion.Count(); ++i )
244 				::DrawGraphic( pItem, &rOut, aOrigRect, aRegion[i] );
245 		else
246 		{
247             // OD 2004-04-23 #116347#
248             rOut.Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
249 			rOut.SetFillColor( rFrm.getRootFrm()->GetCurrShell()->Imp()->GetRetoucheColor());
250 			rOut.SetLineColor();
251 			for( sal_uInt16 i = 0; i < aRegion.Count(); ++i )
252 				rOut.DrawRect( aRegion[i].SVRect() );
253 			rOut.Pop();
254 		}
255 	}
256 }
257 
258 /*************************************************************************
259 |*
260 |*	  void SwNoTxtFrm::Paint()
261 |*
262 |*	  Beschreibung
263 |*	  Ersterstellung	JP 05.03.91
264 |*	  Letzte Aenderung	MA 10. Jan. 97
265 |*
266 *************************************************************************/
267 
268 void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
269 {
270 	if ( Frm().IsEmpty() )
271 		return;
272 
273 	const ViewShell* pSh = getRootFrm()->GetCurrShell();
274 	if( !pSh->GetViewOptions()->IsGraphic() )
275 	{
276 		StopAnimation();
277         // OD 10.01.2003 #i6467# - no paint of placeholder for page preview
278         if ( pSh->GetWin() && !pSh->IsPreView() )
279 		{
280 			const SwNoTxtNode* pNd = GetNode()->GetNoTxtNode();
281             String aTxt( pNd->GetTitle() );
282 			if ( !aTxt.Len() && pNd->IsGrfNode() )
283 				GetRealURL( *(SwGrfNode*)pNd, aTxt );
284 			if( !aTxt.Len() )
285 				aTxt = FindFlyFrm()->GetFmt()->GetName();
286 			lcl_PaintReplacement( Frm(), aTxt, *pSh, this, sal_False );
287 		}
288 		return;
289 	}
290 
291     if( pSh->GetAccessibilityOptions()->IsStopAnimatedGraphics() ||
292     // --> FME 2004-06-21 #i9684# Stop animation during printing/pdf export
293        !pSh->GetWin() )
294     // <--
295         StopAnimation();
296 
297 	SfxProgress::EnterLock(); //Keine Progress-Reschedules im Paint (SwapIn)
298 
299 	OutputDevice *pOut = pSh->GetOut();
300 	pOut->Push();
301 	sal_Bool bClip = sal_True;
302 	PolyPolygon aPoly;
303 
304     SwNoTxtNode& rNoTNd = *(SwNoTxtNode*)GetNode();
305 	SwGrfNode* pGrfNd = rNoTNd.GetGrfNode();
306     if( pGrfNd )
307 		pGrfNd->SetFrameInPaint( sal_True );
308 
309     // OD 16.04.2003 #i13147# - add 2nd parameter with value <sal_True> to
310     // method call <FindFlyFrm().GetContour(..)> to indicate that it is called
311     // for paint in order to avoid load of the intrinsic graphic.
312     if ( ( !pOut->GetConnectMetaFile() ||
313            !pSh->GetWin() ) &&
314          FindFlyFrm()->GetContour( aPoly, sal_True )
315        )
316 	{
317 		pOut->SetClipRegion( aPoly );
318 		bClip = sal_False;
319 	}
320 
321 	SwRect aOrigPaint( rRect );
322 	if ( HasAnimation() && pSh->GetWin() )
323 	{
324 		aOrigPaint = Frm(); aOrigPaint += Prt().Pos();
325 	}
326 
327 	SwRect aGrfArea( Frm() );
328 	SwRect aPaintArea( aGrfArea );
329 	aPaintArea._Intersection( aOrigPaint );
330 
331 	SwRect aNormal( Frm().Pos() + Prt().Pos(), Prt().SSize() );
332 	aNormal.Justify(); //Normalisiertes Rechteck fuer die Vergleiche
333 
334 	if( aPaintArea.IsOver( aNormal ) )
335 	{
336 		// berechne die 4 zu loeschenden Rechtecke
337 		if( pSh->GetWin() )
338 			::lcl_ClearArea( *this, *pSh->GetOut(), aPaintArea, aNormal );
339 
340 		// in der Schnittmenge vom PaintBereich und der Bitmap liegt
341 		// der absolut sichtbare Bereich vom Frame
342 		aPaintArea._Intersection( aNormal );
343 
344 		if ( bClip )
345 			pOut->IntersectClipRegion( aPaintArea.SVRect() );
346         /// OD 25.09.2002 #99739# - delete unused 3rd parameter
347         PaintPicture( pOut, aGrfArea );
348 	}
349 	else
350 		// wenn nicht sichtbar, loesche einfach den angegebenen Bereich
351 		lcl_ClearArea( *this, *pSh->GetOut(), aPaintArea, SwRect() );
352     if( pGrfNd )
353 		pGrfNd->SetFrameInPaint( sal_False );
354 
355 	pOut->Pop();
356 	SfxProgress::LeaveLock();
357 }
358 
359 /*************************************************************************
360 |*
361 |*    void lcl_CalcRect( Point & aPt, Size & aDim,
362 |*                   sal_uInt16 nMirror )
363 |*
364 |*    Beschreibung      Errechne die Position und die Groesse der Grafik im
365 |*                      Frame, entsprechen der aktuellen Grafik-Attribute
366 |*
367 |*    Parameter         Point&  die Position im Frame  ( auch Return-Wert )
368 |*                      Size&   die Groesse der Grafik ( auch Return-Wert )
369 |*                      MirrorGrf   akt. Spiegelungs-Attribut
370 |*    Ersterstellung    JP 04.03.91
371 |*    Letzte Aenderung  JP 31.08.94
372 |*
373 *************************************************************************/
374 
375 
376 void lcl_CalcRect( Point& rPt, Size& rDim, sal_uInt16 nMirror )
377 {
378     if( nMirror == RES_MIRROR_GRAPH_VERT || nMirror == RES_MIRROR_GRAPH_BOTH )
379     {
380         rPt.X() += rDim.Width() -1;
381         rDim.Width() = -rDim.Width();
382     }
383 
384     if( nMirror == RES_MIRROR_GRAPH_HOR || nMirror == RES_MIRROR_GRAPH_BOTH )
385     {
386         rPt.Y() += rDim.Height() -1;
387         rDim.Height() = -rDim.Height();
388     }
389 }
390 
391 /*************************************************************************
392 |*
393 |*	  void SwNoTxtFrm::GetGrfArea()
394 |*
395 |*	  Beschreibung		Errechne die Position und die Groesse der Bitmap
396 |*						innerhalb des uebergebenem Rechtecks.
397 |*
398 |*	  Ersterstellung	JP 03.09.91
399 |*	  Letzte Aenderung	MA 11. Oct. 94
400 |*
401 *************************************************************************/
402 
403 void SwNoTxtFrm::GetGrfArea( SwRect &rRect, SwRect* pOrigRect,
404 							 sal_Bool ) const
405 {
406     // JP 23.01.2001: currently only used for scaling, cropping and mirroring
407     // the contour of graphics!
408 	//					all other is handled by the GraphicObject
409 
410 	//In rRect wird das sichbare Rechteck der Grafik gesteckt.
411 	//In pOrigRect werden Pos+Size der Gesamtgrafik gesteck.
412 
413 	const SwAttrSet& rAttrSet = GetNode()->GetSwAttrSet();
414 	const SwCropGrf& rCrop = rAttrSet.GetCropGrf();
415     sal_uInt16 nMirror = rAttrSet.GetMirrorGrf().GetValue();
416 
417     if( rAttrSet.GetMirrorGrf().IsGrfToggle() )
418     {
419         if( !(FindPageFrm()->GetVirtPageNum() % 2) )
420         {
421             switch ( nMirror )
422             {
423                 case RES_MIRROR_GRAPH_DONT: nMirror = RES_MIRROR_GRAPH_VERT; break;
424                 case RES_MIRROR_GRAPH_VERT: nMirror = RES_MIRROR_GRAPH_DONT; break;
425                 case RES_MIRROR_GRAPH_HOR: nMirror = RES_MIRROR_GRAPH_BOTH; break;
426                 default: nMirror = RES_MIRROR_GRAPH_HOR; break;
427             }
428         }
429     }
430 
431 	//Grafik wird vom Node eingelesen falls notwendig. Kann aber schiefgehen.
432 	long nLeftCrop, nRightCrop, nTopCrop, nBottomCrop;
433 	Size aOrigSz( ((SwNoTxtNode*)GetNode())->GetTwipSize() );
434 	if ( !aOrigSz.Width() )
435 	{
436 		aOrigSz.Width() = Prt().Width();
437 		nLeftCrop  = -rCrop.GetLeft();
438 		nRightCrop = -rCrop.GetRight();
439 	}
440 	else
441 	{
442 		nLeftCrop = Max( aOrigSz.Width() -
443 							(rCrop.GetRight() + rCrop.GetLeft()), long(1) );
444 		const double nScale = double(Prt().Width())  / double(nLeftCrop);
445 		nLeftCrop  = long(nScale * -rCrop.GetLeft() );
446 		nRightCrop = long(nScale * -rCrop.GetRight() );
447 	}
448 
449     // crop values have to be mirrored too
450     if( nMirror == RES_MIRROR_GRAPH_VERT || nMirror == RES_MIRROR_GRAPH_BOTH )
451     {
452         long nTmpCrop = nLeftCrop;
453         nLeftCrop = nRightCrop;
454         nRightCrop= nTmpCrop;
455     }
456 
457 	if( !aOrigSz.Height() )
458 	{
459 		aOrigSz.Height() = Prt().Height();
460 		nTopCrop   = -rCrop.GetTop();
461 		nBottomCrop= -rCrop.GetBottom();
462 	}
463 	else
464 	{
465 		nTopCrop = Max( aOrigSz.Height() - (rCrop.GetTop() + rCrop.GetBottom()), long(1) );
466 		const double nScale = double(Prt().Height()) / double(nTopCrop);
467 		nTopCrop   = long(nScale * -rCrop.GetTop() );
468 		nBottomCrop= long(nScale * -rCrop.GetBottom() );
469 	}
470 
471     // crop values have to be mirrored too
472     if( nMirror == RES_MIRROR_GRAPH_HOR || nMirror == RES_MIRROR_GRAPH_BOTH )
473     {
474         long nTmpCrop = nTopCrop;
475         nTopCrop   = nBottomCrop;
476         nBottomCrop= nTmpCrop;
477     }
478 
479 	Size  aVisSz( Prt().SSize() );
480 	Size  aGrfSz( aVisSz );
481 	Point aVisPt( Frm().Pos() + Prt().Pos() );
482 	Point aGrfPt( aVisPt );
483 
484 	//Erst das 'sichtbare' Rect einstellen.
485 	if ( nLeftCrop > 0 )
486 	{
487 		aVisPt.X() 	+= nLeftCrop;
488 		aVisSz.Width() -= nLeftCrop;
489 	}
490 	if ( nTopCrop > 0 )
491 	{
492 		aVisPt.Y() 	 += nTopCrop;
493 		aVisSz.Height() -= nTopCrop;
494 	}
495 	if ( nRightCrop > 0 )
496 		aVisSz.Width() -= nRightCrop;
497 	if ( nBottomCrop > 0 )
498 		aVisSz.Height() -= nBottomCrop;
499 
500 	rRect.Pos  ( aVisPt );
501 	rRect.SSize( aVisSz );
502 
503 	//Ggf. Die Gesamtgrafik berechnen
504 	if ( pOrigRect )
505 	{
506 		Size aTmpSz( aGrfSz );
507 		aGrfPt.X()    += nLeftCrop;
508 		aTmpSz.Width() -= nLeftCrop + nRightCrop;
509 		aGrfPt.Y()	    += nTopCrop;
510 		aTmpSz.Height()-= nTopCrop + nBottomCrop;
511 
512         if( RES_MIRROR_GRAPH_DONT != nMirror )
513             lcl_CalcRect( aGrfPt, aTmpSz, nMirror );
514 
515 		pOrigRect->Pos  ( aGrfPt );
516 		pOrigRect->SSize( aTmpSz );
517 	}
518 }
519 
520 /*************************************************************************
521 |*
522 |*	  Size SwNoTxtFrm::GetSize()
523 |*
524 |*	  Beschreibung		Gebe die Groesse des umgebenen FLys und
525 |*						damit die der Grafik zurueck.
526 |*	  Ersterstellung	JP 04.03.91
527 |*	  Letzte Aenderung	JP 31.08.94
528 |*
529 *************************************************************************/
530 
531 
532 const Size& SwNoTxtFrm::GetSize() const
533 {
534 	// gebe die Groesse des Frames zurueck
535 	const SwFrm *pFly = FindFlyFrm();
536 	if( !pFly )
537 		pFly = this;
538 	return pFly->Prt().SSize();
539 }
540 
541 /*************************************************************************
542 |*
543 |*	  SwNoTxtFrm::MakeAll()
544 |*
545 |*	  Ersterstellung	MA 29. Nov. 96
546 |*	  Letzte Aenderung	MA 29. Nov. 96
547 |*
548 *************************************************************************/
549 
550 
551 void SwNoTxtFrm::MakeAll()
552 {
553 	SwCntntNotify aNotify( this );
554 	SwBorderAttrAccess aAccess( SwFrm::GetCache(), this );
555 	const SwBorderAttrs &rAttrs = *aAccess.Get();
556 
557 	while ( !bValidPos || !bValidSize || !bValidPrtArea )
558 	{
559 		MakePos();
560 
561 		if ( !bValidSize )
562 			Frm().Width( GetUpper()->Prt().Width() );
563 
564 		MakePrtArea( rAttrs );
565 
566 		if ( !bValidSize )
567 		{	bValidSize = sal_True;
568 			Format();
569 		}
570 	}
571 }
572 
573 /*************************************************************************
574 |*
575 |*	  SwNoTxtFrm::Format()
576 |*
577 |*	  Beschreibung		Errechne die Groesse der Bitmap, wenn noetig
578 |*	  Ersterstellung	JP 11.03.91
579 |*	  Letzte Aenderung	MA 13. Mar. 96
580 |*
581 *************************************************************************/
582 
583 
584 void SwNoTxtFrm::Format( const SwBorderAttrs * )
585 {
586 	const Size aNewSize( GetSize() );
587 
588 	// hat sich die Hoehe geaendert?
589 	SwTwips nChgHght = IsVertical() ?
590 		(SwTwips)(aNewSize.Width() - Prt().Width()) :
591 		(SwTwips)(aNewSize.Height() - Prt().Height());
592     if( nChgHght > 0)
593         Grow( nChgHght );
594 	else if( nChgHght < 0)
595         Shrink( Min(Prt().Height(), -nChgHght) );
596 }
597 
598 /*************************************************************************
599 |*
600 |*	  SwNoTxtFrm::GetCharRect()
601 |*
602 |*	  Beschreibung
603 |*	  Ersterstellung	SS 29-Apr-1991
604 |*	  Letzte Aenderung	MA 10. Oct. 94
605 |*
606 |*************************************************************************/
607 
608 
609 sal_Bool SwNoTxtFrm::GetCharRect( SwRect &rRect, const SwPosition& rPos,
610 							  SwCrsrMoveState *pCMS ) const
611 {
612 	if ( &rPos.nNode.GetNode() != (SwNode*)GetNode() )
613 		return sal_False;
614 
615 	Calc();
616 	SwRect aFrameRect( Frm() );
617 	rRect = aFrameRect;
618 	rRect.Pos( Frm().Pos() + Prt().Pos() );
619 	rRect.SSize( Prt().SSize() );
620 
621 	rRect.Justify();
622 
623 	// liegt die Bitmap ueberhaupt im sichtbaren Berich ?
624 	if( !aFrameRect.IsOver( rRect ) )
625 	{
626 		// wenn nicht dann steht der Cursor auf dem Frame
627 		rRect = aFrameRect;
628 		rRect.Width( 1 );
629 	}
630 	else
631 		rRect._Intersection( aFrameRect );
632 
633 	if ( pCMS )
634 	{
635 		if ( pCMS->bRealHeight )
636 		{
637 			pCMS->aRealHeight.Y() = rRect.Height();
638 			pCMS->aRealHeight.X() = 0;
639 		}
640 	}
641 
642 	return sal_True;
643 }
644 
645 
646 sal_Bool SwNoTxtFrm::GetCrsrOfst(SwPosition* pPos, Point& ,
647                              SwCrsrMoveState* ) const
648 {
649 	SwCntntNode* pCNd = (SwCntntNode*)GetNode();
650 	pPos->nNode = *pCNd;
651 	pPos->nContent.Assign( pCNd, 0 );
652 	return sal_True;
653 }
654 
655 #define CLEARCACHE( pNd ) {\
656 	(pNd)->GetGrfObj().ReleaseFromCache();\
657 	SwFlyFrm* pFly = FindFlyFrm();\
658 	if( pFly && pFly->GetFmt()->GetSurround().IsContour() )\
659 	{\
660 		ClrContourCache( pFly->GetVirtDrawObj() );\
661 		pFly->NotifyBackground( FindPageFrm(), Prt(), PREP_FLY_ATTR_CHG );\
662 	}\
663 }
664 
665 void SwNoTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
666 {
667 	sal_uInt16 nWhich = pNew ? pNew->Which() : pOld ? pOld->Which() : 0;
668 
669     // --> OD 2007-03-06 #i73788#
670     // no <SwCntntFrm::Modify(..)> for RES_LINKED_GRAPHIC_STREAM_ARRIVED
671     if ( RES_GRAPHIC_PIECE_ARRIVED != nWhich &&
672 		 RES_GRAPHIC_ARRIVED != nWhich &&
673          RES_GRF_REREAD_AND_INCACHE != nWhich &&
674          RES_LINKED_GRAPHIC_STREAM_ARRIVED != nWhich )
675     // <--
676     {
677 		SwCntntFrm::Modify( pOld, pNew );
678     }
679 
680 	sal_Bool bComplete = sal_True;
681 
682 	switch( nWhich )
683 	{
684 	case RES_OBJECTDYING:
685 		break;
686 
687 	case RES_GRF_REREAD_AND_INCACHE:
688 		if( ND_GRFNODE == GetNode()->GetNodeType() )
689 		{
690 			bComplete = sal_False;
691 			SwGrfNode* pNd = (SwGrfNode*) GetNode();
692 
693 			ViewShell *pVSh = 0;
694 			pNd->GetDoc()->GetEditShell( &pVSh );
695 			if( pVSh )
696 			{
697 				GraphicAttr aAttr;
698 				if( pNd->GetGrfObj().IsCached( pVSh->GetOut(), Point(),
699 							Prt().SSize(), &pNd->GetGraphicAttr( aAttr, this ) ))
700 				{
701 					ViewShell *pSh = pVSh;
702 					do {
703 						SET_CURR_SHELL( pSh );
704 						if( pSh->GetWin() )
705 						{
706 							if( pSh->IsPreView() )
707 								::RepaintPagePreview( pSh, Frm().SVRect() );
708 							else
709 								pSh->GetWin()->Invalidate( Frm().SVRect() );
710 						}
711 					} while( pVSh != (pSh = (ViewShell*)pSh->GetNext() ));
712 				}
713 				else
714 					pNd->SwapIn();
715 			}
716 		}
717 		break;
718 
719 	case RES_UPDATE_ATTR:
720 	case RES_FMT_CHG:
721 		CLEARCACHE( (SwGrfNode*) GetNode() )
722 		break;
723 
724 	case RES_ATTRSET_CHG:
725 		{
726 			sal_uInt16 n;
727 			for( n = RES_GRFATR_BEGIN; n < RES_GRFATR_END; ++n )
728 				if( SFX_ITEM_SET == ((SwAttrSetChg*)pOld)->GetChgSet()->
729 								GetItemState( n, sal_False ))
730 				{
731 					CLEARCACHE( (SwGrfNode*) GetNode() )
732 					break;
733 				}
734 			if( RES_GRFATR_END == n )			// not found
735 				return ;
736 		}
737 		break;
738 
739 	case RES_GRAPHIC_PIECE_ARRIVED:
740 	case RES_GRAPHIC_ARRIVED:
741     // --> OD 2007-03-06 #i73788#
742     // handle RES_LINKED_GRAPHIC_STREAM_ARRIVED as RES_GRAPHIC_ARRIVED
743     case RES_LINKED_GRAPHIC_STREAM_ARRIVED:
744     // <--
745 		if ( GetNode()->GetNodeType() == ND_GRFNODE )
746 		{
747 			bComplete = sal_False;
748 			SwGrfNode* pNd = (SwGrfNode*) GetNode();
749 
750 			CLEARCACHE( pNd )
751 
752 			SwRect aRect( Frm() );
753 
754 			ViewShell *pVSh = 0;
755 			pNd->GetDoc()->GetEditShell( &pVSh );
756             if( !pVSh )
757 				break;
758 
759 			ViewShell *pSh = pVSh;
760 			do {
761 				SET_CURR_SHELL( pSh );
762 				if( pSh->IsPreView() )
763 				{
764 					if( pSh->GetWin() )
765 						::RepaintPagePreview( pSh, aRect );
766 				}
767                 else if ( pSh->VisArea().IsOver( aRect ) &&
768                    OUTDEV_WINDOW == pSh->GetOut()->GetOutDevType() )
769 				{
770                     // OD 27.11.2002 #105519# - invalidate instead of painting
771                     pSh->GetWin()->Invalidate( aRect.SVRect() );
772 				}
773 
774 				pSh = (ViewShell *)pSh->GetNext();
775 			} while( pSh != pVSh );
776 		}
777 		break;
778 
779 	default:
780         if ( !pNew || !isGRFATR(nWhich) )
781 			return;
782 	}
783 
784 	if( bComplete )
785 	{
786 		InvalidatePrt();
787 		SetCompletePaint();
788 	}
789 }
790 
791 void lcl_correctlyAlignRect( SwRect& rAlignedGrfArea, const SwRect& rInArea, OutputDevice* pOut )
792 {
793 
794     if(!pOut)
795         return;
796     Rectangle aPxRect = pOut->LogicToPixel( rInArea.SVRect() );
797     Rectangle aNewPxRect( aPxRect );
798     while( aNewPxRect.Left() < aPxRect.Left() )
799     {
800         rAlignedGrfArea.Left( rAlignedGrfArea.Left()+1 );
801         aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
802     }
803     while( aNewPxRect.Top() < aPxRect.Top() )
804     {
805         rAlignedGrfArea.Top( rAlignedGrfArea.Top()+1 );
806         aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
807     }
808     while( aNewPxRect.Bottom() > aPxRect.Bottom() )
809     {
810         rAlignedGrfArea.Bottom( rAlignedGrfArea.Bottom()-1 );
811         aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
812     }
813     while( aNewPxRect.Right() > aPxRect.Right() )
814     {
815         rAlignedGrfArea.Right( rAlignedGrfArea.Right()-1 );
816         aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
817     }
818 }
819 
820 // Ausgabe der Grafik. Hier wird entweder eine QuickDraw-Bmp oder
821 // eine Grafik vorausgesetzt. Ist nichts davon vorhanden, wird
822 // eine Ersatzdarstellung ausgegeben.
823 /// OD 25.09.2002 #99739# - delete unused 3rd parameter.
824 /// OD 25.09.2002 #99739# - use aligned rectangle for drawing graphic.
825 /// OD 25.09.2002 #99739# - pixel-align coordinations for drawing graphic.
826 void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) const
827 {
828 	ViewShell* pShell = getRootFrm()->GetCurrShell();
829 
830 	SwNoTxtNode& rNoTNd = *(SwNoTxtNode*)GetNode();
831 	SwGrfNode* pGrfNd = rNoTNd.GetGrfNode();
832 	SwOLENode* pOLENd = rNoTNd.GetOLENode();
833 
834     const sal_Bool bPrn = pOut == rNoTNd.getIDocumentDeviceAccess()->getPrinter( false ) ||
835                           pOut->GetConnectMetaFile();
836 
837     const bool bIsChart = pOLENd && ChartPrettyPainter::IsChart( pOLENd->GetOLEObj().GetObject() );
838 
839     /// OD 25.09.2002 #99739# - calculate aligned rectangle from parameter <rGrfArea>.
840     ///     Use aligned rectangle <aAlignedGrfArea> instead of <rGrfArea> in
841     ///     the following code.
842     SwRect aAlignedGrfArea = rGrfArea;
843     ::SwAlignRect( aAlignedGrfArea,  pShell );
844 
845     if( !bIsChart )
846     {
847         /// OD 25.09.2002 #99739#
848         /// Because for drawing a graphic left-top-corner and size coordinations are
849         /// used, these coordinations have to be determined on pixel level.
850         ::SwAlignGrfRect( &aAlignedGrfArea, *pOut );
851     }
852     else //if( bIsChart )
853     {
854         //#i78025# charts own borders are not completely visible
855         //the above pixel correction is not correct - at least not for charts
856         //so a different pixel correction is choosen here
857         //this might be a good idea for all other OLE objects also,
858         //but as I cannot oversee the consequences I fix it only for charts for now
859         lcl_correctlyAlignRect( aAlignedGrfArea, rGrfArea, pOut );
860     }
861 
862     if( pGrfNd )
863 	{
864 		sal_Bool bForceSwap = sal_False, bContinue = sal_True;
865 		GraphicObject& rGrfObj = pGrfNd->GetGrfObj();
866 
867 		GraphicAttr aGrfAttr;
868 		pGrfNd->GetGraphicAttr( aGrfAttr, this );
869 
870 		if( !bPrn )
871 		{
872             // --> OD 2007-01-02 #i73788#
873             if ( pGrfNd->IsLinkedInputStreamReady() )
874             {
875                 pGrfNd->UpdateLinkWithInputStream();
876             }
877             // <--
878             // --> OD 2008-01-30 #i85717#
879             // --> OD 2008-07-21 #i90395# - check, if asynchronous retrieval
880             // if input stream for the graphic is possible
881 //            else if( GRAPHIC_DEFAULT == rGrfObj.GetType() &&
882             else if ( ( rGrfObj.GetType() == GRAPHIC_DEFAULT ||
883                         rGrfObj.GetType() == GRAPHIC_NONE ) &&
884                       pGrfNd->IsLinkedFile() &&
885                       pGrfNd->IsAsyncRetrieveInputStreamPossible() )
886             // <--
887 			{
888 				Size aTmpSz;
889                 ::sfx2::SvLinkSource* pGrfObj = pGrfNd->GetLink()->GetObj();
890 				if( !pGrfObj ||
891 					!pGrfObj->IsDataComplete() ||
892 					!(aTmpSz = pGrfNd->GetTwipSize()).Width() ||
893 					!aTmpSz.Height() || !pGrfNd->GetAutoFmtLvl() )
894 				{
895                     // --> OD 2006-12-22 #i73788#
896                     pGrfNd->TriggerAsyncRetrieveInputStream();
897                     // <--
898 				}
899                 String aTxt( pGrfNd->GetTitle() );
900 				if ( !aTxt.Len() )
901 					GetRealURL( *pGrfNd, aTxt );
902                 ::lcl_PaintReplacement( aAlignedGrfArea, aTxt, *pShell, this, sal_False );
903 				bContinue = sal_False;
904 			}
905             else if( rGrfObj.IsCached( pOut, aAlignedGrfArea.Pos(),
906                                     aAlignedGrfArea.SSize(), &aGrfAttr ))
907 			{
908                 rGrfObj.DrawWithPDFHandling( *pOut,
909                                              aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(),
910                                              &aGrfAttr );
911 				bContinue = sal_False;
912 			}
913 		}
914 
915 		if( bContinue )
916 		{
917 			const sal_Bool bSwapped = rGrfObj.IsSwappedOut();
918 			const sal_Bool bSwappedIn = 0 != pGrfNd->SwapIn( bPrn );
919 			if( bSwappedIn && rGrfObj.GetGraphic().IsSupportedGraphic())
920 			{
921                 const sal_Bool bAnimate = rGrfObj.IsAnimated() &&
922                                          !pShell->IsPreView() &&
923                                          !pShell->GetAccessibilityOptions()->IsStopAnimatedGraphics() &&
924                 // --> FME 2004-06-21 #i9684# Stop animation during printing/pdf export
925                                           pShell->GetWin();
926                 // <--
927 
928 				if( bAnimate &&
929 					FindFlyFrm() != ::GetFlyFromMarked( 0, pShell ))
930 				{
931 					OutputDevice* pVout;
932 					if( pOut == pShell->GetOut() && SwRootFrm::FlushVout() )
933 						pVout = pOut, pOut = pShell->GetOut();
934 					else if( pShell->GetWin() &&
935 							 OUTDEV_VIRDEV == pOut->GetOutDevType() )
936 						pVout = pOut, pOut = pShell->GetWin();
937 					else
938 						pVout = 0;
939 
940                     ASSERT( OUTDEV_VIRDEV != pOut->GetOutDevType() ||
941                             pShell->GetViewOptions()->IsPDFExport(),
942                             "pOut sollte kein virtuelles Device sein" );
943 
944                     rGrfObj.StartAnimation( pOut, aAlignedGrfArea.Pos(),
945                                         aAlignedGrfArea.SSize(), long(this),
946 										0, GRFMGR_DRAW_STANDARD, pVout );
947 				}
948                 else
949                 {
950                     const SvgDataPtr& rSvgDataPtr = rGrfObj.GetGraphic().getSvgData();
951                     bool bDone(false);
952 
953                     if(rSvgDataPtr.get())
954                     {
955                         // Graphic is Svg and can be painted as primitives (vector graphic)
956                         const basegfx::B2DRange& rRange = rSvgDataPtr->getRange();
957                         const double fWidth(rRange.getWidth());
958                         const double fHeight(rRange.getHeight());
959                         const drawinglayer::primitive2d::Primitive2DSequence& rSequence = rSvgDataPtr->getPrimitive2DSequence();
960 
961                         if(rSequence.hasElements() && !basegfx::fTools::equalZero(fWidth) && !basegfx::fTools::equalZero(fHeight))
962                         {
963                             // get target range
964                             const basegfx::B2DRange aTargetRange(
965                                 aAlignedGrfArea.Left(), aAlignedGrfArea.Top(),
966                                 aAlignedGrfArea.Right(), aAlignedGrfArea.Bottom());
967 
968                             // prepare evtl. cropped range
969                             basegfx::B2DRange aCroppedTargetRange(aTargetRange);
970 
971                             if(aGrfAttr.IsCropped())
972                             {
973                                 // calculate original TargetRange
974                                 const double fFactor100thmmToTwips(72.0 / 127.0);
975 
976                                 aCroppedTargetRange = basegfx::B2DRange(
977                                     aTargetRange.getMinX() - (aGrfAttr.GetLeftCrop() * fFactor100thmmToTwips),
978                                     aTargetRange.getMinY() - (aGrfAttr.GetTopCrop() * fFactor100thmmToTwips),
979                                     aTargetRange.getMaxX() + (aGrfAttr.GetRightCrop() * fFactor100thmmToTwips),
980                                     aTargetRange.getMaxY() + (aGrfAttr.GetBottomCrop() * fFactor100thmmToTwips));
981                             }
982 
983                             const double fTargetWidth(aCroppedTargetRange.getWidth());
984                             const double fTargetHeight(aCroppedTargetRange.getHeight());
985 
986                             if(!basegfx::fTools::equalZero(fTargetWidth) && !basegfx::fTools::equalZero(fTargetHeight))
987                             {
988                                 // map graphic range to target range. This will automatically include
989                                 // tme mapping from Svg 1/100th mm content to twips since the target
990                                 // range is twips already
991                                 basegfx::B2DHomMatrix aMappingTransform(
992                                     basegfx::tools::createTranslateB2DHomMatrix(
993                                         -rRange.getMinX(),
994                                         -rRange.getMinY()));
995 
996                                 aMappingTransform.scale(fTargetWidth / fWidth, fTargetHeight / fHeight);
997                                 aMappingTransform.translate(aCroppedTargetRange.getMinX(), aCroppedTargetRange.getMinY());
998 
999                                 // check for and apply mirrorings
1000                                 const bool bMirrorHor(aGrfAttr.GetMirrorFlags() & BMP_MIRROR_HORZ);
1001                                 const bool bMirrorVer(aGrfAttr.GetMirrorFlags() & BMP_MIRROR_VERT);
1002 
1003                                 if(bMirrorHor || bMirrorVer)
1004                                 {
1005                                     aMappingTransform.translate(-aCroppedTargetRange.getCenterX(), -aCroppedTargetRange.getCenterY());
1006                                     aMappingTransform.scale(bMirrorHor ? -1.0 : 1.0, bMirrorVer ? -1.0 : 1.0);
1007                                     aMappingTransform.translate(aCroppedTargetRange.getCenterX(), aCroppedTargetRange.getCenterY());
1008                                 }
1009 
1010                                 // Fill ViewInformation. Use MappingTransform here, so there is no need to
1011                                 // embed the primitives to it. Use original TargetRange here so there is also
1012                                 // no need to embed the primitives to a MaskPrimitive for cropping. This works
1013                                 // only in this case where the graphic object cannot be rotated, though.
1014                                 const drawinglayer::geometry::ViewInformation2D aViewInformation2D(
1015                                     aMappingTransform,
1016                                     pOut->GetViewTransformation(),
1017                                     aTargetRange,
1018                                     0,
1019                                     0.0,
1020                                     com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >());
1021 
1022                                 // get a primitive processor for rendering
1023                                 drawinglayer::processor2d::BaseProcessor2D* pProcessor2D = sdr::contact::createBaseProcessor2DFromOutputDevice(
1024                                     *pOut,
1025                                     aViewInformation2D);
1026 
1027                                 if(pProcessor2D)
1028                                 {
1029                                     // render and cleanup
1030                                     pProcessor2D->process(rSequence);
1031                                     delete pProcessor2D;
1032                                     bDone = true;
1033                                 }
1034                             }
1035                         }
1036                     }
1037 
1038                     if(!bDone)
1039                     {
1040                         // fallback paint, uses replacement image
1041                         rGrfObj.DrawWithPDFHandling(*pOut, aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), &aGrfAttr);
1042                     }
1043                 }
1044 			}
1045 			else
1046 			{
1047 				sal_uInt16 nResId = 0;
1048 				if( bSwappedIn )
1049 				{
1050 					if( GRAPHIC_NONE == rGrfObj.GetType() )
1051 						nResId = STR_COMCORE_READERROR;
1052 					else if ( !rGrfObj.GetGraphic().IsSupportedGraphic() )
1053 						nResId = STR_COMCORE_CANT_SHOW;
1054 				}
1055 				((SwNoTxtFrm*)this)->nWeight = -1;
1056 				String aText;
1057 				if ( !nResId &&
1058                      !(aText = pGrfNd->GetTitle()).Len() &&
1059 					 (!GetRealURL( *pGrfNd, aText ) || !aText.Len()))
1060 				{
1061 					nResId = STR_COMCORE_READERROR;
1062 				}
1063 				if ( nResId )
1064 					aText = SW_RESSTR( nResId );
1065 
1066                 ::lcl_PaintReplacement( aAlignedGrfArea, aText, *pShell, this, sal_True );
1067 			}
1068 
1069 			//Beim Drucken duerfen wir nicht die Grafiken sammeln...
1070 			if( bSwapped && bPrn )
1071 				bForceSwap = sal_True;
1072 		}
1073 		if( bForceSwap )
1074 			pGrfNd->SwapOut();
1075 	}
1076     else if( bIsChart
1077         //charts must be painted resolution dependent!! #i82893#, #i75867#
1078         && ChartPrettyPainter::ShouldPrettyPaintChartOnThisDevice( pOut )
1079         && svt::EmbeddedObjectRef::TryRunningState( pOLENd->GetOLEObj().GetOleRef() )
1080         && ChartPrettyPainter::DoPrettyPaintChart( uno::Reference< frame::XModel >(
1081             pOLENd->GetOLEObj().GetOleRef()->getComponent(), uno::UNO_QUERY), pOut, aAlignedGrfArea.SVRect() ) )
1082     {
1083         (void)(0);//all was done in if statement
1084     }
1085     else if( pOLENd )
1086 	{
1087         // --> OD 2009-03-05 #i99665#
1088         // Adjust AntiAliasing mode at output device for chart OLE
1089         const sal_uInt16 nFormerAntialiasingAtOutput( pOut->GetAntialiasing() );
1090         if ( pOLENd->IsChart() &&
1091              pShell->Imp()->GetDrawView()->IsAntiAliasing() )
1092         {
1093             const sal_uInt16 nAntialiasingForChartOLE =
1094                     nFormerAntialiasingAtOutput | ANTIALIASING_PIXELSNAPHAIRLINE;
1095             pOut->SetAntialiasing( nAntialiasingForChartOLE );
1096         }
1097         // <--
1098 
1099         Point aPosition(aAlignedGrfArea.Pos());
1100         Size aSize(aAlignedGrfArea.SSize());
1101 
1102         // Im BrowseModus gibt es nicht unbedingt einen Drucker und
1103         // damit kein JobSetup, also legen wir eines an ...
1104         const JobSetup* pJobSetup = pOLENd->getIDocumentDeviceAccess()->getJobsetup();
1105         sal_Bool bDummyJobSetup = 0 == pJobSetup;
1106         if( bDummyJobSetup )
1107             pJobSetup = new JobSetup();
1108 
1109 		// #i42323#
1110 		// The reason for #114233# is gone, so i remove it again
1111         //TODO/LATER: is it a problem that the JopSetup isn't used?
1112         //xRef->DoDraw( pOut, aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), *pJobSetup );
1113 
1114         // get hi-contrast image, but never for printing
1115 		Graphic* pGraphic = NULL;
1116         if (pOut && !bPrn && Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
1117 			pGraphic = pOLENd->GetHCGraphic();
1118 
1119 		// when it is not possible to get HC-representation, the original image should be used
1120 		if ( !pGraphic )
1121            	pGraphic = pOLENd->GetGraphic();
1122 
1123         if ( pGraphic && pGraphic->GetType() != GRAPHIC_NONE )
1124 		{
1125 			pGraphic->Draw( pOut, aPosition, aSize );
1126 
1127 			// shade the representation if the object is activated outplace
1128 			uno::Reference < embed::XEmbeddedObject > xObj = pOLENd->GetOLEObj().GetOleRef();
1129 			if ( xObj.is() && xObj->getCurrentState() == embed::EmbedStates::ACTIVE )
1130 			{
1131 				::svt::EmbeddedObjectRef::DrawShading( Rectangle( aPosition, aSize ), pOut );
1132 			}
1133 		}
1134         else
1135             ::svt::EmbeddedObjectRef::DrawPaintReplacement( Rectangle( aPosition, aSize ), pOLENd->GetOLEObj().GetCurrentPersistName(), pOut );
1136 
1137         if( bDummyJobSetup )
1138             delete pJobSetup;  // ... und raeumen wieder auf.
1139 
1140         sal_Int64 nMiscStatus = pOLENd->GetOLEObj().GetOleRef()->getStatus( pOLENd->GetAspect() );
1141         if ( !bPrn && pShell->ISA( SwCrsrShell ) &&
1142                 nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE )
1143         {
1144             const SwFlyFrm *pFly = FindFlyFrm();
1145             ASSERT( pFly, "OLE not in FlyFrm" );
1146             ((SwFEShell*)pShell)->ConnectObj( pOLENd->GetOLEObj().GetObject(), pFly->Prt(), pFly->Frm());
1147         }
1148 
1149         // --> OD 2009-03-05 #i99665#
1150         if ( pOLENd->IsChart() &&
1151              pShell->Imp()->GetDrawView()->IsAntiAliasing() )
1152         {
1153             pOut->SetAntialiasing( nFormerAntialiasingAtOutput );
1154         }
1155         // <--
1156 	}
1157 }
1158 
1159 
1160 sal_Bool SwNoTxtFrm::IsTransparent() const
1161 {
1162 	const ViewShell* pSh = getRootFrm()->GetCurrShell();
1163 	if ( !pSh || !pSh->GetViewOptions()->IsGraphic() )
1164 		return sal_True;
1165 
1166 	const SwGrfNode *pNd;
1167 	if( 0 != (pNd = GetNode()->GetGrfNode()) )
1168 		return pNd->IsTransparent();
1169 
1170 	//#29381# OLE sind immer Transparent.
1171 	return sal_True;
1172 }
1173 
1174 
1175 void SwNoTxtFrm::StopAnimation( OutputDevice* pOut ) const
1176 {
1177 	//animierte Grafiken anhalten
1178 	SwGrfNode* pGrfNd = (SwGrfNode*)GetNode()->GetGrfNode();
1179 	if( pGrfNd && pGrfNd->IsAnimated() )
1180 		pGrfNd->GetGrfObj().StopAnimation( pOut, long(this) );
1181 }
1182 
1183 
1184 sal_Bool SwNoTxtFrm::HasAnimation() const
1185 {
1186 	const SwGrfNode* pGrfNd = GetNode()->GetGrfNode();
1187 	return pGrfNd && pGrfNd->IsAnimated();
1188 }
1189 
1190 
1191 
1192