Lines 24-29
Link Here
|
24 |
// MARKER(update_precomp.py): autogen include statement, do not remove |
24 |
// MARKER(update_precomp.py): autogen include statement, do not remove |
25 |
#include "precompiled_filter.hxx" |
25 |
#include "precompiled_filter.hxx" |
26 |
#include "eschesdo.hxx" |
26 |
#include "eschesdo.hxx" |
|
|
27 |
#include <svx/svdomedia.hxx> |
27 |
#include <svx/xflftrit.hxx> |
28 |
#include <svx/xflftrit.hxx> |
28 |
#include <filter/msfilter/escherex.hxx> |
29 |
#include <filter/msfilter/escherex.hxx> |
29 |
#include <svx/unoapi.hxx> |
30 |
#include <svx/unoapi.hxx> |
Lines 1324-1361
Link Here
|
1324 |
if ( pGraphic ) |
1325 |
if ( pGraphic ) |
1325 |
{ |
1326 |
{ |
1326 |
GraphicObject aGraphicObject( *pGraphic ); |
1327 |
GraphicObject aGraphicObject( *pGraphic ); |
1327 |
ByteString aUniqueId( aGraphicObject.GetUniqueID() ); |
1328 |
bRetValue = CreateGraphicProperties( rXShape,aGraphicObject ); |
1328 |
if ( aUniqueId.Len() ) |
1329 |
// End |
1329 |
{ |
1330 |
} |
1330 |
AddOpt( ESCHER_Prop_fillType, ESCHER_FillPicture ); |
1331 |
} |
1331 |
uno::Reference< beans::XPropertySet > aXPropSet( rXShape, uno::UNO_QUERY ); |
1332 |
} |
|
|
1333 |
return bRetValue; |
1334 |
} |
1332 |
|
1335 |
|
1333 |
if ( pGraphicProvider && pPicOutStrm && pShapeBoundRect && aXPropSet.is() ) |
1336 |
sal_Bool EscherPropertyContainer::CreateGraphicProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape ,const GraphicObject& rGraphicObj ) |
1334 |
{ |
1337 |
{ |
1335 |
::com::sun::star::uno::Any aAny; |
1338 |
sal_Bool bRetValue = sal_False; |
1336 |
::com::sun::star::awt::Rectangle* pVisArea = NULL; |
1339 |
ByteString aUniqueId( rGraphicObj.GetUniqueID() ); |
1337 |
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "VisibleArea" ) ) ) ) |
1340 |
if ( aUniqueId.Len() ) |
1338 |
{ |
1341 |
{ |
1339 |
pVisArea = new ::com::sun::star::awt::Rectangle; |
1342 |
AddOpt( ESCHER_Prop_fillType, ESCHER_FillPicture ); |
1340 |
aAny >>= (*pVisArea); |
1343 |
uno::Reference< beans::XPropertySet > aXPropSet( rXShape, uno::UNO_QUERY ); |
1341 |
} |
1344 |
|
1342 |
Rectangle aRect( Point( 0, 0 ), pShapeBoundRect->GetSize() ); |
1345 |
if ( pGraphicProvider && pPicOutStrm && pShapeBoundRect && aXPropSet.is() ) |
1343 |
sal_uInt32 nBlibId = pGraphicProvider->GetBlibID( *pPicOutStrm, aUniqueId, aRect, pVisArea, NULL ); |
1346 |
{ |
1344 |
if ( nBlibId ) |
1347 |
::com::sun::star::uno::Any aAny; |
1345 |
{ |
1348 |
::com::sun::star::awt::Rectangle* pVisArea = NULL; |
1346 |
AddOpt( ESCHER_Prop_pib, nBlibId, sal_True ); |
1349 |
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "VisibleArea" ) ) ) ) |
1347 |
ImplCreateGraphicAttributes( aXPropSet, nBlibId, sal_False ); |
1350 |
{ |
1348 |
bRetValue = sal_True; |
1351 |
pVisArea = new ::com::sun::star::awt::Rectangle; |
1349 |
} |
1352 |
aAny >>= (*pVisArea); |
1350 |
delete pVisArea; |
|
|
1351 |
} |
1352 |
} |
1353 |
} |
1353 |
} |
|
|
1354 |
Rectangle aRect( Point( 0, 0 ), pShapeBoundRect->GetSize() ); |
1355 |
sal_uInt32 nBlibId = pGraphicProvider->GetBlibID( *pPicOutStrm, aUniqueId, aRect, pVisArea, NULL ); |
1356 |
if ( nBlibId ) |
1357 |
{ |
1358 |
AddOpt( ESCHER_Prop_pib, nBlibId, sal_True ); |
1359 |
ImplCreateGraphicAttributes( aXPropSet, nBlibId, sal_False ); |
1360 |
bRetValue = sal_True; |
1361 |
} |
1362 |
delete pVisArea; |
1354 |
} |
1363 |
} |
1355 |
} |
1364 |
} |
1356 |
return bRetValue; |
1365 |
return bRetValue; |
1357 |
} |
1366 |
} |
1358 |
|
1367 |
|
|
|
1368 |
sal_Bool EscherPropertyContainer::CreateMediaGraphicProperties( |
1369 |
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape ) |
1370 |
{ |
1371 |
sal_Bool bRetValue = sal_False; |
1372 |
if ( rXShape.is() ) |
1373 |
{ |
1374 |
SdrObject* pSdrMedia( GetSdrObjectFromXShape( rXShape ) ); // SJ: leaving unoapi, because currently there is |
1375 |
if ( pSdrMedia && pSdrMedia->ISA( SdrMediaObj ) ) // no access to the native graphic object |
1376 |
{ |
1377 |
GraphicObject aGraphicObject( ((SdrMediaObj*)pSdrMedia)->getGraphic() ); |
1378 |
bRetValue = CreateGraphicProperties( rXShape, aGraphicObject ); |
1379 |
} |
1380 |
} |
1381 |
return bRetValue; |
1382 |
} |
1359 |
|
1383 |
|
1360 |
sal_Bool EscherPropertyContainer::ImplCreateEmbeddedBmp( const ByteString& rUniqueId ) |
1384 |
sal_Bool EscherPropertyContainer::ImplCreateEmbeddedBmp( const ByteString& rUniqueId ) |
1361 |
{ |
1385 |
{ |