xref: /aoo42x/main/sw/source/core/doc/notxtfrm.cxx (revision 9333066c)
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 <svx/charthelper.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 bool paintUsingPrimitivesHelper(
821     OutputDevice& rOutputDevice,
822     const drawinglayer::primitive2d::Primitive2DSequence& rSequence,
823     const basegfx::B2DRange& rSourceRange,
824     const basegfx::B2DRange& rTargetRange,
825     const sal_Int32 nLeftCrop = 0,
826     const sal_Int32 nTopCrop = 0,
827     const sal_Int32 nRightCrop = 0,
828     const sal_Int32 nBottomCrop = 0,
829     const bool bMirrorX = false,
830     const bool bMirrorY = false)
831 {
832     const double fSourceWidth(rSourceRange.getWidth());
833     const double fSourceHeight(rSourceRange.getHeight());
834 
835     if(rSequence.hasElements() && !basegfx::fTools::equalZero(fSourceWidth) && !basegfx::fTools::equalZero(fSourceHeight))
836     {
837         // copy target range and apply evtl. cropping
838         basegfx::B2DRange aTargetRange(rTargetRange);
839 
840         if(nLeftCrop || nTopCrop || nRightCrop || nBottomCrop)
841         {
842             // calculate original TargetRange
843             const double fFactor100thmmToTwips(72.0 / 127.0);
844 
845             aTargetRange = basegfx::B2DRange(
846                 aTargetRange.getMinX() - (nLeftCrop * fFactor100thmmToTwips),
847                 aTargetRange.getMinY() - (nTopCrop * fFactor100thmmToTwips),
848                 aTargetRange.getMaxX() + (nRightCrop * fFactor100thmmToTwips),
849                 aTargetRange.getMaxY() + (nBottomCrop * fFactor100thmmToTwips));
850         }
851 
852         const double fTargetWidth(aTargetRange.getWidth());
853         const double fTargetHeight(aTargetRange.getHeight());
854 
855         if(!basegfx::fTools::equalZero(fTargetWidth) && !basegfx::fTools::equalZero(fTargetHeight))
856         {
857             // map graphic range to target range. This will automatically include
858             // tme mapping from Svg 1/100th mm content to twips since the target
859             // range is twips already
860             basegfx::B2DHomMatrix aMappingTransform(
861                 basegfx::tools::createTranslateB2DHomMatrix(
862                     -rSourceRange.getMinX(),
863                     -rSourceRange.getMinY()));
864 
865             aMappingTransform.scale(fTargetWidth / fSourceWidth, fTargetHeight / fSourceHeight);
866             aMappingTransform.translate(aTargetRange.getMinX(), aTargetRange.getMinY());
867 
868             // apply mirrorings
869             if(bMirrorX || bMirrorY)
870             {
871                 aMappingTransform.translate(-aTargetRange.getCenterX(), -aTargetRange.getCenterY());
872                 aMappingTransform.scale(bMirrorX ? -1.0 : 1.0, bMirrorY ? -1.0 : 1.0); // #119176# small typo with X/Y
873                 aMappingTransform.translate(aTargetRange.getCenterX(), aTargetRange.getCenterY());
874             }
875 
876             // Fill ViewInformation. Use MappingTransform here, so there is no need to
877             // embed the primitives to it. Use original TargetRange here so there is also
878             // no need to embed the primitives to a MaskPrimitive for cropping. This works
879             // only in this case where the graphic object cannot be rotated, though.
880             const drawinglayer::geometry::ViewInformation2D aViewInformation2D(
881                 aMappingTransform,
882                 rOutputDevice.GetViewTransformation(),
883                 aTargetRange,
884                 0,
885                 0.0,
886                 uno::Sequence< beans::PropertyValue >());
887 
888             // get a primitive processor for rendering
889             drawinglayer::processor2d::BaseProcessor2D* pProcessor2D = sdr::contact::createBaseProcessor2DFromOutputDevice(
890                 rOutputDevice,
891                 aViewInformation2D);
892 
893             if(pProcessor2D)
894             {
895                 // render and cleanup
896                 pProcessor2D->process(rSequence);
897                 delete pProcessor2D;
898                 return true;
899             }
900         }
901     }
902 
903     return false;
904 }
905 
906 // Ausgabe der Grafik. Hier wird entweder eine QuickDraw-Bmp oder
907 // eine Grafik vorausgesetzt. Ist nichts davon vorhanden, wird
908 // eine Ersatzdarstellung ausgegeben.
909 /// OD 25.09.2002 #99739# - delete unused 3rd parameter.
910 /// OD 25.09.2002 #99739# - use aligned rectangle for drawing graphic.
911 /// OD 25.09.2002 #99739# - pixel-align coordinations for drawing graphic.
912 void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) const
913 {
914 	ViewShell* pShell = getRootFrm()->GetCurrShell();
915 
916 	SwNoTxtNode& rNoTNd = *(SwNoTxtNode*)GetNode();
917 	SwGrfNode* pGrfNd = rNoTNd.GetGrfNode();
918 	SwOLENode* pOLENd = rNoTNd.GetOLENode();
919 
920     const sal_Bool bPrn = pOut == rNoTNd.getIDocumentDeviceAccess()->getPrinter( false ) ||
921                           pOut->GetConnectMetaFile();
922 
923     const bool bIsChart = pOLENd && ChartHelper::IsChart( pOLENd->GetOLEObj().GetObject() );
924 
925     /// OD 25.09.2002 #99739# - calculate aligned rectangle from parameter <rGrfArea>.
926     ///     Use aligned rectangle <aAlignedGrfArea> instead of <rGrfArea> in
927     ///     the following code.
928     SwRect aAlignedGrfArea = rGrfArea;
929     ::SwAlignRect( aAlignedGrfArea,  pShell );
930 
931     if( !bIsChart )
932     {
933         /// OD 25.09.2002 #99739#
934         /// Because for drawing a graphic left-top-corner and size coordinations are
935         /// used, these coordinations have to be determined on pixel level.
936         ::SwAlignGrfRect( &aAlignedGrfArea, *pOut );
937     }
938     else //if( bIsChart )
939     {
940         //#i78025# charts own borders are not completely visible
941         //the above pixel correction is not correct - at least not for charts
942         //so a different pixel correction is choosen here
943         //this might be a good idea for all other OLE objects also,
944         //but as I cannot oversee the consequences I fix it only for charts for now
945         lcl_correctlyAlignRect( aAlignedGrfArea, rGrfArea, pOut );
946     }
947 
948     if( pGrfNd )
949 	{
950 		sal_Bool bForceSwap = sal_False, bContinue = sal_True;
951 		GraphicObject& rGrfObj = pGrfNd->GetGrfObj();
952 
953 		GraphicAttr aGrfAttr;
954 		pGrfNd->GetGraphicAttr( aGrfAttr, this );
955 
956 		if( !bPrn )
957 		{
958             // --> OD 2007-01-02 #i73788#
959             if ( pGrfNd->IsLinkedInputStreamReady() )
960             {
961                 pGrfNd->UpdateLinkWithInputStream();
962             }
963             // <--
964             // --> OD 2008-01-30 #i85717#
965             // --> OD 2008-07-21 #i90395# - check, if asynchronous retrieval
966             // if input stream for the graphic is possible
967 //            else if( GRAPHIC_DEFAULT == rGrfObj.GetType() &&
968             else if ( ( rGrfObj.GetType() == GRAPHIC_DEFAULT ||
969                         rGrfObj.GetType() == GRAPHIC_NONE ) &&
970                       pGrfNd->IsLinkedFile() &&
971                       pGrfNd->IsAsyncRetrieveInputStreamPossible() )
972             // <--
973 			{
974 				Size aTmpSz;
975                 ::sfx2::SvLinkSource* pGrfObj = pGrfNd->GetLink()->GetObj();
976 				if( !pGrfObj ||
977 					!pGrfObj->IsDataComplete() ||
978 					!(aTmpSz = pGrfNd->GetTwipSize()).Width() ||
979 					!aTmpSz.Height() || !pGrfNd->GetAutoFmtLvl() )
980 				{
981                     // --> OD 2006-12-22 #i73788#
982                     pGrfNd->TriggerAsyncRetrieveInputStream();
983                     // <--
984 				}
985                 String aTxt( pGrfNd->GetTitle() );
986 				if ( !aTxt.Len() )
987 					GetRealURL( *pGrfNd, aTxt );
988                 ::lcl_PaintReplacement( aAlignedGrfArea, aTxt, *pShell, this, sal_False );
989 				bContinue = sal_False;
990 			}
991             else if( rGrfObj.IsCached( pOut, aAlignedGrfArea.Pos(),
992                                     aAlignedGrfArea.SSize(), &aGrfAttr ))
993 			{
994                 rGrfObj.DrawWithPDFHandling( *pOut,
995                                              aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(),
996                                              &aGrfAttr );
997 				bContinue = sal_False;
998 			}
999 		}
1000 
1001 		if( bContinue )
1002 		{
1003 			const sal_Bool bSwapped = rGrfObj.IsSwappedOut();
1004 			const sal_Bool bSwappedIn = 0 != pGrfNd->SwapIn( bPrn );
1005 			if( bSwappedIn && rGrfObj.GetGraphic().IsSupportedGraphic())
1006 			{
1007                 const sal_Bool bAnimate = rGrfObj.IsAnimated() &&
1008                                          !pShell->IsPreView() &&
1009                                          !pShell->GetAccessibilityOptions()->IsStopAnimatedGraphics() &&
1010                 // --> FME 2004-06-21 #i9684# Stop animation during printing/pdf export
1011                                           pShell->GetWin();
1012                 // <--
1013 
1014 				if( bAnimate &&
1015 					FindFlyFrm() != ::GetFlyFromMarked( 0, pShell ))
1016 				{
1017 					OutputDevice* pVout;
1018 					if( pOut == pShell->GetOut() && SwRootFrm::FlushVout() )
1019 						pVout = pOut, pOut = pShell->GetOut();
1020 					else if( pShell->GetWin() &&
1021 							 OUTDEV_VIRDEV == pOut->GetOutDevType() )
1022 						pVout = pOut, pOut = pShell->GetWin();
1023 					else
1024 						pVout = 0;
1025 
1026                     ASSERT( OUTDEV_VIRDEV != pOut->GetOutDevType() ||
1027                             pShell->GetViewOptions()->IsPDFExport(),
1028                             "pOut sollte kein virtuelles Device sein" );
1029 
1030                     rGrfObj.StartAnimation( pOut, aAlignedGrfArea.Pos(),
1031                                         aAlignedGrfArea.SSize(), long(this),
1032 										0, GRFMGR_DRAW_STANDARD, pVout );
1033 				}
1034                 else
1035                 {
1036                     const SvgDataPtr& rSvgDataPtr = rGrfObj.GetGraphic().getSvgData();
1037                     bool bDone(false);
1038 
1039                     if(rSvgDataPtr.get())
1040                     {
1041                         // Graphic is Svg and can be painted as primitives (vector graphic)
1042                         const basegfx::B2DRange aTargetRange(
1043                             aAlignedGrfArea.Left(), aAlignedGrfArea.Top(),
1044                             aAlignedGrfArea.Right(), aAlignedGrfArea.Bottom());
1045                         const bool bCropped(aGrfAttr.IsCropped());
1046 
1047                         bDone = paintUsingPrimitivesHelper(
1048                             *pOut,
1049                             rSvgDataPtr->getPrimitive2DSequence(),
1050                             rSvgDataPtr->getRange(),
1051                             aTargetRange,
1052                             bCropped ? aGrfAttr.GetLeftCrop() : 0,
1053                             bCropped ? aGrfAttr.GetTopCrop() : 0,
1054                             bCropped ? aGrfAttr.GetRightCrop() : 0,
1055                             bCropped ? aGrfAttr.GetBottomCrop() : 0,
1056                             aGrfAttr.GetMirrorFlags() & BMP_MIRROR_HORZ,
1057                             aGrfAttr.GetMirrorFlags() & BMP_MIRROR_VERT);
1058                     }
1059 
1060                     if(!bDone)
1061                     {
1062                         // fallback paint, uses replacement image
1063                         rGrfObj.DrawWithPDFHandling(*pOut, aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), &aGrfAttr);
1064                     }
1065                 }
1066 			}
1067 			else
1068 			{
1069 				sal_uInt16 nResId = 0;
1070 				if( bSwappedIn )
1071 				{
1072 					if( GRAPHIC_NONE == rGrfObj.GetType() )
1073 						nResId = STR_COMCORE_READERROR;
1074 					else if ( !rGrfObj.GetGraphic().IsSupportedGraphic() )
1075 						nResId = STR_COMCORE_CANT_SHOW;
1076 				}
1077 				((SwNoTxtFrm*)this)->nWeight = -1;
1078 				String aText;
1079 				if ( !nResId &&
1080                      !(aText = pGrfNd->GetTitle()).Len() &&
1081 					 (!GetRealURL( *pGrfNd, aText ) || !aText.Len()))
1082 				{
1083 					nResId = STR_COMCORE_READERROR;
1084 				}
1085 				if ( nResId )
1086 					aText = SW_RESSTR( nResId );
1087 
1088                 ::lcl_PaintReplacement( aAlignedGrfArea, aText, *pShell, this, sal_True );
1089 			}
1090 
1091 			//Beim Drucken duerfen wir nicht die Grafiken sammeln...
1092 			if( bSwapped && bPrn )
1093 				bForceSwap = sal_True;
1094 		}
1095 		if( bForceSwap )
1096 			pGrfNd->SwapOut();
1097 	}
1098     else // bIsChart || pOLENd
1099     {
1100         // --> OD 2009-03-05 #i99665#
1101         // Adjust AntiAliasing mode at output device for chart OLE
1102         const sal_uInt16 nFormerAntialiasingAtOutput( pOut->GetAntialiasing() );
1103         if ( pOLENd->IsChart() &&
1104                 pShell->Imp()->GetDrawView()->IsAntiAliasing() )
1105         {
1106             const sal_uInt16 nAntialiasingForChartOLE =
1107                     nFormerAntialiasingAtOutput | ANTIALIASING_PIXELSNAPHAIRLINE;
1108             pOut->SetAntialiasing( nAntialiasingForChartOLE );
1109         }
1110         // <--
1111 
1112         bool bDone(false);
1113 
1114         if(bIsChart)
1115         {
1116             const uno::Reference< frame::XModel > aXModel(pOLENd->GetOLEObj().GetOleRef()->getComponent(), uno::UNO_QUERY);
1117 
1118             if(aXModel.is())
1119             {
1120                 basegfx::B2DRange aSourceRange;
1121 
1122                 const drawinglayer::primitive2d::Primitive2DSequence aSequence(
1123                     ChartHelper::tryToGetChartContentAsPrimitive2DSequence(
1124                         aXModel,
1125                         aSourceRange));
1126 
1127                 if(aSequence.hasElements() && !aSourceRange.isEmpty())
1128                 {
1129                     const basegfx::B2DRange aTargetRange(
1130                         aAlignedGrfArea.Left(), aAlignedGrfArea.Top(),
1131                         aAlignedGrfArea.Right(), aAlignedGrfArea.Bottom());
1132 
1133                     bDone = paintUsingPrimitivesHelper(
1134                         *pOut,
1135                         aSequence,
1136                         aSourceRange,
1137                         aTargetRange);
1138                 }
1139             }
1140         }
1141 
1142         if(!bDone && pOLENd)
1143 	    {
1144             Point aPosition(aAlignedGrfArea.Pos());
1145             Size aSize(aAlignedGrfArea.SSize());
1146 
1147             // Im BrowseModus gibt es nicht unbedingt einen Drucker und
1148             // damit kein JobSetup, also legen wir eines an ...
1149             const JobSetup* pJobSetup = pOLENd->getIDocumentDeviceAccess()->getJobsetup();
1150             sal_Bool bDummyJobSetup = 0 == pJobSetup;
1151             if( bDummyJobSetup )
1152                 pJobSetup = new JobSetup();
1153 
1154 		    // #i42323#
1155 		    // The reason for #114233# is gone, so i remove it again
1156             //TODO/LATER: is it a problem that the JopSetup isn't used?
1157             //xRef->DoDraw( pOut, aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), *pJobSetup );
1158 
1159             // get hi-contrast image, but never for printing
1160 		    Graphic* pGraphic = NULL;
1161             if (pOut && !bPrn && Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
1162 			    pGraphic = pOLENd->GetHCGraphic();
1163 
1164 		    // when it is not possible to get HC-representation, the original image should be used
1165 		    if ( !pGraphic )
1166            	    pGraphic = pOLENd->GetGraphic();
1167 
1168             if ( pGraphic && pGraphic->GetType() != GRAPHIC_NONE )
1169 		    {
1170 			    pGraphic->Draw( pOut, aPosition, aSize );
1171 
1172 			    // shade the representation if the object is activated outplace
1173 			    uno::Reference < embed::XEmbeddedObject > xObj = pOLENd->GetOLEObj().GetOleRef();
1174 			    if ( xObj.is() && xObj->getCurrentState() == embed::EmbedStates::ACTIVE )
1175 			    {
1176 				    ::svt::EmbeddedObjectRef::DrawShading( Rectangle( aPosition, aSize ), pOut );
1177 			    }
1178 		    }
1179             else
1180                 ::svt::EmbeddedObjectRef::DrawPaintReplacement( Rectangle( aPosition, aSize ), pOLENd->GetOLEObj().GetCurrentPersistName(), pOut );
1181 
1182             if( bDummyJobSetup )
1183                 delete pJobSetup;  // ... und raeumen wieder auf.
1184 
1185             sal_Int64 nMiscStatus = pOLENd->GetOLEObj().GetOleRef()->getStatus( pOLENd->GetAspect() );
1186             if ( !bPrn && pShell->ISA( SwCrsrShell ) &&
1187                     nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE )
1188             {
1189                 const SwFlyFrm *pFly = FindFlyFrm();
1190                 ASSERT( pFly, "OLE not in FlyFrm" );
1191                 ((SwFEShell*)pShell)->ConnectObj( pOLENd->GetOLEObj().GetObject(), pFly->Prt(), pFly->Frm());
1192             }
1193         }
1194 
1195         // --> OD 2009-03-05 #i99665#
1196         if ( pOLENd->IsChart() &&
1197                 pShell->Imp()->GetDrawView()->IsAntiAliasing() )
1198         {
1199             pOut->SetAntialiasing( nFormerAntialiasingAtOutput );
1200         }
1201         // <--
1202     }
1203 }
1204 
1205 
1206 sal_Bool SwNoTxtFrm::IsTransparent() const
1207 {
1208 	const ViewShell* pSh = getRootFrm()->GetCurrShell();
1209 	if ( !pSh || !pSh->GetViewOptions()->IsGraphic() )
1210 		return sal_True;
1211 
1212 	const SwGrfNode *pNd;
1213 	if( 0 != (pNd = GetNode()->GetGrfNode()) )
1214 		return pNd->IsTransparent();
1215 
1216 	//#29381# OLE sind immer Transparent.
1217 	return sal_True;
1218 }
1219 
1220 
1221 void SwNoTxtFrm::StopAnimation( OutputDevice* pOut ) const
1222 {
1223 	//animierte Grafiken anhalten
1224 	SwGrfNode* pGrfNd = (SwGrfNode*)GetNode()->GetGrfNode();
1225 	if( pGrfNd && pGrfNd->IsAnimated() )
1226 		pGrfNd->GetGrfObj().StopAnimation( pOut, long(this) );
1227 }
1228 
1229 
1230 sal_Bool SwNoTxtFrm::HasAnimation() const
1231 {
1232 	const SwGrfNode* pGrfNd = GetNode()->GetGrfNode();
1233 	return pGrfNd && pGrfNd->IsAnimated();
1234 }
1235 
1236 
1237 
1238