diff options
author | Muthu Subramanian <sumuthu@collabora.com> | 2014-03-06 15:52:24 +0530 |
---|---|---|
committer | Muthu Subramanian <sumuthu@collabora.com> | 2014-03-06 16:00:47 +0530 |
commit | 2ec4d410de5bd98527336a9dc49abb76656373df (patch) | |
tree | 65f7a04cc7320b1d988a24b338e19ad60c4eb65c /oox/source | |
parent | 291c3ae79c45bc470f8a903a2541b10e9784fac5 (diff) |
n#821567: Import PPTX background images with table-name.
Seems like using the URL directly causes ODP export
to ignore the background image.
Probaby ODP Export requires updation as well?
Diffstat (limited to 'oox/source')
-rw-r--r-- | oox/source/drawingml/fillproperties.cxx | 4 | ||||
-rw-r--r-- | oox/source/drawingml/shapepropertymap.cxx | 14 |
2 files changed, 17 insertions, 1 deletions
diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index c9ec7243ed82..4eedd35574fb 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -421,7 +421,9 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap, OUString aGraphicUrl = rGraphicHelper.createGraphicObject( xGraphic ); // push bitmap or named bitmap to property map - if( !aGraphicUrl.isEmpty() && rPropMap.setProperty( SHAPEPROP_FillBitmapUrl, aGraphicUrl ) ) + if( !aGraphicUrl.isEmpty() && rPropMap.supportsProperty( SHAPEPROP_FillBitmapNameFromUrl ) && rPropMap.setProperty( SHAPEPROP_FillBitmapNameFromUrl, aGraphicUrl ) ) + eFillStyle = FillStyle_BITMAP; + else if( !aGraphicUrl.isEmpty() && rPropMap.setProperty( SHAPEPROP_FillBitmapUrl, aGraphicUrl ) ) eFillStyle = FillStyle_BITMAP; // set other bitmap properties, if bitmap has been inserted into the map diff --git a/oox/source/drawingml/shapepropertymap.cxx b/oox/source/drawingml/shapepropertymap.cxx index f14b653eb7f0..5a908750f6e1 100644 --- a/oox/source/drawingml/shapepropertymap.cxx +++ b/oox/source/drawingml/shapepropertymap.cxx @@ -48,6 +48,7 @@ static const sal_Int32 spnDefaultShapeIds[ SHAPEPROP_END + 1 ] = // one for the PROP_FillBitmapPositionOffsetX, PROP_FillBitmapPositionOffsetY, PROP_FillBitmapRectanglePoint, PROP_FillHatch, PROP_ShadowXDistance, + PROP_FillBitmapName, PROP_END_LIST }; @@ -115,6 +116,9 @@ bool ShapePropertyMap::setAnyProperty( ShapePropertyId ePropId, const Any& rValu case SHAPEPROP_FillBitmapUrl: return setFillBitmapUrl( nPropId, rValue ); + case SHAPEPROP_FillBitmapNameFromUrl: + return setFillBitmapNameFromUrl( nPropId, rValue ); + default:; // suppress compiler warnings } @@ -202,6 +206,16 @@ bool ShapePropertyMap::setFillBitmapUrl( sal_Int32 nPropId, const Any& rValue ) return false; } +bool ShapePropertyMap::setFillBitmapNameFromUrl( sal_Int32 /*nPropId*/, const Any& rValue ) +{ + if( rValue.has< OUString >() ) + { + OUString aBitmapUrlName = mrModelObjHelper.insertFillBitmapUrl( rValue.get< OUString >() ); + return !aBitmapUrlName.isEmpty() && setProperty( PROP_FillBitmapName, aBitmapUrlName ); + } + return false; +} + } // namespace drawingml |