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