oox: rename FillBitmapUrl to FillBitmap, remove obsolete methods
Change-Id: I597aaa280ef12e46cf2d060cef1b042413d838d4 Reviewed-on: https://gerrit.libreoffice.org/50851 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
This commit is contained in:
committed by
Tomaž Vajngerl
parent
2f061dad7f
commit
e092c72b44
@@ -64,7 +64,7 @@ enum class ShapeProperty
|
||||
FillTransparency,
|
||||
GradientTransparency,
|
||||
FillGradient, /// Explicit fill gradient or name of a fill gradient stored in a global container.
|
||||
FillBitmapUrl, /// Explicit fill bitmap URL or name of a fill bitmap URL stored in a global container.
|
||||
FillBitmap, /// Explicit fill bitmap or name of a fill bitmap stored in a global container.
|
||||
FillBitmapMode,
|
||||
FillBitmapSizeX,
|
||||
FillBitmapSizeY,
|
||||
@@ -73,7 +73,7 @@ enum class ShapeProperty
|
||||
FillBitmapRectanglePoint,
|
||||
FillHatch,
|
||||
ShadowXDistance,
|
||||
FillBitmapNameFromUrl,
|
||||
FillBitmapName,
|
||||
FillBackground,
|
||||
LAST = FillBackground
|
||||
};
|
||||
@@ -86,13 +86,13 @@ struct OOX_DLLPUBLIC ShapePropertyInfo
|
||||
bool mbNamedLineMarker; /// True = use named line marker instead of explicit line marker.
|
||||
bool mbNamedLineDash; /// True = use named line dash instead of explicit line dash.
|
||||
bool mbNamedFillGradient; /// True = use named fill gradient instead of explicit fill gradient.
|
||||
bool mbNamedFillBitmapUrl; /// True = use named fill bitmap URL instead of explicit fill bitmap URL.
|
||||
bool mbNamedFillBitmap; /// True = use named fill bitmap instead of explicit fill bitmap.
|
||||
|
||||
static ShapePropertyInfo DEFAULT; /// Default property info (used as default parameter of other methods).
|
||||
|
||||
explicit ShapePropertyInfo(const ShapePropertyIds& rnPropertyIds,
|
||||
bool bNamedLineMarker, bool bNamedLineDash,
|
||||
bool bNamedFillGradient, bool bNamedFillBitmapUrl);
|
||||
bool bNamedFillGradient, bool bNamedFillBitmap);
|
||||
|
||||
bool has(ShapeProperty ePropId) const
|
||||
{
|
||||
@@ -143,10 +143,10 @@ private:
|
||||
bool setFillGradient( sal_Int32 nPropId, const css::uno::Any& rValue );
|
||||
/** Creates a named transparency gradient. */
|
||||
bool setGradientTrans( sal_Int32 nPropId, const css::uno::Any& rValue );
|
||||
/** Sets an explicit fill bitmap URL, or creates a named fill bitmap URL. */
|
||||
bool setFillBitmapUrl( sal_Int32 nPropId, const css::uno::Any& rValue );
|
||||
/** Sets an explicit fill bitmap URL and pushes the name to FillBitmapName */
|
||||
bool setFillBitmapNameFromUrl( const css::uno::Any& rValue );
|
||||
/** Sets an explicit fill bitmap, or creates a named fill bitmap. */
|
||||
bool setFillBitmap( sal_Int32 nPropId, const css::uno::Any& rValue );
|
||||
/** Sets an explicit fill bitmap and pushes the name to FillBitmapName */
|
||||
bool setFillBitmapName( const css::uno::Any& rValue );
|
||||
|
||||
// not implemented, to prevent implicit conversion from enum to int
|
||||
css::uno::Any& operator[]( ShapeProperty ePropId ) = delete;
|
||||
|
@@ -105,15 +105,10 @@ public:
|
||||
|
||||
OUString insertTransGrandient( const css::awt::Gradient& rGradient );
|
||||
|
||||
/** Inserts a new named fill bitmap URL, returns the bitmap name, based on
|
||||
an internal constant name with a new unused index appended. */
|
||||
OUString insertFillBitmapUrl( const OUString& rGraphicUrl );
|
||||
|
||||
/** Inserts a new named fill graphic, returns the bitmap name, based on
|
||||
an internal constant name with a new unused index appended. */
|
||||
OUString insertFillBitmapXGraphic(css::uno::Reference<css::graphic::XGraphic> const & rxGraphic);
|
||||
|
||||
OUString getFillBitmapUrl( const OUString& rGraphicName );
|
||||
css::uno::Reference<css::awt::XBitmap> getFillBitmap(OUString const & rGraphicName);
|
||||
|
||||
private:
|
||||
|
@@ -598,7 +598,7 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap,
|
||||
|
||||
case XML_blipFill:
|
||||
// do not start complex graphic transformation if property is not supported...
|
||||
if( maBlipProps.mxGraphic.is() && rPropMap.supportsProperty( ShapeProperty::FillBitmapUrl ) )
|
||||
if (maBlipProps.mxGraphic.is() && rPropMap.supportsProperty(ShapeProperty::FillBitmap))
|
||||
{
|
||||
Reference< XGraphic > xGraphic = lclCheckAndApplyDuotoneTransform( maBlipProps, maBlipProps.mxGraphic, rGraphicHelper, nPhClr );
|
||||
uno::Reference<awt::XBitmap> xBitmap(xGraphic, uno::UNO_QUERY);
|
||||
@@ -606,12 +606,12 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap,
|
||||
|
||||
if (xGraphic.is())
|
||||
{
|
||||
if (rPropMap.supportsProperty(ShapeProperty::FillBitmapNameFromUrl) &&
|
||||
rPropMap.setProperty(ShapeProperty::FillBitmapNameFromUrl, xGraphic))
|
||||
if (rPropMap.supportsProperty(ShapeProperty::FillBitmapName) &&
|
||||
rPropMap.setProperty(ShapeProperty::FillBitmapName, xGraphic))
|
||||
{
|
||||
eFillStyle = FillStyle_BITMAP;
|
||||
}
|
||||
else if (rPropMap.setProperty(ShapeProperty::FillBitmapUrl, xGraphic))
|
||||
else if (rPropMap.setProperty(ShapeProperty::FillBitmap, xGraphic))
|
||||
{
|
||||
eFillStyle = FillStyle_BITMAP;
|
||||
}
|
||||
|
@@ -56,12 +56,12 @@ static const ShapePropertyIds spnDefaultShapeIds =
|
||||
ShapePropertyInfo ShapePropertyInfo::DEFAULT( spnDefaultShapeIds, true, false, false, false );
|
||||
|
||||
ShapePropertyInfo::ShapePropertyInfo( const ShapePropertyIds& rnPropertyIds,
|
||||
bool bNamedLineMarker, bool bNamedLineDash, bool bNamedFillGradient, bool bNamedFillBitmapUrl ) :
|
||||
bool bNamedLineMarker, bool bNamedLineDash, bool bNamedFillGradient, bool bNamedFillBitmap ) :
|
||||
mrPropertyIds(rnPropertyIds),
|
||||
mbNamedLineMarker( bNamedLineMarker ),
|
||||
mbNamedLineDash( bNamedLineDash ),
|
||||
mbNamedFillGradient( bNamedFillGradient ),
|
||||
mbNamedFillBitmapUrl( bNamedFillBitmapUrl )
|
||||
mbNamedFillBitmap( bNamedFillBitmap )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -103,11 +103,11 @@ bool ShapePropertyMap::setAnyProperty( ShapeProperty ePropId, const Any& rValue
|
||||
case ShapeProperty::GradientTransparency:
|
||||
return setGradientTrans( nPropId, rValue );
|
||||
|
||||
case ShapeProperty::FillBitmapUrl:
|
||||
return setFillBitmapUrl( nPropId, rValue );
|
||||
case ShapeProperty::FillBitmap:
|
||||
return setFillBitmap(nPropId, rValue);
|
||||
|
||||
case ShapeProperty::FillBitmapNameFromUrl:
|
||||
return setFillBitmapNameFromUrl( rValue );
|
||||
case ShapeProperty::FillBitmapName:
|
||||
return setFillBitmapName(rValue);
|
||||
|
||||
default:; // suppress compiler warnings
|
||||
}
|
||||
@@ -180,10 +180,10 @@ bool ShapePropertyMap::setGradientTrans( sal_Int32 nPropId, const Any& rValue )
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ShapePropertyMap::setFillBitmapUrl(sal_Int32 nPropId, const Any& rValue)
|
||||
bool ShapePropertyMap::setFillBitmap(sal_Int32 nPropId, const Any& rValue)
|
||||
{
|
||||
// push bitmap explicitly
|
||||
if (!maShapePropInfo.mbNamedFillBitmapUrl)
|
||||
if (!maShapePropInfo.mbNamedFillBitmap)
|
||||
{
|
||||
return setAnyProperty(nPropId, rValue);
|
||||
}
|
||||
@@ -199,7 +199,7 @@ bool ShapePropertyMap::setFillBitmapUrl(sal_Int32 nPropId, const Any& rValue)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ShapePropertyMap::setFillBitmapNameFromUrl(const Any& rValue)
|
||||
bool ShapePropertyMap::setFillBitmapName(const Any& rValue)
|
||||
{
|
||||
if (rValue.has<uno::Reference<graphic::XGraphic>>())
|
||||
{
|
||||
|
@@ -129,13 +129,6 @@ OUString ModelObjectHelper::insertTransGrandient( const awt::Gradient& rGradient
|
||||
return maTransGradContainer.insertObject( maTransGradNameBase, Any( rGradient ), true );
|
||||
}
|
||||
|
||||
OUString ModelObjectHelper::insertFillBitmapUrl( const OUString& rGraphicUrl )
|
||||
{
|
||||
if( !rGraphicUrl.isEmpty() )
|
||||
return maBitmapUrlContainer.insertObject( maBitmapUrlNameBase, Any( rGraphicUrl ), true );
|
||||
return OUString();
|
||||
}
|
||||
|
||||
OUString ModelObjectHelper::insertFillBitmapXGraphic(uno::Reference<graphic::XGraphic> const & rxGraphic)
|
||||
{
|
||||
uno::Reference<awt::XBitmap> xBitmap(rxGraphic, uno::UNO_QUERY);
|
||||
@@ -144,14 +137,6 @@ OUString ModelObjectHelper::insertFillBitmapXGraphic(uno::Reference<graphic::XGr
|
||||
return OUString();
|
||||
}
|
||||
|
||||
OUString ModelObjectHelper::getFillBitmapUrl( const OUString &rGraphicName )
|
||||
{
|
||||
Any aAny = maBitmapUrlContainer.getObject( rGraphicName );
|
||||
if( aAny.hasValue() )
|
||||
return aAny.get<OUString>();
|
||||
return OUString();
|
||||
}
|
||||
|
||||
uno::Reference<awt::XBitmap> ModelObjectHelper::getFillBitmap(OUString const & rGraphicName)
|
||||
{
|
||||
uno::Reference<awt::XBitmap> xBitmap;
|
||||
|
Reference in New Issue
Block a user