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_sd.hxx" 26 27 #include "View.hxx" 28 #include <unotools/localfilehelper.hxx> 29 #include <sfx2/request.hxx> 30 #include <sfx2/docfilt.hxx> 31 #include <sfx2/fcontnr.hxx> 32 #include <sfx2/docfile.hxx> 33 #include <vcl/msgbox.hxx> 34 #include <svl/urlbmk.hxx> 35 #include <svx/svdpagv.hxx> 36 #include <svx/xfillit.hxx> 37 #include <svx/svdundo.hxx> 38 #include <svx/xoutbmp.hxx> 39 #include <svx/svdograf.hxx> 40 #include <svx/svdomedia.hxx> 41 #include <svx/svdoole2.hxx> 42 #include <sot/storage.hxx> 43 #include <sfx2/app.hxx> 44 #include <avmedia/mediawindow.hxx> 45 #include <svtools/ehdl.hxx> 46 #include <svtools/sfxecode.hxx> 47 #include <svtools/filter.hxx> 48 #include "app.hrc" 49 #include "Window.hxx" 50 #include "DrawDocShell.hxx" 51 #include "DrawViewShell.hxx" 52 #include "fuinsfil.hxx" 53 #include "drawdoc.hxx" 54 #include "sdresid.hxx" 55 #include "strings.hrc" 56 #include "imapinfo.hxx" 57 #include "sdpage.hxx" 58 #include "view/SlideSorterView.hxx" 59 #include "undo/undoobjects.hxx" 60 61 #include <comphelper/processfactory.hxx> 62 #include <com/sun/star/embed/ElementModes.hpp> 63 #include <com/sun/star/embed/XEmbedPersist.hpp> 64 #include <com/sun/star/embed/Aspects.hpp> 65 #include <com/sun/star/embed/NoVisualAreaSizeException.hpp> 66 #include <svtools/soerr.hxx> 67 68 #include <sfx2/ipclient.hxx> 69 70 using namespace com::sun::star; 71 72 namespace sd { 73 74 #ifdef _MSC_VER 75 #pragma optimize ( "", off ) 76 #endif 77 78 /************************************************************************* 79 |* 80 |* Graphik einfuegen 81 |* Wird ein leeres Graphikobjekt uebergeben, so wird dieses gefuellt. 82 |* Andernfalls wird ein an der gegebenen Position vorhandenes Objekt 83 |* gefuellt. Ist an der Position kein Objekt vorhanden, so wird ein neues 84 |* Objekt erzeugt und ein Pointer auf dieses Objekt zurueckgegeben. 85 |* 86 \************************************************************************/ 87 88 SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction, 89 const Point& rPos, SdrObject* pObj, ImageMap* pImageMap ) 90 { 91 SdrEndTextEdit(); 92 mnAction = rAction; 93 94 // Liegt ein Objekt an der Position rPos? 95 SdrGrafObj* pNewGrafObj = NULL; 96 SdrPageView* pPV = GetSdrPageView(); 97 SdrObject* pPickObj = pObj; 98 const bool bOnMaster = pPV && pPV->GetPage() && pPV->GetPage()->IsMasterPage(); 99 100 if(pPV && this->ISA(::sd::slidesorter::view::SlideSorterView)) 101 { 102 if(!pPV->GetPageRect().IsInside(rPos)) 103 pPV = 0L; 104 } 105 106 if( !pPickObj && pPV ) 107 { 108 SdrPageView* pPageView = pPV; 109 PickObj(rPos, getHitTolLog(), pPickObj, pPageView); 110 } 111 112 if( mnAction == DND_ACTION_LINK && pPickObj && pPV ) 113 { 114 const bool bIsGraphic = pPickObj->ISA( SdrGrafObj ); 115 if( bIsGraphic || (pObj->IsEmptyPresObj() && !bOnMaster) ) 116 { 117 if( IsUndoEnabled() ) 118 BegUndo(String(SdResId(STR_INSERTGRAPHIC))); 119 120 SdPage* pPage = (SdPage*) pPickObj->GetPage(); 121 122 if( bIsGraphic ) 123 { 124 // Das Objekt wird mit der Bitmap gefuellt 125 pNewGrafObj = (SdrGrafObj*) pPickObj->Clone(); 126 pNewGrafObj->SetGraphic(rGraphic); 127 } 128 else 129 { 130 pNewGrafObj = new SdrGrafObj( rGraphic, pPickObj->GetLogicRect() ); 131 pNewGrafObj->SetEmptyPresObj(sal_True); 132 } 133 134 if ( pNewGrafObj->IsEmptyPresObj() ) 135 { 136 Rectangle aRect( pNewGrafObj->GetLogicRect() ); 137 pNewGrafObj->AdjustToMaxRect( aRect, sal_False ); 138 pNewGrafObj->SetOutlinerParaObject(NULL); 139 pNewGrafObj->SetEmptyPresObj(sal_False); 140 } 141 142 if (pPage && pPage->IsPresObj(pPickObj)) 143 { 144 // Neues PresObj in die Liste eintragen 145 pPage->InsertPresObj( pNewGrafObj, PRESOBJ_GRAPHIC ); 146 pNewGrafObj->SetUserCall(pPickObj->GetUserCall()); 147 } 148 149 if (pImageMap) 150 pNewGrafObj->InsertUserData(new SdIMapInfo(*pImageMap)); 151 152 ReplaceObjectAtView(pPickObj, *pPV, pNewGrafObj); // maybe ReplaceObjectAtView 153 154 if( IsUndoEnabled() ) 155 EndUndo(); 156 } 157 else if (pPickObj->IsClosedObj() && !pPickObj->ISA(SdrOle2Obj)) 158 { 159 /****************************************************************** 160 * Das Objekt wird mit der Graphik gefuellt 161 ******************************************************************/ 162 if( IsUndoEnabled() ) 163 { 164 BegUndo(String(SdResId(STR_UNDO_DRAGDROP))); 165 AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pPickObj)); 166 EndUndo(); 167 } 168 169 XOBitmap aXOBitmap( rGraphic.GetBitmap() ); 170 SfxItemSet aSet(mpDocSh->GetPool(), XATTR_FILLSTYLE, XATTR_FILLBITMAP); 171 aSet.Put(XFillStyleItem(XFILL_BITMAP)); 172 aSet.Put(XFillBitmapItem(&mpDocSh->GetPool(), aXOBitmap)); 173 pPickObj->SetMergedItemSetAndBroadcast(aSet); 174 } 175 } 176 else if ( pPV ) 177 { 178 // create new object 179 Size aSize; 180 181 if ( rGraphic.GetPrefMapMode().GetMapUnit() == MAP_PIXEL ) 182 { 183 ::OutputDevice* pOutDev = 0; 184 if( mpViewSh ) 185 pOutDev = mpViewSh->GetActiveWindow(); 186 187 if( !pOutDev ) 188 pOutDev = Application::GetDefaultDevice(); 189 190 if( pOutDev ) 191 aSize = pOutDev->PixelToLogic( rGraphic.GetPrefSize(), MAP_100TH_MM ); 192 } 193 else 194 { 195 aSize = OutputDevice::LogicToLogic( rGraphic.GetPrefSize(), 196 rGraphic.GetPrefMapMode(), 197 MapMode( MAP_100TH_MM ) ); 198 } 199 200 pNewGrafObj = new SdrGrafObj( rGraphic, Rectangle( rPos, aSize ) ); 201 SdrPage* pPage = pPV->GetPage(); 202 Size aPageSize( pPage->GetSize() ); 203 aPageSize.Width() -= pPage->GetLftBorder() + pPage->GetRgtBorder(); 204 aPageSize.Height() -= pPage->GetUppBorder() + pPage->GetLwrBorder(); 205 pNewGrafObj->AdjustToMaxRect( Rectangle( Point(), aPageSize ), sal_True ); 206 // pNewGrafObj->AdjustToMaxRect( Rectangle( pPV->GetOffset(), aPageSize ), sal_True ); 207 208 sal_uLong nOptions = SDRINSERT_SETDEFLAYER; 209 sal_Bool bIsPresTarget = sal_False; 210 211 if ((mpViewSh 212 && mpViewSh->GetViewShell()!=NULL 213 && mpViewSh->GetViewShell()->GetIPClient() 214 && mpViewSh->GetViewShell()->GetIPClient()->IsObjectInPlaceActive()) 215 || this->ISA(::sd::slidesorter::view::SlideSorterView)) 216 nOptions |= SDRINSERT_DONTMARK; 217 218 if( ( mnAction & DND_ACTION_MOVE ) && pPickObj && (pPickObj->IsEmptyPresObj() || pPickObj->GetUserCall()) ) 219 { 220 SdPage* pP = static_cast< SdPage* >( pPickObj->GetPage() ); 221 222 if ( pP && pP->IsMasterPage() ) 223 bIsPresTarget = pP->IsPresObj(pPickObj); 224 } 225 226 if( ( mnAction & DND_ACTION_MOVE ) && pPickObj && !bIsPresTarget ) 227 { 228 // replace object 229 if (pImageMap) 230 pNewGrafObj->InsertUserData(new SdIMapInfo(*pImageMap)); 231 232 Rectangle aPickObjRect(pPickObj->GetCurrentBoundRect()); 233 Size aPickObjSize(aPickObjRect.GetSize()); 234 Rectangle aObjRect(pNewGrafObj->GetCurrentBoundRect()); 235 Size aObjSize(aObjRect.GetSize()); 236 237 Fraction aScaleWidth(aPickObjSize.Width(), aObjSize.Width()); 238 Fraction aScaleHeight(aPickObjSize.Height(), aObjSize.Height()); 239 pNewGrafObj->NbcResize(aObjRect.TopLeft(), aScaleWidth, aScaleHeight); 240 241 Point aVec = aPickObjRect.TopLeft() - aObjRect.TopLeft(); 242 pNewGrafObj->NbcMove(Size(aVec.X(), aVec.Y())); 243 244 const bool bUndo = IsUndoEnabled(); 245 246 if( bUndo ) 247 BegUndo(String(SdResId(STR_UNDO_DRAGDROP))); 248 pNewGrafObj->NbcSetLayer(pPickObj->GetLayer()); 249 SdrPage* pP = pPV->GetPage(); 250 pP->InsertObject(pNewGrafObj); 251 if( bUndo ) 252 { 253 AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoNewObject(*pNewGrafObj)); 254 AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoDeleteObject(*pPickObj)); 255 } 256 pP->RemoveObject(pPickObj->GetOrdNum()); 257 258 if( bUndo ) 259 { 260 EndUndo(); 261 } 262 else 263 { 264 SdrObject::Free(pPickObj); 265 } 266 mnAction = DND_ACTION_COPY; 267 } 268 else 269 { 270 InsertObjectAtView(pNewGrafObj, *pPV, nOptions); 271 272 if( pImageMap ) 273 pNewGrafObj->InsertUserData(new SdIMapInfo(*pImageMap)); 274 } 275 } 276 277 rAction = mnAction; 278 279 return pNewGrafObj; 280 } 281 282 // ----------------------------------------------------------------------------- 283 284 SdrMediaObj* View::InsertMediaURL( const rtl::OUString& rMediaURL, sal_Int8& rAction, 285 const Point& rPos, const Size& rSize ) 286 { 287 SdrEndTextEdit(); 288 mnAction = rAction; 289 290 SdrMediaObj* pNewMediaObj = NULL; 291 SdrPageView* pPV = GetSdrPageView(); 292 SdrObject* pPickObj = GetEmptyPresentationObject( PRESOBJ_MEDIA ); 293 294 if(pPV && this->ISA(::sd::slidesorter::view::SlideSorterView )) 295 { 296 if(!pPV->GetPageRect().IsInside(rPos)) 297 pPV = 0L; 298 } 299 300 if( !pPickObj && pPV ) 301 { 302 SdrPageView* pPageView = pPV; 303 PickObj(rPos, getHitTolLog(), pPickObj, pPageView); 304 } 305 306 if( mnAction == DND_ACTION_LINK && pPickObj && pPV && pPickObj->ISA( SdrMediaObj ) ) 307 { 308 pNewMediaObj = static_cast< SdrMediaObj* >( pPickObj->Clone() ); 309 pNewMediaObj->setURL( rMediaURL ); 310 311 BegUndo(String(SdResId(STR_UNDO_DRAGDROP))); 312 ReplaceObjectAtView(pPickObj, *pPV, pNewMediaObj); 313 EndUndo(); 314 } 315 else if( pPV ) 316 { 317 Rectangle aRect( rPos, rSize ); 318 if( pPickObj ) 319 aRect = pPickObj->GetLogicRect(); 320 321 322 pNewMediaObj = new SdrMediaObj( aRect ); 323 324 bool bIsPres = false; 325 if( pPickObj ) 326 { 327 SdPage* pPage = static_cast< SdPage* >(pPickObj->GetPage()); 328 bIsPres = pPage && pPage->IsPresObj(pPickObj); 329 if( bIsPres ) 330 { 331 pPage->InsertPresObj( pNewMediaObj, PRESOBJ_MEDIA ); 332 } 333 } 334 335 if( pPickObj ) 336 ReplaceObjectAtView(pPickObj, *pPV, pNewMediaObj); 337 else 338 InsertObjectAtView( pNewMediaObj, *pPV, SDRINSERT_SETDEFLAYER ); 339 340 pNewMediaObj->setURL( rMediaURL ); 341 342 if( pPickObj ) 343 { 344 pNewMediaObj->AdjustToMaxRect( pPickObj->GetLogicRect() ); 345 if( bIsPres ) 346 pNewMediaObj->SetUserCall(pPickObj->GetUserCall()); 347 } 348 } 349 350 rAction = mnAction; 351 352 return pNewMediaObj; 353 } 354 355 /************************************************************************* 356 |* 357 |* Timer-Handler fuer InsertFile beim Drop() 358 |* 359 \************************************************************************/ 360 361 IMPL_LINK( View, DropInsertFileHdl, Timer*, EMPTYARG ) 362 { 363 DBG_ASSERT( mpViewSh, "sd::View::DropInsertFileHdl(), I need a view shell to work!" ); 364 if( !mpViewSh ) 365 return 0; 366 367 SfxErrorContext aEc( ERRCTX_ERROR, mpViewSh->GetActiveWindow(), RID_SO_ERRCTX ); 368 ErrCode nError = 0; 369 370 ::std::vector< String >::const_iterator aIter( maDropFileVector.begin() ); 371 372 while( (aIter != maDropFileVector.end()) && !nError ) 373 { 374 String aCurrentDropFile( *aIter ); 375 INetURLObject aURL( aCurrentDropFile ); 376 sal_Bool bOK = sal_False; 377 378 if( aURL.GetProtocol() == INET_PROT_NOT_VALID ) 379 { 380 String aURLStr; 381 ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aCurrentDropFile, aURLStr ); 382 aURL = INetURLObject( aURLStr ); 383 } 384 385 GraphicFilter* pGraphicFilter = GraphicFilter::GetGraphicFilter(); 386 Graphic aGraphic; 387 388 aCurrentDropFile = aURL.GetMainURL( INetURLObject::NO_DECODE ); 389 390 if( !::avmedia::MediaWindow::isMediaURL( aCurrentDropFile ) ) 391 { 392 if( !pGraphicFilter->ImportGraphic( aGraphic, aURL ) ) 393 { 394 sal_Int8 nTempAction = ( aIter == maDropFileVector.begin() ) ? mnAction : 0; 395 const bool bLink = ( ( nTempAction & DND_ACTION_LINK ) != 0 ); 396 SdrGrafObj* pGrafObj = InsertGraphic( aGraphic, nTempAction, maDropPos, NULL, NULL ); 397 398 if( pGrafObj && bLink ) 399 pGrafObj->SetGraphicLink( aCurrentDropFile, String() ); 400 401 // return action from first inserted graphic 402 if( aIter == maDropFileVector.begin() ) 403 mnAction = nTempAction; 404 405 bOK = sal_True; 406 } 407 if( !bOK ) 408 { 409 const SfxFilter* pFoundFilter = NULL; 410 SfxMedium aSfxMedium( aCurrentDropFile, STREAM_READ | STREAM_SHARE_DENYNONE, sal_False ); 411 ErrCode nErr = SFX_APP()->GetFilterMatcher().GuessFilter( aSfxMedium, &pFoundFilter, SFX_FILTER_IMPORT, SFX_FILTER_NOTINSTALLED | SFX_FILTER_EXECUTABLE ); 412 413 if( pFoundFilter && !nErr ) 414 { 415 ::std::vector< String > aFilterVector; 416 const String aFilterName( pFoundFilter->GetFilterName() ); 417 String aLowerAsciiFileName( aCurrentDropFile ); 418 aLowerAsciiFileName.ToLowerAscii(); 419 420 FuInsertFile::GetSupportedFilterVector( aFilterVector ); 421 422 if( ( ::std::find( aFilterVector.begin(), aFilterVector.end(), pFoundFilter->GetMimeType() ) != aFilterVector.end() ) || 423 aFilterName.SearchAscii( "Text" ) != STRING_NOTFOUND || 424 aFilterName.SearchAscii( "Rich" ) != STRING_NOTFOUND || 425 aFilterName.SearchAscii( "RTF" ) != STRING_NOTFOUND || 426 aFilterName.SearchAscii( "HTML" ) != STRING_NOTFOUND || 427 aLowerAsciiFileName.SearchAscii(".sdd") != STRING_NOTFOUND || 428 aLowerAsciiFileName.SearchAscii(".sda") != STRING_NOTFOUND || 429 aLowerAsciiFileName.SearchAscii(".sxd") != STRING_NOTFOUND || 430 aLowerAsciiFileName.SearchAscii(".sxi") != STRING_NOTFOUND || 431 aLowerAsciiFileName.SearchAscii(".std") != STRING_NOTFOUND || 432 aLowerAsciiFileName.SearchAscii(".sti") != STRING_NOTFOUND ) 433 { 434 ::sd::Window* pWin = mpViewSh->GetActiveWindow(); 435 SfxRequest aReq(SID_INSERTFILE, 0, mpDoc->GetItemPool()); 436 SfxStringItem aItem1( ID_VAL_DUMMY0, aCurrentDropFile ), aItem2( ID_VAL_DUMMY1, pFoundFilter->GetFilterName() ); 437 438 aReq.AppendItem( aItem1 ); 439 aReq.AppendItem( aItem2 ); 440 FuInsertFile::Create( mpViewSh, pWin, this, mpDoc, aReq ); 441 bOK = sal_True; 442 } 443 } 444 } 445 } 446 447 if( !bOK ) 448 { 449 Size aPrefSize; 450 451 if( ::avmedia::MediaWindow::isMediaURL( aCurrentDropFile ) && 452 ::avmedia::MediaWindow::isMediaURL( aCurrentDropFile, true, &aPrefSize ) ) 453 { 454 if( aPrefSize.Width() && aPrefSize.Height() ) 455 { 456 ::sd::Window* pWin = mpViewSh->GetActiveWindow(); 457 458 if( pWin ) 459 aPrefSize = pWin->PixelToLogic( aPrefSize, MAP_100TH_MM ); 460 else 461 aPrefSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MAP_100TH_MM ); 462 } 463 else 464 aPrefSize = Size( 5000, 5000 ); 465 466 InsertMediaURL( aCurrentDropFile, mnAction, maDropPos, aPrefSize ) ; 467 } 468 else if( mnAction & DND_ACTION_LINK ) 469 static_cast< DrawViewShell* >( mpViewSh )->InsertURLButton( aCurrentDropFile, aCurrentDropFile, String(), &maDropPos ); 470 else 471 { 472 if( mpViewSh ) 473 { 474 try 475 { 476 //TODO/MBA: testing 477 ::rtl::OUString aName; 478 uno::Sequence < beans::PropertyValue > aMedium(1); 479 aMedium[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ); 480 aMedium[0].Value <<= ::rtl::OUString( aCurrentDropFile ); 481 482 uno::Reference < embed::XEmbeddedObject > xObj = mpDocSh->GetEmbeddedObjectContainer(). 483 InsertEmbeddedObject( aMedium, aName ); 484 485 uno::Reference < embed::XEmbedPersist > xPersist( xObj, uno::UNO_QUERY ); 486 if ( xPersist.is()) 487 { 488 // TODO/LEAN: VisualArea access can switch the object to running state 489 sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT; 490 491 xPersist->storeOwn(); 492 493 awt::Size aSz; 494 try 495 { 496 aSz = xObj->getVisualAreaSize( nAspect ); 497 } 498 catch( embed::NoVisualAreaSizeException& ) 499 { 500 // the default size will be set later 501 } 502 503 Size aSize( aSz.Width, aSz.Height ); 504 Rectangle aRect; 505 506 if (!aSize.Width() || !aSize.Height()) 507 { 508 aSize.Width() = 1410; 509 aSize.Height() = 1000; 510 } 511 512 aRect = Rectangle( maDropPos, aSize ); 513 514 SdrOle2Obj* pOleObj = new SdrOle2Obj( svt::EmbeddedObjectRef( xObj, nAspect ), aName, aRect ); 515 sal_uLong nOptions = SDRINSERT_SETDEFLAYER; 516 517 if (mpViewSh != NULL) 518 { 519 OSL_ASSERT (mpViewSh->GetViewShell()!=NULL); 520 SfxInPlaceClient* pIpClient = 521 mpViewSh->GetViewShell()->GetIPClient(); 522 if (pIpClient!=NULL && pIpClient->IsObjectInPlaceActive()) 523 nOptions |= SDRINSERT_DONTMARK; 524 } 525 526 InsertObjectAtView( pOleObj, *GetSdrPageView(), nOptions ); 527 pOleObj->SetLogicRect( aRect ); 528 aSz.Width = aRect.GetWidth(); 529 aSz.Height = aRect.GetHeight(); 530 xObj->setVisualAreaSize( nAspect,aSz ); 531 } 532 } 533 catch( uno::Exception& ) 534 { 535 nError = ERRCODE_IO_GENERAL; 536 // TODO/LATER: better error handling 537 } 538 } 539 } 540 } 541 542 ++aIter; 543 } 544 545 if( nError ) 546 ErrorHandler::HandleError( nError ); 547 548 return nError; 549 } 550 551 /************************************************************************* 552 |* 553 |* Timer-Handler fuer Errorhandling beim Drop() 554 |* 555 \************************************************************************/ 556 557 IMPL_LINK( View, DropErrorHdl, Timer*, EMPTYARG ) 558 { 559 InfoBox( mpViewSh ? mpViewSh->GetActiveWindow() : 0, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute(); 560 return 0; 561 } 562 563 #ifdef _MSC_VER 564 #pragma optimize ( "", on ) 565 #endif 566 567 /************************************************************************* 568 |* 569 |* Redraw sperren oder erlauben 570 |* 571 \************************************************************************/ 572 573 void View::LockRedraw(sal_Bool bLock) 574 { 575 if (bLock) 576 { 577 mnLockRedrawSmph++; 578 DBG_ASSERT(mnLockRedrawSmph, "Ueberlauf im LockRedraw"); 579 } 580 else 581 { 582 DBG_ASSERT(mnLockRedrawSmph, "Unterlauf im LockRedraw"); 583 mnLockRedrawSmph--; 584 585 // alle gespeicherten Redraws ausfuehren 586 if (!mnLockRedrawSmph) 587 { 588 while (mpLockedRedraws && mpLockedRedraws->Count()) 589 { 590 SdViewRedrawRec* pRec = (SdViewRedrawRec*)mpLockedRedraws->First(); 591 OutputDevice* pCurrentOut = pRec->mpOut; 592 Rectangle aBoundRect(pRec->aRect); 593 mpLockedRedraws->Remove(pRec); 594 delete pRec; 595 596 pRec = (SdViewRedrawRec*)mpLockedRedraws->First(); 597 while (pRec) 598 { 599 if (pRec->mpOut == pCurrentOut) 600 { 601 aBoundRect.Union(pRec->aRect); 602 mpLockedRedraws->Remove(pRec); 603 delete pRec; 604 pRec = (SdViewRedrawRec*)mpLockedRedraws->GetCurObject(); 605 } 606 else 607 { 608 pRec = (SdViewRedrawRec*)mpLockedRedraws->Next(); 609 } 610 } 611 612 CompleteRedraw(pCurrentOut, Region(aBoundRect)); 613 } 614 delete mpLockedRedraws; 615 mpLockedRedraws = NULL; 616 } 617 } 618 } 619 620 621 622 623 /************************************************************************* 624 |* 625 |* StyleSheet aus der Sleketion besorgen 626 |* 627 \************************************************************************/ 628 629 SfxStyleSheet* View::GetStyleSheet() const 630 { 631 return SdrView::GetStyleSheet(); 632 } 633 634 } // end of namespace sd 635