[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - 2 commits - oox/inc oox/source svx/source
Muthu Subramanian
sumuthu at collabora.com
Fri Mar 7 00:06:50 PST 2014
oox/inc/oox/drawingml/shapepropertymap.hxx | 3 +++
oox/source/drawingml/fillproperties.cxx | 4 +++-
oox/source/drawingml/shapepropertymap.cxx | 16 +++++++++++++++-
svx/source/xoutdev/xattrbmp.cxx | 7 +++++--
4 files changed, 26 insertions(+), 4 deletions(-)
New commits:
commit 6b22520691a997bd14d14eba3a3e7a92ecea41b3
Author: Muthu Subramanian <sumuthu at collabora.com>
Date: Fri Mar 7 13:36:50 2014 +0530
n#821567: Use BitmapURL only if its valid.
Ported from bf2ff0468e06770f9320c652a2332f7ec137d061
diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx
index 6f6fe94..77db862 100644
--- a/svx/source/xoutdev/xattrbmp.cxx
+++ b/svx/source/xoutdev/xattrbmp.cxx
@@ -720,8 +720,11 @@ bool XFillBitmapItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt
if( bSetURL )
{
GraphicObject aGrafObj( GraphicObject::CreateGraphicObjectFromURL( aURL ) );
- XOBitmap aBMP( aGrafObj );
- SetBitmapValue( aBMP );
+ if( aGrafObj.GetType() != GRAPHIC_NONE )
+ {
+ XOBitmap aBMP( aGrafObj );
+ SetBitmapValue( aBMP );
+ }
}
if( bSetBitmap )
{
commit fe69621b0005a3399c278971806940a09958848a
Author: Muthu Subramanian <sumuthu at collabora.com>
Date: Fri Mar 7 13:30:43 2014 +0530
n#821567: Import PPTX background images with table-name.
Ported from 2ec4d410de5bd98527336a9dc49abb76656373df
diff --git a/oox/inc/oox/drawingml/shapepropertymap.hxx b/oox/inc/oox/drawingml/shapepropertymap.hxx
index 00f8c4d..8b5e4d7 100644
--- a/oox/inc/oox/drawingml/shapepropertymap.hxx
+++ b/oox/inc/oox/drawingml/shapepropertymap.hxx
@@ -63,6 +63,7 @@ enum ShapePropertyId
SHAPEPROP_FillBitmapRectanglePoint,
SHAPEPROP_FillHatch,
SHAPEPROP_ShadowXDistance,
+ SHAPEPROP_FillBitmapNameFromUrl,
SHAPEPROP_END
};
@@ -128,6 +129,8 @@ private:
bool setGradientTrans( sal_Int32 nPropId, const ::com::sun::star::uno::Any& rValue );
/** Sets an explicit fill bitmap URL, or creates a named fill bitmap URL. */
bool setFillBitmapUrl( sal_Int32 nPropId, const ::com::sun::star::uno::Any& rValue );
+ /** Sets an explicit fill bitmap URL and pushes the name to FillBitmapName */
+ bool setFillBitmapNameFromUrl( sal_Int32 nPropId, const ::com::sun::star::uno::Any& rValue );
// not implemented, to prevent implicit conversion from enum to int
::com::sun::star::uno::Any& operator[]( ShapePropertyId ePropId );
diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx
index c4f58a8..5051932 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -393,7 +393,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 c945a53..eb8a5b4 100644
--- a/oox/source/drawingml/shapepropertymap.cxx
+++ b/oox/source/drawingml/shapepropertymap.cxx
@@ -49,7 +49,8 @@ static const sal_Int32 spnDefaultShapeIds[ SHAPEPROP_END ] =
PROP_FillBitmapURL, PROP_FillBitmapMode, PROP_FillBitmapSizeX, PROP_FillBitmapSizeY,
PROP_FillBitmapPositionOffsetX, PROP_FillBitmapPositionOffsetY, PROP_FillBitmapRectanglePoint,
PROP_FillHatch,
- PROP_ShadowXDistance
+ PROP_ShadowXDistance,
+ PROP_FillBitmapName
};
} // namespace
@@ -110,6 +111,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
}
@@ -197,6 +201,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
More information about the Libreoffice-commits
mailing list