unoshap4.cxx (f6e50924) | unoshap4.cxx (02563ba0) |
---|---|
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 --- 453 unchanged lines hidden (view full) --- 462 SdrOle2Obj* pOle2Obj = dynamic_cast< SdrOle2Obj* >( mpObj.get() ); 463 if ( !pOle2Obj || !pOle2Obj->IsEmpty() ) 464 return sal_False; 465 466 // create storage and inplace object 467 ::comphelper::IEmbeddedHelper* pPersist = mpModel->GetPersist(); 468 ::rtl::OUString aPersistName; 469 OUString aTmpStr; | 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 --- 453 unchanged lines hidden (view full) --- 462 SdrOle2Obj* pOle2Obj = dynamic_cast< SdrOle2Obj* >( mpObj.get() ); 463 if ( !pOle2Obj || !pOle2Obj->IsEmpty() ) 464 return sal_False; 465 466 // create storage and inplace object 467 ::comphelper::IEmbeddedHelper* pPersist = mpModel->GetPersist(); 468 ::rtl::OUString aPersistName; 469 OUString aTmpStr; |
470 if( getPropertyValue( OUString::createFromAscii( UNO_NAME_OLE2_PERSISTNAME ) ) >>= aTmpStr ) | 470 if( SvxShape::getPropertyValue( OUString::createFromAscii( UNO_NAME_OLE2_PERSISTNAME ) ) >>= aTmpStr ) |
471 aPersistName = aTmpStr; 472 473 //TODO/LATER: how to cope with creation failure?! 474 uno::Reference < embed::XEmbeddedObject > xObj( pPersist->getEmbeddedObjectContainer().CreateEmbeddedObject( aClassName.GetByteSequence(), aPersistName ) ); 475 if( xObj.is() ) 476 { 477 Rectangle aRect = pOle2Obj->GetLogicRect(); 478 if ( aRect.GetWidth() == 100 && aRect.GetHeight() == 100 ) --- 14 unchanged lines hidden (view full) --- 493 awt::Size aSz; 494 Size aSize = pOle2Obj->GetLogicRect().GetSize(); 495 aSz.Width = aSize.Width(); 496 aSz.Height = aSize.Height(); 497 xObj->setVisualAreaSize( pOle2Obj->GetAspect(), aSz ); 498 } 499 500 // connect the object after the visual area is set | 471 aPersistName = aTmpStr; 472 473 //TODO/LATER: how to cope with creation failure?! 474 uno::Reference < embed::XEmbeddedObject > xObj( pPersist->getEmbeddedObjectContainer().CreateEmbeddedObject( aClassName.GetByteSequence(), aPersistName ) ); 475 if( xObj.is() ) 476 { 477 Rectangle aRect = pOle2Obj->GetLogicRect(); 478 if ( aRect.GetWidth() == 100 && aRect.GetHeight() == 100 ) --- 14 unchanged lines hidden (view full) --- 493 awt::Size aSz; 494 Size aSize = pOle2Obj->GetLogicRect().GetSize(); 495 aSz.Width = aSize.Width(); 496 aSz.Height = aSize.Height(); 497 xObj->setVisualAreaSize( pOle2Obj->GetAspect(), aSz ); 498 } 499 500 // connect the object after the visual area is set |
501 setPropertyValue( OUString::createFromAscii( UNO_NAME_OLE2_PERSISTNAME ), Any( aTmpStr = aPersistName ) ); | 501 SvxShape::setPropertyValue( OUString::createFromAscii( UNO_NAME_OLE2_PERSISTNAME ), Any( aTmpStr = aPersistName ) ); |
502 503 // the object is inserted during setting of PersistName property usually 504 if( pOle2Obj->IsEmpty() ) 505 pOle2Obj->SetObjRef( xObj ); 506 } 507 508 return xObj.is(); 509} --- 46 unchanged lines hidden (view full) --- 556 awt::Size aSz; 557 Size aSize = pOle2Obj->GetLogicRect().GetSize(); 558 aSz.Width = aSize.Width(); 559 aSz.Height = aSize.Height(); 560 xObj->setVisualAreaSize( pOle2Obj->GetAspect(), aSz ); 561 } 562 563 // connect the object after the visual area is set | 502 503 // the object is inserted during setting of PersistName property usually 504 if( pOle2Obj->IsEmpty() ) 505 pOle2Obj->SetObjRef( xObj ); 506 } 507 508 return xObj.is(); 509} --- 46 unchanged lines hidden (view full) --- 556 awt::Size aSz; 557 Size aSize = pOle2Obj->GetLogicRect().GetSize(); 558 aSz.Width = aSize.Width(); 559 aSz.Height = aSize.Height(); 560 xObj->setVisualAreaSize( pOle2Obj->GetAspect(), aSz ); 561 } 562 563 // connect the object after the visual area is set |
564 setPropertyValue( OUString::createFromAscii( UNO_NAME_OLE2_PERSISTNAME ), uno::makeAny( aPersistName ) ); | 564 SvxShape::setPropertyValue( OUString::createFromAscii( UNO_NAME_OLE2_PERSISTNAME ), uno::makeAny( aPersistName ) ); |
565 566 // the object is inserted during setting of PersistName property usually 567 if ( pOle2Obj->IsEmpty() ) 568 pOle2Obj->SetObjRef( xObj ); 569 } 570 571 return xObj.is(); 572} --- 420 unchanged lines hidden --- | 565 566 // the object is inserted during setting of PersistName property usually 567 if ( pOle2Obj->IsEmpty() ) 568 pOle2Obj->SetObjRef( xObj ); 569 } 570 571 return xObj.is(); 572} --- 420 unchanged lines hidden --- |