include/oox/drawingml/shapepropertymap.hxx |   16 ++++++++--------
 include/oox/helper/modelobjecthelper.hxx   |    5 -----
 oox/source/drawingml/fillproperties.cxx    |    8 ++++----
 oox/source/drawingml/shapepropertymap.cxx  |   18 +++++++++---------
 oox/source/helper/modelobjecthelper.cxx    |   15 ---------------
 5 files changed, 21 insertions(+), 41 deletions(-)

New commits:
commit e092c72b44d99ea5c6c7f71cd717b20a4a86f5ac
Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
Date:   Tue Mar 6 20:02:05 2018 +0900

    oox: rename FillBitmapUrl to FillBitmap, remove obsolete methods
    
    Change-Id: I597aaa280ef12e46cf2d060cef1b042413d838d4
    Reviewed-on: https://gerrit.libreoffice.org/50851
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/include/oox/drawingml/shapepropertymap.hxx 
b/include/oox/drawingml/shapepropertymap.hxx
index 8ba077ea3d27..2fb237cd496f 100644
--- a/include/oox/drawingml/shapepropertymap.hxx
+++ b/include/oox/drawingml/shapepropertymap.hxx
@@ -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;
diff --git a/include/oox/helper/modelobjecthelper.hxx 
b/include/oox/helper/modelobjecthelper.hxx
index 694bdf13ddb7..eb9c7ba97228 100644
--- a/include/oox/helper/modelobjecthelper.hxx
+++ b/include/oox/helper/modelobjecthelper.hxx
@@ -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:
diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index c22654ebeb6f..9ba7e46ac215 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -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;
                         }
diff --git a/oox/source/drawingml/shapepropertymap.cxx 
b/oox/source/drawingml/shapepropertymap.cxx
index 6d487f51c2ed..fcb154901c2b 100644
--- a/oox/source/drawingml/shapepropertymap.cxx
+++ b/oox/source/drawingml/shapepropertymap.cxx
@@ -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>>())
     {
diff --git a/oox/source/helper/modelobjecthelper.cxx 
b/oox/source/helper/modelobjecthelper.cxx
index 95c466f48a89..4929dc26749f 100644
--- a/oox/source/helper/modelobjecthelper.cxx
+++ b/oox/source/helper/modelobjecthelper.cxx
@@ -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;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to